Sha256: ef0b673de1b949618631b34f6d2b815376e8ea936bef85f6c9a28320bc1e797e

Contents?: true

Size: 561 Bytes

Versions: 2

Compression:

Stored size: 561 Bytes

Contents

class CreatePreferences < (ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[4.2] : ActiveRecord::Migration)
  def self.up
    create_table :preferences do |t|
      t.integer :user_id, null: false
      t.string  :category, null: false
      t.string  :name, null: false
      t.integer :value, null: false
      t.timestamps null: false
    end

    add_index :preferences, :user_id
    add_index :preferences, [:user_id, :category]
    add_index :preferences, [:category, :name, :value]
  end

  def self.down
    drop_table :preferences
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
user_preferences-1.0.2 spec/migrations/002_create_preferences.rb
user_preferences-1.0.1 spec/migrations/002_create_preferences.rb