about summary refs log tree commit diff
path: root/db/migrate/20161128103007_create_subscriptions.rb
blob: 46443680adafb4dc40764704e1aa391fcf1e5271 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class CreateSubscriptions < ActiveRecord::Migration[5.0]
  def change
    create_table :subscriptions do |t|
      t.string :callback_url, null: false, default: ''
      t.string :secret
      t.datetime :expires_at, null: true, default: nil
      t.boolean :confirmed, null: false, default: false
      t.integer :account_id, null: false

      t.timestamps
    end

    add_index :subscriptions, [:callback_url, :account_id], unique: true
  end
end