Error creating daabase

141 views
Skip to first unread message

Daniele Mancini

unread,
Jan 12, 2017, 11:51:30 AM1/12/17
to opensport
Hello,
I am trying to setup a database, but I am getting errors during the create phase.

I am using
 - RUBYGEMS VERSION: 2.5.2
 
- RUBY VERSION: 2.3.3 (2016-11-21 patchlevel 222) [x64-mingw32]

this is the result I am getting
C:\openfootball>sportdb create
activerecord
-utils/0.4.0 (activerecord/5.0.1) on Ruby 2.3.3 (2016-11-21) [x64-mingw32]
 
[TagDb.has_many_tags] adding taggings n tags has_many assocs to model >WorldDb::Model::Country<
 
[TagDb.has_many_tags] adding taggings n tags has_many assocs to model >WorldDb::Model::StateBase<
 
[TagDb.has_many_tags] adding taggings n tags has_many assocs to model >WorldDb::Model::CityBase<
sportdb
-update/0.1.1 on Ruby 2.3.3 (2016-11-21) [x64-mingw32]
sportdb
-service/0.4.0 on Ruby 2.3.3 (2016-11-21) [x64-mingw32]
sportdb
/1.11.0 on Ruby 2.3.3 (2016-11-21) [x64-mingw32]
sportdb
/1.11.0 on Ruby 2.3.3 (2016-11-21) [x64-mingw32]
working directory
: C:/openfootball
Connecting to db using settings:
{:adapter=>"sqlite3", :database=>"./
sport.db"}
-- create_table(:logs)
   -> 0.0045s
-- create_table(:props, {})
   -> 0.0009s
-- create_table(:tags)
   -> 0.0017s
-- add_index(:tags, :key, {:unique=>true})
   -> 0.0014s
-- create_table(:taggings)
   -> 0.0019s
-- add_index(:taggings, :tag_id)


*** error: Index name 'index_taggings_on_tag_id' on table 'taggings' already exists

I have read a closed issue regarding the fact that activerecord 5 is not supported, if this is the issue how can I setup a working environment to generate a DB?

Gerald Bauer

unread,
Jan 12, 2017, 12:00:12 PM1/12/17
to open...@googlegroups.com
Hello,

> *** error: Index name 'index_taggings_on_tag_id' on table 'taggings' already exists

Thanks for trying football.db. Yes, this is a known issue. Sorry.
Please "downgrade" activerecord to the 4.2.x series.

> I have read a closed issue regarding the fact that activerecord 5 is not supported,
> if this is the issue how can I setup a working environment to generate a DB?

One way is to use a Gemfile (and bundler) to install the sportdb
and activerecord with a specific version e.g.

Gemfile:

gem 'sportdb'
gem 'activerecord', '~>4.2'

Cheers.

johnwh...@gmail.com

unread,
Jan 18, 2017, 12:36:49 PM1/18/17
to opensport
I found this very helpful and it solved my problem. Note that you'll have to run the sportdb command preceded by, "bundle exec", so e.g. "bundle exec sportdb new en".

This would be worth adding to the FAQ on the main site.

Gerald Bauer

unread,
Jan 18, 2017, 12:38:56 PM1/18/17
to open...@googlegroups.com
Hello,

> This would be worth adding to the FAQ on the main site.

Good point. You can find the FAQ page (edit me!) on GitHub ->
https://github.com/openfootball/docs/blob/master/questions.md

Cheers.
Reply all
Reply to author
Forward
0 new messages