Partitioned tables are rebuilt on incremental deployments with no changes
- Dominant language
- C#
- Stars
- 460
- Forks
- 29
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 7
Description
- SqlPackage or DacFx Version: 170
- .NET Framework (Windows-only) or .NET Core: both
- Environment (local platform and source/target platforms): N/A
**Steps to Reproduce:**
1. Create a database project with following script:
```tsql
CREATE TABLE dbo.table1
(
col1 DATETIME NULL,
snapshotdate AS cast(col1 AS DATE) PERSISTED
, CONSTRAINT pk_table1 PRIMARY KEY CLUSTERED (
snapshotdate DESC)
) ON [ps](snapshotdate);
GO
CREATE PARTITION FUNCTION pf (DATE) AS RANGE RIGHT FOR VALUES ('2024-01-01');
GO
CREATE PARTITION SCHEME ps AS PARTITION pf ALL TO ([PRIMARY]);
GO
```
2. Build and deploy the dacpac to a new database
3. Deploy the same dacpac to same database again, the table is rebuilt even when there has been no changes
Related: #298
**Did this occur in prior versions? If not - which version(s) did it work in?**
(DacFx/SqlPackage/SSMS/Azure Data Studio)
Contributor guide
Research direction
Start by creating the database from the supplied T-SQL script with SqlPackage/DacFx version 170, then deploy the unchanged dacpac a second time. Investigate why the partitioned table is rebuilt during that incremental deployment; done means the second deployment detects no table changes and does not rebuild it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100