From: Oleg Broytman Date: Sat, 4 Nov 2017 17:30:59 +0000 (+0300) Subject: Feat(demo): Add CREATE TABLE X-Git-Tag: 0.2.3~35 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=93c260c6aa3ef8211663e8f98a2adcdb2107c7a2;p=sqlconvert.git Feat(demo): Add CREATE TABLE --- diff --git a/demo/demo.sql b/demo/demo.sql index a3155d5..7153538 100644 --- a/demo/demo.sql +++ b/demo/demo.sql @@ -1,7 +1,15 @@ -SELECT * FROM `mytable`; -- line-comment" +CREATE TABLE `mytable` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `flag` tinyint(4) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `date` (`date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT into /* inline comment */ mytable VALUES (1, 'тест'); +SELECT * FROM `mytable`; -- line-comment" + /*! directive*/; INSERT INTO `MyTable` (`Id`, `Name`) diff --git a/tests/mysql2sql/test.out b/tests/mysql2sql/test.out index 60d3271..0026e62 100644 --- a/tests/mysql2sql/test.out +++ b/tests/mysql2sql/test.out @@ -1,7 +1,15 @@ -SELECT * FROM mytable; -- line-comment" +CREATE TABLE mytable ( + id int(10) unsigned NOT NULL AUTO_INCREMENT, + date datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + flag tinyint(4) NOT NULL DEFAULT '0', + PRIMARY KEY (id), + UNIQUE KEY date (date) +) ENGINE="InnoDB" DEFAULT CHARSET=utf8; INSERT INTO /* inline comment */ mytable VALUES (1, 'тест'); +SELECT * FROM mytable; -- line-comment" + INSERT INTO "MyTable" ("Id", "Name") VALUES (1, 'one');