v52.sql 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. CREATE TABLE `attribute_category` (
  2. `id` int(11) NOT NULL,
  3. `category_id` int(11) NOT NULL,
  4. `attribute_id` int(11) NOT NULL,
  5. `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  6. `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
  7. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  8. ALTER TABLE `attribute_category`
  9. ADD PRIMARY KEY (`id`);
  10. ALTER TABLE `attribute_category`
  11. MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  12. COMMIT;
  13. ALTER TABLE `coupons` ADD `user_id` INT NOT NULL AFTER `id`;
  14. ALTER TABLE `carts` CHANGE `coupon_code` `coupon_code` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;
  15. ALTER TABLE `carts` CHANGE `price` `price` DOUBLE(20,2) NULL DEFAULT '0.00';
  16. ALTER TABLE `carts` CHANGE `tax` `tax` DOUBLE(20,2) NULL DEFAULT '0.00';
  17. ALTER TABLE `carts` CHANGE `shipping_cost` `shipping_cost` DOUBLE(20,2) NULL DEFAULT '0.00';
  18. CREATE TABLE `combined_orders` (
  19. `id` int(11) NOT NULL,
  20. `user_id` int(11) NOT NULL,
  21. `shipping_address` text COLLATE utf8_unicode_ci,
  22. `grand_total` double(20,2) NOT NULL DEFAULT '0.00',
  23. `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  24. `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
  25. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  26. ALTER TABLE `combined_orders`
  27. ADD PRIMARY KEY (`id`);
  28. ALTER TABLE `combined_orders`
  29. MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  30. COMMIT;
  31. ALTER TABLE `orders` ADD `combined_order_id` INT NULL DEFAULT NULL AFTER `id`;
  32. UPDATE `business_settings` SET `value` = '5.2' WHERE `business_settings`.`type` = 'current_version';
  33. COMMIT;