Extend MySQL Workbench to handle PostgreSQL sequences
Posted by: Claude Zervas
Date: August 09, 2018 10:19AM

Background:

Using MySQL Workbench 6.3 Migration Wizard for a PostgreSQL 9.6 to MySQL 5.6 migration:

Psql DDL:

CREATE SEQUENCE public."AO_seq";

ALTER SEQUENCE public."AO_seq"
OWNER TO dbuser;

CREATE TABLE public."AO"
(
"ID" integer NOT NULL DEFAULT nextval('"AO_seq"'::regclass)
CONSTRAINT "AO_pkey" PRIMARY KEY ("ID")
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;

Problem:
MySQL Workbench migration wizard issued thousands of warnings like the following: "Warning Default value nextval('"AO_seq"' is not supported. Removed!" The wizard produced script has the following DDL

CREATE TABLE IF NOT EXISTS 'jdb'.'AO' (
'ID' INT NOT NULL,
PRIMARY KEY ('ID')
)


Question: Is there a better solution than the following:

Extend the migration tool per "Appendix C Extending Workbench" section in the reference manual for mySQL Workbench.

Superficially modify the following script: mysql-workbench-community-8.0.12-src\modules\db.postgresql to produce DDL like the following:
CREATE TABLE 'AO' (
'ID' bigint(20) NOT NULL AUTO_INCREMENT,
PRIMARY KEY ('ID')
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

Options: ReplyQuote


Subject
Written By
Posted
Extend MySQL Workbench to handle PostgreSQL sequences
August 09, 2018 10:19AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.