schema-builder icon indicating copy to clipboard operation
schema-builder copied to clipboard

Foreign keys migration name

Open noud opened this issue 4 years ago • 1 comments

i use multiple packages with generated migrations.

Then the foreign key migrations are not unique, so error.

This creates the foreign keys migrations as a unique filename and class.

(there are numerous commits but the end result is just 2 files changed)

noud avatar Mar 21 '21 18:03 noud

good point.

Noud On Mon, 2021-05-31 at 06:30 -0700, Iftekhar Rifat wrote:

@Agontuk commented on this pull request.

In src/Migrations/MigrationCreator.php:

 {
     // Update time interval each time so that migration
     // files are created with different timestamp.
     $this->setTimeInterval($this->getTimeInterval() + 60);
  •    $path = $this->getDatePrefix() . '_create_foreign_keys_table.php';
    
  •    $schemaPart = $classPart = '';
    
  •    if ($schemaName) {
    
  •        $schemaPart = '_for_' . str_replace(' ', '_', $schemaName);
    

Maybe we need to convert $schemaName to lowercase here in case anyone provides uppercase name. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

noud avatar May 31 '21 14:05 noud