Db:schema:load fails on SQLite3 ANALYZE database

Hello everyone.

SQLite3 database ANALYZE command makes internal statistics table
“sqlite_stat1”,
however db:schema:load trys to clone its reserved table. So it fails.

http://www.sqlite.org/lang_analyze.html
http://www.sqlite.org/fileformat2.html#stat1tab

Could anyone tell me idea?

== command ==

rake test:units
rake aborted!
SQLite3::SQLException: object name reserved for internal use:
sqlite_autoindex_products_1: CREATE UNIQUE INDEX
“sqlite_autoindex_products_1” ON “products” (“id”)

Tasks: TOP => db:schema:load
(See full trace by running task with --trace)

rake db:schema:load
– create_table(“products”, {:force=>true})
-> 0.3594s
– add_index(“products”, [“id”], {:unique=>true,
:name=>“sqlite_autoindex_products_1”})
rake aborted!
SQLite3::SQLException: object name reserved for internal use:
sqlite_autoindex_products_1: CREATE UNIQUE INDEX
“sqlite_autoindex_products_1” ON “products” (“id”)

Tasks: TOP => db:schema:load
(See full trace by running task with --trace)

== sql-db ==

sqlite3 delelopment.db .dump | grep “sqlite_stat1”
INSERT INTO “sqlite_stat1” VALUES(‘products’,‘products_titleid’,‘6247
7’);
INSERT INTO “sqlite_stat1” VALUES(‘products’,‘products_day’,‘6247 521
18’);
INSERT INTO “sqlite_stat1”
VALUES(‘products’,‘sqlite_autoindex_products_1’,‘6247 1’);

= version =

gem list
activerecord (3.2.6)
rails (3.2.6)
sqlite3 (1.3.6)

dpkg -l|grep sqlite
ii sqlite3 3.7.3-1 A command line interface for SQLite 3


Randy Michaels
[email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs