tminglei / slick-pg

Slick extensions for PostgreSQL
BSD 2-Clause "Simplified" License
837 stars 180 forks source link

Postgresql, Code generation and default Tmestamp value "current_date" #259

Open Parabellum1905y opened 8 years ago

Parabellum1905y commented 8 years ago

Hello. I have some table created with this code: CREATE SEQUENCE test_id_seq; CREATE TABLE TEST ( id bigint default nextval('test_id_seq'), userId bigint NOT NULL, createDate timestamp NOT NULL default current_date, Primary Key (id),

Foreign Key (userId) references USERS (UserID)

);

during code generation the error raised :

[DEBUG] SlickException: Could not parse default value Some(('now'::text)::date) for column test.createdate of type java.sql.Timestamp, meta data: MColumn(MQName(public.test),createdate,93,timestamp,Some(29),Some(6),10,Some(false),None,Some(('now'::text)::date),29,6,Some(false),None,None,Some(false)) Can i override parsing default value for dates and timestamps?

tminglei commented 8 years ago

@Parabellum1905y sorry for the delay! current_date default should be treated as no default, we can refer to slick/slick#1472.