Skip Menu |

This queue is for tickets about the DBIx-Class-Schema-Loader CPAN distribution.

Report information
The Basics
Id: 50523
Status: resolved
Priority: 0/
Queue: DBIx-Class-Schema-Loader

People
Owner: Nobody in particular
Requestors: wdhawes [...] gmail.com (daily)
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.04999_09
Fixed in: (no value)



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.
Subject: Re: [rt.cpan.org #50523] Problems with identity columns using MS SQL Server 2005
Date: Fri, 16 Oct 2009 06:06:40 -0400
To: Will Hawes via RT <bug-DBIx-Class-Schema-Loader [...] rt.cpan.org>
From: Rafael Kitover <rkitover [...] io.com>
Will try to fix soon for both mssql and sybase, I just moved and have no windows box but setting up dyndns access to one... On Thu, Oct 15, 2009 at 08:55:18AM -0400, Will Hawes via RT wrote: ... Show quoted text
> 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.
Subject: Re: [rt.cpan.org #50523] Problems with identity columns using MS SQL Server 2005
Date: Sat, 31 Oct 2009 08:55:24 -0400
To: Will Hawes via RT <bug-DBIx-Class-Schema-Loader [...] rt.cpan.org>
From: Rafael Kitover <rkitover [...] io.com>
Please try 0.04999_10 or current svn: http://dev.catalyst.perl.org/repos/bast/branches/DBIx-Class-Schema-Loader/current/ On Thu, Oct 15, 2009 at 08:55:18AM -0400, Will Hawes via RT wrote: Show quoted text
> Thu Oct 15 08:55:16 2009: Request 50523 was acted upon.
... Show quoted text
> > 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.
Fixed in last dev release and current. -- Rafael