In my java Users class, I have the following code and I want the id column to be auto incremental. I am using postgresql 9.1
@Entity
public class Users extends Model {
@Id
@SequenceGenerator(name = "Token_generator", sequenceName = "id_seq")
@GeneratedValue(generator = "Token_generator")
public long id;
public String firstName;
public String lastName;
public String password;
public String email;
.....
}
But the evolution script does not seem to be able to generate the SERIAL column. The content of the 1.sql is something as the follows. The id field does not appear to be auto incremental. Any ideas?
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table users (
id bigint not null,
first_name varchar(255),
last_name varchar(255),
password varchar(255),
email varchar(255),
constraint pk_users primary key (id))
;
create sequence users_seq;
# --- !Downs
drop table if exists users cascade;
drop sequence if exists users_seq;