7.4-update.sql 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. SET NAMES utf8;
  2. SET time_zone = '+00:00';
  3. SET foreign_key_checks = 0;
  4. SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
  5. INSERT INTO `{%TABLE_PREFIX%}settings`
  6. (`name`, `value`) VALUES
  7. ('hpfeat_tabbed', '1'),
  8. ('hpfeat_carousel', '1'),
  9. ('hpfeat_box', 'grid'),
  10. ('recent_tabbed', '1'),
  11. ('recent_carousel', '1'),
  12. ('recent_box', 'grid'),
  13. ('ending_tabbed', '1'),
  14. ('ending_carousel', '1'),
  15. ('ending_box', 'grid'),
  16. ('popular_tabbed', '1'),
  17. ('popular_carousel', '1'),
  18. ('popular_box', 'grid');
  19. INSERT INTO `{%TABLE_PREFIX%}settings`
  20. (`name`, `value`) VALUES
  21. ('payment_methods_registration', '');
  22. CREATE TABLE `{%TABLE_PREFIX%}recently_viewed_listings` (
  23. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  24. `listing_id` INT(11) NOT NULL,
  25. `user_id` INT(11) NULL,
  26. `user_token` VARCHAR(255) NOT NULL
  27. COMMENT 'user token (cookie)',
  28. `created_at` DATETIME NOT NULL,
  29. `updated_at` DATETIME NULL,
  30. FOREIGN KEY (`listing_id`) REFERENCES `{%TABLE_PREFIX%}listings` (`id`)
  31. ON DELETE CASCADE,
  32. FOREIGN KEY (`user_id`) REFERENCES `{%TABLE_PREFIX%}users` (`id`)
  33. ON DELETE CASCADE
  34. )
  35. ENGINE ='InnoDB'
  36. COLLATE 'utf8_general_ci';
  37. ALTER TABLE `{%TABLE_PREFIX%}recently_viewed_listings`
  38. ADD INDEX `user_token` (`user_token`);
  39. INSERT INTO `{%TABLE_PREFIX%}settings`
  40. (`name`, `value`) VALUES
  41. ('enable_recently_viewed_listings', ''),
  42. ('enable_recently_viewed_listings_expiration', '');
  43. INSERT INTO `{%TABLE_PREFIX%}settings`
  44. (`name`, `value`) VALUES
  45. ('enable_bulk_lister', '');
  46. ALTER TABLE `{%TABLE_PREFIX%}listings_watch`
  47. ADD `user_token` varchar(255) NOT NULL AFTER `listing_id`;
  48. ALTER TABLE `{%TABLE_PREFIX%}listings_watch`
  49. ADD INDEX `user_token` (`user_token`);
  50. ALTER TABLE `{%TABLE_PREFIX%}listings_watch`
  51. CHANGE `user_id` `user_id` int(11) NULL AFTER `id`;