You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docuseal/db/migrate/20260508100000_create_teams.rb

18 lines
449 B

# frozen_string_literal: true
class CreateTeams < ActiveRecord::Migration[8.0]
def change
create_table :teams do |t|
t.string :name, null: false
t.references :account, null: false, foreign_key: true
t.string :uuid, null: false
t.datetime :archived_at
t.timestamps
end
add_index :teams, :uuid, unique: true
add_index :teams, %i[account_id name], unique: true, where: 'archived_at IS NULL'
end
end