mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 11:55:09 +08:00
16 lines
422 B
Ruby
16 lines
422 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CreateInvitedUsers < ActiveRecord::Migration[6.0]
|
|
def change
|
|
create_table :invited_users do |t|
|
|
t.integer :user_id
|
|
t.integer :invite_id, null: false
|
|
t.datetime :redeemed_at
|
|
t.timestamps null: false
|
|
end
|
|
|
|
add_index :invited_users, :invite_id
|
|
add_index :invited_users, [:user_id, :invite_id], unique: true, where: 'user_id IS NOT NULL'
|
|
end
|
|
end
|