DACPAC not detect a filegroup change

Victor Zhao 1 Reputation point
2022-12-23T05:08:34.373+00:00

Tools and Env:
Azure DevOps for CI/CD; Git Repo to manage the code; Visual Studio for development; Azure SQL DB; Assuming we have 2 environments Dev and Test.

Original table DDL:
CREATE TABLE [edw].[table1] (
[id] INT NULL,
[description] VARCHAR (4000) NULL,
[Etl_Exp_Dttm] DATETIME2 (3) NULL
) ;

CREATE UNIQUE INDEX [indextable1] ON [edw].[table1]
(
[id] ASC
) ;

Changed in the Repo and did a test release as following:
CREATE TABLE [edw].[table1] (
[id] INT NULL,
[description] VARCHAR (4000) NULL,
[Etl_Exp_Dttm] DATETIME2 (3) NULL
) ON PS_Etl_Exp_Dttm ([Etl_Exp_Dttm]);

CREATE UNIQUE INDEX [indextable1] ON [edw].[table1]
(
[id] ASC
) ON PS_Etl_Exp_Dttm([Etl_Exp_Dttm]);

The partition function and partition scheme have been included in the repo as well.

DACPAC didn't recreate the index or table, as the table is still siting under primary filegroup in test db. Is there any way to partition the test via DACPAC without dropping and recreating the index separately?

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Victor Zhao 1 Reputation point
    2023-01-11T23:14:06.0333333+00:00
    Adding option WITH (DROP_EXISTING = ON) will recreate the index. 
    
    

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.