|
@@ 226-237 (lines=12) @@
|
| 223 |
|
* @param array $tables List of tables to create migrations for |
| 224 |
|
* @return void |
| 225 |
|
*/ |
| 226 |
|
protected function generateTablesAndIndices( array $tables ) |
| 227 |
|
{ |
| 228 |
|
$this->method = 'create'; |
| 229 |
|
|
| 230 |
|
foreach ( $tables as $table ) { |
| 231 |
|
$this->table = $table; |
| 232 |
|
$this->migrationName = 'create_'. $this->table .'_table'; |
| 233 |
|
$this->fields = $this->schemaGenerator->getFields( $this->table ); |
| 234 |
|
|
| 235 |
|
$this->generate(); |
| 236 |
|
} |
| 237 |
|
} |
| 238 |
|
|
| 239 |
|
/** |
| 240 |
|
* Generate foreign key migrations. |
|
@@ 245-256 (lines=12) @@
|
| 242 |
|
* @param array $tables List of tables to create migrations for |
| 243 |
|
* @return void |
| 244 |
|
*/ |
| 245 |
|
protected function generateForeignKeys( array $tables ) |
| 246 |
|
{ |
| 247 |
|
$this->method = 'table'; |
| 248 |
|
|
| 249 |
|
foreach ( $tables as $table ) { |
| 250 |
|
$this->table = $table; |
| 251 |
|
$this->migrationName = 'add_foreign_keys_to_'. $this->table .'_table'; |
| 252 |
|
$this->fields = $this->schemaGenerator->getForeignKeyConstraints( $this->table ); |
| 253 |
|
|
| 254 |
|
$this->generate(); |
| 255 |
|
} |
| 256 |
|
} |
| 257 |
|
|
| 258 |
|
/** |
| 259 |
|
* Generate Migration for the current table. |