Sha256: 58051aff38c2138464b22732bcad919ea09f316e1a85b22aa94919adadbb7884

Contents?: true

Size: 881 Bytes

Versions: 3

Compression:

Stored size: 881 Bytes

Contents

class CreateProposalTokens < ActiveRecord::Migration
  def up
    create_table :proposal_tokens do |t|
      t.string  :token,           null: false
      t.string  :email,           null: false
      t.string  :proposable_type, null: false
      t.string  :resource_type
      t.integer :resource_id
      t.string  :proposer_type
      t.integer :proposer_id
      t.text    :arguments

      t.datetime :accepted_at
      t.datetime :reminded_at
      t.datetime :expires_at,     null: false
      t.datetime :updated_at,     null: false
      t.datetime :created_at,     null: false
    end

    add_index :proposal_tokens, :token, unique: true

    execute <<-SQL
CREATE UNIQUE INDEX proposal_idx ON proposal_tokens (
  email,
  proposable_type,
  resource_type,
  resource_id,
  expires_at,
  accepted_at
)
    SQL
  end

  def down
    drop_table :proposal_tokens
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
proposal-2.0.0 db/migrate/20121026005348_create_proposal_tokens.rb
proposal-1.0.0 db/migrate/20121026005348_create_proposal_tokens.rb
proposal-0.0.6 db/migrate/20121026005348_create_proposal_tokens.rb