Merge initial schema migrations
This commit is contained in:
parent
5774b2463a
commit
821c40c35c
|
|
@ -1,8 +1,45 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DeviseTokenAuthCreateUsers < ActiveRecord::Migration[5.2]
|
||||
class CreateSchema < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table(:users) do |t|
|
||||
create_table :groups do |t|
|
||||
t.string :name
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :group_stages do |t|
|
||||
t.integer :playoff_size
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :matches do |t|
|
||||
t.integer :score_team_1
|
||||
t.integer :score_team_2
|
||||
t.integer :state
|
||||
t.integer :position
|
||||
t.boolean :is_group_match
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :playoff_stages do |t|
|
||||
t.integer :level
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :teams do |t|
|
||||
t.string :name
|
||||
t.integer :group_score
|
||||
t.integer :group_points_scored
|
||||
t.integer :group_points_recieved
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :users do |t|
|
||||
## Required
|
||||
t.string :provider, null: false, default: 'email'
|
||||
t.string :uid, null: false, default: ''
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateGroups < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :groups do |t|
|
||||
t.integer :id
|
||||
t.references :matches, foreign_key: true
|
||||
t.references :teams, foreign_key: true
|
||||
t.string :name
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateGroupStages < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :group_stages do |t|
|
||||
t.integer :id
|
||||
t.reference :groups
|
||||
t.integer :playoff_size
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateMatches < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :matches do |t|
|
||||
t.integer :id
|
||||
t.reference :team_1
|
||||
t.reference :team_2
|
||||
t.integer :score_team_1
|
||||
t.integer :score_team_2
|
||||
t.integer :state
|
||||
t.integer :position
|
||||
t.boolean :is_group_match
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreatePlayoffStages < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :playoff_stages do |t|
|
||||
t.integer :id
|
||||
t.integer :level
|
||||
t.reference :matches
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateTeams < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :teams do |t|
|
||||
t.integer :id
|
||||
t.string :name
|
||||
t.integer :group_score
|
||||
t.integer :group_points_scored
|
||||
t.integer :group_points_recieved
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue