Sha256: 8dddbb8e3711d55cfa7fb1bf322dc219c87ae82c002b6ef8bf5892a723b3b732

Contents?: true

Size: 486 Bytes

Versions: 2

Compression:

Stored size: 486 Bytes

Contents

class CreateKeyValuesTable < ActiveRecord::Migration
  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

2 entries across 2 versions & 1 rubygems

Version Path
github-ds-0.2.0 lib/generators/github/ds/templates/migration.rb
github-ds-0.1.0 lib/generators/github/ds/templates/migration.rb