diff options
author | David Gay <david@davidgay.org> | 2021-05-22 14:32:38 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-05-22 14:32:44 -0400 |
commit | 88bd4f77db3a4372c118a9faef613615db66bc52 (patch) | |
tree | c0ad67b0cdde98e58199052198c9b4f1c45a85f2 /db/migrate | |
parent | 2dd5608409f0a506cd2a682107d9be302cec8079 (diff) |
Titles
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20210520230216_create_titles.rb | 12 | ||||
-rw-r--r-- | db/migrate/20210520230859_create_title_awards.rb | 10 |
2 files changed, 22 insertions, 0 deletions
diff --git a/db/migrate/20210520230216_create_titles.rb b/db/migrate/20210520230216_create_titles.rb new file mode 100644 index 0000000..512773f --- /dev/null +++ b/db/migrate/20210520230216_create_titles.rb @@ -0,0 +1,12 @@ +class CreateTitles < ActiveRecord::Migration[6.1] + def change + create_table :titles do |t| + t.string :gid + t.string :name + + t.timestamps + end + + add_reference :characters, :active_title, foreign_key: { to_table: :titles } + end +end diff --git a/db/migrate/20210520230859_create_title_awards.rb b/db/migrate/20210520230859_create_title_awards.rb new file mode 100644 index 0000000..795cd5e --- /dev/null +++ b/db/migrate/20210520230859_create_title_awards.rb @@ -0,0 +1,10 @@ +class CreateTitleAwards < ActiveRecord::Migration[6.1] + def change + create_table :title_awards do |t| + t.references :title, null: false, foreign_key: true + t.references :character, null: false, foreign_key: true + + t.timestamps + end + end +end |