Autoincrementing Primary keys with Postgres; configure sequence name?
nrmitchi opened this issue · comments
Is there a configurable way to set the sequence name of an autoincrementing key?
Similar to the discussion at http://stackoverflow.com/questions/12794427/squeryl-and-postgresqls-autoincrement, is there any way built into scala-activerecord to configure this?
I do it like this:
object Tables extends ActiveRecordTables with PlaySupport {
val agentLogs = table[AgentLog]
on(agentLogs)(attributes => declare(attributes.id is (autoIncremented("agent_logs_id_seq"))))
}
Okay, that seemed to work. Thanks alot @vnicolici!
I still believe that using the Postgres defaults should be exposed through a configuration option (as opposed to using this manual approach for all tables); any thoughts on this?
I think it should follow PostgreSQL naming convention by default.
It will be applied in version 0.3.0 because it's a breaking change.