I have a table which uses O.AutoInc as ID generator, which is a primary key.
Sample Code:
case class User(id:Long)
class UsersTable(tag: Tag) extends Table[User](tag,"USERS"){
def id = column[Long]("ID", O.PrimaryKey, O.AutoInc)
def * = (id) <> (User.tupled, User.unapply)
}
This creates a table with SERIAL field and a sequence with start value 1. Is there a way to change this start value?
Another option is to create sequence like:
Sequence[Long]("USERS_ID_seq") start 200000 inc 1
and use it something like:
def id = column[Long]("ID", O.PrimaryKey, O.DBType("nextval('USERS_ID_seq')"))
I am not sure whether it will work as I cant find a way to make play use this sequence.
So is there a way to tell play evolution to use this sequence?