Index: trunk/phase3/maintenance/tests/DatabaseSqliteTest.php |
— | — | @@ -49,7 +49,11 @@ |
50 | 50 | $this->replaceVars( "CREATE TABLE text ( text_foo tinytext );" ), |
51 | 51 | 'Table name changed' |
52 | 52 | ); |
53 | | - |
| 53 | + |
| 54 | + $this->assertEquals( "CREATE TABLE enums( enum1 TEXT, myenum TEXT)", |
| 55 | + $this->replaceVars( "CREATE TABLE enums( enum1 ENUM('A', 'B'), myenum ENUM ('X', 'Y'))" ) |
| 56 | + ); |
| 57 | + |
54 | 58 | $this->assertEquals( "ALTER TABLE foo ADD COLUMN foo_bar INTEGER DEFAULT 42", |
55 | 59 | $this->replaceVars( "ALTER TABLE foo\nADD COLUMN foo_bar int(10) unsigned DEFAULT 42" ) |
56 | 60 | ); |
Index: trunk/phase3/includes/db/DatabaseSqlite.php |
— | — | @@ -562,7 +562,7 @@ |
563 | 563 | // DATETIME -> TEXT |
564 | 564 | $s = preg_replace( '/\b(datetime|timestamp)\b/i', 'TEXT', $s ); |
565 | 565 | // No ENUM type |
566 | | - $s = preg_replace( '/enum\([^)]*\)/i', 'BLOB', $s ); |
| 566 | + $s = preg_replace( '/\benum\s*\([^)]*\)/i', 'TEXT', $s ); |
567 | 567 | // binary collation type -> nothing |
568 | 568 | $s = preg_replace( '/\bbinary\b/i', '', $s ); |
569 | 569 | // auto_increment -> autoincrement |