[opensuse-buildservice] frontend and sqlite3
Hello, I use obs-api-0.1.1-37.1. Is it possible to use frontend with sqlite3 database engine? my /srv/www/obs/frontend/config/database.yml: development: adapter: sqlite3 database: db/frontend_development.sqlite3 rake migrate returns an error: (in /srv/www/obs/frontend)
>>>>>>>>>>>>>>>>> /srv/www/obs/common/lib <<<<<<<<<<<<<<<<<<<<<<<<<< Using global environment /srv/www/obs/frontend/config/../config/environments/development_base.rb Using global environment /srv/www/obs/frontend/config/../config/environments/development_base.rb == InitialDatabase: migrating ================================================= -- create_table("groups", {:force=>true}) -> 0.5798s -- add_index("groups", ["parent_id"], {:name=>"groups_parent_id_index"}) -> 0.2343s -- create_table("groups_roles", {:force=>true, :id=>false}) -> 0.4251s -- add_index("groups_roles", ["group_id", "role_id"], {:name=>"groups_roles_all_index", :unique=>true}) -> 0.0716s -- add_index("groups_roles", ["role_id"], {:name=>"role_id"}) -> 0.2138s -- create_table("groups_users", {:force=>true, :id=>false}) -> 0.2460s -- add_index("groups_users", ["group_id", "user_id"], {:name=>"groups_users_all_index", :unique=>true}) -> 0.0992s -- add_index("groups_users", ["user_id"], {:name=>"user_id"}) -> 0.1558s -- create_table("roles", {:force=>true}) -> 0.4221s -- add_index("roles", ["parent_id"], {:name=>"roles_parent_id_index"}) -> 0.1087s -- create_table("roles_static_permissions", {:force=>true, :id=>false}) -> 0.2324s -- add_index("roles_static_permissions", ["static_permission_id", "role_id"], {:name=>"roles_static_permissions_all_index", :unique=>true}) -> 0.1104s -- add_index("roles_static_permissions", ["role_id"], {:name=>"role_id"}) rake aborted! SQLite3::SQLException: index role_id already exists: CREATE INDEX "role_id" ON roles_static_permissions ("role_id")
(See full trace by running task with --trace) What's wrong? --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2007-09-03 17:19:49 +0400, AgBr wrote:
I use obs-api-0.1.1-37.1. Is it possible to use frontend with sqlite3 database engine?
my /srv/www/obs/frontend/config/database.yml:
development: adapter: sqlite3 database: db/frontend_development.sqlite3
rake migrate returns an error: [...] SQLite3::SQLException: index role_id already exists: CREATE INDEX "role_id" ON roles_static_permissions ("role_id")
(See full trace by running task with --trace)
What's wrong?
afaik sqlite only supports one index per table. and you get the error when it tries to add the 2nd index. imho this index might be a candidate for a drop. but we have other tables where we definitely need 2 indeces. darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Monday 03 September 2007 16:24, Marcus Rueckert wrote: Hi,
SQLite3::SQLException: index role_id already exists: CREATE INDEX "role_id" ON roles_static_permissions ("role_id")
(See full trace by running task with --trace)
What's wrong?
afaik sqlite only supports one index per table.
From www.sqlite.org/lang_createindex.html: "There are no arbitrary limits on the number of indices that can be attached to a single table, nor on the number of columns in an index." However, there is already a index with name role_id for table groups_roles. Maybe the names of the indices per database have to be unique? Hmm, that would be strange... regards, Klaas -- Klaas Freitag Architect OPS/IPD SUSE LINUX Products GmbH - Nuernberg --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Klaas Freitag wrote:
From www.sqlite.org/lang_createindex.html: "There are no arbitrary limits on the number of indices that can be attached to a single table, nor on the number of columns in an index."
However, there is already a index with name role_id for table groups_roles. Maybe the names of the indices per database have to be unique? Hmm, that would be strange...
Do you want to say that the index has been created once and there is try to create it again? Does it mean that "CREATE INDEX IF NOT EXISTS" can help? --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (3)
-
AgBr
-
Klaas Freitag
-
Marcus Rueckert