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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
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
This topic is locked and can not be replied to.