Chatwoot/db/migrate/20210114202310_create_teams.rb
Sojan Jose a0c33254e7
feat: Team APIs (#1654)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2021-01-17 23:56:56 +05:30

20 lines
541 B
Ruby

class CreateTeams < ActiveRecord::Migration[6.0]
def change
create_table :teams do |t|
t.string :name, null: false
t.text :description
t.boolean :allow_auto_assign, default: true
t.references :account, null: false, foreign_key: true
t.timestamps
end
create_table :team_members do |t|
t.references :team, null: false, foreign_key: true
t.references :user, null: false, foreign_key: true
t.timestamps
end
add_reference :conversations, :team, foreign_key: true
end
end