Ticket #1362 (closed defect: fixed)

Opened 11 months ago

Last modified 10 months ago

Bug in migration builder's foreign key name generation

Reported by: wolfpakz Owned by: jwage
Priority: minor Milestone:
Component: Migrations Version: 1.0.0
Severity: Keywords:
Cc: Has Test: no
Status: Pending Core Response Has Patch: yes

Description

Today I ran the migration generator on a table using the Versionable template. It generated a bad name for the foreign key because the builder doesn't handle the local key identifier as an array. The result is foreign key names containing "Array", like this:

$this->createForeignKey('paragraph_versions', array(
  'local' => array(0 => 'id'),
  'foreign' => array(0 => 'id'),
  'foreignTable' => 'paragraphs',
  'onUpdate' => 'CASCADE',
  'onDelete' => 'CASCADE',
  'name' => 'paragraph_versions_Array'
));

I've attached a patch which addresses the issue.

Attachments

migration_builder_patch.txt (0.6 KB) - added by wolfpakz 11 months ago.

Change History

Changed 11 months ago by wolfpakz

Changed 11 months ago by guilhermeblanco

  • status changed from new to closed
  • resolution set to fixed

(In [4787]) fixes #1362. Thanks for the report and patch!

Changed 10 months ago by anonymous

  • milestone New deleted

Milestone New deleted

Note: See TracTickets for help on using tickets.