I developed a ROR application using MySQL and now want it to use Postgres instead.
I’ve used Navicat to data transfer the MySQL database to Postgres, and updated the database.yml with the Postgres environment settings.
When I run the ROR application, and try and login or create a user, I get the following error:
RuntimeError: ERROR C23502 Mnull value in column “id” violates not-null constraint FexecMain.c L2229 RExecConstraints: INSERT INTO “users
Thank you
Sounds like you had an AUTO_INCREMENT
idcolumn in your MySQL database. This is a non-ANSI-standard feature, so it won’t necessarily work on other databases.To do the same on Postgres you could use a SERIAL column type (or an equivalent explicit SEQUENCE).