Closed leleobhz closed 8 years ago
Would you, kindly, paste mysql schema to some pastie and send it to me.
hi max, just started trying mysql2postgresql for a project here and ran into the same problem. The SQL generated for string enums is not quite right:
"paymentmethod" character varying(6), check( paymentmethod in ('cc','echeck')) DEFAULT cc NOT NULL,
should be more like:
"paymentmethod" character varying(6) check( paymentmethod in ('cc','echeck')) DEFAULT 'cc' NOT NULL,
i.e. no comma before check constraint, and default value quoted. Seeing if I can fork and fix this; will send you a pull request if so
I think this should be fixed as of http://github.com/maxlapshin/mysql2postgres/commit/973b1f11e317a3342c6d2c9230f642f8d1a25923
Closing as an old issue, that would seem to be out of date.
Feel free to re-open and update with comments aganst the master
branch.
Creating table moodleenrol_authorize... Error: CREATE TABLE "moodleenrol_authorize" ( "id" integer DEFAULT nextval('moodleenrol_authorize_id_seq'::regclass) NOT NULL, "paymentmethod" character varying(6), check( paymentmethod in ('cc','echeck')) DEFAULT cc NOT NULL, "refundinfo" integer DEFAULT 0 NOT NULL, "ccname" character varying(255) NOT NULL, "courseid" bigint DEFAULT 0 NOT NULL, "userid" bigint DEFAULT 0 NOT NULL, "transid" bigint DEFAULT 0 NOT NULL, "status" bigint DEFAULT 0 NOT NULL, "timecreated" bigint DEFAULT 0 NOT NULL, "settletime" bigint DEFAULT 0 NOT NULL, "amount" character varying(10) NOT NULL, "currency" character(3) DEFAULT 'USD'::char NOT NULL ) WITHOUT OIDS; ./mysql2psql:466:in
exec': ERRO: erro de sintaxe em ou próximo a "DEFAULT" (PGError) LINE 3: ...ying(6), check( paymentmethod in ('cc','echeck')) DEFAULT cc... ^ from ./mysql2psql:466:in
write_table' from ./mysql2psql:617:inconvert' from ./mysql2psql:616:in
each' from ./mysql2psql:616:in `convert' from ./mysql2psql:682And the process die.