database-command
database-command copied to clipboard
Yii command to create database migrations from existing schema
fix Foreign Keys, index's using mysql query TODO check other DB Types just find for mysql users ! Thanks to Younos Ali Al-Shamy https://www.facebook.com/Younos.alshamy
continued from https://github.com/schmunk42/database-command/issues/17#issuecomment-70306189 Running command without any parameters (i.e. yiic edatabase) does display help, but also throws Error: Unknown action: index error. You may want to mute that somehow.
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.
during dump
dumping with --prefix=news also dumps "newsCategory" or "newsSomething" would be great to get those other tables dumped only when using a wildcard --prefix=news >>> dumps "news" --prefix=news\* >>> dumps "news",...
When the primary key is composed of two columns, the command generation is also incorrect: ``` CREATE TABLE IF NOT EXISTS `alert_listener` ( `alert_listener_id` int(11) NOT NULL AUTO_INCREMENT, `listener` varchar(250)...
The problem always occurs when importing table with a foreign key : Syntax error or access violation: 1068 Multiple primary key defined. regards, bw
A small suggestion for the generator: I prefer to get the table name form the Model, like this: ``` $this->createTable(ActionHistory::model()->tableName() ``` from http://www.yiiframework.com/extension/database-command/#c11253