I followed the instruction on link below to "create table with no 'id' column", since i am using 'emp_id' instead. Create an ActiveRecord database table with no :id column?
I am facing error "table users has no column named id: CREATE UNIQUE INDEX" from Sqlite. Just wondering if you could provide some suggestions to me. Thank you so much for your kind input.
Below is the original migration file:
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users, :id => false do |t|
t.integer :emp_id
t.string :name
t.integer :dept_id
t.timestamps
end
end
def self.down
drop_table :users
end
end
Below is the result after running "rake db:migrate"
-- add_index(:users, :id, {:unique=>true})
rake aborted!
An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: table users has no column named id: CREATE UNIQUE INDEX "index_users_on_id" ON "users" ("id")
Sincerely, Kevin H