Subject: | Problems with identity columns using MS SQL Server 2005 |
When loading a schema from a SQL Server 2005 database, columns defined
with the "identity" data type are dumped with { data_type => "int
identity" }.
This causes problems further down the line, e.g. when instantiating the
resulting schema and calling create_ddl() using the SQLite producer, you
end up with SQL that looks like this:
CREATE TABLE foo (
id int identity NOT NULL,
...
PRIMARY KEY (id)
);
This will result in an id field that does not auto increment when
deployed to a SQLite database.
It also breaks the SQLServer producer, note "int identity(10)" rather
than "int(10)" in the id column definition:
CREATE TABLE foo (
id int identity(10) IDENTITY NOT NULL,
...
CONSTRAINT foo_pk PRIMARY KEY (id)
);
Generating { data_type => "int" } instead of { data_type => "int
identity" } fixes this particular problem for both producers.