I have a table:
CREATE TABLE dbo.Courses
(
courseID BIGINT IDENTITY(-1,-1) NOT NULL,
courseName NVARCHAR(100) NOT NULL
);
I am trying to convert this to liquibase
- createTable:
tableName: Courses
columns:
- column:
name: courseID
type: bigint
autoIncrement: true
- column:
name: courseName
type: nvarchar(100)
constraints:
nullable: false
The liquibase code generates
CREATE TABLE Courses
(
courseID BIGINT IDENTITY (1, 1),
courseName NVARCHAR(100) NOT NULL
)
GO
I tried not setting autoIncrement: true
and then adding addAutoIncrement
after the create table but that returned:
ERROR liquibase.integration.commandline.Main - Unexpected error running Liquibase: Validation Failed:
1 changes have validation failures
addAutoIncrement is not supported on mssql, baselineTables.yml::Courses::user
Next I tried to change it manually using T-SQL:
ALTER TABLE Courses
ALTER COLUMN CourseID IDENTITY (-1, -1)
But I get a SQL Server error.
Any idea how I can get liquibase to set an identity seed and increment to anything but (1,1)?