Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: dave [...] pdx.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.06000
  • 0.06001
  • 0.07000
Fixed in: 0.01



Subject: v0.06000: UNIQUE constraint on SQLite can't be re-deploy()ed
I've checked that this works in v0.05003, but breaks in v0.06000 and later. Constraint names given to add_unique_constraint() have begun to use reserved sqlite_* identifier names. The SQLite engine rejects the DDL code generated by ->deploy() because of this change in the constraint names generated by DBIx::Class::Schema::Loader. Simple SQLite table: CREATE TABLE users ( id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT UNIQUE, email TEXT, password TEXT, last_modified DATETIME ); Up to v0.05003, this generates the UNIQUE constraint as: __PACKAGE__->add_unique_constraint("username_unique", ["username"]); Beginning with v0.06000, it generates: __PACKAGE__->add_unique_constraint("sqlite_autoindex_users_1", ["username"]); This can't be ->deploy()ed on SQLite. Message: DBIx::Class::Storage::DBI::__ANON__(): DBIx::Class::Schema::deploy(): DBI Exception: DBD::SQLite::db do failed: object name reserved for internal use: sqlite_autoindex_roles_1 [for Statement "CREATE UNIQUE INDEX sqlite_autoindex_roles_1 ON roles (role)"] at script/deploy.pl line 20 The development machine is Mac OS X 10.6.3. My Perl is 5.8.9. My SQLite is 3.6.2. The development library is a fresh build from CPAN to a private lib directory (but using the system-shiped Perl 5.8.9 core library). Thanks, Dave
Subject: Re: [rt.cpan.org #58308] v0.06000: UNIQUE constraint on SQLite can't be re-deploy()ed
Date: Fri, 11 Jun 2010 06:51:40 -0400
To: David Giller via RT <bug-DBIx-Class-Schema-Loader [...] rt.cpan.org>
From: Rafael Kitover <rkitover [...] cpan.org>
Try the git version please: git://git.shadowcat.co.uk/dbsrgits/DBIx-Class-Schema-Loader.git It should work for you. On Thu, Jun 10, 2010 at 12:52:57PM -0400, David Giller via RT wrote: Show quoted text
> Thu Jun 10 12:52:56 2010: Request 58308 was acted upon. > Transaction: Ticket created by dgiller > Queue: DBIx-Class-Schema-Loader > Subject: v0.06000: UNIQUE constraint on SQLite can't be re-deploy()ed > Broken in: 0.06000, 0.06001, 0.07000 > Severity: Normal > Owner: Nobody > Requestors: dave@pdx.net > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=58308 > > > > I've checked that this works in v0.05003, but breaks in v0.06000 and later. > > Constraint names given to add_unique_constraint() have begun to use reserved sqlite_* > identifier names. The SQLite engine rejects the DDL code generated by ->deploy() because > of this change in the constraint names generated by DBIx::Class::Schema::Loader. > > Simple SQLite table: > > CREATE TABLE users ( > id INTEGER PRIMARY KEY AUTOINCREMENT, > username TEXT UNIQUE, > email TEXT, > password TEXT, > last_modified DATETIME > ); > > Up to v0.05003, this generates the UNIQUE constraint as: > > __PACKAGE__->add_unique_constraint("username_unique", ["username"]); > > Beginning with v0.06000, it generates: > > __PACKAGE__->add_unique_constraint("sqlite_autoindex_users_1", ["username"]); > > This can't be ->deploy()ed on SQLite. Message: > > DBIx::Class::Storage::DBI::__ANON__(): DBIx::Class::Schema::deploy(): DBI Exception: > DBD::SQLite::db do failed: object name reserved for internal use: sqlite_autoindex_roles_1 > [for Statement "CREATE UNIQUE INDEX sqlite_autoindex_roles_1 ON roles (role)"] at > script/deploy.pl line 20 > > The development machine is Mac OS X 10.6.3. My Perl is 5.8.9. My SQLite is 3.6.2. The > development library is a fresh build from CPAN to a private lib directory (but using the > system-shiped Perl 5.8.9 core library). > > Thanks, > Dave
From: dave [...] pdx.net
Indeed the version from git, identifying itself as v0.7001, does work for me. Cheers, Dave On Fri Jun 11 06:51:40 2010, rkitover@cpan.org wrote: Show quoted text
> Try the git version please: > > git://git.shadowcat.co.uk/dbsrgits/DBIx-Class-Schema-Loader.git > > It should work for you.
From: dave [...] pdx.net
Sorry, 0.07001. On Fri Jun 18 20:46:57 2010, dgiller wrote: Show quoted text
> Indeed the version from git, identifying itself as v0.7001, does work > for me.
Fixed in 0.07001 .