Closed NetzaWhoop closed 2 years ago
I solved it using this line, replacing from the documentation:
CAST type date when default "0000-00-00" to date drop default
using zero-dates-to-null
Ignored the zero dates to null cause I didn't have null values, and it resulted in a line like this:
CAST type date when default "curdate()" to date drop default
And after checking in depth the Default MySQL Casting Rules in the documentation for version v3.6.2: https://pgloader.readthedocs.io/en/v3.6.2/ref/mysql.html
Still checking if migration was correctly executed, but I think specifically the "curdate()" type migration isn't that intuitive, it could be better explained, but pgloader works great though.
Tried to migrate MariaDB (from docker container) to postgresql (another container), both in a compose file. The problem is with tables that have the types curdate() or CURRENT_TIMESTAMP in MariaDB. I installed pgloader with the command apt-get install. Everything seems fine in both databases, only that step. Here the structuree of my compose file:
I get the following error when running my .load file:
I can exclude the tables and the migration works fine, but I'd like to do a cast to migrate the entire database, so I can do that in other databases I have to migrate.
Found a lot about the year zero in MySQL, but nothing on casting curdate().
Maybe I'm missing something very simple, hope you can help me. Thanks!