Open ProPuke opened 6 years ago
record-macros is often used with dbadmin. Dbadmin allows to add indexes from the web interface
How does that relate to this pull request?
you said "this was disabled before for some reason", the explaination could be that the initial developer and its team (Nicolas Cannasse and Motion Twin) used it always with dbadmin. This allowed to create tables first and add indexes later through dbadmin.
Ahh, no - It was only disabled in the case of SQLite. TableCreate had likely not been tested fully with SQLite so it was disabled there.
This fails the MySQL unit tests:
CREATE TABLE MySpodClass (theId INTEGER AUTO_INCREMENT NOT NULL,`int` INTEGER NOT NULL,`double` DOUBLE NOT NULL,boolean TINYINT(1) NOT NULL,string VARCHAR(255) NOT NULL,date DATETIME NOT NULL,`binary` MEDIUMBLOB NOT NULL,abstractType MEDIUMTEXT NOT NULL,nullInt INTEGER,enumFlags INTEGER NOT NULL,data MEDIUMBLOB NOT NULL,anEnum TINYINT UNSIGNED NOT NULL,bytes BINARY(2) NOT NULL,rid INTEGER NOT NULL,rnid INTEGER,spid INTEGER)
Incorrect table definition; there can be only one auto column and it must be defined as a key
Possibly related to the absence of an index on that table and the change to:
if( !hasID )
decls.push("PRIMARY KEY ("+Lambda.map(infos.key,quote).join(",")+")");
This PR is a very useful one. I recommand we make the above suggested change, and if it passes the tests pull the commits :)
TableCreate
now also generates indexes when creating tables, and primary keys are added in SQLite (this was disabled before for some reason)