不要怂,就是干,撸起袖子干!

Commit c7ba9781 by Jan Aagaard Meier

Also move lengths of the form x,y to the end of sqlite data types

1 parent 79551116
...@@ -68,7 +68,7 @@ module.exports = (function() { ...@@ -68,7 +68,7 @@ module.exports = (function() {
if ((endParen = dataType.indexOf(')')) !== -1 && endParen !== (dataType.length - 1)) { if ((endParen = dataType.indexOf(')')) !== -1 && endParen !== (dataType.length - 1)) {
// Move the length to the end of the string, as required by SQLite (needed for things like INTEGER(5) UNSIGNED -> INTEGER UNSIGNED(5)) // Move the length to the end of the string, as required by SQLite (needed for things like INTEGER(5) UNSIGNED -> INTEGER UNSIGNED(5))
var match = dataType.match(/\(\d+\)/) var match = dataType.match(/\(\s*\d+(\s*,\s*\d)?\s*\)/)
if (match) { if (match) {
match = match[0] match = match[0]
......
...@@ -91,8 +91,8 @@ if (dialect === 'sqlite') { ...@@ -91,8 +91,8 @@ if (dialect === 'sqlite') {
expectation: "CREATE TABLE IF NOT EXISTS `myTable` (`title` VARCHAR(255), `name` VARCHAR(255));" expectation: "CREATE TABLE IF NOT EXISTS `myTable` (`title` VARCHAR(255), `name` VARCHAR(255));"
}, },
{ {
arguments: ['myTable', {title: 'VARCHAR(255) BINARY', number: 'INTEGER(5) UNSIGNED'}], arguments: ['myTable', {title: 'VARCHAR(255) BINARY', number: 'INTEGER(5) UNSIGNED', decimal: 'DECIMAL(10, 2) UNSIGNED'}],
expectation: "CREATE TABLE IF NOT EXISTS `myTable` (`title` VARCHAR BINARY(255), `number` INTEGER UNSIGNED(5));" expectation: "CREATE TABLE IF NOT EXISTS `myTable` (`title` VARCHAR BINARY(255), `number` INTEGER UNSIGNED(5), `decimal` DECIMAL UNSIGNED(10, 2));"
}, },
{ {
arguments: ['myTable', {title: 'ENUM("A", "B", "C")', name: 'VARCHAR(255)'}], arguments: ['myTable', {title: 'ENUM("A", "B", "C")', name: 'VARCHAR(255)'}],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!