Sha256: a75fe1588a61646ad4d46b02a7d50e0c603ddbf2ae7066231c572d265d27551c
Contents?: true
Size: 730 Bytes
Versions: 13
Compression:
Stored size: 730 Bytes
Contents
class CreateLists < ActiveRecord::Migration def up create_table :lists, force: true do |t| t.integer :user_id t.string :name t.timestamps end add_index :lists, :user_id create_table :list_items, force: true do |t| t.integer :list_id t.integer :user_id t.string :thing_type t.integer :thing_id t.integer :position t.timestamps end #add_index :list_items, [:list_id, :position], unique: true create_table :things, force: true do |t| t.string :name t.timestamps end add_index :things, :name, unique: true end def down [:lists, :list_items, :things].each {|table| drop_table table } end end
Version data entries
13 entries across 13 versions & 1 rubygems