ww9 / mysql2sqlite

Online MySQL to SQLite converter 🔨 https://ww9.github.io/mysql2sqlite/
The Unlicense
91 stars 15 forks source link

FULLTEXT KEY convert error #9

Open sir1st opened 10 hours ago

sir1st commented 10 hours ago

mysql ddl CREATE TABLE muse_model_sync_record ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', gmt_create datetime NOT NULL COMMENT '创建时间', gmt_modified datetime NOT NULL COMMENT '修改时间', source_url varchar(512) NOT NULL, PRIMARY KEY (id), KEY idx_gmt_create (gmt_create), KEY idx_gmt_modified (gmt_modified), FULLTEXT KEY idx_source_url (source_url) ) ENGINE=InnoDB AUTO_INCREMENT=158 DEFAULT CHARSET=utf8 ; return error sqlite ddl -- import to SQLite by running: sqlite3.exe db.sqlite3 -init sqlite.sql

PRAGMA journal_mode = MEMORY; PRAGMA synchronous = OFF; PRAGMA foreign_keys = OFF; PRAGMA ignore_check_constraints = OFF; PRAGMA auto_vacuum = NONE; PRAGMA secure_delete = OFF; BEGIN TRANSACTION;

CREATE TABLE muse_model_sync_record ( id bigINTEGER NOT NULL , gmt_create datetime NOT NULL , gmt_modified datetime NOT NULL , source_url TEXT NOT NULL, PRIMARY KEY (id), FULLTEXT KEY idx_source_url (source_url) ); ;

CREATE INDEX muse_model_sync_record_idx_gmt_create ON muse_model_sync_record (gmt_create); CREATE INDEX muse_model_sync_record_idx_gmt_modified ON muse_model_sync_record (gmt_modified);

COMMIT; PRAGMA ignore_check_constraints = ON; PRAGMA foreign_keys = ON; PRAGMA journal_mode = WAL; PRAGMA synchronous = NORMAL;

sir1st commented 10 hours ago

currently, i change the match pattern to this, and it solved my problem line = line.replace(/^(?!FOREIGN)(?!PRIMARY)(?!UNIQUE)\w+\s+KEY/gi, 'KEY');