Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CreateXaaronUsers < ActiveRecord::Migration
- def change
- create_table :xaaron_users do |t|
- t.string :first_name
- t.string :last_name
- t.string :user_name
- t.string :email
- t.string :password
- t.string :salt
- t.timestamps
- end
- end
- end
- class Roles < ActiveRecord::Migration
- def change
- create_table :xaaron_roles do |t|
- t.string :role
- t.timestamps
- end
- end
- end
- class UserRolesJoin < ActiveRecord::Migration
- def change
- create_table :xaaron_user_roles, id: false do |t|
- t.references :xaaron_user, null: false
- t.references :xaaron_role, null: false
- end
- add_index :xaaron_user_roles, :user_id
- add_index :xaaron_user_roles, [:role_id, :user_id], unique: true
- add_index :xarron_roles, :role, unique: true
- end
- end
- PG::UndefinedColumn: ERROR: column "user_id" does not exist
- : CREATE INDEX "index_xaaron_user_roles_on_user_id" ON "xaaron_user_roles" ("user_id")/Users/Adam/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `async_exec'
- /Users/Adam/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute''
- class CreateJoinTableUserRole < ActiveRecord::Migration
- def change
- create_join_table :users, :roles do |t|
- # t.index [:user_id, :role_id]
- # t.index [:role_id, :user_id]
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement