rails3 bigint clave principal
Me gustaría crear unabigint
(ostring
o lo que sea que no seaint
) escribió el campo de clave principal en Rails 3.
Tengo una estructura de datos dada, por ejemplo:
things
------
id bigint primary_key
name char(32)
El enfoque que estoy tratando de impulsar actualmente:
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
El tipo de columna será correcto, pero la opción de clave principal no estará presente con sqlite3 y sospecho que este es el caso también para MySQL.