Add class and master level support to db
This commit is contained in:
parent
e377306663
commit
f7e6afb1dc
2 changed files with 20 additions and 0 deletions
14
db/migrate/20220322080142_create_classes.rb
Normal file
14
db/migrate/20220322080142_create_classes.rb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
class CreateClasses < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :classes, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
|
||||
t.string :name_en
|
||||
t.string :name_jp
|
||||
|
||||
t.integer :proficiency1
|
||||
t.integer :proficiency2
|
||||
|
||||
t.string :row
|
||||
t.boolean :ml, default: false
|
||||
end
|
||||
end
|
||||
end
|
||||
6
db/migrate/20220322084824_add_class_and_ml_to_party.rb
Normal file
6
db/migrate/20220322084824_add_class_and_ml_to_party.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
class AddClassAndMlToParty < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_reference :parties, :class, name: :class_id, type: :uuid, foreign_key: { to_table: :classes }
|
||||
add_column :parties, :ml, :integer
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue