mysql2sqlite icon indicating copy to clipboard operation
mysql2sqlite copied to clipboard

Zerofill not compatible with sqlite?

Open JayBizzle opened this issue 6 years ago • 0 comments

Firstly, thanks for this great script 👍

We have a database that after running the mysqldump output through this script, we are left with a part of the SQL dump that looks like this...

CREATE TABLE `news` (
  `id` integer  zerofill NOT NULL PRIMARY KEY AUTOINCREMENT
,  `title` text
,  `content` text
,  `created_at` timestamp NULL DEFAULT NULL
,  `updated_at` timestamp NULL DEFAULT NULL
);

When importing this into sqlite it throws the following error...

Error: near line 367: AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY

If I place gsub( /ZEROFILL|zerofill/, "" ) into around line 192 of the mysql2lite script, this fixes the issue.

Im not too clued up on any other ways to fix this, but it works fine for what we need.

Any thoughts on this?

JayBizzle avatar Feb 20 '19 22:02 JayBizzle