Sha256: 4af75030f2ea5a2414eb1d36243563df37800dd2c748e922542b4553708eaaa0

Contents?: true

Size: 544 Bytes

Versions: 5

Compression:

Stored size: 544 Bytes

Contents

class CreateKeyValuesTable < ActiveRecord::Migration<%= migration_version %>
  def self.up
    create_table <%= table_name %> 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  <%= table_name %>, :key, :unique => true
    add_index  <%= table_name %>, :expires_at

    change_column  <%= table_name %>, :id, "bigint(20) NOT NULL AUTO_INCREMENT"
  end

  def self.down
    drop_table  <%= table_name %>
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
github-ds-0.5.4 lib/generators/github/ds/templates/migration.rb
github-ds-0.5.3 lib/generators/github/ds/templates/migration.rb
github-ds-0.5.2 lib/generators/github/ds/templates/migration.rb
github-ds-0.5.0 lib/generators/github/ds/templates/migration.rb
github-ds-0.4.0 lib/generators/github/ds/templates/migration.rb