diff options
author | David Gay <david@davidgay.org> | 2021-06-06 17:57:43 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-06-06 17:57:43 -0400 |
commit | 3622126380278d9bed8ea0e1e05a0bd1ea040596 (patch) | |
tree | f34f85368138cc3038f362ac4c68a9d5756f55fc /db/migrate | |
parent | 387684c8be4691c4469677e48e1b0a46ad600363 (diff) |
Messages
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20210606214340_create_messages.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20210606214340_create_messages.rb b/db/migrate/20210606214340_create_messages.rb new file mode 100644 index 0000000..5886af6 --- /dev/null +++ b/db/migrate/20210606214340_create_messages.rb @@ -0,0 +1,12 @@ +class CreateMessages < ActiveRecord::Migration[6.1] + def change + create_table :messages do |t| + t.references :sender, foreign_key: { to_table: :characters } + t.references :recipient, null: false, foreign_key: { to_table: :characters } + t.string :subject + t.text :body + + t.timestamps + end + end +end |