created models for chatroom

This commit is contained in:
Beatrice Olivera
2018-08-29 13:44:10 +01:00
parent 82079d71cd
commit 085e402c4d
12 changed files with 100 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
class CreateChatRooms < ActiveRecord::Migration[5.2]
def change
create_table :chat_rooms do |t|
t.timestamps
end
end
end

View File

@@ -0,0 +1,10 @@
class CreateChatRoomParticipations < ActiveRecord::Migration[5.2]
def change
create_table :chat_room_participations do |t|
t.references :user, foreign_key: true
t.references :chat_room, foreign_key: true
t.timestamps
end
end
end

View File

@@ -0,0 +1,11 @@
class CreateRequests < ActiveRecord::Migration[5.2]
def change
create_table :requests do |t|
t.references :user, foreign_key: true
t.references :chat_room, foreign_key: true
t.boolean :accepted
t.timestamps
end
end
end

View File

@@ -0,0 +1,5 @@
class ChangeColumnInRequests < ActiveRecord::Migration[5.2]
def change
change_column :requests, :accepted, :boolean, default: false
end
end