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