Commit 7d2c9d13 authored by Charles Drew's avatar Charles Drew

Modified sql install script - email/event constraint was not working because...

Modified sql install script - email/event constraint was not working because the foreign key was signed and the referenced key was unsigned. Foreign key is now unsigned.
parent 886059db
......@@ -5,7 +5,12 @@ $installer = $this;
$installer->startSetup();
$installer->run("
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS {$this->getTable('freelunchlabs_mailgun/email')};
DROP TABLE IF EXISTS {$this->getTable('freelunchlabs_mailgun/event')};
SET FOREIGN_KEY_CHECKS = 1;
-- DROP TABLE IF EXISTS {$this->getTable('freelunchlabs_mailgun/email')};
CREATE TABLE {$this->getTable('freelunchlabs_mailgun/email')} (
`id` int(11) unsigned NOT NULL auto_increment,
......@@ -21,11 +26,11 @@ CREATE TABLE {$this->getTable('freelunchlabs_mailgun/email')} (
-- DROP TABLE IF EXISTS {$this->getTable('freelunchlabs_mailgun/event')};
CREATE TABLE {$this->getTable('freelunchlabs_mailgun/event')} (
`id` int(11) unsigned NOT NULL auto_increment,
`email_id` int(11) NULL,
`email_id` int(11) unsigned NULL,
`event_type` varchar(255) NOT NULL default '',
`timestamp` varchar(255)
`timestamp` varchar(255),
PRIMARY KEY (`id`),
CONSTRAINT `fk_event_tracking` FOREIGN KEY (`email_id`) REFERENCES `{$this->getTable('freelunchlabs_mailgun/email')}` (`id`) ON DELETE CASCADE
CONSTRAINT `fk_mailgun_event` FOREIGN KEY (`email_id`) REFERENCES `{$this->getTable('freelunchlabs_mailgun/email')}` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment