diff options
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20170506235850_create_conversations.rb | 10 | ||||
-rw-r--r-- | db/migrate/20170507000211_add_conversation_id_to_statuses.rb | 6 |
2 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20170506235850_create_conversations.rb b/db/migrate/20170506235850_create_conversations.rb new file mode 100644 index 000000000..eaf66ded7 --- /dev/null +++ b/db/migrate/20170506235850_create_conversations.rb @@ -0,0 +1,10 @@ +class CreateConversations < ActiveRecord::Migration[5.0] + def change + create_table :conversations, id: :bigserial do |t| + t.string :uri, null: true, default: nil + t.timestamps + end + + add_index :conversations, :uri, unique: true + end +end diff --git a/db/migrate/20170507000211_add_conversation_id_to_statuses.rb b/db/migrate/20170507000211_add_conversation_id_to_statuses.rb new file mode 100644 index 000000000..d1ef7c290 --- /dev/null +++ b/db/migrate/20170507000211_add_conversation_id_to_statuses.rb @@ -0,0 +1,6 @@ +class AddConversationIdToStatuses < ActiveRecord::Migration[5.0] + def change + add_column :statuses, :conversation_id, :bigint, null: true, default: nil + add_index :statuses, :conversation_id + end +end |