Add class and master level support to db

This commit is contained in:
Justin Edmund 2022-03-22 02:29:54 -07:00
parent e377306663
commit f7e6afb1dc
2 changed files with 20 additions and 0 deletions

View 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

View 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