-
-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing AUTO_INCREMENT to SERIAL conversion from MySQL 8 to Postgres 13 #1248
Comments
I have same issue i am migrating thousands of tables and some (not all) auto increments are not serials in postgresql examples: CREATE TABLE `users` (
`uid` int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=123510 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; creates no serials: CREATE TABLE users (
uid int4 NOT NULL,
CONSTRAINT idx_76096_primary PRIMARY KEY (uid)
); but CREATE TABLE `node` (
`nid` int unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`nid`)
) ENGINE=InnoDB AUTO_INCREMENT=40190 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; will generate good with serial CREATE TABLE node (
nid bigserial NOT NULL,
CONSTRAINT idx_73509_primary PRIMARY KEY (nid)
); so maybe missing unsigned is breaking it? |
I found a problém: CAST
type int when signed with extra auto_increment to serial drop typemod |
I did not.
Yes. Couldn't find anything.
This is the minimal
mysqldump
:On MySQL 8.0 (docker image to be precise
mysql:8.0
).I'm trying to move the data to a Postgres 13 database (docker image
postgres:13.1
).The command I've used is:
I would expect the
id
primary key to become aSERIAL
but pgloader just converts it to anINTEGER
with noSEQUENCE
attached.According to the documented casting rules it seems it should be converted to a
SERIAL
int
.I'm going to manually fix this post migration in my case.
Just wanted to give you a heads up.
Thanks again for this wonderful tool.
The text was updated successfully, but these errors were encountered: