rr-wfm / MSBuild.Sdk.SqlProj

An MSBuild SDK that provides similar functionality to SQL Server Data Tools (.sqlproj) projects
MIT License
409 stars 45 forks source link

Is RefactorLog supported? #596

Closed jbennink closed 6 days ago

jbennink commented 3 months ago

The .sqlproj has support for RefactorLog. Somehow when your rename columns in the visual editor it generates this file which is also included in the project as:

 <ItemGroup>
    <RefactorLog Include="CallProSQL.refactorlog" />
  </ItemGroup>

But I cannot add this to the SDK style project.

So I guess this means there is no native support for handling column renames in the SDK style project? I should do it myself in a pre-deployment step? and craft the sp_rename myself, but then I also have to handle whether it is needed, that seems boilerplate?

P.S. I always found this RefactorLog file a bit scary but it works very well, and seems to do something similar (but simpler) as EF MigrationHistory.

ErikEJ commented 3 months ago

You can use a .sqlproj companion project for managing the refactorlog, and it will be used, this was added here: https://github.com/rr-wfm/MSBuild.Sdk.SqlProj/pull/47 (but it looks like it was not really documented)

jbennink commented 3 months ago

You can use a .sqlproj companion project for managing the refactorlog, and it will be used, this was added here: #47 (but it looks like it was not really documented)

What doe you mean an .sqlproj companion project. I have the original .refactorlog file, how would I put it in the SDK project so that the bacpac generated uses it.

ErikEJ commented 3 months ago

See this: https://github.com/rr-wfm/MSBuild.Sdk.SqlProj/tree/master/test/TestProjectWithPrePost - again, leaving this open to actually get it documented

jbennink commented 3 months ago

DELETED due to typo in file :-(

jbennink commented 3 months ago

@ErikEJ Forget about my previous post. I switch windows a lot and sometimes windows 11 :-( just sets the focus to a window when I think it is in another and I start typing. Somehow my refactorlog included "notepad" as the first chacacter :-( Which made the file invalid. I will remove the content from my last post.

It now builds fine :-)