Azure Data Studio how to rename column for dacpac so it is actually renamed when applying db changes
Is your feature request related to a problem? Please describe. When using Azure Data Studio for Database project, I try to change column name in the designer, I see that file DbProjectName.refactorlog is not being generated. If I create Database project in Visual Studio 2022, and open table in designer and rename column DbProjectName.refactorlog is generated.
<Operation Name="Rename Refactor" Key="3c87a5bb-d9dd-4ce6-b60f-1f45a715a3fc" ChangeDateTime="11/24/2023 18:00:51"> <Property Name="ElementName" Value="[dbo].[AdamVSItems].[Name]" /> <Property Name="ElementType" Value="SqlSimpleColumn" /> <Property Name="ParentElementName" Value="[dbo].[AdamVSItems]" /> <Property Name="ParentElementType" Value="SqlTable" /> <Property Name="NewName" Value="Name3" /> </Operation>
Because in Azure Data Studio no refactorlog is being generated when I build dacpac the output dacpac drops column and creates a new column (renamed one).
<?xml version="1.0" encoding="utf-8"?>
<DeploymentReport xmlns="http://schemas.microsoft.com/sqlserver/dac/DeployReport/2012/02">
<Alerts>
<Alert Name="DataIssue">
<Issue Value="The column [dbo].[AdamVSItems].[Name4] is being dropped, data loss could occur." Id="1" />
</Alert>
</Alerts>
<Operations>
<Operation Name="Rename">
<Item Value="[dbo].[AdamVSItems].[Name4]" Type="SqlSimpleColumn" />
</Operation>
<Operation Name="Alter">
<Item Value="[dbo].[AdamVSItems]" Type="SqlTable">
<Issue Id="1" />
</Item>
</Operation>
</Operations>
</DeploymentReport>
Describe the solution you'd like I would like to know how it can be done in dotnet core world
I would like Azure Data Studio to be able to create refactorlog so my project doesn't need to reference framework v4.7.2
<Project DefaultTargets="Build">
<Sdk Name="Microsoft.Build.Sql" Version="0.1.14-preview" />
<PropertyGroup>
<Name>TimeMoto.Core</Name>
<DSP>Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider</DSP>
<ModelCollation>1033, CI</ModelCollation>
<TargetDatabaseSet>True</TargetDatabaseSet>
<TargetFrameworkProfile />
<ProjectVersion>4.1</ProjectVersion>
<ProjectGuid>{a81af5a2-11dd-4963-b14e-1b1a1af8220f}</ProjectGuid>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
I'm using the SDK-style sqlproj preview in VS and have run into this issue, is the refactor functionality currently unsupported?
I've got a similar issue but with renaming tables and views. There seems to be no refactor functionality in either datastudio or visual code. It would be really useful to have it, it was a key feature that we used when working with ssdt projects.