As said by @a_horse_with_no_name, a serial Column is using a sequence. In Slick you simply need to define your column with AutoInc, in your case:
def id = column[Int]("id", O.AutoInc, O.PrimaryKey)
On the PostgreSQL side when defining a Serial column you simply get back an Int column with Default Value: nextval('user_id_seq'::regclass), which is the sequence used to increment the value.
There's no need to manually create a sequence in your schema code:
class User(id: Int, first: String, last: String)
class Users(tag: Tag) extends Table[Int](tag, "users") {
def id = column[Int]("id", O.AutoInc, O.PrimaryKey)
def * = id
}
val users = TableQuery[Users]
Edit after comment:
I ran your sql statement adding the table alter for the sequence:
create table users (
id bigint not null
);
create sequence users_seq;
alter table users alter column id set default nextval('users_seq');
On my database now I have a table with a column id of type Int and as default value the sequence: nextval('users_seq'::regclass). This is the same thing I wrote before, you have a table with a sequence that is applied to the id column, the slick code doesn't change too, you can try running this on a local database.
Note that your sql statement is wrong, you do create a sequence but it's not assigned to any column, you either have to use the alter or directly add a column with the sequence as shown here. Hope this was clearer.
P.s. One thing I'm not completely sure about is that BigInt Postgres fields are mapped to Scala Long, but probably with the sequence it doesn't matter, not sure though, for consistency I always map them to Long.
serialcolumn is using a sequence. So I'm not sure what you are asking.