Permalink
Browse files

cleanup demo seeds

  • Loading branch information...
1 parent b0717c9 commit f21baa67b3b2e13b8c75743c41561e37bcd3dbd2 @geraldb geraldb committed Jul 8, 2012
Showing with 48 additions and 61 deletions.
  1. +3 −1 db/seeds.rb
  2. +29 −0 db/seeds/demo/pools.rb
  3. +16 −0 db/seeds/demo/users.rb
  4. +0 −30 db/seeds/pools.rb
  5. +0 −16 db/seeds/users.rb
  6. +0 −14 db/structure.sql
View
@@ -1,6 +1,8 @@
-['services', 'cl', 'euro', 'users', 'pools'].each do |seed|
+['services',
+ 'euro/teams', 'world/quali_2012_13',
+ 'demo/users', 'demo/pools'].each do |seed|
require "#{Rails.root}/db/seeds/#{seed}.rb"
end
@@ -0,0 +1,29 @@
+# encoding: utf-8
+
+puts "*** loading seed data in seeds/demo/pools.rb"
+
+wmql = Event.find_by_key!( 'wmql' )
+
+lionel = User.find_by_key!( 'lionel' )
+cristiano = User.find_by_key!( 'cristiano' )
+demo = User.find_by_key!( 'demo' )
+
+pool1 = Pool.create!( :event => wmql, :title => 'Demo', :user => lionel, :welcome => '' )
+
+# pool2 = Pool.create!( :event => euro, :title => 'Demo', :user => cristiano, :welcome => '', :fix => true )
+# pool3 = Pool.create!( :event => euro, :title => 'Demo', :user => cristiano, :welcome => '' )
+
+
+pool1.players << lionel # also auto add admin as first player
+pool1.players << demo
+
+# pool2.players << cristiano
+# pool2.players << demo
+
+# pool3.players << cristiano
+
+## todo: use new version constant for app module e.g. Wettpool::VERSION ??
+Prop.create!( :key => 'db.seeds.demo.pools.version', :value => '1' )
+
+
+
@@ -0,0 +1,16 @@
+# encoding: utf-8
+
+puts "*** loading seed data in seeds/demo/users.rb"
+
+##############
+## Users
+
+User.create!( :name => 'Lionel MESSI', :email => 'lionel', :password => 'lionel' )
+User.create!( :name => 'Cristiano RONALDO', :email => 'cristiano', :password => 'cristiano' )
+
+User.create!( :name => 'Diego LAFATA', :email => 'demo', :password => 'demo' )
+
+User.create!( :name => 'Gerald BAUER', :email => 'gerald', :password => 'tipp', :admin => true )
+
+## todo: use new version constant for app module e.g. Wettpool::VERSION ??
+Prop.create!( :key => 'db.seeds.demo.users.version', :value => '1' )
View
@@ -1,30 +0,0 @@
-# encoding: utf-8
-
-puts "*** loading seed data in seeds/pools.rb"
-
-cl = Event.find_by_key!( 'cl' )
-euro = Event.find_by_key!( 'euro' )
-
-lionel = User.find_by_email!( 'lionel' )
-cristiano = User.find_by_email!( 'cristiano' )
-demo = User.find_by_email!( 'demo' )
-
-pool1 = Pool.create!( :event => cl, :title => 'Demo', :user => lionel, :welcome => '' )
-
-pool2 = Pool.create!( :event => euro, :title => 'Demo', :user => cristiano, :welcome => '', :fix => true )
-pool3 = Pool.create!( :event => euro, :title => 'Demo', :user => cristiano, :welcome => '' )
-
-
-pool1.players << lionel # also auto add admin as first player
-pool1.players << demo
-
-pool2.players << cristiano
-pool2.players << demo
-
-pool3.players << cristiano
-
-## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.pools.version', :value => '1' )
-
-
-
View
@@ -1,16 +0,0 @@
-# encoding: utf-8
-
-puts "*** loading seed data in seeds/users.rb"
-
-##############
-## Users
-
-lionel = User.create!( :name => 'Lionel MESSI', :email => 'lionel', :password => 'lionel' )
-cristiano = User.create!( :name => 'Cristiano RONALDO', :email => 'cristiano', :password => 'cristiano' )
-
-demo = User.create!( :name => 'Diego LAFATA', :email => 'demo', :password => 'demo' )
-
-gerald = User.create!( :name => 'Gerald BAUER', :email => 'gerald', :password => 'tipp', :admin => true )
-
-## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.users.version', :value => '1' )
View
@@ -1,14 +0,0 @@
-CREATE TABLE "events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255) NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "start_at" datetime);
-CREATE TABLE "events_teams" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "event_id" integer NOT NULL, "team_id" integer NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL);
-CREATE TABLE "game_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "event_id" integer NOT NULL, "title" varchar(255) NOT NULL, "pos" integer NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "calc" boolean DEFAULT 'f');
-CREATE TABLE "games" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "game_group_id" integer NOT NULL, "pos" integer NOT NULL, "team1_id" integer NOT NULL, "team2_id" integer NOT NULL, "play_at" datetime NOT NULL, "score1" integer, "score2" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "knockout" boolean DEFAULT 'f', "score3" integer, "score4" integer, "score5" integer, "score6" integer);
-CREATE TABLE "pools" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "event_id" integer NOT NULL, "title" varchar(255) NOT NULL, "user_id" integer NOT NULL, "welcome" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "fix" boolean DEFAULT 'f');
-CREATE TABLE "pools_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer NOT NULL, "pool_id" integer NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "team1_id" integer, "team2_id" integer, "team3_id" integer, "points" integer);
-CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL);
-CREATE TABLE "teams" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255) NOT NULL, "img" varchar(255), "calc" boolean DEFAULT 'f' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL);
-CREATE TABLE "tips" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer NOT NULL, "pool_id" integer NOT NULL, "game_id" integer NOT NULL, "score1" integer, "score2" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "score3" integer, "score4" integer, "score5" integer, "score6" integer);
-CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "email" varchar(255), "password" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL);
-CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version");
-INSERT INTO schema_migrations (version) VALUES ('20120305214015');
-
-INSERT INTO schema_migrations (version) VALUES ('20120312165907');

0 comments on commit f21baa6

Please sign in to comment.