Sha256: c4b944226ae7a0b6237ca98862799a800ff5701c4c64d4269c5f5ef687faa230

Contents?: true

Size: 510 Bytes

Versions: 12

Compression:

Stored size: 510 Bytes

Contents

class CreateKeyValuesTable < ActiveRecord::Migration<%= migration_version %>
  def self.up
    create_table :key_values do |t|
      t.string :key, :null => false
      t.binary :value, :null => false
      t.datetime :expires_at, :null => true
      t.timestamps :null => false
    end

    add_index :key_values, :key, :unique => true
    add_index :key_values, :expires_at

    change_column :key_values, :id, "bigint(20) NOT NULL AUTO_INCREMENT"
  end

  def self.down
    drop_table :key_values
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
github-ds-0.3.0 lib/generators/github/ds/templates/migration.rb
github-ds-0.2.11 lib/generators/github/ds/templates/migration.rb
github-ds-0.2.10 lib/generators/github/ds/templates/migration.rb
github-ds-0.2.9 lib/generators/github/ds/templates/migration.rb
github-ds-0.2.8 lib/generators/github/ds/templates/migration.rb
github-ds-0.2.7 lib/generators/github/ds/templates/migration.rb
github-ds-0.2.6 lib/generators/github/ds/templates/migration.rb
github-ds-0.2.5 lib/generators/github/ds/templates/migration.rb
github-ds-0.2.4 lib/generators/github/ds/templates/migration.rb
github-ds-0.2.3 lib/generators/github/ds/templates/migration.rb
github-ds-0.2.2 lib/generators/github/ds/templates/migration.rb
github-ds-0.2.1 lib/generators/github/ds/templates/migration.rb