Sha256: d6639d444fa4be3f7c8f085e9d329773389d35aef8ebadcfe8a306f698e6d0be

Contents?: true

Size: 586 Bytes

Versions: 5

Compression:

Stored size: 586 Bytes

Contents

class CreateTokens < ActiveRecord::Migration
  def change
    create_table :tokens do |t|
      t.string      :name, null: false
      t.belongs_to  :tokenizable, null: false, polymorphic: true
      t.string      :token, null: false
      t.text        :data, null: true
      t.datetime    :expires_at, null: true
      t.datetime    :created_at, null: false
    end

    add_index :tokens, [:tokenizable_type, :tokenizable_id]
    add_index :tokens, :token
    add_index :tokens, :expires_at
    add_index :tokens, [:tokenizable_id, :tokenizable_type, :name], unique: true
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
mongoid-tokens-1.0.0 templates/tokens.rb
tokens-2.1.1 templates/tokens.rb
tokens-2.1.0 templates/tokens.rb
tokens-2.0.1 templates/tokens.rb
tokens-2.0.0 templates/tokens.rb