mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-24 22:42:27 -05:00
13 lines
358 B
Ruby
13 lines
358 B
Ruby
|
class CreateUserBadges < ActiveRecord::Migration
|
||
|
def change
|
||
|
create_table :user_badges do |t|
|
||
|
t.integer :badge_id, null: false
|
||
|
t.integer :user_id, index: true, null: false
|
||
|
t.datetime :granted_at, null: false
|
||
|
t.integer :granted_by_id, null: false
|
||
|
end
|
||
|
|
||
|
add_index :user_badges, [:badge_id, :user_id], unique: true
|
||
|
end
|
||
|
end
|