discourse/db/migrate/20121123063630_create_user_visits.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
295 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class CreateUserVisits < ActiveRecord::Migration[4.2]
2013-02-06 03:16:51 +08:00
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