postgresql - ERROR: type "datetime" does not exist -
i trying migrate hibernate-based app mysql postgres, there seems problem date format
in entity have
@entity @table( name = "app_users" ) public class user { @id @generatedvalue(generator="increment") @genericgenerator(name="increment", strategy = "increment") private int id; private string username; private string email; private string password; private string firstname; private string lastname; private timestamp joindate; ...
but error when creating table
error: type "datetime" not exist
the sql "showsql" is
hibernate: create table app_users (id integer not null, email varchar(255), firstname varchar(255), joindate datetime, lastname varchar(255), password varchar(255), username varchar(255), primary key (id))
i have postgresql-9.5.3-1 installed locally , using hibernate version 5.0.10.final
searching error on google gives me few results.
the top restult of google search "postgresql datetime" have taken postgresql's documentation date , time data types. obvious page framework need generate ddl uses "timestamp" rather "datetime".
when application framework generates wrong data types sql ddl, problem it's configured use wrong database. in case, it's still configured use mysql. reconfigure postgresql.
Comments
Post a Comment