diff options
Diffstat (limited to 'install/index.php')
-rw-r--r-- | install/index.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/install/index.php b/install/index.php index 1bb4bdd..990c6eb 100644 --- a/install/index.php +++ b/install/index.php @@ -102,13 +102,14 @@ if (isset($_GET['create_tables'])) { KEY `invoice_fileId_2` (`invoice_fileId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1"); - $_pdo->query("CREATE TABLE IF NOT EXISTS `payment` ( + $_pdo->query("CREATE TABLE IF NOT EXISTS `".Constants::db_prefix."payment` ( `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `offerId` smallint(5) unsigned NOT NULL, `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `braintree_id` varchar(36) DEFAULT NULL, `braintree_status` varchar(63) DEFAULT NULL, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + UNIQUE KEY `offerId` (`offerId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;"); $_pdo->query("CREATE TABLE IF NOT EXISTS `".Constants::db_prefix."user` ( @@ -135,9 +136,8 @@ if (isset($_GET['create_tables'])) { ADD CONSTRAINT `offer_ibfk_1` FOREIGN KEY (`invoice_fileId`) REFERENCES `".Constants::db_prefix."file` (`id`), ADD CONSTRAINT `offer_ibfk_2` FOREIGN KEY (`contactId`) REFERENCES `".Constants::db_prefix."contact` (`id`)"); - $_pdo->query("CREATE UNIQUE INDEX `payment_uniq_1` ON `".Constants::db_prefix."payment` (`offerId`);"); - $_pdo->query("ALTER TABLE `payment` - ADD CONSTRAINT `payment_ibfk_1` FOREIGN KEY (`offerId`) REFERENCES `offer` (`id`);"); + $_pdo->query("ALTER TABLE `".Constants::db_prefix."payment` + ADD CONSTRAINT `payment_ibfk_1` FOREIGN KEY (`offerId`) REFERENCES `".Constants::db_prefix."offer` (`id`);"); echo "Succeeded creating the database tables."; |