KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I would like to create a bigint (or string or whatever that is not int ) typed primary key field under Rails 3. I have a given structure of data, for example: things ------ id bigint primary_key name char(32) The approach I'm currently trying to push: create_table :things, :id => false do |t| # That prevents the creation of (id int) PK t.integer :id, :limit => 8 # That makes the column type bigint t.string :name, :limit => 32 t.primary_key :id # This is perfectly ignored :-( end The column type will be correct, but the primary key option will not be present with sqlite3 and I suspect that this is the case for MySQL too.
Tags (comma-separated)
Save Edits
Cancel