Sha256: 6e389837a232d3eb25cecd3b8e19ff3768fb01a53f13cefaba7a887ef83e0ca0

Contents?: true

Size: 453 Bytes

Versions: 1

Compression:

Stored size: 453 Bytes

Contents

class CreateRefMany < ActiveRecord::Migration
  def self.up
    # down

    create_table :users do |t|
      # implicit user_id binds to user_id of roles_users join table
      t.string :name
      t.timestamps
    end

    create_table :roles do |t|
      # implicit role_id binds to role_id of roles_users join table
      t.string :name
      t.timestamps
    end    
  end
  
  def self.down  
    drop_table :users
    drop_table :roles
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
troles-0.5.2 spec/active_record/migrations/many/ref_many.rb