git Visual Studio 数据库项目 *.refactorlog 文件是否属于源代码管理?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21636546/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:42:35  来源:igfitidea点击:

Do Visual Studio Database Project *.refactorlog Files Belong in Source Control?

gitvisual-studio-2012version-control

提问by qxotk

I am using git (via GitHub for Windows) and I am using the latest .gitignore for Visual Studio from GitHub

我正在使用 git(通过 GitHub for Windows)并且我正在使用最新的 .gitignore for Visual Studio 来自 GitHub

I notice that my <ProjectName>.refactorlogfiles are being included in my commits.

我注意到我的<ProjectName>.refactorlog文件被包含在我的提交中。

Do .refactorlog files belong in source control?

.refactorlog 文件是否属于源代码管理?

回答by Shiva

The .refactorlogshould be in source control if you intend to move database objects across schemas.

.refactorlog应在源代码控制,如果你打算在模式间移动数据库对象。

See: MSDN:Move a Database Object to a Different Schema

请参阅:MSDN:将数据库对象移动到不同的架构

Relevant section: Preserving Your Intent With The Refactoring Log

相关部分:使用重构日志保留您的意图

When you move a database object to a different schema, an entry is added to the refactoring log for your database project. When you deploy your changes, this log helps ensure that the corresponding object in the target environment is renamed as you intended. Otherwise, the existing object would be dropped, and an object would be added with the new name. The log is maintained in an XML file that is named ProjectName.refactorlog. You check this file in to version control when you check in the other files that compose your database project. The ProjectName.refactorlogfile contains only information about refactoring operations that require special handling during deployment.

当您将数据库对象移动到不同的模式时,会在您的数据库项目的重构日志中添加一个条目。部署更改时,此日志有助于确保目标环境中的相应对象按预期重命名。 否则,现有对象将被删除,并且将添加一个具有新名称的对象。日志保存在名为 .xml 的 XML 文件中ProjectName.refactorlog当您签入组成数据库项目的其他文件时,您可以将此文件签入版本控制。该ProjectName.refactorlog文件仅包含有关在部署期间需要特殊处理的重构操作的信息。