darold / ora2pg

Ora2Pg is a free tool used to migrate an Oracle database to a PostgreSQL compatible schema. It connects your Oracle database, scan it automatically and extracts its structure or data, it then generates SQL scripts that you can load into PostgreSQL.
http://www.ora2pg.com/
GNU General Public License v3.0
1.01k stars 342 forks source link

For MySQL, "datetime" columns with default value don't export properly #1525

Closed shubham-yb closed 1 year ago

shubham-yb commented 1 year ago

Hi Team,

If we have a schema in MYSQL which has a default value defined for a datetime column, it does not get exported properly and thus we face syntax errors while importing.

Consider this schema:

create table m (date_status_changed datetime DEFAULT (curtime()));

This gets exported as:

CREATE TABLE m (
    date_status_changed timestamp without time zone DEFAULT CURRENT_TIMESTAMP::(0)::timestamp without time zone(0)
) ;

Which is syntactically incorrect and we get the error.

Thank You for your help!

darold commented 1 year ago

Commit 23e01d5 fixes this issue.