]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-coupon.php
File renamed to naming convention, ext-repair continued:
[mailer.git] / inc / extensions / ext-coupon.php
index a84c4b20ebe8884d5050df3388d07058456e387d..7b532b083011331531ba128adda8a6bcb4de9a03 100644 (file)
@@ -77,7 +77,7 @@ PRIMARY KEY (`id`)",
 `coupon_code` VARCHAR(30) NULL DEFAULT NULL,
 `cashed_on` TIMESTAMP NULL DEFAULT NULL,
 PRIMARY KEY (`id`),
-UNIQUE KEY `coupon_user` (`coupon_id`,`userid`),
+UNIQUE KEY `coupon_user` (`coupon_id`, `userid`),
 UNIQUE KEY (`coupon_code`)",
                        'Coupon->user connection');
 
@@ -138,7 +138,15 @@ UNIQUE KEY (`coupon_code`)",
                                addExtensionDependency('order');
 
                                // Insert data in new table
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`ext_name`,`column_name`,`locked_mode`,`payment_method`) VALUES('coupon','order_points','LOCKED','DIRECT')");
+                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`subject`, `column_name`, `locked_mode`, `payment_method`) VALUES ('coupon_cashed','order_points','LOCKED','DIRECT')");
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes('');
+                               break;
+
+                       case '0.0.1': // SQL queries for v0.0.1
+                               // Update data in points_data table
+                               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_points_data` SET `subject`='coupon_cashed' WHERE `subject`='coupon' LIMIT 1");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes('');