modify the name of the :id to :another_id in rails 3 -
well googled question couldn't find or it's not correct question..
the issue need modify primary_key name of database :id :another_id, in project need use pgrouting , contains several plsql functions , these functions uses primary-key name gid , instead of modify plsql functions better change id name, , thinking migration becouse thought it's rails way.
is possible, , how can ??
thanks in advance , sorry english.
edit
create_table :pruebas, primary_key: :gid |t| t.string :name t.timestamps end this trick, , active record generate , uses pk gid.
sorry if question not clear.. gracias por las respuestas.
to set primary key yourself, when create table, do:
create_table(:table_name, primary_key: 'gid') |t| ... end and need define primary key name in model:
self.primary_key = 'gid'
Comments
Post a Comment