mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 23:13:40 +08:00
13 lines
295 B
Ruby
13 lines
295 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CreateUserVisits < ActiveRecord::Migration[4.2]
|
|
def change
|
|
create_table :user_visits do |t|
|
|
t.integer :user_id, null: false
|
|
t.date :visited_at, null: false
|
|
end
|
|
|
|
add_index :user_visits, %i[user_id visited_at], unique: true
|
|
end
|
|
end
|