database-command icon indicating copy to clipboard operation
database-command copied to clipboard

Add index generation and change PK generation

Open sarunast opened this issue 11 years ago • 5 comments

Dumping table with MySQL gave my duplicate Primary Keys so I changed the generation. Also there was no Index generation so I managed to create function which can do that.

sarunast avatar Jul 11 '13 15:07 sarunast

THanks! I noticed it but handled it on the generated script by hand

luislobo avatar Jul 11 '13 22:07 luislobo

Is there anything which would break backward compatibility or SQLite support? I left a comment at the code line.

schmunk42 avatar Jul 12 '13 16:07 schmunk42

Got an error when dumping a table without PK, eg. AuthAssignment

*** applying m130715_184724_dump

    > create table AuthAssignment ...Exception: CDbCommand failed to execute the SQL statement: CDbCommand failed to prepare the SQL statement: SQLSTATE[HY000]: General error: 1 near ")": syntax error. The SQL statement executed was: CREATE TABLE 'AuthAssignment' (
    "itemname" varchar(64) NOT NULL,
    "userid" varchar(64) NOT NULL,
    "bizrule" text,
    "data" text,
    PRIMARY KEY ()
)  

Shouldn't output the last line I think.

schmunk42 avatar Jul 15 '13 16:07 schmunk42

schmunk42 feel free to update however you want it, I don't mind. Here is the rep https://github.com/Stamy/database-command. It does completely everything for MySQL, Full FK generation, multiple-keys.

sarunast avatar Jul 15 '13 17:07 sarunast

I'll have a detailed look, when I find more time. Thanks.

schmunk42 avatar Jul 25 '13 19:07 schmunk42