Forum: Ruby on Rails db:schema:load fails on SQLite3 ANALYZE database

938b7097478c2c31fcc508fa2692f653?d=identicon&s=25 Randy.M (Guest)
on 2012-07-28 16:51
(Received via mailing list)
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
randy_michaels@aol.com
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.