techouse / sqlite3-to-mysql

Transfer data from SQLite to MySQL

Home Page:https://techouse.github.io/sqlite3-to-mysql/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PRAGMAS automatic_index seems to be ignored

ytokan opened this issue · comments

Describe the bug
I try to transform sqlite database generate by the headless cms strapi.io to a mysql database.

But no mysql id field has auto_increment.

The field in sqllite does have a PRAGMA Automatic_index

Expected behaviour
sqlite3-to-mysql do not add the AUTO_INCREMENT option.

ALTER TABLE `contents`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `contents_slug_unique` (`slug`);

ALTER TABLE `contents`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
COMMIT;

Actual result

ALTER TABLE `contents`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `contents_slug_unique` (`slug`);

System Information

$ sqlite3mysql --version
sqlite3mysql --version
| software               | version                                                                     |
|------------------------|-----------------------------------------------------------------------------|
| sqlite3-to-mysql       | 1.4.1                                                                       |
|                        |                                                                             |
| Operating System       | Linux 5.4.0-74-generic                                                      |
| Python                 | CPython 3.8.5                                                               |
| MySQL                  | mysql  Ver 14.14 Distrib 5.7.34, for Linux (x86_64) using  EditLine wrapper |
| SQLite                 | 3.31.1                                                                      |
|                        |                                                                             |
| click                  | 7.0                                                                         |
| mysql-connector-python | 8.0.25                                                                      |
| pytimeparse            | 1.1.8                                                                       |
| simplejson             | 3.16.0                                                                      |
| six                    | 1.14.0                                                                      |
| tabulate               | 0.8.9                                                                       |
| tqdm                   | 4.61.1                                                                      |

Same issue as #23

Fixed in fb3690a