From a59931c98a1585cf5e1939b5d735ba001366d8ad Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Wed, 23 Apr 2025 04:24:13 +0200 Subject: [PATCH] Fix: removed old install scripts --- .../sql/admin_setup/mysql4-install-0.7.0.php | 82 - .../mysql4-upgrade-0.7.0-0.7.1.php | 23 - .../mysql4-upgrade-0.7.1-0.7.2.php | 34 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 315 - .../mysql4-install-1.0.0.php | 38 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 123 - .../sql/api_setup/mysql4-install-0.7.0.php | 79 - .../api_setup/mysql4-upgrade-0.7.0-0.7.1.php | 23 - .../api_setup/mysql4-upgrade-0.8.0-0.8.1.php | 39 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 362 - .../mysql4-data-upgrade-0.1.13-0.1.14.php | 71 - .../sql/bundle_setup/mysql4-install-0.1.0.php | 158 - .../mysql4-upgrade-0.1.0-0.1.1.php | 43 - .../mysql4-upgrade-0.1.1-0.1.2.php | 26 - .../mysql4-upgrade-0.1.10-0.1.11.php | 32 - .../mysql4-upgrade-0.1.11-0.1.12.php | 115 - .../mysql4-upgrade-0.1.12-0.1.13.php | 44 - .../mysql4-upgrade-0.1.2-0.1.3.php | 43 - .../mysql4-upgrade-0.1.3-0.1.4.php | 28 - .../mysql4-upgrade-0.1.4-0.1.5.php | 21 - .../mysql4-upgrade-0.1.5-0.1.6.php | 23 - .../mysql4-upgrade-0.1.6-0.1.7.php | 36 - .../mysql4-upgrade-0.1.7-0.1.8.php | 26 - .../mysql4-upgrade-0.1.8-0.1.9.php | 38 - .../mysql4-upgrade-0.1.9-0.1.10.php | 29 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 948 -- .../mysql4-data-upgrade-0.7.57-0.7.58.php | 18 - .../mysql4-data-upgrade-0.7.63-0.7.64.php | 19 - ...ql4-data-upgrade-1.4.0.0.28-1.4.0.0.29.php | 18 - ...ql4-data-upgrade-1.4.0.0.42-1.4.0.0.43.php | 21 - .../catalog_setup/mysql4-install-0.7.0.php | 550 -- .../mysql4-install-1.4.0.0.0.php | 783 -- .../mysql4-upgrade-0.6.40-0.7.0.php | 20 - .../mysql4-upgrade-0.7.0-0.7.1.php | 28 - .../mysql4-upgrade-0.7.1-0.7.2.php | 18 - .../mysql4-upgrade-0.7.11-0.7.12.php | 21 - .../mysql4-upgrade-0.7.12-0.7.13.php | 19 - .../mysql4-upgrade-0.7.13-0.7.14.php | 42 - .../mysql4-upgrade-0.7.14-0.7.15.php | 22 - .../mysql4-upgrade-0.7.15-0.7.16.php | 34 - .../mysql4-upgrade-0.7.16-0.7.17.php | 19 - .../mysql4-upgrade-0.7.17-0.7.18.php | 23 - .../mysql4-upgrade-0.7.18-0.7.19.php | 26 - .../mysql4-upgrade-0.7.19-0.7.20.php | 21 - .../mysql4-upgrade-0.7.2-0.7.3.php | 23 - .../mysql4-upgrade-0.7.20-0.7.21.php | 40 - .../mysql4-upgrade-0.7.21-0.7.22.php | 31 - .../mysql4-upgrade-0.7.22-0.7.23.php | 17 - .../mysql4-upgrade-0.7.23-0.7.24.php | 20 - .../mysql4-upgrade-0.7.24-0.7.25.php | 20 - .../mysql4-upgrade-0.7.25-0.7.26.php | 19 - .../mysql4-upgrade-0.7.26-0.7.27.php | 72 - .../mysql4-upgrade-0.7.27-0.7.28.php | 20 - .../mysql4-upgrade-0.7.28-0.7.29.php | 26 - .../mysql4-upgrade-0.7.29-0.7.30.php | 29 - .../mysql4-upgrade-0.7.30-0.7.31.php | 15 - .../mysql4-upgrade-0.7.31-0.7.32.php | 24 - .../mysql4-upgrade-0.7.32-0.7.33.php | 34 - .../mysql4-upgrade-0.7.33-0.7.34.php | 51 - .../mysql4-upgrade-0.7.34-0.7.35.php | 23 - .../mysql4-upgrade-0.7.35-0.7.36.php | 51 - .../mysql4-upgrade-0.7.36-0.7.37.php | 38 - .../mysql4-upgrade-0.7.37-0.7.38.php | 102 - .../mysql4-upgrade-0.7.38-0.7.39.php | 25 - .../mysql4-upgrade-0.7.39-0.7.40.php | 31 - .../mysql4-upgrade-0.7.4-0.7.5.php | 80 - .../mysql4-upgrade-0.7.40-0.7.41.php | 54 - .../mysql4-upgrade-0.7.41-0.7.42.php | 27 - .../mysql4-upgrade-0.7.43-0.7.44.php | 26 - .../mysql4-upgrade-0.7.44-0.7.45.php | 23 - .../mysql4-upgrade-0.7.45-0.7.46.php | 23 - .../mysql4-upgrade-0.7.46-0.7.47.php | 128 - .../mysql4-upgrade-0.7.47-0.7.48.php | 41 - .../mysql4-upgrade-0.7.48-0.7.49.php | 26 - .../mysql4-upgrade-0.7.49-0.7.50.php | 32 - .../mysql4-upgrade-0.7.5-0.7.6.php | 27 - .../mysql4-upgrade-0.7.50-0.7.51.php | 34 - .../mysql4-upgrade-0.7.51-0.7.52.php | 42 - .../mysql4-upgrade-0.7.52-0.7.53.php | 24 - .../mysql4-upgrade-0.7.53-0.7.54.php | 51 - .../mysql4-upgrade-0.7.54-0.7.55.php | 25 - .../mysql4-upgrade-0.7.55-0.7.56.php | 115 - .../mysql4-upgrade-0.7.56-0.7.57.php | 55 - .../mysql4-upgrade-0.7.57-0.7.58.php | 190 - .../mysql4-upgrade-0.7.58-0.7.59.php | 42 - .../mysql4-upgrade-0.7.59-0.7.60.php | 24 - .../mysql4-upgrade-0.7.6-0.7.7.php | 21 - .../mysql4-upgrade-0.7.60-0.7.61.php | 76 - .../mysql4-upgrade-0.7.61-0.7.62.php | 51 - .../mysql4-upgrade-0.7.62-0.7.63.php | 21 - .../mysql4-upgrade-0.7.63-0.7.64.php | 42 - .../mysql4-upgrade-0.7.64-0.7.65.php | 34 - .../mysql4-upgrade-0.7.65-0.7.66.php | 31 - .../mysql4-upgrade-0.7.66-0.7.67.php | 29 - .../mysql4-upgrade-0.7.67-0.7.68.php | 42 - .../mysql4-upgrade-0.7.68-0.7.69.php | 103 - .../mysql4-upgrade-0.7.69-0.7.70.php | 36 - .../mysql4-upgrade-0.7.7-0.7.8.php | 74 - .../mysql4-upgrade-0.7.70-0.7.71.php | 19 - .../mysql4-upgrade-0.7.71-0.7.72.php | 24 - .../mysql4-upgrade-0.7.72-0.7.73.php | 65 - .../mysql4-upgrade-0.7.73-1.4.0.0.0.php | 88 - .../mysql4-upgrade-0.7.8-0.7.9.php | 29 - .../mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php | 37 - .../mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php | 37 - .../mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php | 25 - .../mysql4-upgrade-1.4.0.0.11-1.4.0.0.12.php | 21 - .../mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php | 38 - .../mysql4-upgrade-1.4.0.0.13-1.4.0.0.14.php | 65 - .../mysql4-upgrade-1.4.0.0.14-1.4.0.0.15.php | 27 - .../mysql4-upgrade-1.4.0.0.15-1.4.0.0.16.php | 15 - .../mysql4-upgrade-1.4.0.0.16-1.4.0.0.17.php | 21 - .../mysql4-upgrade-1.4.0.0.17-1.4.0.0.18.php | 28 - .../mysql4-upgrade-1.4.0.0.18-1.4.0.0.19.php | 25 - .../mysql4-upgrade-1.4.0.0.19-1.4.0.0.20.php | 48 - .../mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php | 38 - .../mysql4-upgrade-1.4.0.0.20-1.4.0.0.21.php | 25 - .../mysql4-upgrade-1.4.0.0.21-1.4.0.0.22.php | 52 - .../mysql4-upgrade-1.4.0.0.22-1.4.0.0.23.php | 28 - .../mysql4-upgrade-1.4.0.0.23-1.4.0.0.24.php | 314 - .../mysql4-upgrade-1.4.0.0.24-1.4.0.0.25.php | 33 - .../mysql4-upgrade-1.4.0.0.25-1.4.0.0.26.php | 31 - .../mysql4-upgrade-1.4.0.0.26-1.4.0.0.27.php | 27 - .../mysql4-upgrade-1.4.0.0.27-1.4.0.0.28.php | 67 - .../mysql4-upgrade-1.4.0.0.28-1.4.0.0.29.php | 87 - .../mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php | 24 - .../mysql4-upgrade-1.4.0.0.30-1.4.0.0.31.php | 28 - .../mysql4-upgrade-1.4.0.0.31-1.4.0.0.32.php | 26 - .../mysql4-upgrade-1.4.0.0.32-1.4.0.0.33.php | 30 - .../mysql4-upgrade-1.4.0.0.33-1.4.0.0.34.php | 23 - .../mysql4-upgrade-1.4.0.0.34-1.4.0.0.35.php | 24 - .../mysql4-upgrade-1.4.0.0.35-1.4.0.0.36.php | 43 - .../mysql4-upgrade-1.4.0.0.36-1.4.0.0.37.php | 89 - .../mysql4-upgrade-1.4.0.0.37-1.4.0.0.38.php | 21 - .../mysql4-upgrade-1.4.0.0.38-1.4.0.0.39.php | 24 - .../mysql4-upgrade-1.4.0.0.39-1.4.0.0.40.php | 21 - .../mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php | 63 - .../mysql4-upgrade-1.4.0.0.40-1.4.0.0.41.php | 25 - .../mysql4-upgrade-1.4.0.0.41-1.4.0.0.42.php | 22 - .../mysql4-upgrade-1.4.0.0.43-1.4.0.0.44.php | 22 - .../mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php | 42 - .../mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php | 21 - .../mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php | 23 - .../mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php | 32 - .../mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php | 41 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 6056 ------------ .../mysql4-install-0.7.0.php | 55 - .../mysql4-upgrade-0.7.0-0.7.1.php | 23 - .../mysql4-upgrade-0.7.1-0.7.2.php | 15 - .../mysql4-upgrade-0.7.2-0.7.3.php | 38 - .../mysql4-upgrade-0.7.3-0.7.4.php | 27 - .../mysql4-upgrade-0.7.4-0.7.5.php | 105 - .../mysql4-upgrade-0.7.5-0.7.6.php | 37 - .../mysql4-upgrade-0.7.6-0.7.7.php | 31 - .../mysql4-upgrade-0.7.7-0.7.8.php | 27 - .../mysql4-upgrade-0.7.8-0.7.9.php | 30 - .../mysql4-upgrade-0.7.9-0.7.10.php | 56 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 15 - .../mysql4-install-0.7.0.php | 59 - .../mysql4-upgrade-0.7.0-0.7.1.php | 25 - .../mysql4-upgrade-0.7.1-0.7.2.php | 24 - .../mysql4-upgrade-0.7.2-0.7.3.php | 21 - .../mysql4-upgrade-0.7.3-0.7.4.php | 38 - .../mysql4-upgrade-0.7.4-0.7.5.php | 42 - .../mysql4-upgrade-0.7.5-0.7.6.php | 25 - .../mysql4-upgrade-0.7.6-0.7.7.php | 47 - .../mysql4-upgrade-0.7.7-0.7.8.php | 25 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 536 -- .../mysql4-install-0.7.0.php | 83 - .../mysql4-upgrade-0.7.0-0.7.1.php | 24 - .../mysql4-upgrade-0.7.1-0.7.2.php | 91 - .../mysql4-upgrade-0.7.2-0.7.3.php | 24 - .../mysql4-upgrade-0.7.3-0.7.4.php | 34 - .../mysql4-upgrade-0.7.4-0.7.5.php | 28 - .../mysql4-upgrade-0.7.5-0.7.6.php | 25 - .../mysql4-upgrade-0.7.6-0.7.7.php | 31 - .../mysql4-upgrade-0.7.7-0.7.8.php | 64 - .../mysql4-upgrade-0.7.8-0.7.9.php | 21 - .../mysql4-upgrade-0.7.9-0.7.10.php | 28 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 606 -- .../mysql4-install-0.7.0.php | 40 - .../mysql4-upgrade-0.7.1-0.7.2.php | 22 - .../mysql4-upgrade-0.7.2-0.7.3.php | 22 - .../mysql4-upgrade-0.7.3-0.7.4.php | 22 - .../mysql4-upgrade-0.7.4-0.7.5.php | 15 - .../mysql4-upgrade-0.7.5-0.7.6.php | 67 - .../mysql4-upgrade-0.7.6-0.7.7.php | 25 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 296 - .../checkout_setup/mysql4-install-0.9.1.php | 40 - .../mysql4-upgrade-0.9.0-0.9.1.php | 34 - .../mysql4-upgrade-0.9.1-0.9.2.php | 27 - .../mysql4-upgrade-0.9.2-0.9.3.php | 27 - .../mysql4-upgrade-0.9.3-0.9.4.php | 691 -- .../mysql4-upgrade-0.9.4-0.9.5.php | 49 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 148 - .../contacts_setup/mysql4-install-0.7.1.php | 25 - .../contacts_setup/mysql4-install-0.8.0.php | 18 - .../mysql4-upgrade-0.7.1-0.7.2.php | 25 - .../sql/core_setup/mysql4-install-0.7.0.php | 193 - .../sql/core_setup/mysql4-install-0.8.0.php | 211 - .../mysql4-upgrade-0.6.26-0.7.0.php | 29 - .../core_setup/mysql4-upgrade-0.7.1-0.7.2.php | 41 - .../core_setup/mysql4-upgrade-0.7.2-0.7.3.php | 26 - .../core_setup/mysql4-upgrade-0.7.3-0.7.4.php | 39 - .../core_setup/mysql4-upgrade-0.7.4-0.7.5.php | 119 - .../core_setup/mysql4-upgrade-0.7.5-0.7.6.php | 28 - .../core_setup/mysql4-upgrade-0.7.6-0.7.7.php | 26 - .../core_setup/mysql4-upgrade-0.7.7-0.7.8.php | 28 - .../core_setup/mysql4-upgrade-0.7.8-0.7.9.php | 46 - .../core_setup/mysql4-upgrade-0.8.0-0.8.1.php | 24 - .../core_setup/mysql4-upgrade-0.8.1-0.8.2.php | 23 - .../mysql4-upgrade-0.8.10-0.8.11.php | 40 - .../mysql4-upgrade-0.8.11-0.8.12.php | 37 - .../mysql4-upgrade-0.8.12-0.8.13.php | 32 - .../mysql4-upgrade-0.8.13-0.8.14.php | 21 - .../mysql4-upgrade-0.8.14-0.8.15.php | 21 - .../mysql4-upgrade-0.8.15-0.8.16.php | 27 - .../mysql4-upgrade-0.8.16-0.8.17.php | 45 - .../mysql4-upgrade-0.8.17-0.8.18.php | 33 - .../mysql4-upgrade-0.8.18-0.8.19.php | 44 - .../mysql4-upgrade-0.8.19-0.8.20.php | 54 - .../core_setup/mysql4-upgrade-0.8.2-0.8.3.php | 23 - .../mysql4-upgrade-0.8.20-0.8.21.php | 29 - .../mysql4-upgrade-0.8.21-0.8.22.php | 47 - .../mysql4-upgrade-0.8.22-0.8.23.php | 32 - .../mysql4-upgrade-0.8.23-0.8.24.php | 31 - .../mysql4-upgrade-0.8.24-0.8.25.php | 27 - .../mysql4-upgrade-0.8.25-0.8.26.php | 21 - .../mysql4-upgrade-0.8.26-0.8.27.php | 20 - .../mysql4-upgrade-0.8.27-0.8.28.php | 25 - .../core_setup/mysql4-upgrade-0.8.3-0.8.4.php | 37 - .../core_setup/mysql4-upgrade-0.8.4-0.8.5.php | 29 - .../core_setup/mysql4-upgrade-0.8.5-0.8.6.php | 38 - .../core_setup/mysql4-upgrade-0.8.6-0.8.7.php | 29 - .../core_setup/mysql4-upgrade-0.8.7-0.8.8.php | 25 - .../core_setup/mysql4-upgrade-0.8.8-0.8.9.php | 28 - .../mysql4-upgrade-0.8.9-0.8.10.php | 33 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 1445 --- .../sql/cron_setup/mysql4-install-0.7.0.php | 56 - .../cron_setup/mysql4-upgrade-0.7.0-0.7.1.php | 40 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 106 - .../customer_setup/mysql4-install-0.7.0.php | 261 - .../customer_setup/mysql4-install-0.8.0.php | 230 - .../mysql4-install-1.4.0.0.0.php | 621 -- .../mysql4-upgrade-0.6.1-0.7.0.php | 19 - .../mysql4-upgrade-0.7.1-0.7.2.php | 57 - .../mysql4-upgrade-0.7.2-0.7.3.php | 56 - .../mysql4-upgrade-0.8.0-0.8.1.php | 17 - .../mysql4-upgrade-0.8.10-0.8.11.php | 24 - .../mysql4-upgrade-0.8.11-0.8.12.php | 381 - .../mysql4-upgrade-0.8.12-1.4.0.0.0.php | 68 - .../mysql4-upgrade-0.8.4-0.8.5.php | 21 - .../mysql4-upgrade-0.8.5-0.8.6.php | 33 - .../mysql4-upgrade-0.8.6-0.8.7.php | 28 - .../mysql4-upgrade-0.8.7-0.8.8.php | 27 - .../mysql4-upgrade-0.8.8-0.8.9.php | 33 - .../mysql4-upgrade-0.8.9-0.8.10.php | 53 - .../mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php | 53 - .../mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php | 24 - .../mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php | 26 - .../mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php | 45 - .../mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php | 29 - .../mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php | 20 - .../mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php | 21 - .../mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php | 20 - .../mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php | 61 - .../mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php | 38 - .../mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php | 21 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 1912 ---- .../dataflow_setup/mysql4-install-0.7.0.php | 48 - .../mysql4-upgrade-0.7.0-0.7.1.php | 57 - .../mysql4-upgrade-0.7.1-0.7.2.php | 27 - .../mysql4-upgrade-0.7.2-0.7.3.php | 68 - .../mysql4-upgrade-0.7.3-0.7.4.php | 21 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 478 - .../directory_setup/mysql4-install-0.7.0.php | 72 - .../directory_setup/mysql4-install-0.8.0.php | 262 - .../mysql4-upgrade-0.7.0-0.7.1.php | 34 - .../mysql4-upgrade-0.7.1-0.7.2.php | 29 - .../mysql4-upgrade-0.8.0-0.8.1.php | 58 - .../mysql4-upgrade-0.8.1-0.8.2.php | 26 - .../mysql4-upgrade-0.8.10-0.8.11.php | 208 - .../mysql4-upgrade-0.8.2-0.8.3.php | 26 - .../mysql4-upgrade-0.8.3-0.8.4.php | 27 - .../mysql4-upgrade-0.8.4-0.8.5.php | 27 - .../mysql4-upgrade-0.8.5-0.8.6.php | 27 - .../mysql4-upgrade-0.8.6-0.8.7.php | 27 - .../mysql4-upgrade-0.8.7-0.8.8.php | 35 - .../mysql4-upgrade-0.8.8-0.8.9.php | 49 - .../mysql4-upgrade-0.8.9-0.8.10.php | 53 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 242 - .../mysql4-install-0.1.0.php | 42 - .../mysql4-install-1.4.0.0.php | 250 - .../mysql4-upgrade-0.1.0-0.1.1.php | 44 - .../mysql4-upgrade-0.1.1-0.1.2.php | 147 - .../mysql4-upgrade-0.1.10-0.1.11.php | 86 - .../mysql4-upgrade-0.1.11-0.1.12.php | 21 - .../mysql4-upgrade-0.1.12-0.1.13.php | 42 - .../mysql4-upgrade-0.1.13-0.1.14.php | 48 - .../mysql4-upgrade-0.1.14-0.1.15.php | 34 - .../mysql4-upgrade-0.1.15-0.1.16.php | 59 - .../mysql4-upgrade-0.1.2-0.1.3.php | 43 - .../mysql4-upgrade-0.1.3-0.1.4.php | 21 - .../mysql4-upgrade-0.1.4-0.1.5.php | 21 - .../mysql4-upgrade-0.1.5-0.1.6.php | 56 - .../mysql4-upgrade-0.1.6-0.1.7.php | 196 - .../mysql4-upgrade-0.1.7-0.1.8.php | 21 - .../mysql4-upgrade-0.1.8-0.1.9.php | 21 - .../mysql4-upgrade-0.1.9-0.1.10.php | 65 - .../mysql4-upgrade-1.3.9-1.4.0.0.php | 37 - .../mysql4-upgrade-1.4.0.0-1.4.0.1.php | 44 - .../mysql4-upgrade-1.4.0.1-1.4.0.2.php | 20 - .../mysql4-upgrade-1.4.0.2-1.4.0.3.php | 94 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 853 -- .../sql/eav_setup/mysql4-install-0.7.0.php | 275 - .../eav_setup/mysql4-upgrade-0.7.0-0.7.1.php | 27 - .../eav_setup/mysql4-upgrade-0.7.1-0.7.2.php | 21 - .../mysql4-upgrade-0.7.10-0.7.11.php | 31 - .../mysql4-upgrade-0.7.11-0.7.12.php | 21 - .../mysql4-upgrade-0.7.12-0.7.13.php | 32 - .../mysql4-upgrade-0.7.13-0.7.14.php | 38 - .../mysql4-upgrade-0.7.14-0.7.15.php | 85 - .../mysql4-upgrade-0.7.15-0.7.16.php | 27 - .../eav_setup/mysql4-upgrade-0.7.2-0.7.3.php | 24 - .../eav_setup/mysql4-upgrade-0.7.3-0.7.4.php | 21 - .../eav_setup/mysql4-upgrade-0.7.4-0.7.5.php | 21 - .../eav_setup/mysql4-upgrade-0.7.5-0.7.6.php | 24 - .../eav_setup/mysql4-upgrade-0.7.6-0.7.7.php | 26 - .../eav_setup/mysql4-upgrade-0.7.7-0.7.8.php | 23 - .../eav_setup/mysql4-upgrade-0.7.8-0.7.9.php | 26 - .../eav_setup/mysql4-upgrade-0.7.9-0.7.10.php | 21 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 2222 ----- .../mysql4-install-0.7.0.php | 57 - .../mysql4-upgrade-0.1.3-0.7.0.php | 41 - .../mysql4-upgrade-0.7.0-0.7.1.php | 20 - .../mysql4-upgrade-0.7.1-0.7.2.php | 26 - .../mysql4-upgrade-0.7.2-0.7.3.php | 46 - .../mysql4-upgrade-0.7.3-0.7.4.php | 62 - .../mysql4-upgrade-0.7.4-0.7.5.php | 20 - .../mysql4-upgrade-0.7.5-0.7.6.php | 25 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 115 - .../mysql4-install-0.1.0.php | 84 - .../index_setup/mysql4-install-1.4.0.0.php | 55 - .../mysql4-upgrade-1.4.0.0-1.4.0.1.php | 24 - .../mysql4-upgrade-1.4.0.1-1.4.0.2.php | 25 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 221 - .../sql/log_setup/mysql4-install-0.7.0.php | 104 - .../log_setup/mysql4-upgrade-0.7.0-0.7.1.php | 21 - .../log_setup/mysql4-upgrade-0.7.1-0.7.2.php | 23 - .../log_setup/mysql4-upgrade-0.7.3-0.7.4.php | 25 - .../log_setup/mysql4-upgrade-0.7.4-0.7.5.php | 37 - .../log_setup/mysql4-upgrade-0.7.5-0.7.6.php | 21 - .../log_setup/mysql4-upgrade-0.7.6-0.7.7.php | 32 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 402 - .../newsletter_setup/mysql4-install-0.7.0.php | 130 - .../newsletter_setup/mysql4-install-0.8.0.php | 105 - .../mysql4-upgrade-0.7.0-0.7.1.php | 39 - .../mysql4-upgrade-0.8.0-0.8.1.php | 24 - .../mysql4-upgrade-0.8.1-0.8.2.php | 27 - .../mysql4-upgrade-0.8.2-0.8.3.php | 81 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 545 -- .../mysql4-data-upgrade-0.7.0-0.7.1.php | 138 - .../paygate_setup/mysql4-install-0.7.0.php | 37 - .../mysql4-upgrade-0.7.0-0.7.1.php | 34 - .../data-upgrade-1.6.0.2-1.6.0.3.php | 30 - .../data-upgrade-1.6.0.4-1.6.0.5.php | 21 - .../sql/paypal_setup/mysql4-install-0.7.0.php | 39 - .../paypal_setup/mysql4-install-1.4.0.0.php | 36 - .../mysql4-upgrade-0.7.1-0.7.2.php | 21 - .../mysql4-upgrade-0.7.2-0.7.3.php | 34 - .../mysql4-upgrade-1.4.0.0-1.4.0.1.php | 60 - .../mysql4-upgrade-1.4.0.1-1.4.0.2.php | 37 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 293 - .../paypaluk_setup/mysql4-install-0.7.0.php | 36 - .../mysql4-install-0.7.0.php | 79 - .../mysql4-upgrade-0.7.1-0.7.2.php | 56 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 307 - .../sql/rating_setup/mysql4-install-0.7.0.php | 111 - .../mysql4-upgrade-0.7.0-0.7.1.php | 42 - .../mysql4-upgrade-0.7.1-0.7.2.php | 34 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 554 -- .../reports_setup/mysql4-install-0.7.1.php | 54 - .../reports_setup/mysql4-install-1.5.0.0.php | 71 - .../mysql4-upgrade-0.7.0-0.7.1.php | 54 - .../mysql4-upgrade-0.7.1-0.7.2.php | 33 - .../mysql4-upgrade-0.7.2-0.7.3.php | 33 - .../mysql4-upgrade-0.7.3-0.7.4.php | 49 - .../mysql4-upgrade-0.7.4-0.7.5.php | 32 - .../mysql4-upgrade-0.7.5-0.7.7.php | 37 - .../mysql4-upgrade-0.7.7-0.7.8.php | 61 - .../mysql4-upgrade-0.7.8-0.7.9.php | 21 - .../mysql4-upgrade-0.7.9-0.7.10.php | 27 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 489 - .../sql/review_setup/mysql4-install-0.7.0.php | 92 - .../mysql4-upgrade-0.7.0-0.7.1.php | 44 - .../mysql4-upgrade-0.7.1-0.7.2.php | 37 - .../mysql4-upgrade-0.7.2-0.7.3.php | 51 - .../mysql4-upgrade-0.7.3-0.7.4.php | 32 - .../mysql4-upgrade-0.7.4-0.7.5.php | 37 - .../mysql4-upgrade-0.7.5-0.7.6.php | 21 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 432 - .../sql/sales_setup/mysql4-install-0.7.0.php | 725 -- .../sql/sales_setup/mysql4-install-0.8.11.php | 365 - .../sql/sales_setup/mysql4-install-0.9.0.php | 502 - .../sales_setup/mysql4-install-1.4.0.0.php | 1300 --- .../mysql4-upgrade-0.6.2-0.7.0.php | 36 - .../mysql4-upgrade-0.7.0-0.7.1.php | 22 - .../mysql4-upgrade-0.7.1-0.7.2.php | 30 - .../mysql4-upgrade-0.7.2-0.7.3.php | 26 - .../mysql4-upgrade-0.7.9-0.7.10.php | 22 - .../mysql4-upgrade-0.8.0-0.8.1.php | 19 - .../mysql4-upgrade-0.8.1-0.8.2.php | 46 - .../mysql4-upgrade-0.8.11-0.8.12.php | 21 - .../mysql4-upgrade-0.8.12-0.8.13.php | 18 - .../mysql4-upgrade-0.8.13-0.8.14.php | 238 - .../mysql4-upgrade-0.8.14-0.8.15.php | 384 - .../mysql4-upgrade-0.8.15-0.8.16.php | 24 - .../mysql4-upgrade-0.8.16-0.8.17.php | 35 - .../mysql4-upgrade-0.8.17-0.8.18.php | 57 - .../mysql4-upgrade-0.8.18-0.8.19.php | 21 - .../mysql4-upgrade-0.8.19-0.8.20.php | 44 - .../mysql4-upgrade-0.8.2-0.8.3.php | 21 - .../mysql4-upgrade-0.8.20-0.8.21.php | 32 - .../mysql4-upgrade-0.8.21-0.8.22.php | 24 - .../mysql4-upgrade-0.8.22-0.8.23.php | 21 - .../mysql4-upgrade-0.8.23-0.8.24.php | 20 - .../mysql4-upgrade-0.8.24-0.8.25.php | 36 - .../mysql4-upgrade-0.8.25-0.8.26.php | 22 - .../mysql4-upgrade-0.8.26-0.8.27.php | 37 - .../mysql4-upgrade-0.8.27-0.8.28.php | 26 - .../mysql4-upgrade-0.8.28-0.8.29.php | 26 - .../mysql4-upgrade-0.8.29-0.9.0.php | 343 - .../mysql4-upgrade-0.8.3-0.8.4.php | 25 - .../mysql4-upgrade-0.8.6-0.8.7.php | 21 - .../mysql4-upgrade-0.8.7-0.8.8.php | 30 - .../mysql4-upgrade-0.8.8-0.8.9.php | 54 - .../mysql4-upgrade-0.9.0-0.9.1.php | 24 - .../mysql4-upgrade-0.9.1-0.9.2.php | 20 - .../mysql4-upgrade-0.9.10-0.9.11.php | 22 - .../mysql4-upgrade-0.9.11-0.9.12.php | 20 - .../mysql4-upgrade-0.9.12-0.9.13.php | 24 - .../mysql4-upgrade-0.9.13-0.9.14.php | 31 - .../mysql4-upgrade-0.9.14-0.9.15.php | 31 - .../mysql4-upgrade-0.9.15-0.9.16.php | 23 - .../mysql4-upgrade-0.9.16-0.9.17.php | 23 - .../mysql4-upgrade-0.9.17-0.9.18.php | 24 - .../mysql4-upgrade-0.9.18-0.9.19.php | 22 - .../mysql4-upgrade-0.9.19-0.9.20.php | 24 - .../mysql4-upgrade-0.9.2-0.9.3.php | 36 - .../mysql4-upgrade-0.9.20-0.9.21.php | 28 - .../mysql4-upgrade-0.9.21-0.9.22.php | 24 - .../mysql4-upgrade-0.9.22-0.9.23.php | 26 - .../mysql4-upgrade-0.9.23-0.9.24.php | 21 - .../mysql4-upgrade-0.9.24-0.9.25.php | 24 - .../mysql4-upgrade-0.9.25-0.9.26.php | 33 - .../mysql4-upgrade-0.9.26-0.9.27.php | 170 - .../mysql4-upgrade-0.9.27-0.9.28.php | 36 - .../mysql4-upgrade-0.9.28-0.9.29.php | 150 - .../mysql4-upgrade-0.9.29-0.9.30.php | 70 - .../mysql4-upgrade-0.9.3-0.9.4.php | 159 - .../mysql4-upgrade-0.9.30-0.9.31.php | 31 - .../mysql4-upgrade-0.9.31-0.9.32.php | 20 - .../mysql4-upgrade-0.9.32-0.9.33.php | 23 - .../mysql4-upgrade-0.9.33-0.9.34.php | 23 - .../mysql4-upgrade-0.9.34-0.9.35.php | 24 - .../mysql4-upgrade-0.9.35-0.9.36.php | 15 - .../mysql4-upgrade-0.9.36-0.9.37.php | 24 - .../mysql4-upgrade-0.9.37-0.9.38.php | 39 - .../mysql4-upgrade-0.9.38-0.9.39.php | 53 - .../mysql4-upgrade-0.9.39-0.9.40.php | 21 - .../mysql4-upgrade-0.9.4-0.9.5.php | 31 - .../mysql4-upgrade-0.9.40-0.9.41.php | 47 - .../mysql4-upgrade-0.9.41-0.9.42.php | 19 - .../mysql4-upgrade-0.9.42-0.9.43.php | 37 - .../mysql4-upgrade-0.9.43-0.9.44.php | 24 - .../mysql4-upgrade-0.9.44-0.9.45.php | 64 - .../mysql4-upgrade-0.9.45-0.9.46.php | 97 - .../mysql4-upgrade-0.9.46-0.9.47.php | 112 - .../mysql4-upgrade-0.9.47-0.9.48.php | 73 - .../mysql4-upgrade-0.9.48-0.9.49.php | 69 - .../mysql4-upgrade-0.9.49-0.9.50.php | 64 - .../mysql4-upgrade-0.9.5-0.9.6.php | 32 - .../mysql4-upgrade-0.9.50-0.9.51.php | 127 - .../mysql4-upgrade-0.9.51-0.9.52.php | 36 - .../mysql4-upgrade-0.9.52-0.9.53.php | 22 - .../mysql4-upgrade-0.9.53-0.9.54.php | 27 - .../mysql4-upgrade-0.9.54-0.9.55.php | 21 - .../mysql4-upgrade-0.9.55-0.9.56.php | 21 - .../mysql4-upgrade-0.9.6-0.9.7.php | 24 - .../mysql4-upgrade-0.9.7-0.9.8.php | 22 - .../mysql4-upgrade-0.9.8-0.9.9.php | 22 - .../mysql4-upgrade-0.9.9-0.9.10.php | 35 - .../mysql4-upgrade-1.3.99-1.4.0.0.php | 1261 --- .../mysql4-upgrade-1.4.0.0-1.4.0.1.php | 26 - .../mysql4-upgrade-1.4.0.1-1.4.0.2.php | 22 - .../mysql4-upgrade-1.4.0.15-1.4.0.16.php | 22 - .../mysql4-upgrade-1.4.0.16-1.4.0.17.php | 36 - .../mysql4-upgrade-1.4.0.17-1.4.0.18.php | 37 - .../mysql4-upgrade-1.4.0.18-1.4.0.19.php | 26 - .../mysql4-upgrade-1.4.0.19-1.4.0.20.php | 21 - .../mysql4-upgrade-1.4.0.2-1.4.0.3.php | 60 - .../mysql4-upgrade-1.4.0.20-1.4.0.21.php | 61 - .../mysql4-upgrade-1.4.0.21-1.4.0.22.php | 28 - .../mysql4-upgrade-1.4.0.22-1.4.0.23.php | 83 - .../mysql4-upgrade-1.4.0.23-1.4.0.24.php | 24 - .../mysql4-upgrade-1.4.0.24-1.4.0.25.php | 20 - .../mysql4-upgrade-1.4.0.3-1.4.0.4.php | 57 - .../mysql4-upgrade-1.4.0.4-1.4.0.5.php | 30 - .../mysql4-upgrade-1.4.0.5-1.4.0.6.php | 60 - .../mysql4-upgrade-1.4.0.6-1.4.0.7.php | 27 - .../mysql4-upgrade-1.4.0.7-1.4.0.8.php | 28 - .../mysql4-upgrade-1.4.0.8-1.4.0.15.php | 190 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 8188 ----------------- .../salesrule_setup/mysql4-install-0.7.0.php | 99 - .../mysql4-install-1.4.0.0.0.php | 128 - .../mysql4-upgrade-0.7.0-0.7.1.php | 27 - .../mysql4-upgrade-0.7.1-0.7.2.php | 27 - .../mysql4-upgrade-0.7.10-0.7.11.php | 109 - .../mysql4-upgrade-0.7.11-0.7.12.php | 15 - .../mysql4-upgrade-0.7.2-0.7.3.php | 26 - .../mysql4-upgrade-0.7.3-0.7.4.php | 26 - .../mysql4-upgrade-0.7.4-0.7.5.php | 45 - .../mysql4-upgrade-0.7.5-0.7.6.php | 24 - .../mysql4-upgrade-0.7.6-0.7.7.php | 34 - .../mysql4-upgrade-0.7.7-0.7.8.php | 29 - .../mysql4-upgrade-0.7.8-0.7.9.php | 53 - .../mysql4-upgrade-0.7.9-0.7.10.php | 15 - .../mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php | 93 - .../mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php | 50 - .../mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php | 28 - .../mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php | 36 - .../mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php | 57 - .../mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php | 47 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 927 -- .../shipping_setup/mysql4-install-0.7.0.php | 40 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 120 - .../sitemap_setup/mysql4-install-0.7.0.php | 34 - .../mysql4-upgrade-0.7.0-0.7.1.php | 31 - .../mysql4-upgrade-0.7.1-0.7.2.php | 15 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 104 - .../sql/tag_setup/mysql4-install-0.7.0.php | 66 - .../tag_setup/mysql4-upgrade-0.7.0-0.7.1.php | 28 - .../tag_setup/mysql4-upgrade-0.7.1-0.7.2.php | 147 - .../tag_setup/mysql4-upgrade-0.7.2-0.7.3.php | 34 - .../tag_setup/mysql4-upgrade-0.7.3-0.7.4.php | 37 - .../tag_setup/mysql4-upgrade-0.7.4-0.7.5.php | 37 - .../tag_setup/mysql4-upgrade-0.7.5-0.7.6.php | 61 - .../tag_setup/mysql4-upgrade-0.7.6-0.7.7.php | 26 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 433 - .../sql/tax_setup/mysql4-install-0.7.0.php | 111 - .../sql/tax_setup/mysql4-install-1.4.0.0.php | 135 - .../tax_setup/mysql4-upgrade-0.6.1-0.7.0.php | 23 - .../tax_setup/mysql4-upgrade-0.7.0-0.7.1.php | 29 - .../tax_setup/mysql4-upgrade-0.7.1-0.7.2.php | 25 - .../mysql4-upgrade-0.7.10-0.7.11.php | 45 - .../mysql4-upgrade-0.7.11-0.7.12.php | 26 - .../mysql4-upgrade-0.7.12-0.7.13.php | 25 - .../tax_setup/mysql4-upgrade-0.7.2-0.7.3.php | 27 - .../tax_setup/mysql4-upgrade-0.7.3-0.7.4.php | 25 - .../tax_setup/mysql4-upgrade-0.7.4-0.7.5.php | 35 - .../tax_setup/mysql4-upgrade-0.7.5-0.7.6.php | 27 - .../tax_setup/mysql4-upgrade-0.7.6-0.7.7.php | 85 - .../tax_setup/mysql4-upgrade-0.7.7-0.7.8.php | 23 - .../tax_setup/mysql4-upgrade-0.7.8-0.7.9.php | 56 - .../tax_setup/mysql4-upgrade-0.7.9-0.7.10.php | 29 - .../tax_setup/mysql4-upgrade-1.3.9-1.4.0.php | 26 - .../mysql4-upgrade-1.4.0.0-1.4.0.1.php | 32 - .../mysql4-upgrade-1.4.0.1-1.4.0.2.php | 28 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 525 -- .../usa_setup/mysql4-upgrade-0.7.0-0.7.1.php | 23 - .../sql/weee_setup/mysql4-install-0.1.php | 38 - .../sql/weee_setup/mysql4-upgrade-0.1-0.2.php | 23 - .../weee_setup/mysql4-upgrade-0.10-0.11.php | 36 - .../weee_setup/mysql4-upgrade-0.11-0.12.php | 36 - .../weee_setup/mysql4-upgrade-0.12-0.13.php | 35 - .../sql/weee_setup/mysql4-upgrade-0.2-0.3.php | 23 - .../sql/weee_setup/mysql4-upgrade-0.3-0.4.php | 24 - .../sql/weee_setup/mysql4-upgrade-0.4-0.5.php | 27 - .../sql/weee_setup/mysql4-upgrade-0.5-0.6.php | 39 - .../sql/weee_setup/mysql4-upgrade-0.6-0.7.php | 24 - .../sql/weee_setup/mysql4-upgrade-0.7-0.8.php | 23 - .../sql/weee_setup/mysql4-upgrade-0.8-0.9.php | 34 - .../weee_setup/mysql4-upgrade-0.9-0.10.php | 45 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 551 -- .../widget_setup/mysql4-install-1.4.0.0.0.php | 67 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 337 - .../wishlist_setup/mysql4-install-0.7.0.php | 50 - .../mysql4-upgrade-0.7.0-0.7.1.php | 28 - .../mysql4-upgrade-0.7.1-0.7.2.php | 31 - .../mysql4-upgrade-0.7.2-0.7.4.php | 34 - .../mysql4-upgrade-0.7.4-0.7.5.php | 80 - .../mysql4-upgrade-0.7.5-0.7.6.php | 15 - .../mysql4-upgrade-0.7.6-0.7.7.php | 21 - .../mysql4-upgrade-0.7.7-0.7.8.php | 21 - .../mysql4-upgrade-0.7.8-0.7.9.php | 42 - .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 293 - 596 files changed, 63398 deletions(-) delete mode 100644 app/code/core/Mage/Admin/sql/admin_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/AdminNotification/sql/adminnotification_setup/mysql4-install-1.0.0.php delete mode 100644 app/code/core/Mage/AdminNotification/sql/adminnotification_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Api/sql/api_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.8.0-0.8.1.php delete mode 100644 app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-install-0.1.0.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.0-0.1.1.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.1-0.1.2.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.10-0.1.11.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.11-0.1.12.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.12-0.1.13.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.2-0.1.3.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.3-0.1.4.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.4-0.1.5.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.5-0.1.6.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.6-0.1.7.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.7-0.1.8.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.8-0.1.9.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.9-0.1.10.php delete mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-0.7.57-0.7.58.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-0.7.63-0.7.64.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-1.4.0.0.28-1.4.0.0.29.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-1.4.0.0.42-1.4.0.0.43.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-1.4.0.0.0.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.6.40-0.7.0.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.11-0.7.12.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.12-0.7.13.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.14-0.7.15.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.15-0.7.16.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.16-0.7.17.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.17-0.7.18.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.18-0.7.19.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.19-0.7.20.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.20-0.7.21.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.21-0.7.22.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.22-0.7.23.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.23-0.7.24.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.24-0.7.25.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.25-0.7.26.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.26-0.7.27.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.27-0.7.28.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.28-0.7.29.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.29-0.7.30.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.30-0.7.31.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.31-0.7.32.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.32-0.7.33.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.33-0.7.34.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.34-0.7.35.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.35-0.7.36.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.36-0.7.37.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.37-0.7.38.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.38-0.7.39.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.39-0.7.40.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.40-0.7.41.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.41-0.7.42.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.43-0.7.44.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.44-0.7.45.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.45-0.7.46.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.47-0.7.48.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.48-0.7.49.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.49-0.7.50.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.5-0.7.6.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.50-0.7.51.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.52-0.7.53.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.53-0.7.54.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.54-0.7.55.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.55-0.7.56.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.56-0.7.57.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.57-0.7.58.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.58-0.7.59.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.59-0.7.60.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.6-0.7.7.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.60-0.7.61.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.61-0.7.62.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.62-0.7.63.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.63-0.7.64.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.64-0.7.65.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.65-0.7.66.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.66-0.7.67.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.67-0.7.68.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.68-0.7.69.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.69-0.7.70.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.7-0.7.8.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.70-0.7.71.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.71-0.7.72.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.72-0.7.73.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.73-1.4.0.0.0.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.8-0.7.9.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.11-1.4.0.0.12.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.13-1.4.0.0.14.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.14-1.4.0.0.15.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.15-1.4.0.0.16.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.16-1.4.0.0.17.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.17-1.4.0.0.18.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.18-1.4.0.0.19.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.19-1.4.0.0.20.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.20-1.4.0.0.21.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.21-1.4.0.0.22.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.22-1.4.0.0.23.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.23-1.4.0.0.24.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.24-1.4.0.0.25.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.25-1.4.0.0.26.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.26-1.4.0.0.27.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.27-1.4.0.0.28.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.28-1.4.0.0.29.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.30-1.4.0.0.31.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.31-1.4.0.0.32.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.32-1.4.0.0.33.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.33-1.4.0.0.34.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.34-1.4.0.0.35.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.35-1.4.0.0.36.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.36-1.4.0.0.37.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.37-1.4.0.0.38.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.38-1.4.0.0.39.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.39-1.4.0.0.40.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.40-1.4.0.0.41.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.41-1.4.0.0.42.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.43-1.4.0.0.44.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php delete mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.3-0.7.4.php delete mode 100644 app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.5-0.7.6.php delete mode 100644 app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.6-0.7.7.php delete mode 100644 app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.7-0.7.8.php delete mode 100644 app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.8-0.7.9.php delete mode 100644 app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.9-0.7.10.php delete mode 100644 app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.3-0.7.4.php delete mode 100644 app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.5-0.7.6.php delete mode 100644 app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.6-0.7.7.php delete mode 100644 app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.7-0.7.8.php delete mode 100644 app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.3-0.7.4.php delete mode 100644 app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.5-0.7.6.php delete mode 100644 app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.6-0.7.7.php delete mode 100644 app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.7-0.7.8.php delete mode 100644 app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.8-0.7.9.php delete mode 100644 app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.9-0.7.10.php delete mode 100644 app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.3-0.7.4.php delete mode 100644 app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.5-0.7.6.php delete mode 100644 app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.6-0.7.7.php delete mode 100644 app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-install-0.9.1.php delete mode 100644 app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.0-0.9.1.php delete mode 100644 app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.1-0.9.2.php delete mode 100644 app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.2-0.9.3.php delete mode 100644 app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.3-0.9.4.php delete mode 100644 app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.4-0.9.5.php delete mode 100644 app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.7.1.php delete mode 100644 app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.8.0.php delete mode 100644 app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.8.0.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.6.26-0.7.0.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.3-0.7.4.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.5-0.7.6.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.6-0.7.7.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.7-0.7.8.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.8-0.7.9.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.0-0.8.1.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.1-0.8.2.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.11-0.8.12.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.12-0.8.13.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.13-0.8.14.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.17-0.8.18.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.18-0.8.19.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.19-0.8.20.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.2-0.8.3.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.20-0.8.21.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.21-0.8.22.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.22-0.8.23.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.23-0.8.24.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.24-0.8.25.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.25-0.8.26.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.26-0.8.27.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.27-0.8.28.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.3-0.8.4.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.4-0.8.5.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.5-0.8.6.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.6-0.8.7.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.7-0.8.8.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.8-0.8.9.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.9-0.8.10.php delete mode 100644 app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Cron/sql/cron_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.8.0.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-1.4.0.0.0.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.6.1-0.7.0.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.0-0.8.1.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.10-0.8.11.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.11-0.8.12.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.12-1.4.0.0.0.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.4-0.8.5.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.5-0.8.6.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.6-0.8.7.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.7-0.8.8.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.8-0.8.9.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.9-0.8.10.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php delete mode 100644 app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.3-0.7.4.php delete mode 100644 app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.8.0.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.0-0.8.1.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.1-0.8.2.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.10-0.8.11.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.2-0.8.3.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.3-0.8.4.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.4-0.8.5.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.5-0.8.6.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.6-0.8.7.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.7-0.8.8.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.8-0.8.9.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.9-0.8.10.php delete mode 100644 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-0.1.0.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-1.4.0.0.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.0-0.1.1.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.1-0.1.2.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.10-0.1.11.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.11-0.1.12.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.12-0.1.13.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.13-0.1.14.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.14-0.1.15.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.15-0.1.16.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.2-0.1.3.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.3-0.1.4.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.4-0.1.5.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.5-0.1.6.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.6-0.1.7.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.7-0.1.8.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.8-0.1.9.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.9-0.1.10.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.3.9-1.4.0.0.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php delete mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.11-0.7.12.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.12-0.7.13.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.13-0.7.14.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.14-0.7.15.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.15-0.7.16.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.3-0.7.4.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.5-0.7.6.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.6-0.7.7.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.8-0.7.9.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php delete mode 100644 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.1.3-0.7.0.php delete mode 100644 app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.3-0.7.4.php delete mode 100644 app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.5-0.7.6.php delete mode 100644 app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-install-0.1.0.php delete mode 100644 app/code/core/Mage/Index/sql/index_setup/mysql4-install-1.4.0.0.php delete mode 100644 app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php delete mode 100644 app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php delete mode 100644 app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Log/sql/log_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.3-0.7.4.php delete mode 100644 app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.5-0.7.6.php delete mode 100644 app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.6-0.7.7.php delete mode 100644 app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.8.0.php delete mode 100644 app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.0-0.8.1.php delete mode 100644 app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php delete mode 100644 app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php delete mode 100644 app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-data-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Paypal/data/paypal_setup/data-upgrade-1.6.0.2-1.6.0.3.php delete mode 100644 app/code/core/Mage/Paypal/data/paypal_setup/data-upgrade-1.6.0.4-1.6.0.5.php delete mode 100644 app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-1.4.0.0.php delete mode 100644 app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php delete mode 100644 app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php delete mode 100644 app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/PaypalUk/sql/paypaluk_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Rating/sql/rating_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-0.7.1.php delete mode 100644 app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.5.0.0.php delete mode 100644 app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.3-0.7.4.php delete mode 100644 app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.5-0.7.7.php delete mode 100644 app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.7-0.7.8.php delete mode 100644 app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.8-0.7.9.php delete mode 100644 app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.9-0.7.10.php delete mode 100644 app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Review/sql/review_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.3-0.7.4.php delete mode 100644 app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.5-0.7.6.php delete mode 100644 app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.8.11.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.9.0.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-1.4.0.0.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.6.2-0.7.0.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.9-0.7.10.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.0-0.8.1.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.1-0.8.2.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.11-0.8.12.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.12-0.8.13.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.14-0.8.15.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.15-0.8.16.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.16-0.8.17.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.17-0.8.18.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.18-0.8.19.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.19-0.8.20.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.2-0.8.3.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.20-0.8.21.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.21-0.8.22.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.22-0.8.23.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.23-0.8.24.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.24-0.8.25.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.25-0.8.26.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.26-0.8.27.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.27-0.8.28.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.28-0.8.29.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.29-0.9.0.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.3-0.8.4.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.6-0.8.7.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.7-0.8.8.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.8-0.8.9.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.0-0.9.1.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.1-0.9.2.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.10-0.9.11.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.11-0.9.12.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.12-0.9.13.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.13-0.9.14.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.14-0.9.15.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.15-0.9.16.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.16-0.9.17.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.17-0.9.18.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.18-0.9.19.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.19-0.9.20.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.2-0.9.3.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.20-0.9.21.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.21-0.9.22.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.22-0.9.23.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.23-0.9.24.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.24-0.9.25.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.25-0.9.26.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.26-0.9.27.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.27-0.9.28.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.28-0.9.29.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.29-0.9.30.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.3-0.9.4.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.30-0.9.31.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.31-0.9.32.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.32-0.9.33.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.33-0.9.34.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.34-0.9.35.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.35-0.9.36.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.36-0.9.37.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.37-0.9.38.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.38-0.9.39.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.39-0.9.40.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.4-0.9.5.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.40-0.9.41.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.41-0.9.42.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.42-0.9.43.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.43-0.9.44.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.44-0.9.45.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.45-0.9.46.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.47-0.9.48.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.48-0.9.49.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.49-0.9.50.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.5-0.9.6.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.51-0.9.52.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.52-0.9.53.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.53-0.9.54.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.54-0.9.55.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.55-0.9.56.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.6-0.9.7.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.7-0.9.8.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.8-0.9.9.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.9-0.9.10.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.3.99-1.4.0.0.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.15-1.4.0.16.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.16-1.4.0.17.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.17-1.4.0.18.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.18-1.4.0.19.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.19-1.4.0.20.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.20-1.4.0.21.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.21-1.4.0.22.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.22-1.4.0.23.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.23-1.4.0.24.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.24-1.4.0.25.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.3-1.4.0.4.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.4-1.4.0.5.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.5-1.4.0.6.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.6-1.4.0.7.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.7-1.4.0.8.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.8-1.4.0.15.php delete mode 100644 app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-1.4.0.0.0.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.10-0.7.11.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.11-0.7.12.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.3-0.7.4.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.5-0.7.6.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.6-0.7.7.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.7-0.7.8.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.8-0.7.9.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.9-0.7.10.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php delete mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Tag/sql/tag_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.3-0.7.4.php delete mode 100644 app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.5-0.7.6.php delete mode 100644 app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.6-0.7.7.php delete mode 100644 app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-1.4.0.0.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.6.1-0.7.0.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.10-0.7.11.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.11-0.7.12.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.12-0.7.13.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.2-0.7.3.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.3-0.7.4.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.5-0.7.6.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.6-0.7.7.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.8-0.7.9.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.3.9-1.4.0.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php delete mode 100644 app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Usa/sql/usa_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Weee/sql/weee_setup/mysql4-install-0.1.php delete mode 100644 app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.1-0.2.php delete mode 100644 app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.10-0.11.php delete mode 100644 app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php delete mode 100644 app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.12-0.13.php delete mode 100644 app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php delete mode 100644 app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.3-0.4.php delete mode 100644 app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.4-0.5.php delete mode 100644 app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.5-0.6.php delete mode 100644 app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.6-0.7.php delete mode 100644 app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.7-0.8.php delete mode 100644 app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.8-0.9.php delete mode 100644 app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.9-0.10.php delete mode 100644 app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Widget/sql/widget_setup/mysql4-install-1.4.0.0.0.php delete mode 100644 app/code/core/Mage/Widget/sql/widget_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php delete mode 100644 app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.0-0.7.1.php delete mode 100644 app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.1-0.7.2.php delete mode 100644 app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.2-0.7.4.php delete mode 100644 app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.4-0.7.5.php delete mode 100644 app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.5-0.7.6.php delete mode 100644 app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.6-0.7.7.php delete mode 100644 app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.7-0.7.8.php delete mode 100644 app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.8-0.7.9.php delete mode 100644 app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php diff --git a/app/code/core/Mage/Admin/sql/admin_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Admin/sql/admin_setup/mysql4-install-0.7.0.php deleted file mode 100644 index f22ab66b40c..00000000000 --- a/app/code/core/Mage/Admin/sql/admin_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,82 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('admin_assert')}; -CREATE TABLE {$this->getTable('admin_assert')} ( - `assert_id` int(10) unsigned NOT NULL auto_increment, - `assert_type` varchar(20) character set utf8 NOT NULL default '', - `assert_data` text character set utf8, - PRIMARY KEY (`assert_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ACL Asserts'; - --- DROP TABLE IF EXISTS {$this->getTable('admin_role')}; -CREATE TABLE {$this->getTable('admin_role')} ( - `role_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL default '0', - `tree_level` tinyint(3) unsigned NOT NULL default '0', - `sort_order` tinyint(3) unsigned NOT NULL default '0', - `role_type` char(1) character set utf8 NOT NULL default '0', - `user_id` int(11) unsigned NOT NULL default '0', - `role_name` varchar(50) character set utf8 NOT NULL default '', - PRIMARY KEY (`role_id`), - KEY `parent_id` (`parent_id`,`sort_order`), - KEY `tree_level` (`tree_level`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ACL Roles'; - -insert into {$this->getTable('admin_role')}(`role_id`,`parent_id`,`tree_level`,`sort_order`,`role_type`,`user_id`,`role_name`) values (1,0,1,1,'G',0,'Administrators'),(2,1,2,1,'U',1,'Administrator'); - --- DROP TABLE IF EXISTS {$this->getTable('admin_rule')}; -CREATE TABLE {$this->getTable('admin_rule')} ( - `rule_id` int(10) unsigned NOT NULL auto_increment, - `role_id` int(10) unsigned NOT NULL default '0', - `resource_id` varchar(255) character set utf8 NOT NULL default '', - `privileges` varchar(20) character set utf8 NOT NULL default '', - `assert_id` int(10) unsigned NOT NULL default '0', - `role_type` char(1) default NULL, - `permission` varchar(10) default NULL, - PRIMARY KEY (`rule_id`), - KEY `resource` (`resource_id`,`role_id`), - KEY `role_id` (`role_id`,`resource_id`), - CONSTRAINT `FK_admin_rule` FOREIGN KEY (`role_id`) REFERENCES {$this->getTable('admin_role')} (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ACL Rules'; - -insert into {$this->getTable('admin_rule')}(`rule_id`, `role_id`, `resource_id`, `privileges`, `assert_id`, `role_type`, `permission`) values (1,1,'all','',0,'G','allow'); - --- DROP TABLE IF EXISTS {$this->getTable('admin_user')}; -CREATE TABLE {$this->getTable('admin_user')} ( - `user_id` mediumint(9) unsigned NOT NULL auto_increment, - `firstname` varchar(32) character set utf8 NOT NULL default '', - `lastname` varchar(32) character set utf8 NOT NULL default '', - `email` varchar(128) character set utf8 NOT NULL default '', - `username` varchar(40) character set utf8 NOT NULL default '', - `password` varchar(40) character set utf8 NOT NULL default '', - `created` datetime NOT NULL default '0000-00-00 00:00:00', - `modified` datetime default NULL, - `logdate` datetime default NULL, - `lognum` smallint(5) unsigned NOT NULL default '0', - `reload_acl_flag` tinyint(1) NOT NULL default '0', - `is_active` tinyint(1) NOT NULL default '1', - PRIMARY KEY (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Users'; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 68f62c36714..00000000000 --- a/app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($this->getTable('admin/user'), 'extra', 'TEXT NULL'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index 3d0ef93d785..00000000000 --- a/app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -$tableAdmins = $installer->getTable('admin/user'); - -// delete admin username duplicates -$duplicatedUsers = $installer->getConnection()->fetchPairs(" -SELECT user_id, username FROM {$tableAdmins} GROUP by username HAVING COUNT(user_id) > 1 -"); -$installer->run("DELETE FROM {$tableAdmins} WHERE username " - . $installer->getConnection()->quoteInto('IN (?) ', array_values($duplicatedUsers)) - . 'AND user_id ' . $installer->getConnection()->quoteInto('NOT IN (?) ', array_keys($duplicatedUsers))); - -// add unique key to username field -$installer->getConnection()->addKey($tableAdmins, 'UNQ_ADMIN_USER_USERNAME', 'username', 'unique'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 10a1c7f7d26..00000000000 --- a/app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,315 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('admin/rule'), - 'FK_ADMIN_RULE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('admin/role'), - 'PARENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('admin/role'), - 'TREE_LEVEL', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('admin/rule'), - 'RESOURCE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('admin/rule'), - 'ROLE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('admin/user'), - 'UNQ_ADMIN_USER_USERNAME', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('admin/user') => [ - 'columns' => [ - 'user_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'User ID', - ], - 'firstname' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'User First Name', - ], - 'lastname' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'User Last Name', - ], - 'email' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 128, - 'comment' => 'User Email', - ], - 'username' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 40, - 'comment' => 'User Login', - ], - 'password' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 100, - 'comment' => 'User Password', - ], - 'created' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'User Created Time', - ], - 'modified' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'User Modified Time', - ], - 'logdate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'User Last Login Time', - ], - 'lognum' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'User Login Number', - ], - 'reload_acl_flag' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Reload ACL', - ], - 'is_active' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '1', - 'comment' => 'User Is Active', - ], - 'extra' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'User Extra Data', - ], - ], - 'comment' => 'Admin User Table', - ], - $installer->getTable('admin/role') => [ - 'columns' => [ - 'role_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Role ID', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Parent Role ID', - ], - 'tree_level' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Role Tree Level', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Role Sort Order', - ], - 'role_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 1, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Role Type', - ], - 'user_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'User ID', - ], - 'role_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'nullable' => false, - 'comment' => 'Role Name', - ], - ], - 'comment' => 'Admin Role Table', - ], - $installer->getTable('admin/rule') => [ - 'columns' => [ - 'rule_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Rule ID', - ], - 'role_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Role ID', - ], - 'resource_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Resource ID', - ], - 'privileges' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 20, - 'comment' => 'Privileges', - ], - 'assert_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Assert ID', - ], - 'role_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 1, - 'comment' => 'Role Type', - ], - 'permission' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 10, - 'comment' => 'Permission', - ], - ], - 'comment' => 'Admin Rule Table', - ], - $installer->getTable('admin/assert') => [ - 'columns' => [ - 'assert_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Assert ID', - ], - 'assert_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 20, - 'nullable' => false, - 'comment' => 'Assert Type', - ], - 'assert_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Assert Data', - ], - ], - 'comment' => 'Admin Assert Table', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('admin/role'), - $installer->getIdxName('admin/role', ['parent_id', 'sort_order']), - ['parent_id', 'sort_order'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('admin/role'), - $installer->getIdxName('admin/role', ['tree_level']), - ['tree_level'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('admin/rule'), - $installer->getIdxName('admin/rule', ['resource_id', 'role_id']), - ['resource_id', 'role_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('admin/rule'), - $installer->getIdxName('admin/rule', ['role_id', 'resource_id']), - ['role_id', 'resource_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('admin/user'), - $installer->getIdxName( - 'admin/user', - ['username'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['username'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('admin/rule', 'role_id', 'admin/role', 'role_id'), - $installer->getTable('admin/rule'), - 'role_id', - $installer->getTable('admin/role'), - 'role_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/AdminNotification/sql/adminnotification_setup/mysql4-install-1.0.0.php b/app/code/core/Mage/AdminNotification/sql/adminnotification_setup/mysql4-install-1.0.0.php deleted file mode 100644 index 36b16bffe5f..00000000000 --- a/app/code/core/Mage/AdminNotification/sql/adminnotification_setup/mysql4-install-1.0.0.php +++ /dev/null @@ -1,38 +0,0 @@ -startSetup(); - -$installer->run(" --- DROP TABLE IF EXISTS `{$installer->getTable('adminnotification_inbox')}`; -CREATE TABLE IF NOT EXISTS `{$installer->getTable('adminnotification_inbox')}` ( - `notification_id` int(10) unsigned NOT NULL auto_increment, - `severity` tinyint(3) unsigned NOT NULL default '0', - `date_added` datetime NOT NULL, - `title` varchar(255) NOT NULL, - `description` text, - `url` varchar(255) NOT NULL, - `is_read` tinyint(1) unsigned NOT NULL default '0', - `is_remove` tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (`notification_id`), - KEY `IDX_SEVERITY` (`severity`), - KEY `IDX_IS_READ` (`is_read`), - KEY `IDX_IS_REMOVE` (`is_remove`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/AdminNotification/sql/adminnotification_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/AdminNotification/sql/adminnotification_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index b37c0cdc254..00000000000 --- a/app/code/core/Mage/AdminNotification/sql/adminnotification_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,123 +0,0 @@ -startSetup(); - -/** - * Drop indexes - */ -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('adminnotification/inbox'), - 'IDX_SEVERITY', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('adminnotification/inbox'), - 'IDX_IS_READ', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('adminnotification/inbox'), - 'IDX_IS_REMOVE', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('adminnotification/inbox') => [ - 'columns' => [ - 'notification_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Notification id', - ], - 'severity' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Problem type', - ], - 'date_added' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Create date', - ], - 'title' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Title', - ], - 'description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Description', - ], - 'url' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Url', - ], - 'is_read' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Flag if notification read', - ], - 'is_remove' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Flag if notification might be removed', - ], - ], - 'comment' => 'Adminnotification Inbox', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$connection = $installer->getConnection()->addIndex( - $installer->getTable('adminnotification/inbox'), - $installer->getIdxName('adminnotification/inbox', ['severity']), - ['severity'], -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('adminnotification/inbox'), - $installer->getIdxName('adminnotification/inbox', ['is_read']), - ['is_read'], -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('adminnotification/inbox'), - $installer->getIdxName('adminnotification/inbox', ['is_remove']), - ['is_remove'], -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Api/sql/api_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Api/sql/api_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 6ae4f4f9e0d..00000000000 --- a/app/code/core/Mage/Api/sql/api_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,79 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('api_assert')}; -CREATE TABLE {$this->getTable('api_assert')} ( - `assert_id` int(10) unsigned NOT NULL auto_increment, - `assert_type` varchar(20) character set utf8 NOT NULL default '', - `assert_data` text character set utf8, - PRIMARY KEY (`assert_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Api ACL Asserts'; - --- DROP TABLE IF EXISTS {$this->getTable('api_role')}; -CREATE TABLE {$this->getTable('api_role')} ( - `role_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL default '0', - `tree_level` tinyint(3) unsigned NOT NULL default '0', - `sort_order` tinyint(3) unsigned NOT NULL default '0', - `role_type` char(1) character set utf8 NOT NULL default '0', - `user_id` int(11) unsigned NOT NULL default '0', - `role_name` varchar(50) character set utf8 NOT NULL default '', - PRIMARY KEY (`role_id`), - KEY `parent_id` (`parent_id`,`sort_order`), - KEY `tree_level` (`tree_level`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Api ACL Roles'; - --- DROP TABLE IF EXISTS {$this->getTable('api_rule')}; -CREATE TABLE {$this->getTable('api_rule')} ( - `rule_id` int(10) unsigned NOT NULL auto_increment, - `role_id` int(10) unsigned NOT NULL default '0', - `resource_id` varchar(255) character set utf8 NOT NULL default '', - `privileges` varchar(20) character set utf8 NOT NULL default '', - `assert_id` int(10) unsigned NOT NULL default '0', - `role_type` char(1) default NULL, - `permission` varchar(10) default NULL, - PRIMARY KEY (`rule_id`), - KEY `resource` (`resource_id`,`role_id`), - KEY `role_id` (`role_id`,`resource_id`), - CONSTRAINT `FK_api_rule` FOREIGN KEY (`role_id`) REFERENCES {$this->getTable('api_role')} (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Api ACL Rules'; - --- DROP TABLE IF EXISTS {$this->getTable('api_user')}; -CREATE TABLE {$this->getTable('api_user')} ( - `user_id` mediumint(9) unsigned NOT NULL auto_increment, - `firstname` varchar(32) character set utf8 NOT NULL default '', - `lastname` varchar(32) character set utf8 NOT NULL default '', - `email` varchar(128) character set utf8 NOT NULL default '', - `username` varchar(40) character set utf8 NOT NULL default '', - `api_key` varchar(40) character set utf8 NOT NULL default '', - `created` datetime NOT NULL default '0000-00-00 00:00:00', - `modified` datetime default NULL, - `logdate` datetime default NULL, - `lognum` smallint(5) unsigned NOT NULL default '0', - `reload_acl_flag` tinyint(1) NOT NULL default '0', - `is_active` tinyint(1) NOT NULL default '1', - PRIMARY KEY (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Api Users'; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 809227027f5..00000000000 --- a/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->run("ALTER TABLE {$this->getTable('api_user')} ADD `sessid` VARCHAR(40) NOT NULL AFTER `lognum`;"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.8.0-0.8.1.php b/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.8.0-0.8.1.php deleted file mode 100644 index 88c3781565e..00000000000 --- a/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.8.0-0.8.1.php +++ /dev/null @@ -1,39 +0,0 @@ -startSetup(); - -$installer->run(" - CREATE TABLE `{$installer->getTable('api/session')}` ( - `user_id` mediumint(9) UNSIGNED NOT NULL, - `logdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `sessid` varchar(40) NOT NULL DEFAULT '', - KEY `API_SESSION_USER` (`user_id`), - KEY `API_SESSION_SESSID` (`sessid`), - CONSTRAINT `FK_API_SESSION_USER` FOREIGN KEY (`user_id`) REFERENCES `{$installer->getTable('api/user')}` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Api Sessions'; -"); - -$insertStmt = "INSERT INTO - `{$installer->getTable('api/session')}` (`user_id`, `logdate`, `sessid`) - SELECT `user_id`, `logdate`, `sessid` FROM `{$installer->getTable('api/user')}`"; -$installer->run($insertStmt); -$installer->getConnection()->dropColumn($installer->getTable('api/user'), 'logdate'); -$installer->getConnection()->dropColumn($installer->getTable('api/user'), 'sessid'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index f06568b68a2..00000000000 --- a/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,362 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('api/rule'), - 'FK_API_RULE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('api/session'), - 'FK_API_SESSION_USER', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('api/role'), - 'PARENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('api/role'), - 'TREE_LEVEL', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('api/rule'), - 'RESOURCE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('api/rule'), - 'ROLE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('api/session'), - 'API_SESSION_USER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('api/session'), - 'API_SESSION_SESSID', -); - -/* - * Change columns - */ -$tables = [ - $installer->getTable('api/assert') => [ - 'columns' => [ - 'assert_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Assert id', - ], - 'assert_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 20, - 'comment' => 'Assert type', - ], - 'assert_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Assert additional data', - ], - ], - 'comment' => 'Api ACL Asserts', - ], - $installer->getTable('api/role') => [ - 'columns' => [ - 'role_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Role id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Parent role id', - ], - 'tree_level' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Role level in tree', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort order to display on admin area', - ], - 'role_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 1, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Role type', - ], - 'user_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'User id', - ], - 'role_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Role name', - ], - ], - 'comment' => 'Api ACL Roles', - ], - $installer->getTable('api/rule') => [ - 'columns' => [ - 'rule_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Api rule Id', - ], - 'role_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Api role Id', - ], - 'resource_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Module code', - ], - 'assert_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Assert id', - ], - 'role_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 1, - 'comment' => 'Role type', - ], - ], - 'comment' => 'Api ACL Rules', - ], - $installer->getTable('api/user') => [ - 'columns' => [ - 'user_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'User id', - ], - 'firstname' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'First name', - ], - 'lastname' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Last name', - ], - 'email' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 128, - 'comment' => 'Email', - ], - 'username' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 40, - 'comment' => 'Nickname', - ], - 'api_key' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 40, - 'comment' => 'Api key', - ], - 'created' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'User record create date', - ], - 'modified' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'User record modify date', - ], - 'lognum' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Quantity of log ins', - ], - 'reload_acl_flag' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Refresh ACL flag', - ], - 'is_active' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Account status', - ], - ], - 'comment' => 'Api Users', - ], - $installer->getTable('api/session') => [ - 'columns' => [ - 'user_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'User id', - ], - 'logdate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Login date', - ], - 'sessid' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 40, - 'comment' => 'Sessioin id', - ], - ], - 'comment' => 'Api Sessions', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -$installer->getConnection()->changeColumn( - $installer->getTable('api/rule'), - 'privileges', - 'api_privileges', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 20, - 'comment' => 'Privileges', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('api/rule'), - 'permission', - 'api_permission', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 10, - 'comment' => 'Permission', - ], -); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('api/rule'), - $installer->getIdxName('api/rule', ['resource_id', 'role_id']), - ['resource_id', 'role_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$installer->getConnection()->addIndex( - $installer->getTable('api/rule'), - $installer->getIdxName('api/rule', ['role_id', 'resource_id']), - ['role_id', 'resource_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$installer->getConnection()->addIndex( - $installer->getTable('api/session'), - $installer->getIdxName('api/session', ['user_id']), - ['user_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$installer->getConnection()->addIndex( - $installer->getTable('api/session'), - $installer->getIdxName('api/session', ['sessid']), - ['sessid'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$installer->getConnection()->addIndex( - $installer->getTable('api/role'), - $installer->getIdxName('api/role', ['parent_id', 'sort_order']), - ['parent_id', 'sort_order'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$installer->getConnection()->addIndex( - $installer->getTable('api/role'), - $installer->getIdxName('api/role', ['tree_level']), - ['tree_level'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('api/rule', 'role_id', 'api/role', 'role_id'), - $installer->getTable('api/rule'), - 'role_id', - $installer->getTable('api/role'), - 'role_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('api/session', 'user_id', 'api/user', 'user_id'), - $installer->getTable('api/session'), - 'user_id', - $installer->getTable('api/user'), - 'user_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php deleted file mode 100644 index a90032a2625..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php +++ /dev/null @@ -1,71 +0,0 @@ -getAttribute('catalog_product', 'price_type'); -$taxClassAttribute = $installer->getAttribute('catalog_product', 'tax_class_id'); - -$productTable = $installer->getTable('catalog/product'); -$priceTypeTable = $productTable . '_' . $priceTypeAttribute['backend_type']; -$taxClassTable = $productTable . '_' . $taxClassAttribute['backend_type']; - -$db = $installer->getConnection(); -$db->beginTransaction(); -try { - // select bundle product ids with dynamic price - $select = $db->select() - ->from(['attr' => $priceTypeTable], 'attr.entity_id') - ->joinLeft(['e' => $productTable], 'attr.entity_id = e.entity_id', '') - ->where('attr.attribute_id = ?', $priceTypeAttribute['attribute_id']) - ->where('e.type_id = ?', 'bundle') - ->where('attr.value = ?', 0); - - $isDataChanged = false; - $stmt = $db->query($select); - // set "None" tax class attribute for bundles with dynamic price - while ($row = $stmt->fetch()) { - $data = ['value' => 0]; - $where = [ - 'attribute_id = ?' => $taxClassAttribute['attribute_id'], - 'entity_id = ?' => $row['entity_id'], - ]; - $count = $db->update($taxClassTable, $data, $where); - if ($count > 0) { - $isDataChanged = true; - } - } - - // set "Require Reindex" status for some indexes if attributes data has been modified - if ($isDataChanged) { - $indexerCodes = [ - 'catalog_product_attribute', - 'catalog_product_price', - 'catalog_product_flat', - ]; - - $indexer = Mage::getModel('index/process'); - foreach ($indexerCodes as $code) { - $indexer->load($code, 'indexer_code') - ->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX); - } - } - $db->commit(); -} catch (Exception $e) { - $db->rollBack(); - throw $e; -} diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-install-0.1.0.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-install-0.1.0.php deleted file mode 100644 index e0f808f96d2..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-install-0.1.0.php +++ /dev/null @@ -1,158 +0,0 @@ -startSetup(); - -$installer->run(" - -DROP TABLE IF EXISTS {$this->getTable('catalog_product_bundle_option')}; -CREATE TABLE {$this->getTable('catalog_product_bundle_option')} ( - `option_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `required` tinyint(1) unsigned NOT NULL default '0', - `position` int(10) unsigned NOT NULL default '0', - `type` varchar(255) NOT NULL default '', - PRIMARY KEY (`option_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bundle Options'; - -DROP TABLE IF EXISTS {$this->getTable('catalog_product_bundle_option_link')}; -DROP TABLE IF EXISTS {$this->getTable('catalog_product_bundle_selection')}; -CREATE TABLE {$this->getTable('catalog_product_bundle_selection')} ( - `selection_id` int(10) unsigned NOT NULL auto_increment, - `option_id` int(10) unsigned NOT NULL, - `product_id` int(10) unsigned NOT NULL, - `position` int(10) unsigned NOT NULL default '0', - `is_default` tinyint(1) unsigned NOT NULL default '0', - `selection_price_type` tinyint(1) unsigned NOT NULL default '0', - `selection_price_value` decimal(12,4) NOT NULL default '0.0000', - `selection_qty` decimal(12,4) NOT NULL default '0.0000', - `selection_can_change_qty` tinyint(1) NOT NULL default '0', - PRIMARY KEY (`selection_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bundle Selections'; - -DROP TABLE IF EXISTS {$this->getTable('catalog_product_bundle_option_value')}; -CREATE TABLE {$this->getTable('catalog_product_bundle_option_value')} ( - `value_id` int(10) unsigned NOT NULL auto_increment, - `option_id` int(10) unsigned NOT NULL, - `store_id` smallint(5) unsigned NOT NULL, - `title` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bundle Selections'; - -"); - -$installer->addAttribute('catalog_product', 'price_type', [ - 'type' => 'int', - 'backend' => '', - 'frontend' => '', - 'label' => '', - 'input' => '', - 'class' => '', - 'source' => '', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, - 'visible' => false, - 'required' => true, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'bundle', - 'is_configurable' => false, -]); - -$installer->addAttribute('catalog_product', 'sku_type', [ - 'type' => 'int', - 'backend' => '', - 'frontend' => '', - 'label' => '', - 'input' => '', - 'class' => '', - 'source' => '', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, - 'visible' => false, - 'required' => true, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'bundle', - 'is_configurable' => false, -]); - -$installer->addAttribute('catalog_product', 'weight_type', [ - 'type' => 'int', - 'backend' => '', - 'frontend' => '', - 'label' => '', - 'input' => '', - 'class' => '', - 'source' => '', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, - 'visible' => false, - 'required' => true, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'bundle', - 'is_configurable' => false, -]); - -$installer->addAttribute('catalog_product', 'price_view', [ - 'group' => 'Prices', - 'type' => 'int', - 'backend' => '', - 'frontend' => '', - 'label' => 'Price View', - 'input' => 'select', - 'class' => '', - 'source' => 'bundle/product_attribute_source_price_view', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, - 'visible' => true, - 'required' => true, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'bundle', - 'is_configurable' => false, -]); - -$fieldList = ['price','special_price','special_from_date','special_to_date', - 'minimal_price','cost','tier_price','weight','tax_class_id']; -foreach ($fieldList as $field) { - $applyTo = explode(',', $installer->getAttribute('catalog_product', $field, 'apply_to')); - if (!in_array('bundle', $applyTo)) { - $applyTo[] = 'bundle'; - $installer->updateAttribute('catalog_product', $field, 'apply_to', implode(',', $applyTo)); - } -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.0-0.1.1.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.0-0.1.1.php deleted file mode 100644 index 03ff94a600d..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.0-0.1.1.php +++ /dev/null @@ -1,43 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('catalog_product_bundle_option')} - ADD CONSTRAINT `FK_CATALOG_PRODUCT_BUNDLE_OPTION_PARENT` FOREIGN KEY (`parent_id`) - REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) - ON DELETE CASCADE - ON UPDATE CASCADE; -ALTER TABLE {$this->getTable('catalog_product_bundle_option_value')} - ADD CONSTRAINT `FK_CATALOG_PRODUCT_BUNDLE_OPTION_VALUE_OPTION` FOREIGN KEY (`option_id`) - REFERENCES {$this->getTable('catalog_product_bundle_option')} (`option_id`) - ON DELETE CASCADE - ON UPDATE CASCADE; -ALTER TABLE {$this->getTable('catalog_product_bundle_selection')} - ADD CONSTRAINT `FK_CATALOG_PRODUCT_BUNDLE_SELECTION_OPTION` FOREIGN KEY (`option_id`) - REFERENCES {$this->getTable('catalog_product_bundle_option')} (`option_id`) - ON DELETE CASCADE - ON UPDATE CASCADE, - ADD CONSTRAINT `FK_CATALOG_PRODUCT_BUNDLE_SELECTION_PRODUCT` FOREIGN KEY (`product_id`) - REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) - ON DELETE CASCADE - ON UPDATE CASCADE; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.1-0.1.2.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.1-0.1.2.php deleted file mode 100644 index ea71980739a..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.1-0.1.2.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('catalog_product_bundle_selection')} - ADD COLUMN parent_product_id INT(10) UNSIGNED NOT NULL AFTER option_id; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.10-0.1.11.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.10-0.1.11.php deleted file mode 100644 index 24729e8dad7..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.10-0.1.11.php +++ /dev/null @@ -1,32 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$installer->getTable('bundle/stock_index')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `stock_id` SMALLINT(5) UNSIGNED NOT NULL, - `option_id` INT(10) UNSIGNED DEFAULT 0, - `stock_status` TINYINT(1) DEFAULT 0, - PRIMARY KEY (`entity_id`,`stock_id`,`website_id`,`option_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.11-0.1.12.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.11-0.1.12.php deleted file mode 100644 index 0eded263c19..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.11-0.1.12.php +++ /dev/null @@ -1,115 +0,0 @@ -startSetup(); - -$installer->run(" -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_index_price')}_bundle`; - -CREATE TABLE `{$installer->getTable('bundle/price_indexer_idx')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `customer_group_id` SMALLINT(5) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `tax_class_id` SMALLINT(5) UNSIGNED DEFAULT '0', - `price_type` TINYINT(1) UNSIGNED NOT NULL, - `special_price` DECIMAL(12,4) DEFAULT NULL, - `tier_percent` DECIMAL(12,4) DEFAULT NULL, - `orig_price` DECIMAL(12,4) DEFAULT NULL, - `price` DECIMAL(12,4) DEFAULT NULL, - `min_price` DECIMAL(12,4) DEFAULT NULL, - `max_price` DECIMAL(12,4) DEFAULT NULL, - `tier_price` DECIMAL(12,4) DEFAULT NULL, - `base_tier` DECIMAL(12,4) DEFAULT NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('bundle/price_indexer_tmp')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `customer_group_id` SMALLINT(5) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `tax_class_id` SMALLINT(5) UNSIGNED DEFAULT '0', - `price_type` TINYINT(1) UNSIGNED NOT NULL, - `special_price` DECIMAL(12,4) DEFAULT NULL, - `tier_percent` DECIMAL(12,4) DEFAULT NULL, - `orig_price` DECIMAL(12,4) DEFAULT NULL, - `price` DECIMAL(12,4) DEFAULT NULL, - `min_price` DECIMAL(12,4) DEFAULT NULL, - `max_price` DECIMAL(12,4) DEFAULT NULL, - `tier_price` DECIMAL(12,4) DEFAULT NULL, - `base_tier` DECIMAL(12,4) DEFAULT NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_index_price')}_bndl_sel`; - -CREATE TABLE `{$installer->getTable('bundle/selection_indexer_idx')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `customer_group_id` SMALLINT(5) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `option_id` INT(10) UNSIGNED DEFAULT '0', - `selection_id` INT(10) UNSIGNED DEFAULT '0', - `group_type` TINYINT(1) UNSIGNED DEFAULT '0', - `is_required` TINYINT(1) UNSIGNED DEFAULT '0', - `price` DECIMAL(12,4) DEFAULT NULL, - `tier_price` DECIMAL(12,4) DEFAULT NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`, `option_id`, `selection_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('bundle/selection_indexer_tmp')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `customer_group_id` SMALLINT(5) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `option_id` INT(10) UNSIGNED DEFAULT '0', - `selection_id` INT(10) UNSIGNED DEFAULT '0', - `group_type` TINYINT(1) UNSIGNED DEFAULT '0', - `is_required` TINYINT(1) UNSIGNED DEFAULT '0', - `price` DECIMAL(12,4) DEFAULT NULL, - `tier_price` DECIMAL(12,4) DEFAULT NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`, `option_id`, `selection_id`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_index_price')}_bndl_opt`; - -CREATE TABLE `{$installer->getTable('bundle/option_indexer_idx')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `customer_group_id` SMALLINT(5) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `option_id` INT(10) UNSIGNED DEFAULT '0', - `min_price` DECIMAL(12,4) DEFAULT NULL, - `alt_price` DECIMAL(12,4) DEFAULT NULL, - `max_price` DECIMAL(12,4) DEFAULT NULL, - `tier_price` DECIMAL(12,4) DEFAULT NULL, - `alt_tier_price` DECIMAL(12,4) DEFAULT NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`, `option_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('bundle/option_indexer_tmp')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `customer_group_id` SMALLINT(5) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `option_id` INT(10) UNSIGNED DEFAULT '0', - `min_price` DECIMAL(12,4) DEFAULT NULL, - `alt_price` DECIMAL(12,4) DEFAULT NULL, - `max_price` DECIMAL(12,4) DEFAULT NULL, - `tier_price` DECIMAL(12,4) DEFAULT NULL, - `alt_tier_price` DECIMAL(12,4) DEFAULT NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`, `option_id`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.12-0.1.13.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.12-0.1.13.php deleted file mode 100644 index ac29d270257..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.12-0.1.13.php +++ /dev/null @@ -1,44 +0,0 @@ -run(" -CREATE TABLE {$this->getTable('bundle/selection_price')} ( - `selection_id` int(10) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `selection_price_type` tinyint(1) unsigned NOT NULL default '0', - `selection_price_value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`selection_id`, `website_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->getConnection()->addConstraint( - 'FK_BUNDLE_PRICE_SELECTION_ID', - $this->getTable('bundle/selection_price'), - 'selection_id', - $this->getTable('bundle/selection'), - 'selection_id', -); - -$installer->getConnection()->addConstraint( - 'FK_BUNDLE_PRICE_SELECTION_WEBSITE', - $this->getTable('bundle/selection_price'), - 'website_id', - $this->getTable('core_website'), - 'website_id', -); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.2-0.1.3.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.2-0.1.3.php deleted file mode 100644 index a7a2f73a36c..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.2-0.1.3.php +++ /dev/null @@ -1,43 +0,0 @@ -startSetup(); - -$installer->addAttribute('catalog_product', 'shipment_type', [ - 'type' => 'int', - 'backend' => '', - 'frontend' => '', - 'label' => 'Shipment', - 'input' => '', - 'class' => '', - 'source' => '', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, - 'visible' => false, - 'required' => true, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'bundle', - 'is_configurable' => false, -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.3-0.1.4.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.3-0.1.4.php deleted file mode 100644 index dc2ffebc88c..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.3-0.1.4.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup(); - -$installer->run(" - UPDATE `{$installer->getTable('catalog/product')}` SET `has_options` = '1' - WHERE (entity_id IN ( - SELECT parent_product_id FROM `{$installer->getTable('bundle/selection')}` GROUP BY parent_product_id - )); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.4-0.1.5.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.4-0.1.5.php deleted file mode 100644 index 9d322831f14..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.4-0.1.5.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->updateAttribute('catalog_product', 'price_type', 'used_in_product_listing', 1); -$installer->endSetup(); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.5-0.1.6.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.5-0.1.6.php deleted file mode 100644 index 0921a30ba8a..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.5-0.1.6.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); -$installer->updateAttribute('catalog_product', 'price_view', 'used_in_product_listing', 1); -$installer->updateAttribute('catalog_product', 'shipment_type', 'used_in_product_listing', 1); -$installer->updateAttribute('catalog_product', 'weight_type', 'used_in_product_listing', 1); -$installer->endSetup(); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.6-0.1.7.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.6-0.1.7.php deleted file mode 100644 index 46607fa0dcf..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.6-0.1.7.php +++ /dev/null @@ -1,36 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$installer->getTable('bundle/price_index')}` ( - `entity_id` int(10) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `customer_group_id` smallint(3) unsigned NOT NULL, - `min_price` decimal(12,4) NOT NULL, - `max_price` decimal(12,4) NOT NULL, - PRIMARY KEY (`entity_id`,`website_id`,`customer_group_id`), - KEY `IDX_WEBSITE` (`website_id`), - KEY `IDX_CUSTOMER_GROUP` (`customer_group_id`), - CONSTRAINT `CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_CUSTOMER_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES `{$installer->getTable('customer/customer_group')}` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('catalog/product')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `{$installer->getTable('core/website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.7-0.1.8.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.7-0.1.8.php deleted file mode 100644 index 6e25fd95fb2..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.7-0.1.8.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); -$installer->getConnection()->addKey( - $installer->getTable('bundle/option_value'), - 'UNQ_OPTION_STORE', - ['option_id', 'store_id'], - 'unique', -); -$installer->endSetup(); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.8-0.1.9.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.8-0.1.9.php deleted file mode 100644 index 8798111275c..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.8-0.1.9.php +++ /dev/null @@ -1,38 +0,0 @@ -startSetup(); - -$attributes = [ - $installer->getAttributeId('catalog_product', 'cost'), -]; - -$sql = $installer->getConnection()->quoteInto("SELECT * FROM `{$installer->getTable('catalog/eav_attribute')}` WHERE attribute_id IN (?)", $attributes); -$data = $installer->getConnection()->fetchAll($sql); - -foreach ($data as $row) { - $row['apply_to'] = array_flip(explode(',', $row['apply_to'])); - unset($row['apply_to']['bundle']); - $row['apply_to'] = implode(',', array_flip($row['apply_to'])); - - $installer->run("UPDATE `{$installer->getTable('catalog/eav_attribute')}` - SET `apply_to` = '{$row['apply_to']}' - WHERE `attribute_id` = {$row['attribute_id']}"); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.9-0.1.10.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.9-0.1.10.php deleted file mode 100644 index e8f7af7d53c..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.9-0.1.10.php +++ /dev/null @@ -1,29 +0,0 @@ -startSetup(); - -$installer->run(" -INSERT IGNORE INTO `{$installer->getTable('catalog/product_relation')}` -SELECT - `parent_product_id`, - `product_id` -FROM `{$installer->getTable('bundle/selection')}`; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 0571b82742a..00000000000 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,948 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('bundle/option'), - 'FK_CATALOG_PRODUCT_BUNDLE_OPTION_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('bundle/option_value'), - 'FK_CATALOG_PRODUCT_BUNDLE_OPTION_VALUE_OPTION', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('bundle/price_index'), - 'FK_CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_CUSTOMER_GROUP', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('bundle/price_index'), - 'CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_CUSTOMER_GROUP', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('bundle/price_index'), - 'FK_CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('bundle/price_index'), - 'CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('bundle/price_index'), - 'FK_CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('bundle/price_index'), - 'CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('bundle/selection'), - 'FK_CATALOG_PRODUCT_BUNDLE_SELECTION_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('bundle/selection'), - 'FK_CATALOG_PRODUCT_BUNDLE_SELECTION_OPTION', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('bundle/selection_price'), - 'FK_BUNDLE_PRICE_SELECTION_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('bundle/selection_price'), - 'FK_BUNDLE_PRICE_SELECTION_WEBSITE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('bundle/option'), - 'FK_CATALOG_PRODUCT_BUNDLE_OPTION_PARENT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('bundle/option_value'), - 'UNQ_OPTION_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('bundle/option_value'), - 'FK_CATALOG_PRODUCT_BUNDLE_OPTION_VALUE_OPTION', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('bundle/price_index'), - 'IDX_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('bundle/price_index'), - 'IDX_CUSTOMER_GROUP', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('bundle/selection'), - 'FK_CATALOG_PRODUCT_BUNDLE_SELECTION_OPTION', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('bundle/selection'), - 'FK_CATALOG_PRODUCT_BUNDLE_SELECTION_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('bundle/selection_price'), - 'FK_BUNDLE_PRICE_SELECTION_WEBSITE', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('bundle/option') => [ - 'columns' => [ - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Option Id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Parent Id', - ], - 'required' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Required', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Position', - ], - 'type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Type', - ], - ], - 'comment' => 'Catalog Product Bundle Option', - ], - $installer->getTable('bundle/option_value') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Option Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store Id', - ], - 'title' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Title', - ], - ], - 'comment' => 'Catalog Product Bundle Option Value', - ], - $installer->getTable('bundle/selection') => [ - 'columns' => [ - 'selection_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Selection Id', - ], - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Option Id', - ], - 'parent_product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Parent Product Id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Product Id', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Position', - ], - 'is_default' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Default', - ], - 'selection_price_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Selection Price Type', - ], - 'selection_price_value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Selection Price Value', - ], - 'selection_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Selection Qty', - ], - 'selection_can_change_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Selection Can Change Qty', - ], - ], - 'comment' => 'Catalog Product Bundle Selection', - ], - $installer->getTable('bundle/selection_price') => [ - 'columns' => [ - 'selection_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Selection Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'selection_price_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Selection Price Type', - ], - 'selection_price_value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Selection Price Value', - ], - ], - 'comment' => 'Catalog Product Bundle Selection Price', - ], - $installer->getTable('bundle/price_index') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Customer Group Id', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'comment' => 'Min Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'comment' => 'Max Price', - ], - ], - 'comment' => 'Catalog Product Bundle Price Index', - ], - $installer->getTable('bundle/stock_index') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'stock_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Stock Id', - ], - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Option Id', - ], - 'stock_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'default' => '0', - 'comment' => 'Stock Status', - ], - ], - 'comment' => 'Catalog Product Bundle Stock Index', - ], - $installer->getTable('bundle/price_indexer_idx') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Customer Group Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'tax_class_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Tax Class Id', - ], - 'price_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Price Type', - ], - 'special_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Special Price', - ], - 'tier_percent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Percent', - ], - 'orig_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Orig Price', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - 'base_tier' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Tier', - ], - ], - 'comment' => 'Catalog Product Index Price Bundle Idx', - ], - $installer->getTable('bundle/price_indexer_tmp') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Customer Group Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'tax_class_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Tax Class Id', - ], - 'price_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Price Type', - ], - 'special_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Special Price', - ], - 'tier_percent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Percent', - ], - 'orig_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Orig Price', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - 'base_tier' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Tier', - ], - ], - 'comment' => 'Catalog Product Index Price Bundle Tmp', - 'engine' => 'InnoDB', - ], - $installer->getTable('bundle/selection_indexer_idx') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Customer Group Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Option Id', - ], - 'selection_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Selection Id', - ], - 'group_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Group Type', - ], - 'is_required' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Is Required', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - ], - 'comment' => 'Catalog Product Index Price Bundle Sel Idx', - ], - $installer->getTable('bundle/selection_indexer_tmp') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Customer Group Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Option Id', - ], - 'selection_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Selection Id', - ], - 'group_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Group Type', - ], - 'is_required' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Is Required', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - ], - 'comment' => 'Catalog Product Index Price Bundle Sel Tmp', - 'engine' => 'InnoDB', - ], - $installer->getTable('bundle/option_indexer_idx') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Customer Group Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Option Id', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'alt_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Alt Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - 'alt_tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Alt Tier Price', - ], - ], - 'comment' => 'Catalog Product Index Price Bundle Opt Idx', - ], - $installer->getTable('bundle/option_indexer_tmp') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Customer Group Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Option Id', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'alt_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Alt Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - 'alt_tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Alt Tier Price', - ], - ], - 'comment' => 'Catalog Product Index Price Bundle Opt Tmp', - 'engine' => 'InnoDB', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('bundle/option'), - $installer->getIdxName('bundle/option', ['parent_id']), - ['parent_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('bundle/option_value'), - $installer->getIdxName( - 'bundle/option_value', - ['option_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['option_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('bundle/price_index'), - $installer->getIdxName('bundle/price_index', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('bundle/price_index'), - $installer->getIdxName('bundle/price_index', ['customer_group_id']), - ['customer_group_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('bundle/selection'), - $installer->getIdxName('bundle/selection', ['option_id']), - ['option_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('bundle/selection'), - $installer->getIdxName('bundle/selection', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('bundle/selection_price'), - $installer->getIdxName('bundle/selection_price', ['website_id']), - ['website_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('bundle/selection', 'option_id', 'bundle/option', 'option_id'), - $installer->getTable('bundle/selection'), - 'option_id', - $installer->getTable('bundle/option'), - 'option_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('bundle/option', 'parent_id', 'catalog/product', 'entity_id'), - $installer->getTable('bundle/option'), - 'parent_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('bundle/option_value', 'option_id', 'bundle/option', 'option_id'), - $installer->getTable('bundle/option_value'), - 'option_id', - $installer->getTable('bundle/option'), - 'option_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('bundle/price_index', 'customer_group_id', 'customer/customer_group', 'customer_group_id'), - $installer->getTable('bundle/price_index'), - 'customer_group_id', - $installer->getTable('customer/customer_group'), - 'customer_group_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('bundle/price_index', 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable('bundle/price_index'), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('bundle/price_index', 'website_id', 'core/website', 'website_id'), - $installer->getTable('bundle/price_index'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('bundle/selection', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('bundle/selection'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('bundle/selection_price', 'website_id', 'core/website', 'website_id'), - $installer->getTable('bundle/selection_price'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('bundle/selection_price', 'selection_id', 'bundle/selection', 'selection_id'), - $installer->getTable('bundle/selection_price'), - 'selection_id', - $installer->getTable('bundle/selection'), - 'selection_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-0.7.57-0.7.58.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-0.7.57-0.7.58.php deleted file mode 100644 index 76b87e90c27..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-0.7.57-0.7.58.php +++ /dev/null @@ -1,18 +0,0 @@ -startSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-1.4.0.0.28-1.4.0.0.29.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-1.4.0.0.28-1.4.0.0.29.php deleted file mode 100644 index 90bbd86125d..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-1.4.0.0.28-1.4.0.0.29.php +++ /dev/null @@ -1,18 +0,0 @@ -getEntityTypeId('catalog_product'); -$installer->updateAttribute($productEntityTypeId, 'sku', 'backend_model', 'catalog/product_attribute_backend_sku'); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 413e2c6df44..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,550 +0,0 @@ -startSetup(); - -if (!$installer->tableExists($installer->getTable('catalog_category_entity'))) { - $installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('catalog_category_entity')}; -CREATE TABLE {$this->getTable('catalog_category_entity')} ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `parent_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_catalog_category_ENTITY_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_catalog_category_ENTITY_STORE` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Category Entities'; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_category_entity_datetime')}; -CREATE TABLE {$this->getTable('catalog_category_entity_datetime')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`), - KEY `FK_ATTRIBUTE_DATETIME_ENTITY` (`entity_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_DATETIME_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('catalog_category_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DATETIME_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_category_entity_decimal')}; -CREATE TABLE {$this->getTable('catalog_category_entity_decimal')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`), - KEY `FK_ATTRIBUTE_DECIMAL_ENTITY` (`entity_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('catalog_category_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_category_entity_int')}; -CREATE TABLE {$this->getTable('catalog_category_entity_int')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`), - KEY `FK_ATTRIBUTE_INT_ENTITY` (`entity_id`), - KEY `FK_CATALOG_CATEGORY_EMTITY_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_CATEGORY_EMTITY_INT_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('catalog_category_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_category_entity_text')}; -CREATE TABLE {$this->getTable('catalog_category_entity_text')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`), - KEY `FK_ATTRIBUTE_TEXT_ENTITY` (`entity_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_TEXT_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_TEXT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('catalog_category_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_TEXT_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_category_entity_varchar')}; -CREATE TABLE {$this->getTable('catalog_category_entity_varchar')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_BASE` USING BTREE (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`), - KEY `FK_ATTRIBUTE_VARCHAR_ENTITY` (`entity_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('catalog_category_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_category_product')}; -CREATE TABLE {$this->getTable('catalog_category_product')} ( - `category_id` int(10) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `position` int(10) unsigned NOT NULL default '0', - KEY `CATALOG_CATEGORY_PRODUCT_CATEGORY` (`category_id`), - KEY `CATALOG_CATEGORY_PRODUCT_PRODUCT` (`product_id`), - CONSTRAINT `CATALOG_CATEGORY_PRODUCT_CATEGORY` FOREIGN KEY (`category_id`) REFERENCES {$this->getTable('catalog_category_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `CATALOG_CATEGORY_PRODUCT_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_compare_item')}; -CREATE TABLE {$this->getTable('catalog_compare_item')} ( - `catalog_compare_item_id` int(11) unsigned NOT NULL auto_increment, - `visitor_id` int(11) unsigned NOT NULL default '0', - `customer_id` int(11) unsigned default NULL, - `product_id` int(11) unsigned NOT NULL default '0', - PRIMARY KEY (`catalog_compare_item_id`), - KEY `FK_CATALOG_COMPARE_ITEM_CUSTOMER` (`customer_id`), - KEY `FK_CATALOG_COMPARE_ITEM_PRODUCT` (`product_id`), - CONSTRAINT `FK_CATALOG_COMPARE_ITEM_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES {$this->getTable('customer_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_COMPARE_ITEM_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_bundle_option')}; -CREATE TABLE {$this->getTable('catalog_product_bundle_option')} ( - `option_id` int(10) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`option_id`), - KEY `FK_catalog_product_bundle_option` (`product_id`), - CONSTRAINT `FK_catalog_product_bundle_option` FOREIGN KEY (`product_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_bundle_option_link')}; -CREATE TABLE {$this->getTable('catalog_product_bundle_option_link')} ( - `link_id` int(10) unsigned NOT NULL auto_increment, - `option_id` int(10) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `discount` decimal(10,4) unsigned default NULL, - PRIMARY KEY (`link_id`), - KEY `FK_catalog_product_bundle_option_link` (`option_id`), - KEY `FK_catalog_product_bundle_option_link_entity` (`product_id`), - CONSTRAINT `FK_catalog_product_bundle_option_link` FOREIGN KEY (`option_id`) REFERENCES {$this->getTable('catalog_product_bundle_option')} (`option_id`) ON DELETE CASCADE, - CONSTRAINT `FK_catalog_product_bundle_option_link_entity` FOREIGN KEY (`product_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_bundle_option_value')}; -CREATE TABLE {$this->getTable('catalog_product_bundle_option_value')} ( - `value_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned NOT NULL default '0', - `option_id` int(10) unsigned NOT NULL default '0', - `label` varchar(255) default NULL, - `position` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_catalog_product_bundle_option_label` (`option_id`), - CONSTRAINT `FK_catalog_product_bundle_option_label` FOREIGN KEY (`option_id`) REFERENCES {$this->getTable('catalog_product_bundle_option')} (`option_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_entity')}; -CREATE TABLE {$this->getTable('catalog_product_entity')} ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `parent_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `type_id` tinyint(3) unsigned NOT NULL default '1', - `sku` varchar (64) default NULL, - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_ATTRIBUTE_SET_ID` (`attribute_set_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_STORE_ID` (`store_id`), - KEY `sku` (`sku`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_ATTRIBUTE_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES {$this->getTable('eav_attribute_set')} (`attribute_set_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Product Entities'; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_entity_datetime')}; -CREATE TABLE {$this->getTable('catalog_product_entity_datetime')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_DATETIME_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_DATETIME_STORE` (`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_DATETIME_PRODUCT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DATETIME_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DATETIME_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_entity_decimal')}; -CREATE TABLE {$this->getTable('catalog_product_entity_decimal')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_STORE` (`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_PRODUCT_ENTITY` (`entity_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_ATTRIBUTE` (`attribute_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_entity_gallery')}; -CREATE TABLE {$this->getTable('catalog_product_entity_gallery')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `position` int(11) NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `IDX_BASE` USING BTREE (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`), - KEY `FK_ATTRIBUTE_GALLERY_ENTITY` (`entity_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_GALLERY_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_GALLERY_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_GALLERY_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_GALLERY_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_GALLERY_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_entity_int')}; -CREATE TABLE {$this->getTable('catalog_product_entity_int')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` mediumint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_INT_STORE` (`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_INT_PRODUCT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_INT_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_INT_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_entity_text')}; -CREATE TABLE {$this->getTable('catalog_product_entity_text')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` mediumint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_TEXT_STORE` (`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_TEXT_PRODUCT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TEXT_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TEXT_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_entity_tier_price')}; -CREATE TABLE {$this->getTable('catalog_product_entity_tier_price')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` mediumint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `qty` smallint(5) unsigned NOT NULL default '1', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_STORE` (`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_PRODUCT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_entity_varchar')}; -CREATE TABLE {$this->getTable('catalog_product_entity_varchar')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` mediumint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_STORE` (`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_PRODUCT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_link')}; -CREATE TABLE {$this->getTable('catalog_product_link')} ( - `link_id` int(11) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - `linked_product_id` int(10) unsigned NOT NULL default '0', - `link_type_id` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`link_id`), - KEY `FK_LINK_PRODUCT` (`product_id`), - KEY `FK_LINKED_PRODUCT` (`linked_product_id`), - KEY `FK_PRODUCT_LINK_TYPE` (`link_type_id`), - CONSTRAINT `FK_PRODUCT_LINK_LINKED_PRODUCT` FOREIGN KEY (`linked_product_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_PRODUCT_LINK_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_PRODUCT_LINK_TYPE` FOREIGN KEY (`link_type_id`) REFERENCES {$this->getTable('catalog_product_link_type')} (`link_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Related products'; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_link_attribute')}; -CREATE TABLE {$this->getTable('catalog_product_link_attribute')} ( - `product_link_attribute_id` smallint(6) unsigned NOT NULL auto_increment, - `link_type_id` tinyint(3) unsigned NOT NULL default '0', - `product_link_attribute_code` varchar(32) NOT NULL default '', - `data_type` varchar(32) NOT NULL default '', - PRIMARY KEY (`product_link_attribute_id`), - KEY `FK_ATTRIBUTE_PRODUCT_LINK_TYPE` (`link_type_id`), - CONSTRAINT `FK_ATTRIBUTE_PRODUCT_LINK_TYPE` FOREIGN KEY (`link_type_id`) REFERENCES {$this->getTable('catalog_product_link_type')} (`link_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Attributes for product link'; - -insert into {$this->getTable('catalog_product_link_attribute')}(`product_link_attribute_id`,`link_type_id`,`product_link_attribute_code`,`data_type`) values (1,2,'qty','decimal'),(2,1,'position','int'),(3,4,'position','int'),(4,5,'position','int'),(6,1,'qty','decimal'),(7,3,'position','int'),(8,3,'qty','decimal'); - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_link_attribute_decimal')}; -CREATE TABLE {$this->getTable('catalog_product_link_attribute_decimal')} ( - `value_id` int(11) unsigned NOT NULL auto_increment, - `product_link_attribute_id` smallint(6) unsigned default NULL, - `link_id` int(11) unsigned default NULL, - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_DECIMAL_PRODUCT_LINK_ATTRIBUTE` (`product_link_attribute_id`), - KEY `FK_DECIMAL_LINK` (`link_id`), - CONSTRAINT `FK_DECIMAL_LINK` FOREIGN KEY (`link_id`) REFERENCES {$this->getTable('catalog_product_link')} (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_DECIMAL_PRODUCT_LINK_ATTRIBUTE` FOREIGN KEY (`product_link_attribute_id`) REFERENCES {$this->getTable('catalog_product_link_attribute')} (`product_link_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Decimal attributes values'; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_link_attribute_int')}; -CREATE TABLE {$this->getTable('catalog_product_link_attribute_int')} ( - `value_id` int(11) unsigned NOT NULL auto_increment, - `product_link_attribute_id` smallint(6) unsigned default NULL, - `link_id` int(11) unsigned default NULL, - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_INT_PRODUCT_LINK_ATTRIBUTE` (`product_link_attribute_id`), - KEY `FK_INT_PRODUCT_LINK` (`link_id`), - CONSTRAINT `FK_INT_PRODUCT_LINK` FOREIGN KEY (`link_id`) REFERENCES {$this->getTable('catalog_product_link')} (`link_id`) ON DELETE CASCADE, - CONSTRAINT `FK_INT_PRODUCT_LINK_ATTRIBUTE` FOREIGN KEY (`product_link_attribute_id`) REFERENCES {$this->getTable('catalog_product_link_attribute')} (`product_link_attribute_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_link_attribute_varchar')}; -CREATE TABLE {$this->getTable('catalog_product_link_attribute_varchar')} ( - `value_id` int(11) unsigned NOT NULL auto_increment, - `product_link_attribute_id` smallint(6) unsigned NOT NULL default '0', - `link_id` int(11) unsigned default NULL, - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_VARCHAR_PRODUCT_LINK_ATTRIBUTE` (`product_link_attribute_id`), - KEY `FK_VARCHAR_LINK` (`link_id`), - CONSTRAINT `FK_VARCHAR_LINK` FOREIGN KEY (`link_id`) REFERENCES {$this->getTable('catalog_product_link')} (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_VARCHAR_PRODUCT_LINK_ATTRIBUTE` FOREIGN KEY (`product_link_attribute_id`) REFERENCES {$this->getTable('catalog_product_link_attribute')} (`product_link_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Varchar attributes values'; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_link_type')}; -CREATE TABLE {$this->getTable('catalog_product_link_type')} ( - `link_type_id` tinyint(3) unsigned NOT NULL auto_increment, - `code` varchar(32) NOT NULL default '', - PRIMARY KEY (`link_type_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Types of product link(Related, superproduct, bundles)'; - -insert into {$this->getTable('catalog_product_link_type')}(`link_type_id`,`code`) values (1,'relation'),(2,'bundle'),(3,'super'),(4,'up_sell'),(5,'cross_sell'); - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_status')}; -CREATE TABLE {$this->getTable('catalog_product_status')} ( - `status_id` tinyint(3) unsigned NOT NULL auto_increment, - `status_code` varchar(32) NOT NULL default '', - PRIMARY KEY (`status_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Available product statuses'; - -insert into {$this->getTable('catalog_product_status')}(`status_id`,`status_code`) values (1,'Enabled'),(2,'Disabled'),(3,'Out-of-stock'); - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_store')}; -CREATE TABLE {$this->getTable('catalog_product_store')} ( - `store_id` smallint(5) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - UNIQUE KEY `IDX_PS_UNIQ` (`store_id`,`product_id`), - KEY `store_id` (`store_id`), - KEY `FK_CATALOG_PRDUCT_STORE_PRODUCT` (`product_id`), - CONSTRAINT `FK_CATALOG_PRDUCT_STORE_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRDUCT_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_super_attribute')}; -CREATE TABLE {$this->getTable('catalog_product_super_attribute')} ( - `product_super_attribute_id` int(10) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `position` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`product_super_attribute_id`), - KEY `FK_SUPER_PRODUCT_ATTRIBUTE_PRODUCT` (`product_id`), - CONSTRAINT `FK_SUPER_PRODUCT_ATTRIBUTE_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_super_attribute_label')}; -CREATE TABLE {$this->getTable('catalog_product_super_attribute_label')} ( - `value_id` int(10) unsigned NOT NULL auto_increment, - `product_super_attribute_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `value` varchar(255) character set utf8 NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_SUPER_PRODUCT_ATTRIBUTE_LABEL` (`product_super_attribute_id`), - CONSTRAINT `FK_SUPER_PRODUCT_ATTRIBUTE_LABEL` FOREIGN KEY (`product_super_attribute_id`) REFERENCES {$this->getTable('catalog_product_super_attribute')} (`product_super_attribute_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_super_attribute_pricing')}; -CREATE TABLE {$this->getTable('catalog_product_super_attribute_pricing')} ( - `value_id` int(10) unsigned NOT NULL auto_increment, - `product_super_attribute_id` int(10) unsigned NOT NULL default '0', - `value_index` varchar(255) character set utf8 NOT NULL default '', - `is_percent` tinyint(1) unsigned default '0', - `pricing_value` decimal(10,4) default NULL, - PRIMARY KEY (`value_id`), - KEY `FK_SUPER_PRODUCT_ATTRIBUTE_PRICING` (`product_super_attribute_id`), - CONSTRAINT `FK_SUPER_PRODUCT_ATTRIBUTE_PRICING` FOREIGN KEY (`product_super_attribute_id`) REFERENCES {$this->getTable('catalog_product_super_attribute')} (`product_super_attribute_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_super_link')}; -CREATE TABLE {$this->getTable('catalog_product_super_link')} ( - `link_id` int(10) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - `parent_id` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`link_id`), - KEY `FK_SUPER_PRODUCT_LINK_PARENT` (`parent_id`), - KEY `FK_catalog_product_super_link` (`product_id`), - CONSTRAINT `FK_SUPER_PRODUCT_LINK_ENTITY` FOREIGN KEY (`product_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE, - CONSTRAINT `FK_SUPER_PRODUCT_LINK_PARENT` FOREIGN KEY (`parent_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_type')}; -CREATE TABLE {$this->getTable('catalog_product_type')} ( - `type_id` tinyint(3) unsigned NOT NULL auto_increment, - `code` varchar(32) NOT NULL default '', - PRIMARY KEY (`type_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -insert into {$this->getTable('catalog_product_type')}(`type_id`,`code`) values (1,'Simple Product'),(2,'bundle'),(3,'Configurable Product'),(4,'Grouped Product'); - --- DROP TABLE IF EXISTS {$this->getTable('catalog_product_visibility')}; -CREATE TABLE {$this->getTable('catalog_product_visibility')} ( - `visibility_id` tinyint(3) unsigned NOT NULL auto_increment, - `visibility_code` varchar(32) NOT NULL default '', - PRIMARY KEY (`visibility_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Available product visibility'; - -insert into {$this->getTable('catalog_product_visibility')}(`visibility_id`,`visibility_code`) values (1,'Nowhere'),(2,'Catalog'),(3,'Search'),(4,'Catalog, Search'); - -ALTER TABLE `{$this->getTable('catalog_category_entity')}` ADD `path` VARCHAR( 255 ) NOT NULL, ADD `position` INT NOT NULL; - -ALTER TABLE `{$installer->getTable('catalog_category_entity')}` ADD `level` INT NOT NULL; -ALTER TABLE `{$installer->getTable('catalog_category_entity')}` ADD INDEX `IDX_LEVEL` ( `level` ); - - -CREATE TABLE `{$installer->getTable('catalog_category_product_index')}` ( - `category_id` int(10) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `position` int(10) unsigned NOT NULL default '0', - `is_parent` tinyint(1) unsigned NOT NULL default '0', - UNIQUE KEY `UNQ_CATEGORY_PRODUCT` (`category_id`,`product_id`), - KEY `IDX_CATEGORY_POSITION` (`category_id`,`position`), - CONSTRAINT `FK_CATALOG_CATEGORY_PRODUCT_INDEX_PRODUCT_ENTITY` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_PRODUCT_INDEX_CATEGORY_ENTITY` FOREIGN KEY (`category_id`) REFERENCES `{$installer->getTable('catalog_category_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('catalog_product_enabled_index')}` ( - `product_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `visibility` smallint(5) unsigned NOT NULL default '0', - UNIQUE KEY `UNQ_PRODUCT_STORE` (`product_id`,`store_id`), - KEY `IDX_PRODUCT_VISIBILITY_IN_STORE` (`product_id`,`store_id`, `visibility`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENABLED_INDEX_PRODUCT_ENTITY` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENABLED_INDEX_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `{$this->getTable('catalog_category_entity')}` ADD `children_count` INT NOT NULL; - -"); -} - -$installer->endSetup(); - -$installer->installEntities(); - -// Create Root Catalog Node -Mage::getModel('catalog/category') - ->setId(1) - ->setPath(1) - ->setName('Root Catalog') - ->setInitialSetupFlag(true) - ->save(); - -$category = Mage::getModel('catalog/category'); -/** @var Mage_Catalog_Model_Category $category */ - -$category->setStoreId(0) - ->setName('Default Category') - ->setDisplayMode('PRODUCTS') - ->setAttributeSetId($category->getDefaultAttributeSetId()) - ->setIsActive(1) - ->setPath('1/') - ->setInitialSetupFlag(true) - ->save(); - -$category->setStoreId(1) - ->save(); - -$installer->setConfigData('catalog/category/root_id', $category->getId()); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-1.4.0.0.0.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-1.4.0.0.0.php deleted file mode 100644 index 585ff3f0c4f..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-1.4.0.0.0.php +++ /dev/null @@ -1,783 +0,0 @@ -startSetup(); - -if (!$installer->tableExists($installer->getTable('catalog_category_entity'))) { - $installer->run(" - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_category_entity')}; -CREATE TABLE {$installer->getTable('catalog_category_entity')} ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `parent_id` int(10) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `path` varchar(255) NOT NULL, - `position` int(11) NOT NULL, - `level` int(11) NOT NULL, - `children_count` int(11) NOT NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_LEVEL` (`level`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Category Entities'; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_category_entity_datetime')}; -CREATE TABLE {$installer->getTable('catalog_category_entity_datetime')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`), - KEY `FK_ATTRIBUTE_DATETIME_ENTITY` (`entity_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_DATETIME_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$installer->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$installer->getTable('catalog_category_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DATETIME_STORE` FOREIGN KEY (`store_id`) REFERENCES {$installer->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_category_entity_decimal')}; -CREATE TABLE {$installer->getTable('catalog_category_entity_decimal')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`), - KEY `FK_ATTRIBUTE_DECIMAL_ENTITY` (`entity_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$installer->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$installer->getTable('catalog_category_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_STORE` FOREIGN KEY (`store_id`) REFERENCES {$installer->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_category_entity_int')}; -CREATE TABLE {$installer->getTable('catalog_category_entity_int')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`), - KEY `FK_ATTRIBUTE_INT_ENTITY` (`entity_id`), - KEY `FK_CATALOG_CATEGORY_EMTITY_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_CATEGORY_EMTITY_INT_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$installer->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$installer->getTable('catalog_category_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_STORE` FOREIGN KEY (`store_id`) REFERENCES {$installer->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_category_entity_text')}; -CREATE TABLE {$installer->getTable('catalog_category_entity_text')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`), - KEY `FK_ATTRIBUTE_TEXT_ENTITY` (`entity_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_TEXT_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$installer->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_TEXT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$installer->getTable('catalog_category_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_TEXT_STORE` FOREIGN KEY (`store_id`) REFERENCES {$installer->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_category_entity_varchar')}; -CREATE TABLE {$installer->getTable('catalog_category_entity_varchar')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_BASE` USING BTREE (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`), - KEY `FK_ATTRIBUTE_VARCHAR_ENTITY` (`entity_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$installer->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$installer->getTable('catalog_category_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_STORE` FOREIGN KEY (`store_id`) REFERENCES {$installer->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_category_product')}; -CREATE TABLE {$installer->getTable('catalog_category_product')} ( - `category_id` int(10) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `position` int(10) unsigned NOT NULL default '0', - UNIQUE KEY `UNQ_CATEGORY_PRODUCT` (`category_id`,`product_id`), - KEY `CATALOG_CATEGORY_PRODUCT_CATEGORY` (`category_id`), - KEY `CATALOG_CATEGORY_PRODUCT_PRODUCT` (`product_id`), - CONSTRAINT `CATALOG_CATEGORY_PRODUCT_CATEGORY` FOREIGN KEY (`category_id`) REFERENCES {$installer->getTable('catalog_category_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `CATALOG_CATEGORY_PRODUCT_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES {$installer->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_compare_item')}; -CREATE TABLE {$installer->getTable('catalog_compare_item')} ( - `catalog_compare_item_id` int(11) unsigned NOT NULL auto_increment, - `visitor_id` int(11) unsigned NOT NULL default '0', - `customer_id` int(11) unsigned default NULL, - `product_id` int(11) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned DEFAULT NULL, - PRIMARY KEY (`catalog_compare_item_id`), - KEY `FK_CATALOG_COMPARE_ITEM_CUSTOMER` (`customer_id`), - KEY `FK_CATALOG_COMPARE_ITEM_PRODUCT` (`product_id`), - KEY `IDX_VISITOR_PRODUCTS` (`visitor_id`,`product_id`), - KEY `IDX_CUSTOMER_PRODUCTS` (`customer_id`,`product_id`), - KEY `FK_CATALOG_COMPARE_ITEM_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_COMPARE_ITEM_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES {$installer->getTable('customer_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_COMPARE_ITEM_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES {$installer->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_COMPARE_ITEM_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_bundle_option')}; -CREATE TABLE {$installer->getTable('catalog_product_bundle_option')} ( - `option_id` int(10) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`option_id`), - KEY `FK_catalog_product_bundle_option` (`product_id`), - CONSTRAINT `FK_catalog_product_bundle_option` FOREIGN KEY (`product_id`) REFERENCES {$installer->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_bundle_option_link')}; -CREATE TABLE {$installer->getTable('catalog_product_bundle_option_link')} ( - `link_id` int(10) unsigned NOT NULL auto_increment, - `option_id` int(10) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `discount` decimal(10,4) unsigned default NULL, - PRIMARY KEY (`link_id`), - KEY `FK_catalog_product_bundle_option_link` (`option_id`), - KEY `FK_catalog_product_bundle_option_link_entity` (`product_id`), - CONSTRAINT `FK_catalog_product_bundle_option_link` FOREIGN KEY (`option_id`) REFERENCES {$installer->getTable('catalog_product_bundle_option')} (`option_id`) ON DELETE CASCADE, - CONSTRAINT `FK_catalog_product_bundle_option_link_entity` FOREIGN KEY (`product_id`) REFERENCES {$installer->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_bundle_option_value')}; -CREATE TABLE {$installer->getTable('catalog_product_bundle_option_value')} ( - `value_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned NOT NULL default '0', - `option_id` int(10) unsigned NOT NULL default '0', - `label` varchar(255) default NULL, - `position` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_catalog_product_bundle_option_label` (`option_id`), - CONSTRAINT `FK_catalog_product_bundle_option_label` FOREIGN KEY (`option_id`) REFERENCES {$installer->getTable('catalog_product_bundle_option')} (`option_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_entity')}; -CREATE TABLE {$installer->getTable('catalog_product_entity')} ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `type_id` varchar(32) NOT NULL DEFAULT 'simple', - `sku` varchar (64) default NULL, - `has_options` smallint(1) NOT NULL DEFAULT '0', - `required_options` tinyint(1) unsigned NOT NULL DEFAULT '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`entity_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_ATTRIBUTE_SET_ID` (`attribute_set_id`), - KEY `sku` (`sku`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_ATTRIBUTE_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES {$installer->getTable('eav_attribute_set')} (`attribute_set_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES {$installer->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Product Entities'; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_entity_datetime')}; -CREATE TABLE {$installer->getTable('catalog_product_entity_datetime')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`,`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_DATETIME_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_DATETIME_STORE` (`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_DATETIME_PRODUCT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$installer->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DATETIME_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$installer->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DATETIME_STORE` FOREIGN KEY (`store_id`) REFERENCES {$installer->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_entity_decimal')}; -CREATE TABLE {$installer->getTable('catalog_product_entity_decimal')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`,`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_STORE` (`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_PRODUCT_ENTITY` (`entity_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_ATTRIBUTE` (`attribute_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$installer->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$installer->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_STORE` FOREIGN KEY (`store_id`) REFERENCES {$installer->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_entity_gallery')}; -CREATE TABLE {$installer->getTable('catalog_product_entity_gallery')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `position` int(11) NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`), - KEY `FK_ATTRIBUTE_GALLERY_ENTITY` (`entity_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_GALLERY_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_CATEGORY_ENTITY_GALLERY_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_GALLERY_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$installer->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_GALLERY_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$installer->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_GALLERY_STORE` FOREIGN KEY (`store_id`) REFERENCES {$installer->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_entity_int')}; -CREATE TABLE {$installer->getTable('catalog_product_entity_int')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` mediumint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`,`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_INT_STORE` (`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_INT_PRODUCT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$installer->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_INT_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$installer->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_INT_STORE` FOREIGN KEY (`store_id`) REFERENCES {$installer->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_entity_text')}; -CREATE TABLE {$installer->getTable('catalog_product_entity_text')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` mediumint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`,`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_TEXT_STORE` (`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_TEXT_PRODUCT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$installer->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TEXT_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$installer->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TEXT_STORE` FOREIGN KEY (`store_id`) REFERENCES {$installer->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_entity_tier_price')}; -CREATE TABLE {$installer->getTable('catalog_product_entity_tier_price')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_id` int(10) unsigned NOT NULL default '0', - `all_groups` tinyint (1)unsigned NOT NULL DEFAULT '1', - `customer_group_id` smallint(5) unsigned NOT NULL default '0', - `qty` decimal(12,4) NOT NULL default 1, - `value` decimal(12,4) NOT NULL default '0.0000', - `website_id` smallint(5) unsigned NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_PRODUCT_ENTITY` (`entity_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_GROUP` (`customer_group_id`), - KEY `FK_CATALOG_PRODUCT_TIER_WEBSITE` (`website_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$installer->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES {$installer->getTable('customer_group')} (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_TIER_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `{$installer->getTable('core_website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_entity_varchar')}; -CREATE TABLE {$installer->getTable('catalog_product_entity_varchar')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` mediumint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`,`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_STORE` (`store_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_PRODUCT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES {$installer->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$installer->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_STORE` FOREIGN KEY (`store_id`) REFERENCES {$installer->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_link')}; -CREATE TABLE {$installer->getTable('catalog_product_link')} ( - `link_id` int(11) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - `linked_product_id` int(10) unsigned NOT NULL default '0', - `link_type_id` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`link_id`), - KEY `FK_LINK_PRODUCT` (`product_id`), - KEY `FK_LINKED_PRODUCT` (`linked_product_id`), - KEY `FK_PRODUCT_LINK_TYPE` (`link_type_id`), - CONSTRAINT `FK_PRODUCT_LINK_LINKED_PRODUCT` FOREIGN KEY (`linked_product_id`) REFERENCES {$installer->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_PRODUCT_LINK_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES {$installer->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_PRODUCT_LINK_TYPE` FOREIGN KEY (`link_type_id`) REFERENCES {$installer->getTable('catalog_product_link_type')} (`link_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Related products'; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_link_attribute')}; -CREATE TABLE {$installer->getTable('catalog_product_link_attribute')} ( - `product_link_attribute_id` smallint(6) unsigned NOT NULL auto_increment, - `link_type_id` tinyint(3) unsigned NOT NULL default '0', - `product_link_attribute_code` varchar(32) NOT NULL default '', - `data_type` varchar(32) NOT NULL default '', - PRIMARY KEY (`product_link_attribute_id`), - KEY `FK_ATTRIBUTE_PRODUCT_LINK_TYPE` (`link_type_id`), - CONSTRAINT `FK_ATTRIBUTE_PRODUCT_LINK_TYPE` FOREIGN KEY (`link_type_id`) REFERENCES {$installer->getTable('catalog_product_link_type')} (`link_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Attributes for product link'; - -insert into {$installer->getTable('catalog_product_link_attribute')}(`product_link_attribute_id`,`link_type_id`,`product_link_attribute_code`,`data_type`) values (1,2,'qty','decimal'),(2,1,'position','int'),(3,4,'position','int'),(4,5,'position','int'),(6,1,'qty','decimal'),(7,3,'position','int'),(8,3,'qty','decimal'); - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_link_attribute_decimal')}; -CREATE TABLE {$installer->getTable('catalog_product_link_attribute_decimal')} ( - `value_id` int(11) unsigned NOT NULL auto_increment, - `product_link_attribute_id` smallint(6) unsigned default NULL, - `link_id` int(11) unsigned default NULL, - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_DECIMAL_PRODUCT_LINK_ATTRIBUTE` (`product_link_attribute_id`), - KEY `FK_DECIMAL_LINK` (`link_id`), - CONSTRAINT `FK_DECIMAL_LINK` FOREIGN KEY (`link_id`) REFERENCES {$installer->getTable('catalog_product_link')} (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_DECIMAL_PRODUCT_LINK_ATTRIBUTE` FOREIGN KEY (`product_link_attribute_id`) REFERENCES {$installer->getTable('catalog_product_link_attribute')} (`product_link_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Decimal attributes values'; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_link_attribute_int')}; -CREATE TABLE {$installer->getTable('catalog_product_link_attribute_int')} ( - `value_id` int(11) unsigned NOT NULL auto_increment, - `product_link_attribute_id` smallint(6) unsigned default NULL, - `link_id` int(11) unsigned default NULL, - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_INT_PRODUCT_LINK_ATTRIBUTE` (`product_link_attribute_id`), - KEY `FK_INT_PRODUCT_LINK` (`link_id`), - CONSTRAINT `FK_INT_PRODUCT_LINK` FOREIGN KEY (`link_id`) REFERENCES {$installer->getTable('catalog_product_link')} (`link_id`) ON DELETE CASCADE, - CONSTRAINT `FK_INT_PRODUCT_LINK_ATTRIBUTE` FOREIGN KEY (`product_link_attribute_id`) REFERENCES {$installer->getTable('catalog_product_link_attribute')} (`product_link_attribute_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_link_attribute_varchar')}; -CREATE TABLE {$installer->getTable('catalog_product_link_attribute_varchar')} ( - `value_id` int(11) unsigned NOT NULL auto_increment, - `product_link_attribute_id` smallint(6) unsigned NOT NULL default '0', - `link_id` int(11) unsigned default NULL, - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_VARCHAR_PRODUCT_LINK_ATTRIBUTE` (`product_link_attribute_id`), - KEY `FK_VARCHAR_LINK` (`link_id`), - CONSTRAINT `FK_VARCHAR_LINK` FOREIGN KEY (`link_id`) REFERENCES {$installer->getTable('catalog_product_link')} (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_VARCHAR_PRODUCT_LINK_ATTRIBUTE` FOREIGN KEY (`product_link_attribute_id`) REFERENCES {$installer->getTable('catalog_product_link_attribute')} (`product_link_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Varchar attributes values'; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_link_type')}; -CREATE TABLE {$installer->getTable('catalog_product_link_type')} ( - `link_type_id` tinyint(3) unsigned NOT NULL auto_increment, - `code` varchar(32) NOT NULL default '', - PRIMARY KEY (`link_type_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Types of product link(Related, superproduct, bundles)'; - -insert into {$installer->getTable('catalog_product_link_type')}(`link_type_id`,`code`) values (1,'relation'),(2,'bundle'),(3,'super'),(4,'up_sell'),(5,'cross_sell'); - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_super_attribute')}; -CREATE TABLE {$installer->getTable('catalog_product_super_attribute')} ( - `product_super_attribute_id` int(10) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `position` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`product_super_attribute_id`), - KEY `FK_SUPER_PRODUCT_ATTRIBUTE_PRODUCT` (`product_id`), - CONSTRAINT `FK_SUPER_PRODUCT_ATTRIBUTE_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES {$installer->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_super_attribute_label')}; -CREATE TABLE {$installer->getTable('catalog_product_super_attribute_label')} ( - `value_id` int(10) unsigned NOT NULL auto_increment, - `product_super_attribute_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `use_default` tinyint(1) unsigned DEFAULT '0', - `value` varchar(255) character set utf8 NOT NULL default '', - PRIMARY KEY (`value_id`), - UNIQUE KEY `UNQ_ATTRIBUTE_STORE` (`product_super_attribute_id`,`store_id`), - KEY `FK_SUPER_PRODUCT_ATTRIBUTE_LABEL` (`product_super_attribute_id`), - KEY `FK_CATALOG_PRODUCT_SUPER_ATTRIBUTE_LABEL_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_SUPER_ATTRIBUTE_LABEL_ATTRIBUTE` FOREIGN KEY (`product_super_attribute_id`) REFERENCES `{$installer->getTable('catalog_product_super_attribute')}` (`product_super_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_SUPER_ATTRIBUTE_LABEL_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_super_attribute_pricing')}; -CREATE TABLE {$installer->getTable('catalog_product_super_attribute_pricing')} ( - `value_id` int(10) unsigned NOT NULL auto_increment, - `product_super_attribute_id` int(10) unsigned NOT NULL default '0', - `value_index` varchar(255) character set utf8 NOT NULL default '', - `is_percent` tinyint(1) unsigned default '0', - `pricing_value` decimal(10,4) default NULL, - `website_id` smallint(5) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`value_id`), - KEY `FK_SUPER_PRODUCT_ATTRIBUTE_PRICING` (`product_super_attribute_id`), - KEY `FK_CATALOG_PRODUCT_SUPER_PRICE_WEBSITE` (`website_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_SUPER_PRICE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `{$installer->getTable('core/website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SUPER_PRODUCT_ATTRIBUTE_PRICING` FOREIGN KEY (`product_super_attribute_id`) REFERENCES `{$installer->getTable('catalog_product_super_attribute')}` (`product_super_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_super_link')}; -CREATE TABLE {$installer->getTable('catalog_product_super_link')} ( - `link_id` int(10) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - `parent_id` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`link_id`), - KEY `FK_SUPER_PRODUCT_LINK_PARENT` (`parent_id`), - KEY `FK_catalog_product_super_link` (`product_id`), - CONSTRAINT `FK_SUPER_PRODUCT_LINK_ENTITY` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SUPER_PRODUCT_LINK_PARENT` FOREIGN KEY (`parent_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_category_product_index')}; -CREATE TABLE `{$installer->getTable('catalog_category_product_index')}` ( - `category_id` int(10) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `position` int(10) unsigned NOT NULL default '0', - `is_parent` tinyint(1) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL DEFAULT '0', - `visibility` tinyint(3) unsigned NOT NULL, - UNIQUE KEY `UNQ_CATEGORY_PRODUCT` (`category_id`,`product_id`,`is_parent`,`store_id`), - KEY `FK_CATALOG_CATEGORY_PRODUCT_INDEX_CATEGORY_ENTITY` (`category_id`), - KEY `IDX_JOIN` (`product_id`,`store_id`,`category_id`,`visibility`), - KEY `IDX_BASE` (`store_id`,`category_id`,`visibility`,`is_parent`,`position`), - CONSTRAINT `FK_CATALOG_CATEGORY_PRODUCT_INDEX_PRODUCT_ENTITY` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_PRODUCT_INDEX_CATEGORY_ENTITY` FOREIGN KEY (`category_id`) REFERENCES `{$installer->getTable('catalog_category_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATEGORY_PRODUCT_INDEX_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_enabled_index')}; -CREATE TABLE `{$installer->getTable('catalog_product_enabled_index')}` ( - `product_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `visibility` smallint(5) unsigned NOT NULL default '0', - UNIQUE KEY `UNQ_PRODUCT_STORE` (`product_id`,`store_id`), - KEY `IDX_PRODUCT_VISIBILITY_IN_STORE` (`product_id`,`store_id`, `visibility`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENABLED_INDEX_PRODUCT_ENTITY` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENABLED_INDEX_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -update {$installer->getTable('eav_entity_attribute')} set `sort_order`=10 where `attribute_id`=(select `attribute_id` from {$installer->getTable('eav_attribute')} where `attribute_code`='tier_price'); - --- DROP TABLE IF EXISTS {$installer->getTable('catalog_product_website')}; -CREATE TABLE {$installer->getTable('catalog_product_website')} ( - `product_id` INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - PRIMARY KEY (`product_id`, `website_id`), - KEY `FK_CATALOG_PRODUCT_WEBSITE_WEBSITE` (`website_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_WEBSITE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `{$installer->getTable('core/website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_WEBSITE_PRODUCT_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT = DYNAMIC; - --- DROP TABLE IF EXISTS `{$installer->getTable('catalog_product_entity_media_gallery')}`; -CREATE TABLE `{$installer->getTable('catalog_product_entity_media_gallery')}` ( - `value_id` int(11) unsigned NOT NULL auto_increment, - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) default NULL, - PRIMARY KEY (`value_id`), - KEY `FK_CATALOG_PRODUCT_MEDIA_GALLERY_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_PRODUCT_MEDIA_GALLERY_ENTITY` (`entity_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog product media gallery'; - --- DROP TABLE IF EXISTS `{$installer->getTable('catalog_product_entity_media_gallery_value')}`; -CREATE TABLE `{$installer->getTable('catalog_product_entity_media_gallery_value')}` ( - `value_id` int(11) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `label` varchar(255) default NULL, - `position` int(11) unsigned default NULL, - `disabled` tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (`value_id`,`store_id`), - KEY `FK_CATALOG_PRODUCT_MEDIA_GALLERY_VALUE_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_VALUE_GALLERY` FOREIGN KEY (`value_id`) REFERENCES `{$installer->getTable('catalog_product_entity_media_gallery')}` (`value_id`) ON DELETE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_VALUE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog product media gallery values'; - -"); - - $installer->getConnection()->dropColumn($installer->getTable('eav_attribute'), 'use_in_super_product'); - - $installer->getConnection()->addColumn($installer->getTable('core_url_rewrite'), 'category_id', 'int unsigned NULL AFTER `store_id`'); - $installer->getConnection()->addColumn($installer->getTable('core_url_rewrite'), 'product_id', 'int unsigned NULL AFTER `category_id`'); - $installer->getConnection()->addConstraint('FK_CORE_URL_REWRITE_CATEGORY', $installer->getTable('core_url_rewrite'), 'category_id', $installer->getTable('catalog_category_entity'), 'entity_id'); - $installer->getConnection()->addConstraint('FK_CORE_URL_REWRITE_PRODUCT', $installer->getTable('core_url_rewrite'), 'product_id', $installer->getTable('catalog_product_entity'), 'entity_id'); - - $installer->run(" -UPDATE `{$installer->getTable('eav_attribute')}` SET `position` = 1 WHERE `position` = 0 AND `attribute_code` != 'price'; - --- DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_option')}`; -CREATE TABLE `{$installer->getTable('catalog/product_option')}` ( - `option_id` int(10) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - `type` varchar(50) NOT NULL default '', - `is_require` tinyint(1) NOT NULL default '1', - `sku` varchar(64) NOT NULL default '', - `max_characters` int(10) unsigned default NULL, - `file_extension` varchar(50) default NULL, - `image_size_x` smallint(5) unsigned NOT NULL, - `image_size_y` smallint(5) unsigned NOT NULL, - `sort_order` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`option_id`), - KEY `CATALOG_PRODUCT_OPTION_PRODUCT` (`product_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog/product')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -)ENGINE=InnoDB default CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_option_price')}`; -CREATE TABLE `{$installer->getTable('catalog/product_option_price')}` ( - `option_price_id` int(10) unsigned NOT NULL auto_increment, - `option_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `price` decimal(12,4) NOT NULL default '0.00', - `price_type` enum('fixed', 'percent') NOT NULL default 'fixed', - PRIMARY KEY (`option_price_id`), - KEY `CATALOG_PRODUCT_OPTION_PRICE_OPTION` (`option_id`), - KEY `CATALOG_PRODUCT_OPTION_TITLE_STORE` (`store_id`), - KEY `IDX_CATALOG_PRODUCT_OPTION_PRICE_SI_OI` (`store_id`,`option_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_PRICE_OPTION` FOREIGN KEY (`option_id`) REFERENCES `{$installer->getTable('catalog/product_option')}` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_PRICE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -)ENGINE=InnoDB default CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_option_title')}`; -CREATE TABLE `{$installer->getTable('catalog/product_option_title')}` ( - `option_title_id` int(10) unsigned NOT NULL auto_increment, - `option_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `title` VARCHAR(255) NOT NULL default '', - PRIMARY KEY (`option_title_id`), - KEY `CATALOG_PRODUCT_OPTION_TITLE_OPTION` (`option_id`), - KEY `CATALOG_PRODUCT_OPTION_TITLE_STORE` (`store_id`), - KEY `IDX_CATALOG_PRODUCT_OPTION_TITLE_SI_OI` (`store_id`,`option_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TITLE_OPTION` FOREIGN KEY (`option_id`) REFERENCES `{$installer->getTable('catalog/product_option')}` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TITLE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -)ENGINE=InnoDB default CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_option_type_value')}`; -CREATE TABLE `{$installer->getTable('catalog/product_option_type_value')}` ( - `option_type_id` int(10) unsigned NOT NULL auto_increment, - `option_id` int(10) unsigned NOT NULL default '0', - `sku` varchar(64) NOT NULL default '', - `sort_order` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`option_type_id`), - KEY `CATALOG_PRODUCT_OPTION_TYPE_VALUE_OPTION` (`option_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_VALUE_OPTION` FOREIGN KEY (`option_id`) REFERENCES `{$installer->getTable('catalog/product_option')}` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE -)ENGINE=InnoDB default CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_option_type_price')}`; -CREATE TABLE `{$installer->getTable('catalog/product_option_type_price')}` ( - `option_type_price_id` int(10) unsigned NOT NULL auto_increment, - `option_type_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `price` decimal(12,4) NOT NULL default '0.00', - `price_type` enum('fixed','percent') NOT NULL default 'fixed', - PRIMARY KEY (`option_type_price_id`), - KEY `CATALOG_PRODUCT_OPTION_TYPE_PRICE_OPTION_TYPE` (`option_type_id`), - KEY `CATALOG_PRODUCT_OPTION_TYPE_PRICE_STORE` (`store_id`), - KEY `IDX_CATALOG_PRODUCT_OPTION_TYPE_PRICE_SI_OTI` (`store_id`,`option_type_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_PRICE_OPTION` FOREIGN KEY (`option_type_id`) REFERENCES `{$installer->getTable('catalog/product_option_type_value')}` (`option_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_PRICE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -)ENGINE=InnoDB default CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_option_type_title')}`; -CREATE TABLE `{$installer->getTable('catalog/product_option_type_title')}` ( - `option_type_title_id` int(10) unsigned NOT NULL auto_increment, - `option_type_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `title` varchar(255) NOT NULL default '', - PRIMARY KEY (`option_type_title_id`), - KEY `CATALOG_PRODUCT_OPTION_TYPE_TITLE_OPTION` (`option_type_id`), - KEY `CATALOG_PRODUCT_OPTION_TYPE_TITLE_STORE` (`store_id`), - KEY `IDX_CATALOG_PRODUCT_OPTION_TYPE_TITLE_SI_OTI` (`store_id`,`option_type_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_TITLE_OPTION` FOREIGN KEY (`option_type_id`) REFERENCES `{$installer->getTable('catalog/product_option_type_value')}` (`option_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_TITLE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -)ENGINE=InnoDB default CHARSET=utf8; - - -ALTER TABLE `{$installer->getTable('core_url_rewrite')}` ADD INDEX `IDX_CATEGORY_REWRITE` (`category_id`, `is_system`, `product_id`, `store_id`, `id_path`); -"); - - $installer->run(" -CREATE TABLE `{$installer->getTable('catalog/eav_attribute')}` ( - `attribute_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, - `frontend_input_renderer` varchar(255) DEFAULT NULL, - `is_global` tinyint(1) unsigned NOT NULL DEFAULT '1', - `is_visible` tinyint(1) unsigned NOT NULL DEFAULT '1', - `is_searchable` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_filterable` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_comparable` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_visible_on_front` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_html_allowed_on_front` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_used_for_price_rules` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_filterable_in_search` tinyint(1) unsigned NOT NULL DEFAULT '0', - `used_in_product_listing` tinyint(1) unsigned NOT NULL DEFAULT '0', - `used_for_sort_by` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_configurable` tinyint(1) unsigned NOT NULL DEFAULT '1', - `apply_to` varchar(255) NOT NULL, - `is_visible_in_advanced_search` tinyint(1) unsigned NOT NULL DEFAULT '0', - `position` int(11) NOT NULL, - PRIMARY KEY (`attribute_id`), - KEY `IDX_USED_FOR_SORT_BY` (`used_for_sort_by`), - KEY `IDX_USED_IN_PRODUCT_LISTING` (`used_in_product_listing`), - CONSTRAINT `FK_CATALOG_EAV_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav/attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); -} - -$installer->endSetup(); - -$installer->installEntities(); - -// Create Root Catalog Node -Mage::getModel('catalog/category') - ->setStoreId(0) - ->setId(1) - ->setPath(1) - ->setName('Root Catalog') - ->setInitialSetupFlag(true) - ->save(); - -/** @var Mage_Catalog_Model_Category $category */ -$category = Mage::getModel('catalog/category'); - -$category->setStoreId(0) - ->setName('Default Category') - ->setDisplayMode('PRODUCTS') - ->setAttributeSetId($category->getDefaultAttributeSetId()) - ->setIsActive(1) - ->setPath('1') - ->setInitialSetupFlag(true) - ->save(); - -$installer->setConfigData('catalog/category/root_id', $category->getId()); - -$installer->addAttributeGroup('catalog_product', 'Default', 'Design', 6); - -$entityTypeId = $installer->getEntityTypeId('catalog_category'); -$attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId); -$attributeGroupId = $installer->getDefaultAttributeGroupId($entityTypeId, $attributeSetId); - -// update General Group -$installer->updateAttributeGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'attribute_group_name', 'General Information'); -$installer->updateAttributeGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'sort_order', '10'); - -$groups = [ - 'display' => [ - 'name' => 'Display Settings', - 'sort' => 20, - 'id' => null, - ], - 'design' => [ - 'name' => 'Custom Design', - 'sort' => 30, - 'id' => null, - ], -]; - -foreach ($groups as $k => $groupProp) { - $installer->addAttributeGroup($entityTypeId, $attributeSetId, $groupProp['name'], $groupProp['sort']); - $groups[$k]['id'] = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, $groupProp['name']); -} - -// update attributes group and sort -$attributes = [ - 'custom_design' => [ - 'group' => 'design', - 'sort' => 10, - ], - 'custom_design_apply' => [ - 'group' => 'design', - 'sort' => 20, - ], - 'custom_design_from' => [ - 'group' => 'design', - 'sort' => 30, - ], - 'custom_design_to' => [ - 'group' => 'design', - 'sort' => 40, - ], - 'page_layout' => [ - 'group' => 'design', - 'sort' => 50, - ], - 'custom_layout_update' => [ - 'group' => 'design', - 'sort' => 60, - ], - 'display_mode' => [ - 'group' => 'display', - 'sort' => 10, - ], - 'landing_page' => [ - 'group' => 'display', - 'sort' => 20, - ], - 'is_anchor' => [ - 'group' => 'display', - 'sort' => 30, - ], - 'available_sort_by' => [ - 'group' => 'display', - 'sort' => 40, - ], - 'default_sort_by' => [ - 'group' => 'display', - 'sort' => 50, - ], -]; - -foreach ($attributes as $attributeCode => $attributeProp) { - $installer->addAttributeToGroup( - $entityTypeId, - $attributeSetId, - $groups[$attributeProp['group']]['id'], - $attributeCode, - $attributeProp['sort'], - ); -} - -$describe = $installer->getConnection()->describeTable($installer->getTable('catalog/eav_attribute')); -foreach ($describe as $columnData) { - if ($columnData['COLUMN_NAME'] == 'attribute_id') { - continue; - } - $installer->getConnection()->dropColumn($installer->getTable('eav/attribute'), $columnData['COLUMN_NAME']); -} diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.6.40-0.7.0.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.6.40-0.7.0.php deleted file mode 100644 index 56d0e316cbf..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.6.40-0.7.0.php +++ /dev/null @@ -1,20 +0,0 @@ -deleteConfigData('catalog/category/root_id', 'stores'); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 6ea8652d3d6..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup()->run(" - -ALTER TABLE {$this->getTable('catalog_product_entity_tier_price')} - ADD COLUMN `customer_group_id` smallint(5) unsigned NOT NULL default '0' AFTER `entity_id`, - ADD CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_GROUP` FOREIGN KEY (`customer_group_id`) - REFERENCES {$this->getTable('customer_group')} (`customer_group_id`) - ON DELETE CASCADE - ON UPDATE CASCADE; - -update {$this->getTable('catalog_product_entity_tier_price')} set `customer_group_id`=(select `customer_group_id` from {$this->getTable('customer_group')} limit 1); - -")->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index f7e52de74ee..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,18 +0,0 @@ -addAttributeGroup('catalog_product', 'Default', 'Design', 6); -$this->installEntities(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.11-0.7.12.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.11-0.7.12.php deleted file mode 100644 index fdca6d56506..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.11-0.7.12.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->installEntities(); -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.12-0.7.13.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.12-0.7.13.php deleted file mode 100644 index 95662354fd3..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.12-0.7.13.php +++ /dev/null @@ -1,19 +0,0 @@ -installEntities(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php deleted file mode 100644 index 04488b77dca..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php +++ /dev/null @@ -1,42 +0,0 @@ -getAttributeId('catalog_product', 'media_gallery'); - -$imagesAttributesIds = implode(',', [ - (int) $installer->getAttributeId('catalog_product', 'small_image'), - (int) $installer->getAttributeId('catalog_product', 'image'), - (int) $installer->getAttributeId('catalog_product', 'thumbnail'), -]); - -$installer->startSetup(); -$installer->run(" -INSERT INTO `{$installer->getTable('catalog_product_entity_media_gallery')}` (attribute_id, entity_id, value) - SELECT $mediaAttributeId as attribute_id, entity_id, `value` - FROM `{$installer->getTable('catalog_product_entity_gallery')}` - GROUP BY `value`; - -INSERT INTO `{$installer->getTable('catalog_product_entity_media_gallery')}` (attribute_id, entity_id, value) - SELECT $mediaAttributeId as attribute_id, entity_id, `value` - FROM `{$installer->getTable('catalog_product_entity_varchar')}` - WHERE attribute_id IN($imagesAttributesIds) AND store_id = 0 - GROUP BY `value`; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.14-0.7.15.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.14-0.7.15.php deleted file mode 100644 index 812f28cc46f..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.14-0.7.15.php +++ /dev/null @@ -1,22 +0,0 @@ -startSetup()->run(" -delete link1.* -from {$this->getTable('catalog_product_link')} link1 -inner join {$this->getTable('catalog_product_link')} link2 on link2.product_id=link1.product_id and link2.linked_product_id=link1.linked_product_id -and link2.link_id<>link1.link_id; -")->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.15-0.7.16.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.15-0.7.16.php deleted file mode 100644 index 21c8b3b50b3..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.15-0.7.16.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -$installer->run(" - ALTER TABLE `{$installer->getTable('catalog_product_entity')}` - CHANGE `type_id` `type_id` VARCHAR(32) DEFAULT 'simple' NOT NULL; - UPDATE `{$installer->getTable('catalog_product_entity')}` - SET `type_id` = CASE `type_id` - WHEN '1' THEN 'simple' - WHEN '2' THEN 'bundle' - WHEN '3' THEN 'configurable' - WHEN '4' THEN 'grouped' - WHEN '5' THEN 'virtual' - ELSE `type_id` END; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.16-0.7.17.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.16-0.7.17.php deleted file mode 100644 index 95662354fd3..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.16-0.7.17.php +++ /dev/null @@ -1,19 +0,0 @@ -installEntities(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.17-0.7.18.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.17-0.7.18.php deleted file mode 100644 index 6b9ef88f14e..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.17-0.7.18.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->updateAttribute('catalog_category', 'image', 'backend_model', 'catalog/category_attribute_backend_image'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.18-0.7.19.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.18-0.7.19.php deleted file mode 100644 index d0627378074..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.18-0.7.19.php +++ /dev/null @@ -1,26 +0,0 @@ -getEntityTypeId('catalog_product'); -$installer->run(" - UPDATE `{$installer->getTable('eav_attribute')}` - SET `apply_to` = IF(`use_in_super_product`, 'simple,grouped,configurable', 'simple') - WHERE `entity_type_id` = $entityTypeId; -"); -$installer->getConnection()->dropColumn($installer->getTable('eav_attribute'), 'use_in_super_product'); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.19-0.7.20.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.19-0.7.20.php deleted file mode 100644 index fdca6d56506..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.19-0.7.20.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->installEntities(); -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index 3a7901d71b0..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,23 +0,0 @@ -run(" - -update {$this->getTable('eav_entity_attribute')} set `sort_order`=10 where `attribute_id`=(select `attribute_id` from {$this->getTable('eav_attribute')} where `attribute_code`='tier_price'); - -alter table {$this->getTable('catalog_product_entity_tier_price')} add column `all_groups` tinyint (1)UNSIGNED DEFAULT '1' NOT NULL after `entity_id`; - -"); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.20-0.7.21.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.20-0.7.21.php deleted file mode 100644 index fcc78eb1531..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.20-0.7.21.php +++ /dev/null @@ -1,40 +0,0 @@ -getAttributeId('catalog_product', 'price'), - $installer->getAttributeId('catalog_product', 'special_price'), - $installer->getAttributeId('catalog_product', 'special_from_date'), - $installer->getAttributeId('catalog_product', 'special_to_date'), - $installer->getAttributeId('catalog_product', 'cost'), - $installer->getAttributeId('catalog_product', 'tier_price'), -]; - -$sql = $installer->getConnection()->quoteInto("SELECT * FROM `{$installer->getTable('eav_attribute')}` WHERE attribute_id IN (?)", $attributes); -$data = $installer->getConnection()->fetchAll($sql); - -foreach ($data as $row) { - $row['apply_to'] = array_flip(explode(',', $row['apply_to'])); - unset($row['apply_to']['grouped']); - $row['apply_to'] = implode(',', array_flip($row['apply_to'])); - - $installer->run("UPDATE `{$installer->getTable('eav_attribute')}` - SET `apply_to` = '{$row['apply_to']}' - WHERE `attribute_id` = {$row['attribute_id']}"); -} diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.21-0.7.22.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.21-0.7.22.php deleted file mode 100644 index 6ca88b2c393..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.21-0.7.22.php +++ /dev/null @@ -1,31 +0,0 @@ -run(" -ALTER TABLE `{$this->getTable('catalog_product_entity_tier_price')}` MODIFY COLUMN `qty` DECIMAL(12,4) NOT NULL DEFAULT 1; -DELETE FROM `{$this->getTable('catalog_product_entity_tier_price')}` WHERE store_id>0; -ALTER TABLE `{$this->getTable('catalog_product_entity_tier_price')}` DROP COLUMN `store_id`, - ADD COLUMN `website_id` SMALLINT(5) UNSIGNED NOT NULL AFTER `value` -, DROP INDEX `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_STORE`, - DROP FOREIGN KEY `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_STORE`, - ADD CONSTRAINT `FK_CATALOG_PRODUCT_TIER_WEBSITE` FOREIGN KEY `FK_CATALOG_PRODUCT_TIER_WEBSITE` (`website_id`) - REFERENCES `{$this->getTable('core_website')}` (`website_id`) - ON DELETE CASCADE - ON UPDATE CASCADE; -"); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.22-0.7.23.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.22-0.7.23.php deleted file mode 100644 index e86a878c514..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.22-0.7.23.php +++ /dev/null @@ -1,17 +0,0 @@ -installEntities(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.23-0.7.24.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.23-0.7.24.php deleted file mode 100644 index feb50cf0977..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.23-0.7.24.php +++ /dev/null @@ -1,20 +0,0 @@ -run("UPDATE `{$this->getTable('catalog_category_entity')}` SET `position` = `entity_id` WHERE `position` = 0;"); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.24-0.7.25.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.24-0.7.25.php deleted file mode 100644 index b35dcc99f32..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.24-0.7.25.php +++ /dev/null @@ -1,20 +0,0 @@ -installEntities(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.25-0.7.26.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.25-0.7.26.php deleted file mode 100644 index e01ae56307f..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.25-0.7.26.php +++ /dev/null @@ -1,19 +0,0 @@ -installEntities(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.26-0.7.27.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.26-0.7.27.php deleted file mode 100644 index 8b0ca6dd51a..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.26-0.7.27.php +++ /dev/null @@ -1,72 +0,0 @@ -startSetup(); - -$conn = $installer->getConnection(); -$conn->addColumn($installer->getTable('core_url_rewrite'), 'category_id', 'int unsigned NULL AFTER `store_id`'); -$conn->addColumn($installer->getTable('core_url_rewrite'), 'product_id', 'int unsigned NULL AFTER `category_id`'); -$installer->run(" -UPDATE `{$installer->getTable('core_url_rewrite')}` - SET `category_id`=SUBSTRING_INDEX(SUBSTR(`id_path` FROM 10),'/',1) - WHERE `id_path` LIKE 'category/%'; -UPDATE `{$installer->getTable('core_url_rewrite')}` - SET `product_id`=SUBSTRING_INDEX(SUBSTR(`id_path` FROM 9),'/',1) - WHERE `id_path` RLIKE 'product/[0-9]+$'; -UPDATE `{$installer->getTable('core_url_rewrite')}` - SET `category_id`=SUBSTRING_INDEX(SUBSTR(`id_path` FROM 9),'/',-1), - `product_id`=SUBSTRING_INDEX(SUBSTR(`id_path` FROM 9),'/',1) - WHERE `id_path` LIKE 'product/%/%'; - -DROP TABLE IF EXISTS `{$installer->getTable('core_url_rewrite_temporary')}`; -CREATE TABLE `{$installer->getTable('core_url_rewrite_temporary')}` ( - `url_rewrite_id` int unsigned not null, - PRIMARY KEY(`url_rewrite_id`) -) ENGINE=MyISAM; - -REPLACE INTO `{$installer->getTable('core_url_rewrite_temporary')}` (`url_rewrite_id`) - SELECT `ur`.`url_rewrite_id` FROM `{$installer->getTable('core_url_rewrite')}` as `ur` - LEFT JOIN `{$installer->getTable('catalog_category_entity')}` as `cc` ON `ur`.`category_id`=`cc`.`entity_id` - WHERE `ur`.`category_id` IS NOT NULL - AND `cc`.`entity_id` IS NULL; -REPLACE INTO `{$installer->getTable('core_url_rewrite_temporary')}` (`url_rewrite_id`) - SELECT `ur`.`url_rewrite_id` FROM `{$installer->getTable('core_url_rewrite')}` as `ur` - LEFT JOIN `{$installer->getTable('catalog_product_entity')}` as `cp` ON `ur`.`product_id`=`cp`.`entity_id` - WHERE `ur`.`product_id` IS NOT NULL - AND `cp`.`entity_id` IS NULL; -DELETE FROM `{$installer->getTable('core_url_rewrite')}` WHERE `url_rewrite_id` IN( - SELECT `url_rewrite_id` FROM `{$installer->getTable('core_url_rewrite_temporary')}` -); -DROP TABLE IF EXISTS `{$installer->getTable('core_url_rewrite_temporary')}`; -"); -$conn->addConstraint( - 'FK_CORE_URL_REWRITE_CATEGORY', - $installer->getTable('core_url_rewrite'), - 'category_id', - $installer->getTable('catalog_category_entity'), - 'entity_id', -); -$conn->addConstraint( - 'FK_CORE_URL_REWRITE_PRODUCT', - $installer->getTable('core_url_rewrite'), - 'product_id', - $installer->getTable('catalog_product_entity'), - 'entity_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.27-0.7.28.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.27-0.7.28.php deleted file mode 100644 index 96cc8d82e05..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.27-0.7.28.php +++ /dev/null @@ -1,20 +0,0 @@ -run("UPDATE `{$installer->getTable('eav_attribute')}` SET `position` = 1 WHERE `position` = 0 AND `attribute_code` != 'price';"); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.28-0.7.29.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.28-0.7.29.php deleted file mode 100644 index 0da732a5741..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.28-0.7.29.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); - -// status attribute -$installer->updateAttribute('catalog_product', 'status', 'is_visible_in_advanced_search', 0); -// visibility attribute -$installer->updateAttribute('catalog_product', 'visibility', 'is_visible_in_advanced_search', 0); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.29-0.7.30.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.29-0.7.30.php deleted file mode 100644 index 87ca7dcf167..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.29-0.7.30.php +++ /dev/null @@ -1,29 +0,0 @@ -startSetup(); - -$installer->updateAttribute('catalog_category', 'is_active', 'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE); -$installer->updateAttribute('catalog_category', 'image', 'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE); -$installer->updateAttribute('catalog_category', 'display_mode', 'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE); -$installer->updateAttribute('catalog_category', 'landing_page', 'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE); -$installer->updateAttribute('catalog_category', 'page_layout', 'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE); -$installer->updateAttribute('catalog_category', 'custom_layout_update', 'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE); -$installer->updateAttribute('catalog_product', 'status', 'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.30-0.7.31.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.30-0.7.31.php deleted file mode 100644 index ee19e9f17e2..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.30-0.7.31.php +++ /dev/null @@ -1,15 +0,0 @@ -run(" - -update `{$installer->getTable('eav/attribute')}` set `is_required`=1 where `attribute_id`='{$installer->getAttributeId('catalog_product', 'tax_class_id')}' - -"); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.32-0.7.33.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.32-0.7.33.php deleted file mode 100644 index 58c3ea4468c..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.32-0.7.33.php +++ /dev/null @@ -1,34 +0,0 @@ -getAttributeId('catalog_category', 'is_active'); -$entityTypeId = $installer->getEntityTypeId('catalog_category'); -$installer->updateAttribute('catalog_category', 'is_active', 'backend_type', 'int'); - -$categoryIntTable = $installer->getTable('catalog_category_entity_int'); -$categoryTable = $installer->getTable('catalog_category_entity'); -$attributesCount = $installer->getConnection()->fetchOne("SELECT count(*) FROM `{$categoryIntTable}` WHERE attribute_id='{$attributeId}'"); -$valueId = $installer->getConnection()->fetchOne("SELECT MAX(value_id) FROM `{$categoryIntTable}`"); -if (!$attributesCount) { - $data = $installer->getConnection()->fetchAll("SELECT {$entityTypeId} as entity_type_id, {$attributeId} as attribute_id, 0 as store_id, entity_id, is_active as value FROM `{$categoryTable}`"); - foreach ($data as $row) { - $row['value_id'] = ++$valueId; - $data = $installer->getConnection()->insert($categoryIntTable, $row); - } -} diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.33-0.7.34.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.33-0.7.34.php deleted file mode 100644 index 9dd59ebcc11..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.33-0.7.34.php +++ /dev/null @@ -1,51 +0,0 @@ -startSetup(); - -$select = $installer->getConnection()->select() - ->from($installer->getTable('catalog_category_product'), [ - 'category_id', - 'product_id', - 'position', - 'cnt' => 'COUNT(product_id)', - ]) - ->group('category_id') - ->group('product_id') - ->having('cnt > 1'); -$rowSet = $installer->getConnection()->fetchAll($select); - -foreach ($rowSet as $row) { - $data = [ - 'category_id' => $row['category_id'], - 'product_id' => $row['product_id'], - 'position' => $row['position'], - ]; - $installer->getConnection()->delete($installer->getTable('catalog_category_product'), [ - $installer->getConnection()->quoteInto('category_id = ?', $row['category_id']), - $installer->getConnection()->quoteInto('product_id = ?', $row['product_id']), - ]); - $installer->getConnection()->insert($installer->getTable('catalog_category_product'), $data); -} - -$installer->run(" -ALTER TABLE `{$installer->getTable('catalog_category_product')}` - ADD UNIQUE `UNQ_CATEGORY_PRODUCT` (`category_id`, `product_id`); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.34-0.7.35.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.34-0.7.35.php deleted file mode 100644 index 616420cc54a..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.34-0.7.35.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->run("ALTER TABLE `{$installer->getTable('catalog_category_entity')}` DROP `is_active`;"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.35-0.7.36.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.35-0.7.36.php deleted file mode 100644 index 862122053cc..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.35-0.7.36.php +++ /dev/null @@ -1,51 +0,0 @@ -startSetup(); - -try { - $installer->run(" - ALTER TABLE `{$installer->getTable('catalog_category_entity')}` ADD `level` INT NOT NULL; - ALTER TABLE `{$installer->getTable('catalog_category_entity')}` ADD INDEX `IDX_LEVEL` ( `level` ); - "); -} catch (Exception $e) { -} - -$installer->rebuildCategoryLevels(); - -$installer->addAttribute('catalog_category', 'level', [ - 'type' => 'static', - 'backend' => '', - 'frontend' => '', - 'label' => 'Level', - 'input' => '', - 'class' => '', - 'source' => '', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, - 'visible' => false, - 'required' => false, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.36-0.7.37.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.36-0.7.37.php deleted file mode 100644 index fe7796d8671..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.36-0.7.37.php +++ /dev/null @@ -1,38 +0,0 @@ -startSetup(); - -try { - $installer->run(" - ALTER TABLE `{$installer->getTable('catalog_product_website')}` ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci; - - delete from `{$installer->getTable('catalog_product_website')}` where product_id not in (select entity_id from catalog_product_entity); - delete from `{$installer->getTable('catalog_product_website')}` where website_id not in (select website_id from core_website); - - ALTER TABLE `{$installer->getTable('catalog_product_website')}` DROP INDEX `FK_CATALOG_PRODUCT_WEBSITE_WEBSITE`, - ADD CONSTRAINT `FK_CATALOG_PRODUCT_WEBSITE_PRODUCT` FOREIGN KEY `FK_CATALOG_PRODUCT_WEBSITE_PRODUCT` (`product_id`) - REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `FK_CATAOLOG_PRODUCT_WEBSITE_WEBSITE` FOREIGN KEY `FK_CATAOLOG_PRODUCT_WEBSITE_WEBSITE` (`website_id`) - REFERENCES `{$installer->getTable('core_website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ROW_FORMAT = DYNAMIC; - "); -} catch (Exception $e) { -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.37-0.7.38.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.37-0.7.38.php deleted file mode 100644 index 50f2ae48062..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.37-0.7.38.php +++ /dev/null @@ -1,102 +0,0 @@ -startSetup(); - -$installer->run(" - DROP TABLE IF EXISTS `{$this->getTable('catalog/product_option')}`; - CREATE TABLE `{$this->getTable('catalog/product_option')}` ( - `option_id` int(10) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - `type` varchar(50) NOT NULL default '', - `is_require` tinyint(1) NOT NULL default '1', - `sku` varchar(64) NOT NULL default '', - `max_characters` int(10) unsigned default NULL, - `file_extension` varchar(50) default NULL, - `sort_order` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`option_id`), - KEY `CATALOG_PRODUCT_OPTION_PRODUCT` (`product_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `{$this->getTable('catalog/product')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE - )ENGINE=InnoDB default CHARSET=utf8; - - DROP TABLE IF EXISTS `{$this->getTable('catalog/product_option_price')}`; - CREATE TABLE `{$this->getTable('catalog/product_option_price')}` ( - `option_price_id` int(10) unsigned NOT NULL auto_increment, - `option_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `price` decimal(12,4) NOT NULL default '0.00', - `price_type` enum('fixed', 'percent') NOT NULL default 'fixed', - PRIMARY KEY (`option_price_id`), - KEY `CATALOG_PRODUCT_OPTION_PRICE_OPTION` (`option_id`), - KEY `CATALOG_PRODUCT_OPTION_TITLE_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_PRICE_OPTION` FOREIGN KEY (`option_id`) REFERENCES `{$this->getTable('catalog/product_option')}` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_PRICE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE - )ENGINE=InnoDB default CHARSET=utf8; - - DROP TABLE IF EXISTS `{$this->getTable('catalog/product_option_title')}`; - CREATE TABLE `{$this->getTable('catalog/product_option_title')}` ( - `option_title_id` int(10) unsigned NOT NULL auto_increment, - `option_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `title` VARCHAR(50) NOT NULL default '', - PRIMARY KEY (`option_title_id`), - KEY `CATALOG_PRODUCT_OPTION_TITLE_OPTION` (`option_id`), - KEY `CATALOG_PRODUCT_OPTION_TITLE_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TITLE_OPTION` FOREIGN KEY (`option_id`) REFERENCES `{$this->getTable('catalog/product_option')}` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TITLE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE - )ENGINE=InnoDB default CHARSET=utf8; - - DROP TABLE IF EXISTS `{$this->getTable('catalog/product_option_type_value')}`; - CREATE TABLE `{$this->getTable('catalog/product_option_type_value')}` ( - `option_type_id` int(10) unsigned NOT NULL auto_increment, - `option_id` int(10) unsigned NOT NULL default '0', - `sku` varchar(64) NOT NULL default '', - PRIMARY KEY (`option_type_id`), - KEY `CATALOG_PRODUCT_OPTION_TYPE_VALUE_OPTION` (`option_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_VALUE_OPTION` FOREIGN KEY (`option_id`) REFERENCES `{$this->getTable('catalog/product_option')}` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE - )ENGINE=InnoDB default CHARSET=utf8; - - DROP TABLE IF EXISTS `{$this->getTable('catalog/product_option_type_price')}`; - CREATE TABLE `{$this->getTable('catalog/product_option_type_price')}` ( - `option_type_price_id` int(10) unsigned NOT NULL auto_increment, - `option_type_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `price` decimal(12,4) NOT NULL default '0.00', - `price_type` enum('fixed','percent') NOT NULL default 'fixed', - PRIMARY KEY (`option_type_price_id`), - KEY `CATALOG_PRODUCT_OPTION_TYPE_PRICE_OPTION_TYPE` (`option_type_id`), - KEY `CATALOG_PRODUCT_OPTION_TYPE_PRICE_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_PRICE_OPTION` FOREIGN KEY (`option_type_id`) REFERENCES `{$this->getTable('catalog/product_option_type_value')}` (`option_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_PRICE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE - )ENGINE=InnoDB default CHARSET=utf8; - - DROP TABLE IF EXISTS `{$this->getTable('catalog/product_option_type_title')}`; - CREATE TABLE `{$this->getTable('catalog/product_option_type_title')}` ( - `option_type_title_id` int(10) unsigned NOT NULL auto_increment, - `option_type_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `title` varchar(50) NOT NULL default '', - PRIMARY KEY (`option_type_title_id`), - KEY `CATALOG_PRODUCT_OPTION_TYPE_TITLE_OPTION` (`option_type_id`), - KEY `CATALOG_PRODUCT_OPTION_TYPE_TITLE_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_TITLE_OPTION` FOREIGN KEY (`option_type_id`) REFERENCES `{$this->getTable('catalog/product_option_type_value')}` (`option_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_TITLE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE - )ENGINE=InnoDB default CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.38-0.7.39.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.38-0.7.39.php deleted file mode 100644 index 37b8fd2e875..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.38-0.7.39.php +++ /dev/null @@ -1,25 +0,0 @@ -startSetup(); - -$installer->run(" - ALTER TABLE `{$this->getTable('catalog/product_option_type_value')}` ADD `sort_order` int(10) unsigned NOT NULL default '0'; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.39-0.7.40.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.39-0.7.40.php deleted file mode 100644 index e40ed079a3c..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.39-0.7.40.php +++ /dev/null @@ -1,31 +0,0 @@ -startSetup(); - -$fieldList = ['price','special_price','special_from_date','special_to_date', - 'minimal_price','cost','tier_price']; -foreach ($fieldList as $field) { - $applyTo = explode(',', $installer->getAttribute('catalog_product', $field, 'apply_to')); - if (!in_array('virtual', $applyTo)) { - $applyTo[] = 'virtual'; - $installer->updateAttribute('catalog_product', $field, 'apply_to', implode(',', $applyTo)); - } -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index 3096aaed24f..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,80 +0,0 @@ -startSetup(); - -$installer->run(" -DROP TABLE IF EXISTS {$this->getTable('catalog_product_website')}; -CREATE TABLE {$this->getTable('catalog_product_website')} ( - `product_id` INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - PRIMARY KEY (`product_id`, `website_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_WEBSITE_WEBSITE` FOREIGN KEY `FK_CATALOG_PRODUCT_WEBSITE_WEBSITE` (`website_id`) - REFERENCES `{$this->getTable('core_website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_WEBSITE_PRODUCT_PRODUCT` FOREIGN KEY `FK_CATALOG_WEBSITE_PRODUCT_PRODUCT` (`product_id`) - REFERENCES `{$this->getTable('catalog/product')}` (`entity_id`) ON DELETE CASCADE -); - -DROP TABLE IF EXISTS {$this->getTable('catalog_product_status')}; -DROP TABLE IF EXISTS {$this->getTable('catalog_product_visibility')}; -DROP TABLE IF EXISTS {$this->getTable('catalog_product_type')}; -"); -$installer->endSetup(); -$productTable = $this->getTable('catalog_product_entity'); -$installer->getConnection()->dropColumn($productTable, 'parent_id'); -$installer->getConnection()->dropColumn($productTable, 'store_id'); -$installer->getConnection()->dropColumn($productTable, 'is_active'); - -try { - $installer->run(" - INSERT INTO {$this->getTable('catalog_product_website')} - SELECT DISTINCT ps.product_id, cs.website_id - FROM {$this->getTable('catalog_product_store')} ps, {$this->getTable('core_store')} cs - WHERE cs.store_id=ps.store_id AND ps.store_id>0; - DROP TABLE IF EXISTS {$this->getTable('catalog_product_store')}; - "); -} catch (Exception $e) { -} - -$categoryTable = $this->getTable('catalog/category'); -$installer->getConnection()->dropForeignKey($categoryTable, 'FK_CATALOG_CATEGORY_ENTITY_TREE_NODE'); - -try { - $this->run("ALTER TABLE `{$this->getTable('catalog/category')}` ADD `path` VARCHAR( 255 ) NOT NULL, ADD `position` INT NOT NULL;"); -} catch (Exception $e) { -} -try { - $this->run("DROP TABLE IF EXISTS `{$this->getTable('catalog/category_tree')}`;"); -} catch (Exception $e) { -} - -$installer->getConnection()->dropKey($categoryTable, 'FK_catalog_category_ENTITY_ENTITY_TYPE'); -$installer->getConnection()->dropKey($categoryTable, 'FK_catalog_category_ENTITY_STORE'); -$installer->getConnection()->dropColumn($categoryTable, 'store_id'); - -$tierPriceTable = $this->getTable('catalog_product_entity_tier_price'); -$installer->getConnection()->dropColumn($tierPriceTable, 'entity_type_id'); -$installer->getConnection()->dropColumn($tierPriceTable, 'attribute_id'); -$installer->getConnection()->dropForeignKey($tierPriceTable, 'FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_ATTRIBUTE'); -$installer->getConnection()->dropKey($tierPriceTable, 'FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_ATTRIBUTE'); - -$installer->startSetup(); -$installer->installEntities(); -$installer->endSetup(); - -$this->convertOldTreeToNew(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.40-0.7.41.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.40-0.7.41.php deleted file mode 100644 index c37d35c1143..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.40-0.7.41.php +++ /dev/null @@ -1,54 +0,0 @@ -startSetup(); - -$defaultValue = 'container2'; - -$installer->addAttribute('catalog_product', 'options_container', [ - 'group' => 'Design', - 'type' => 'varchar', - 'backend' => '', - 'frontend' => '', - 'label' => 'Display Product Options In', - 'input' => 'select', - 'class' => '', - 'source' => 'catalog/entity_product_attribute_design_options_container', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, - 'visible' => true, - 'required' => false, - 'user_defined' => false, - 'default' => $defaultValue, - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'visible_in_advanced_search' => false, - 'unique' => false, -]); - -$newAttributeId = $installer->getAttributeId('catalog_product', 'options_container'); - -$installer->run(" -INSERT INTO {$this->getTable('catalog_product_entity_varchar')} - (entity_id, entity_type_id, attribute_id, value) - SELECT entity_id, entity_type_id, {$newAttributeId}, '{$defaultValue}' - FROM {$this->getTable('catalog_product_entity')} -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.41-0.7.42.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.41-0.7.42.php deleted file mode 100644 index 7d87891a3e1..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.41-0.7.42.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->getConnection()->addKey($installer->getTable('catalog_product_entity_int'), 'IDX_ATTRIBUTE_VALUE', ['entity_id', 'attribute_id', 'store_id']); -$installer->getConnection()->addKey($installer->getTable('catalog_product_entity_datetime'), 'IDX_ATTRIBUTE_VALUE', ['entity_id', 'attribute_id', 'store_id']); -$installer->getConnection()->addKey($installer->getTable('catalog_product_entity_decimal'), 'IDX_ATTRIBUTE_VALUE', ['entity_id', 'attribute_id', 'store_id']); -$installer->getConnection()->addKey($installer->getTable('catalog_product_entity_text'), 'IDX_ATTRIBUTE_VALUE', ['entity_id', 'attribute_id', 'store_id']); -$installer->getConnection()->addKey($installer->getTable('catalog_product_entity_varchar'), 'IDX_ATTRIBUTE_VALUE', ['entity_id', 'attribute_id', 'store_id']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.43-0.7.44.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.43-0.7.44.php deleted file mode 100644 index 2b868fb62e9..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.43-0.7.44.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); - -$installer->addAttribute('catalog_product', 'required_options', [ - 'visible' => false, - 'default' => false, -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.44-0.7.45.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.44-0.7.45.php deleted file mode 100644 index 8f15f2fab3c..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.44-0.7.45.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->updateAttribute('catalog_product', 'tax_class_id', 'apply_to', 'simple,configurable,virtual'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.45-0.7.46.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.45-0.7.46.php deleted file mode 100644 index 5c21a150d31..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.45-0.7.46.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->updateAttribute('catalog_product', 'tier_price', 'is_used_for_price_rules', '0'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php deleted file mode 100644 index 2d337cfa3f0..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php +++ /dev/null @@ -1,128 +0,0 @@ -startSetup(); - -$installer->run(" -DROP TABLE IF EXISTS {$this->getTable('catalog_category_product_index')}; -CREATE TABLE `{$installer->getTable('catalog_category_product_index')}` ( - `category_id` int(10) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `position` int(10) unsigned NOT NULL default '0', - `is_parent` tinyint(1) unsigned NOT NULL default '0', - UNIQUE KEY `UNQ_CATEGORY_PRODUCT` (`category_id`,`product_id`), - KEY `IDX_CATEGORY_POSITION` (`category_id`,`position`), - CONSTRAINT `FK_CATALOG_CATEGORY_PRODUCT_INDEX_PRODUCT_ENTITY` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_CATEGORY_PRODUCT_INDEX_CATEGORY_ENTITY` FOREIGN KEY (`category_id`) REFERENCES `{$installer->getTable('catalog_category_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS {$this->getTable('catalog_product_enabled_index')}; -CREATE TABLE `{$installer->getTable('catalog_product_enabled_index')}` ( - `product_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `visibility` smallint(5) unsigned NOT NULL default '0', - UNIQUE KEY `UNQ_PRODUCT_STORE` (`product_id`,`store_id`), - KEY `IDX_PRODUCT_VISIBILITY_IN_STORE` (`product_id`,`store_id`, `visibility`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENABLED_INDEX_PRODUCT_ENTITY` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENABLED_INDEX_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -/** - * Build category product index - */ -$categories = $installer->getConnection()->fetchAll( - $installer->getConnection()->select() - ->from($installer->getTable('catalog_category_entity')) - ->order('level') - ->order('path'), -); - -// $installer->run(" -// LOCK TABLES `{$installer->getTable('catalog_category_product_index')}` WRITE, `{$installer->getTable('catalog_category_product')}` READ, `{$installer->getTable('catalog_category_entity')}` READ; -// "); -$installer->run(" -/*!40000 ALTER TABLE `{$installer->getTable('catalog_category_product_index')}` DISABLE KEYS */; -"); - -foreach ($categories as $category) { - $categoryId = $category['entity_id']; - $query = "INSERT INTO `{$installer->getTable('catalog_category_product_index')}` - SELECT DISTINCT {$categoryId}, `product_id`, `position`, {$categoryId}=`category_id` AS `is_parent` - FROM `{$installer->getTable('catalog_category_product')}` - WHERE `category_id` IN( - SELECT `entity_id` FROM `{$installer->getTable('catalog_category_entity')}` - WHERE `path` LIKE '{$category['path']}%' - ) - GROUP BY `product_id` - ORDER BY `is_parent` DESC"; - $installer->run($query); -} - -$installer->run(" -/*!40000 ALTER TABLE `{$installer->getTable('catalog_category_product_index')}` ENABLE KEYS */; -"); -// $installer->run(" -// UNLOCK TABLES; -// "); - -/** - * Build product visibility index - */ -$statusAttributeId = $installer->getAttributeId('catalog_product', 'status'); -$visibilityAttributeId = $installer->getAttributeId('catalog_product', 'visibility'); - -$installer->run(" -/*!40000 ALTER TABLE `{$installer->getTable('catalog_product_enabled_index')}` DISABLE KEYS */; -"); -$websiteIds = $installer->getConnection()->fetchCol("SELECT website_id FROM {$installer->getTable('core_website')}"); -foreach ($websiteIds as $websiteId) { - $storeIds = $installer->getConnection()->fetchCol(" - SELECT store_id FROM {$installer->getTable('core_store')} WHERE website_id={$websiteId} - "); - foreach ($storeIds as $storeId) { - if (!$storeId) { - continue; - } - $installer->run(" -INSERT INTO {$installer->getTable('catalog_product_enabled_index')} - SELECT t_v_default.entity_id, {$storeId}, IFNULL(t_v.value, t_v_default.value) - FROM {$installer->getTable('catalog_product_entity_int')} AS t_v_default - INNER JOIN {$installer->getTable('catalog_product_website')} AS w ON w.product_id=t_v_default.entity_id AND w.website_id={$websiteId} - LEFT JOIN {$installer->getTable('catalog_product_entity_int')} AS `t_v` - ON (t_v.entity_id = t_v_default.entity_id) AND (t_v.attribute_id='{$visibilityAttributeId}') AND (t_v.store_id='{$storeId}') - INNER JOIN {$installer->getTable('catalog_product_entity_int')} AS `t_s_default` - ON (t_s_default.entity_id = t_v_default.entity_id) AND (t_s_default.attribute_id='{$statusAttributeId}') AND t_s_default.store_id=0 - LEFT JOIN {$installer->getTable('catalog_product_entity_int')} AS `t_s` - ON (t_s.entity_id = t_v_default.entity_id) AND (t_s.attribute_id='{$statusAttributeId}') AND (t_s.store_id='{$storeId}') - WHERE - t_v_default.attribute_id='{$visibilityAttributeId}' AND t_v_default.store_id=0 - AND (IFNULL(t_s.value, t_s_default.value)=" . Mage_Catalog_Model_Product_Status::STATUS_ENABLED . ') - '); - } -} - -$installer->run(" -/*!40000 ALTER TABLE `{$installer->getTable('catalog_product_enabled_index')}` ENABLE KEYS */ -"); - -$installer->run(" -ALTER TABLE `{$installer->getTable('core_url_rewrite')}` ADD INDEX `IDX_CATEGORY_REWRITE` (`category_id`, `is_system`, `product_id`, `store_id`, `id_path`); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.47-0.7.48.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.47-0.7.48.php deleted file mode 100644 index 7018cd16346..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.47-0.7.48.php +++ /dev/null @@ -1,41 +0,0 @@ -startSetup(); - -$installer->run(" - ALTER TABLE `{$installer->getTable('catalog/product')}` ADD `has_options` SMALLINT(1) NOT NULL DEFAULT '0'; -"); - -$installer->addAttribute('catalog_product', 'has_options', [ - 'type' => 'static', - 'visible' => false, - 'default' => false, -]); -$installer->run(" - UPDATE `{$installer->getTable('catalog/product')}` SET `has_options` = '1' - WHERE (entity_id IN ( - SELECT product_id FROM `{$installer->getTable('catalog/product_option')}` GROUP BY product_id - )); - UPDATE `{$installer->getTable('catalog/product')}` SET `has_options` = '1' - WHERE (entity_id IN ( - SELECT product_id FROM `{$installer->getTable('catalog/product_super_attribute')}` GROUP BY product_id - )); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.48-0.7.49.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.48-0.7.49.php deleted file mode 100644 index e742596114c..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.48-0.7.49.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); - -$installer->run(" - ALTER TABLE `{$installer->getTable('catalog_compare_item')}` add index `IDX_VISITOR_PRODUCTS` (`visitor_id`, `product_id`); - ALTER TABLE `{$installer->getTable('catalog_compare_item')}` add index `IDX_CUSTOMER_PRODUCTS` (`customer_id`, `product_id`); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.49-0.7.50.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.49-0.7.50.php deleted file mode 100644 index be8d70fed8d..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.49-0.7.50.php +++ /dev/null @@ -1,32 +0,0 @@ -startSetup(); - -// get options_container attribute and update its value to 'container1' for configurable products -$attribute = $this->getAttribute('catalog_product', 'options_container'); -if (!empty($attribute['attribute_id'])) { - $this->run(" - UPDATE {$this->getTable('catalog_product_entity_varchar')} - SET value = 'container1' - WHERE - entity_id IN (SELECT entity_id FROM {$this->getTable('catalog_product_entity')} WHERE type_id='configurable') - AND attribute_id={$attribute['attribute_id']} - "); -} - -$this->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.5-0.7.6.php deleted file mode 100644 index 53412d0abc3..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$conn = $installer->getConnection(); - -$conn->addColumn($this->getTable('catalog_product_entity'), 'category_ids', 'text after `sku`'); - -$installer->run("update `{$this->getTable('catalog_product_entity')}` set `category_ids`=(select group_concat(`category_id` separator ',') from `{$this->getTable('catalog_category_product')}` where `product_id`=`entity_id`)"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.50-0.7.51.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.50-0.7.51.php deleted file mode 100644 index 890fe9cd5d4..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.50-0.7.51.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -$this->getConnection()->addColumn($this->getTable('catalog_category_entity'), 'children_count', 'INT NOT NULL'); - -$sql = "SELECT * FROM `{$this->getTable('catalog_category_entity')}`"; -$data = $this->getConnection()->fetchAll($sql); - -foreach ($data as $row) { - $sql = "SELECT COUNT(*) FROM `{$this->getTable('catalog_category_entity')}` WHERE `path` REGEXP '^{$row['path']}\/([0-9]+)$'"; - $count = (int) $this->getConnection()->fetchOne($sql); - - $this->run("UPDATE `{$this->getTable('catalog_category_entity')}` - SET `children_count` = $count - WHERE `entity_id` = {$row['entity_id']}"); -} - -$this->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php deleted file mode 100644 index b81aaf2ed52..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php +++ /dev/null @@ -1,42 +0,0 @@ -startSetup(); - -$table = $this->getTable('catalog/category'); -$tableTmp = $table . '_tmp'; -$this->run("DROP TABLE IF EXISTS `{$tableTmp}`"); - -$this->run("CREATE TABLE `{$tableTmp}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `children_count` int(11) NOT NULL, - PRIMARY KEY (`entity_id`) -) ENGINE=InnoDB; -"); - -$this->run("INSERT INTO {$tableTmp} (SELECT e.entity_id, COUNT( ee.entity_id ) as children_count -FROM `{$table}` e -INNER JOIN `{$table}` ee ON ee.path LIKE CONCAT( e.path, '/%' ) -GROUP BY e.entity_id)"); - -$this->run("UPDATE {$table}, {$tableTmp} -SET {$table}.children_count = {$tableTmp}.children_count -WHERE {$table}.entity_id = {$tableTmp}.entity_id"); - -$this->run("DROP TABLE `{$tableTmp}`"); - -$this->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.52-0.7.53.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.52-0.7.53.php deleted file mode 100644 index b4d157f6c2d..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.52-0.7.53.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->getConnection()->changeColumn($installer->getTable('catalog/product_option_title'), 'title', 'title', 'VARCHAR(255) NOT NULL default \'\''); -$installer->getConnection()->changeColumn($installer->getTable('catalog/product_option_type_title'), 'title', 'title', 'VARCHAR(255) NOT NULL default \'\''); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.53-0.7.54.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.53-0.7.54.php deleted file mode 100644 index c4e176e81d9..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.53-0.7.54.php +++ /dev/null @@ -1,51 +0,0 @@ -startSetup(); - -$installer->addAttribute('catalog_product', 'image_label', [ - 'type' => 'varchar', - 'label' => 'Image Label', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, - 'visible' => false, - 'required' => false, - 'searchable' => true, - 'is_configurable' => false, -]); - -$installer->addAttribute('catalog_product', 'small_image_label', [ - 'type' => 'varchar', - 'label' => 'Small Image Label', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, - 'visible' => false, - 'required' => false, - 'searchable' => true, - 'is_configurable' => false, -]); - -$installer->addAttribute('catalog_product', 'thumbnail_label', [ - 'type' => 'varchar', - 'label' => 'Thumbnail Label', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, - 'visible' => false, - 'required' => false, - 'searchable' => true, - 'is_configurable' => false, -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.54-0.7.55.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.54-0.7.55.php deleted file mode 100644 index 227e142a2a9..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.54-0.7.55.php +++ /dev/null @@ -1,25 +0,0 @@ -startSetup(); - -$installer->updateAttribute('catalog_product', 'image_label', 'is_searchable', '0'); -$installer->updateAttribute('catalog_product', 'small_image_label', 'is_searchable', '0'); -$installer->updateAttribute('catalog_product', 'thumbnail_label', 'is_searchable', '0'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.55-0.7.56.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.55-0.7.56.php deleted file mode 100644 index 2baf3a23d80..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.55-0.7.56.php +++ /dev/null @@ -1,115 +0,0 @@ -startSetup(); - -$categoryIndexTable = $installer->getTable('catalog/category_product_index'); - -$installer->getConnection()->addColumn( - $categoryIndexTable, - 'store_id', - 'smallint(5) unsigned NOT NULL default \'0\'', -); - -$installer->getConnection()->addColumn( - $categoryIndexTable, - 'visibility', - 'tinyint(3) unsigned NOT NULL', -); - -/** - * Clear relation with root category - */ -$installer->getConnection()->delete($categoryIndexTable, 'category_id=' . Mage_Catalog_Model_Category::TREE_ROOT_ID); -$installer->getConnection()->addKey( - $categoryIndexTable, - 'FK_CATALOG_CATEGORY_PRODUCT_INDEX_CATEGORY_ENTITY', - ['category_id'], -); -$installer->getConnection()->dropKey($categoryIndexTable, 'IDX_CATEGORY_POSITION'); -$installer->getConnection()->dropKey($categoryIndexTable, 'UNQ_CATEGORY_PRODUCT'); - -$storesData = $installer->getConnection()->fetchAll(" - SELECT - s.store_id, s.website_id, c.path AS root_path - FROM - {$installer->getTable('core/store')} AS s, - {$installer->getTable('core/store_group')} AS sg, - {$installer->getTable('catalog/category')} AS c - WHERE - sg.group_id=s.group_id - AND c.entity_id=sg.root_category_id -"); - -foreach ($storesData as $storeData) { - $storeId = $storeData['store_id']; - $websiteId = $storeData['website_id']; - $path = $storeData['root_path']; - - $query = "INSERT INTO {$categoryIndexTable} - (`category_id`, `product_id`, `position`, `is_parent`, `store_id`, `visibility`) - SELECT - ci.category_id, - ci.product_id, - ci.position, - ci.is_parent, - {$storeId}, - ep.visibility - FROM - $categoryIndexTable AS ci - INNER JOIN {$installer->getTable('catalog/product_website')} AS pw - ON pw.product_id=ci.product_id AND pw.website_id={$websiteId} - INNER JOIN {$installer->getTable('catalog/category')} AS c - ON c.entity_id=ci.category_id AND c.path LIKE '{$path}%' - INNER JOIN {$installer->getTable('catalog/product_enabled_index')} AS ep - ON ep.product_id=ci.product_id AND ep.store_id={$storeId} - WHERE - ci.store_id=0"; - - $installer->run($query); -} - -$installer->getConnection()->delete($categoryIndexTable, 'store_id=0'); - -$installer->getConnection()->addKey( - $categoryIndexTable, - 'UNQ_CATEGORY_PRODUCT', - ['store_id', 'category_id', 'product_id'], -); - -$installer->getConnection()->addKey( - $categoryIndexTable, - 'IDX_JOIN', - ['product_id', 'store_id', 'category_id', 'visibility'], -); - -$installer->getConnection()->addKey( - $categoryIndexTable, - 'IDX_BASE', - ['store_id', 'category_id', 'visibility', 'is_parent', 'position'], -); - -$installer->getConnection()->addConstraint( - 'FK_CATEGORY_PRODUCT_INDEX_STORE', - $categoryIndexTable, - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.56-0.7.57.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.56-0.7.57.php deleted file mode 100644 index bde49491f5b..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.56-0.7.57.php +++ /dev/null @@ -1,55 +0,0 @@ -startSetup(); - -$select = $installer->getConnection()->select() - ->from($installer->getTable('catalog/category_product_index'), [ - 'category_id' => 'category_id', - 'product_id' => 'product_id', - 'is_parent' => 'is_parent', - 'store_id' => 'store_id', - 'rows_count' => 'COUNT(*)']) - ->group(['category_id' , 'product_id' , 'is_parent' , 'store_id']) - ->having('rows_count > 1'); -$query = $installer->getConnection()->query($select); - -while ($row = $query->fetch()) { - $sql = 'DELETE FROM `' . $installer->getTable('catalog/category_product_index') . '`' - . ' WHERE category_id=? AND product_id=? AND is_parent=? AND store_id=?' - . ' LIMIT ' . ($row['rows_count'] - 1); - $installer->getConnection()->query($sql, [ - $row['category_id'], - $row['product_id'], - $row['is_parent'], - $row['store_id'], - ]); -} - -$installer->getConnection()->dropKey( - $installer->getTable('catalog/category_product_index'), - 'UNQ_CATEGORY_PRODUCT', -); -$installer->getConnection()->addKey( - $installer->getTable('catalog/category_product_index'), - 'UNQ_CATEGORY_PRODUCT', - ['category_id', 'product_id', 'is_parent', 'store_id'], - 'unique', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.57-0.7.58.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.57-0.7.58.php deleted file mode 100644 index efd27a83f0c..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.57-0.7.58.php +++ /dev/null @@ -1,190 +0,0 @@ -startSetup(); - -$installer->getConnection()->closeConnection(); - -// Add listing and sort attribute properties -$installer->getConnection()->addColumn( - $installer->getTable('eav/attribute'), - 'used_in_product_listing', - 'tinyint(1) UNSIGNED NOT NULL DEFAULT 0', -); -$installer->getConnection()->addColumn( - $installer->getTable('eav/attribute'), - 'used_for_sort_by', - 'tinyint(1) UNSIGNED NOT NULL DEFAULT 0', -); - -$entityTypeId = $installer->getEntityTypeId('catalog_product'); -$sqlAttributes = $installer->getConnection()->quoteInto( - '?', - Mage::getSingleton('catalog/config')->getProductCollectionAttributes(), -); -$installer->run(" -UPDATE `{$installer->getTable('eav/attribute')}` - SET `used_for_sort_by`='1' - WHERE `entity_type_id`='{$entityTypeId}' - AND `attribute_code` IN('name', 'price'); -UPDATE `{$installer->getTable('eav/attribute')}` - SET `used_in_product_listing`='1' - WHERE `entity_type_id`='{$entityTypeId}' - AND `attribute_code` IN($sqlAttributes); -"); - -$installer->getConnection()->addKey( - $installer->getTable('eav/attribute'), - 'IDX_USED_FOR_SORT_BY', - ['entity_type_id','used_for_sort_by'], -); -$installer->getConnection()->addKey( - $installer->getTable('eav/attribute'), - 'IDX_USED_IN_PRODUCT_LISTING', - ['entity_type_id','used_in_product_listing'], -); - -// Add frontend input renderer -$installer->getConnection()->addColumn( - $installer->getTable('eav/attribute'), - 'frontend_input_renderer', - 'varchar(255) DEFAULT NULL AFTER `frontend_input`', -); - -// Modify Groups and Attributes for Category -$entityTypeId = $installer->getEntityTypeId('catalog_category'); -$attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId); -$attributeGroupId = $installer->getDefaultAttributeGroupId($entityTypeId, $attributeSetId); - -// update General Group -$installer->updateAttributeGroup( - $entityTypeId, - $attributeSetId, - $attributeGroupId, - 'attribute_group_name', - 'General Information', -); -$installer->updateAttributeGroup( - $entityTypeId, - $attributeSetId, - $attributeGroupId, - 'sort_order', - '10', -); - -// Add groups -$groups = [ - 'display' => [ - 'name' => 'Display Settings', - 'sort' => 20, - 'id' => null, - ], - 'design' => [ - 'name' => 'Custom Design', - 'sort' => 30, - 'id' => null, - ], -]; - -foreach ($groups as $k => $groupProp) { - $installer->addAttributeGroup($entityTypeId, $attributeSetId, $groupProp['name'], $groupProp['sort']); - $groups[$k]['id'] = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, $groupProp['name']); -} - -// Add Catalog Default Sort Attributes -$installer->addAttribute($entityTypeId, 'available_sort_by', [ - 'input' => 'multiselect', - 'type' => 'text', - 'label' => 'Available Product Listing Sort By', - 'source' => 'catalog/category_attribute_source_sortby', - 'backend' => 'catalog/category_attribute_backend_sortby', - 'required' => 1, - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, - 'visible' => 1, - 'input_renderer' => 'adminhtml/catalog_category_helper_sortby_available', -]); -$installer->addAttribute($entityTypeId, 'default_sort_by', [ - 'input' => 'select', - 'label' => 'Default Product Listing Sort By', - 'source' => 'catalog/category_attribute_source_sortby', - 'backend' => 'catalog/category_attribute_backend_sortby', - 'required' => 1, - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, - 'visible' => 1, - 'input_renderer' => 'adminhtml/catalog_category_helper_sortby_default', -]); - -// update attributes group and sort -$attributes = [ - 'custom_design' => [ - 'group' => 'design', - 'sort' => 10, - ], - 'custom_design_apply' => [ - 'group' => 'design', - 'sort' => 20, - ], - 'custom_design_from' => [ - 'group' => 'design', - 'sort' => 30, - ], - 'custom_design_to' => [ - 'group' => 'design', - 'sort' => 40, - ], - 'page_layout' => [ - 'group' => 'design', - 'sort' => 50, - ], - 'custom_layout_update' => [ - 'group' => 'design', - 'sort' => 60, - ], - 'display_mode' => [ - 'group' => 'display', - 'sort' => 10, - ], - 'landing_page' => [ - 'group' => 'display', - 'sort' => 20, - ], - 'is_anchor' => [ - 'group' => 'display', - 'sort' => 30, - ], - 'available_sort_by' => [ - 'group' => 'display', - 'sort' => 40, - ], - 'default_sort_by' => [ - 'group' => 'display', - 'sort' => 50, - ], -]; - -foreach ($attributes as $attributeCode => $attributeProp) { - $installer->addAttributeToGroup( - $entityTypeId, - $attributeSetId, - $groups[$attributeProp['group']]['id'], - $attributeCode, - $attributeProp['sort'], - ); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.58-0.7.59.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.58-0.7.59.php deleted file mode 100644 index 323727d5b04..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.58-0.7.59.php +++ /dev/null @@ -1,42 +0,0 @@ -startSetup(); - -$installer->run(" -DROP TABLE IF EXISTS `{$installer->getTable('catalog/category_flat')}`; -CREATE TABLE `{$installer->getTable('catalog/category_flat')}` ( - `entity_id` int(10) unsigned not null, - `store_id` smallint(5) unsigned not null default '0', - `parent_id` int(10) unsigned not null default '0', - `path` varchar(255) not null default '', - `level` int(11) not null default '0', - `position` int(11) not null default '0', - `children_count` int(11) not null, - `created_at` datetime not null default '0000-00-00 00:00:00', - `updated_at` datetime not null default '0000-00-00 00:00:00', - KEY `CATEGORY_FLAT_CATEGORY_ID` (`entity_id`), - KEY `CATEGORY_FLAT_STORE_ID` (`store_id`), - KEY `path` (`path`), - KEY `IDX_LEVEL` (`level`), - CONSTRAINT `FK_CATEGORY_FLAT_CATEGORY_ID` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('catalog/category')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATEGORY_FLAT_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Flat Category' -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.59-0.7.60.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.59-0.7.60.php deleted file mode 100644 index 88e7f4b72de..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.59-0.7.60.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('catalog/product_option'), 'image_size_x', 'smallint unsigned not null after `file_extension`'); -$installer->getConnection()->addColumn($installer->getTable('catalog/product_option'), 'image_size_y', 'smallint unsigned not null after `image_size_x`'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.6-0.7.7.php deleted file mode 100644 index ece061e1762..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->installEntities(); -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.60-0.7.61.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.60-0.7.61.php deleted file mode 100644 index 6c4eecc3888..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.60-0.7.61.php +++ /dev/null @@ -1,76 +0,0 @@ -getTable('catalog/product'); -$types = ['datetime', 'decimal', 'int', 'text', 'varchar']; -foreach ($types as $type) { - $tableName = $tableCatalogProduct . '_' . $type; - - $select = $installer->getConnection()->select() - ->from($tableName, [ - 'entity_id' => 'entity_id', - 'attribute_id' => 'attribute_id', - 'store_id' => 'store_id', - 'rows_count' => 'COUNT(*)']) - ->group(['entity_id', 'attribute_id', 'store_id']) - ->having('rows_count > 1'); - $query = $installer->getConnection()->query($select); - - while ($row = $query->fetch()) { - $sql = 'DELETE FROM `' . $tableName . '`' - . ' WHERE entity_id=? AND attribute_id=? AND store_id=?' - . ' LIMIT ' . ($row['rows_count'] - 1); - $installer->getConnection()->query($sql, [ - $row['entity_id'], - $row['attribute_id'], - $row['store_id'], - ]); - } - - $installer->getConnection()->addKey($tableName, 'IDX_ATTRIBUTE_VALUE', ['entity_id', 'attribute_id', 'store_id'], 'unique'); -} - -// exception for gallery table - -$tableName = $tableCatalogProduct . '_gallery'; - -$select = $installer->getConnection()->select() - ->from($tableName, [ - 'entity_type_id' => 'entity_type_id', - 'entity_id' => 'entity_id', - 'attribute_id' => 'attribute_id', - 'store_id' => 'store_id', - 'rows_count' => 'COUNT(*)']) - ->group(['entity_id', 'attribute_id', 'store_id']) - ->having('rows_count > 1'); -$query = $installer->getConnection()->query($select); - -while ($row = $query->fetch()) { - $sql = 'DELETE FROM `' . $tableName . '`' - . ' WHERE entity_type_id=? AND entity_id=? AND attribute_id=? AND store_id=?' - . ' LIMIT ' . ($row['rows_count'] - 1); - $installer->getConnection()->query($sql, [ - $row['entity_type_id'], - $row['entity_id'], - $row['attribute_id'], - $row['store_id'], - ]); -} - -$installer->getConnection()->addKey("{$tableCatalogProduct}_gallery", 'IDX_BASE', ['entity_type_id','entity_id','attribute_id','store_id'], 'unique'); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.61-0.7.62.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.61-0.7.62.php deleted file mode 100644 index 4ca061fd512..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.61-0.7.62.php +++ /dev/null @@ -1,51 +0,0 @@ -startSetup(); - -$installer->getConnection()->addKey( - $installer->getTable('catalog_product_super_attribute_label'), - 'IDX_CATALOG_PRODUCT_SUPER_ATTRIBUTE_STORE_PSAI_SI', - ['product_super_attribute_id', 'store_id'], -); - -$installer->getConnection()->addKey( - $installer->getTable('catalog_product_option_price'), - 'IDX_CATALOG_PRODUCT_OPTION_PRICE_SI_OI', - ['store_id', 'option_id'], -); - -$installer->getConnection()->addKey( - $installer->getTable('catalog_product_option_title'), - 'IDX_CATALOG_PRODUCT_OPTION_TITLE_SI_OI', - ['store_id', 'option_id'], -); - -$installer->getConnection()->addKey( - $installer->getTable('catalog_product_option_type_price'), - 'IDX_CATALOG_PRODUCT_OPTION_TYPE_PRICE_SI_OTI', - ['store_id', 'option_type_id'], -); - -$installer->getConnection()->addKey( - $installer->getTable('catalog_product_option_type_title'), - 'IDX_CATALOG_PRODUCT_OPTION_TYPE_TITLE_SI_OTI', - ['store_id', 'option_type_id'], -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.62-0.7.63.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.62-0.7.63.php deleted file mode 100644 index 43793a3ced3..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.62-0.7.63.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->updateAttribute('catalog_product', 'required_options', 'used_in_product_listing', '1'); -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.63-0.7.64.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.63-0.7.64.php deleted file mode 100644 index 21bf141e279..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.63-0.7.64.php +++ /dev/null @@ -1,42 +0,0 @@ -startSetup(); - -$installer->addAttribute('catalog_product', 'page_layout', [ - 'type' => 'varchar', - 'backend' => '', - 'frontend' => '', - 'label' => 'Page Layout', - 'input' => 'select', - 'class' => '', - 'source' => 'catalog/product_attribute_source_layout', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, - 'visible' => true, - 'required' => false, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'group' => 'Design', -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.64-0.7.65.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.64-0.7.65.php deleted file mode 100644 index 24c131d222e..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.64-0.7.65.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -$connection = $installer->getConnection(); -/** @var Varien_Db_Adapter_Pdo_Mysql $connection */ -$connection->addColumn($installer->getTable('catalog/product_super_attribute_pricing'), 'website_id', 'smallint(5) UNSIGNED NOT NULL DEFAULT 0'); -$connection->addConstraint( - 'FK_CATALOG_PRODUCT_SUPER_PRICE_WEBSITE', - $installer->getTable('catalog/product_super_attribute_pricing'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', - 'cascade', - 'cascade', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.65-0.7.66.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.65-0.7.66.php deleted file mode 100644 index e3cda61b54c..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.65-0.7.66.php +++ /dev/null @@ -1,31 +0,0 @@ -loadSelf() - ->setIsBuilt(false) - ->save(); - -$installer->startSetup(); -$installer->run(" - UPDATE `{$installer->getTable('core/config_data')}` SET `value`=0 - WHERE `path` LIKE '" . Mage_Catalog_Helper_Product_Flat::XML_PATH_USE_PRODUCT_FLAT . "'; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.66-0.7.67.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.66-0.7.67.php deleted file mode 100644 index f67ea6d535a..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.66-0.7.67.php +++ /dev/null @@ -1,29 +0,0 @@ -addAttribute('catalog_product', 'created_at', [ - 'type' => 'static', - 'backend' => 'eav/entity_attribute_backend_time_created', - 'visible' => 0, -]); -$installer->addAttribute('catalog_product', 'updated_at', [ - 'type' => 'static', - 'backend' => 'eav/entity_attribute_backend_time_updated', - 'visible' => 0, -]); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.67-0.7.68.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.67-0.7.68.php deleted file mode 100644 index 94161d0c233..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.67-0.7.68.php +++ /dev/null @@ -1,42 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('catalog/product'), 'required_options', 'tinyint(1) unsigned NOT NULL default 0'); - -$entityTypeId = 'catalog_product'; -$attributeId = $installer->getAttributeId($entityTypeId, 'required_options'); -$attributeTable = $installer->getAttributeTable($entityTypeId, $attributeId); - -if ($attributeTable != $installer->getTable('catalog/product')) { - $installer->run(" - UPDATE `{$installer->getTable('catalog/product')}` AS `p` - INNER JOIN `{$attributeTable}` AS `a` ON `p`.`entity_id`=`a`.`entity_id` - AND `a`.`attribute_id`={$attributeId} AND `a`.`store_id`=0 - SET `p`.`required_options` = `a`.`value`; - "); - - $installer->updateAttribute($entityTypeId, $attributeId, 'backend_type', 'static'); - - $installer->run(" - DELETE FROM `{$attributeTable}` WHERE `attribute_id`={$attributeId}; - "); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.68-0.7.69.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.68-0.7.69.php deleted file mode 100644 index 35b555ae1e3..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.68-0.7.69.php +++ /dev/null @@ -1,103 +0,0 @@ -startSetup(); - -// fix for sample data 1.2.0 -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_website'), - 'FK_CATALOG_PRODUCT_WEBSITE_PRODUCT', -); -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_website'), - 'FK_CATAOLOG_PRODUCT_WEBSITE_WEBSITE', -); -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_website'), - 'FK_CATALOG_PRODUCT_WEBSITE_WEBSITE', -); -$installer->getConnection()->dropKey( - $installer->getTable('catalog/product_website'), - 'FK_CATAOLOG_PRODUCT_WEBSITE_WEBSITE', -); -$installer->getConnection()->dropKey( - $installer->getTable('catalog/product_website'), - 'FK_CATALOG_PRODUCT_WEBSITE_WEBSITE', -); -$installer->getConnection()->addConstraint( - 'FK_SUPER_PRODUCT_ATTRIBUTE_LABEL', - $installer->getTable('catalog/product_super_attribute_label'), - 'product_super_attribute_id', - $installer->getTable('catalog/product_super_attribute'), - 'product_super_attribute_id', - 'CASCADE', - 'CASCADE', - true, -); -$installer->getConnection()->addConstraint( - 'FK_SUPER_PRODUCT_ATTRIBUTE_PRICING', - $installer->getTable('catalog/product_super_attribute_pricing'), - 'product_super_attribute_id', - $installer->getTable('catalog/product_super_attribute'), - 'product_super_attribute_id', - 'CASCADE', - 'CASCADE', - true, -); -$installer->getConnection()->addConstraint( - 'FK_SUPER_PRODUCT_LINK_ENTITY', - $installer->getTable('catalog/product_super_link'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', - 'CASCADE', - 'CASCADE', - true, -); -$installer->getConnection()->addConstraint( - 'FK_SUPER_PRODUCT_LINK_PARENT', - $installer->getTable('catalog/product_super_link'), - 'parent_id', - $installer->getTable('catalog/product'), - 'entity_id', - 'CASCADE', - 'CASCADE', - true, -); -$installer->getConnection()->addConstraint( - 'FK_CATALOG_PRODUCT_WEBSITE_WEBSITE', - $installer->getTable('catalog/product_website'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', - 'CASCADE', - 'CASCADE', - true, -); -$installer->getConnection()->addConstraint( - 'FK_CATALOG_WEBSITE_PRODUCT_PRODUCT', - $installer->getTable('catalog/product_website'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', - 'CASCADE', - 'CASCADE', - true, -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.69-0.7.70.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.69-0.7.70.php deleted file mode 100644 index b0678ff9462..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.69-0.7.70.php +++ /dev/null @@ -1,36 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('catalog/compare_item'), - 'store_id', - 'smallint unsigned default null', -); -$installer->getConnection()->addConstraint( - 'FK_CATALOG_COMPARE_ITEM_STORE', - $installer->getTable('catalog/compare_item'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'set null', - 'cascade', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.7-0.7.8.php deleted file mode 100644 index 5ef9d8383fc..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ /dev/null @@ -1,74 +0,0 @@ -startSetup(); - -$installer->addAttribute('catalog_product', 'media_gallery', [ - 'group' => 'Images', - 'label' => 'Media Gallery', - 'input' => 'gallery', - 'backend' => 'catalog/product_attribute_backend_media', - 'class' => '', - 'global' => true, - 'visible' => true, - 'required' => false, - 'user_defined' => false, - 'visible_on_front' => false, -]); -$installer->run(" - DROP TABLE IF EXISTS `{$this->getTable('catalog_product_entity_media_gallery')}`; - CREATE TABLE `{$this->getTable('catalog_product_entity_media_gallery')}` ( - `value_id` int(11) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) default NULL, - PRIMARY KEY (`value_id`), - KEY `FK_CATALOG_PRODUCT_MEDIA_GALLERY_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOG_PRODUCT_MEDIA_GALLERY_ENTITY` (`entity_id`), - KEY `FK_CATALOG_PRODUCT_MEDIA_GALLERY_ENTITY_TYPE` (`entity_type_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog product media gallery'; - - DROP TABLE IF EXISTS `{$this->getTable('catalog_product_entity_media_gallery_value')}`; - CREATE TABLE `{$this->getTable('catalog_product_entity_media_gallery_value')}` ( - `value_id` int(11) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `label` varchar(255) default NULL, - `position` int(11) unsigned default NULL, - `disabled` tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (`value_id`,`store_id`), - KEY `FK_CATALOG_PRODUCT_MEDIA_GALLERY_VALUE_STORE` (`store_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_VALUE_GALLERY` FOREIGN KEY (`value_id`) REFERENCES `{$this->getTable('catalog_product_entity_media_gallery')}` (`value_id`) ON DELETE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_VALUE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog product media gallery values'; - - DROP TABLE IF EXISTS `{$this->getTable('catalog_product_entity_media_gallery_image')}`; - CREATE TABLE `{$this->getTable('catalog_product_entity_media_gallery_image')}` ( - `value_id` int(11) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `type` varchar(50) NOT NULL default '', - PRIMARY KEY (`value_id`,`store_id`,`type`), - CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_IMAGE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_IMAGE_GALLERY` FOREIGN KEY (`value_id`) REFERENCES `{$this->getTable('catalog_product_entity_media_gallery')}` (`value_id`) ON DELETE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Catalog product media gallery images'; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.70-0.7.71.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.70-0.7.71.php deleted file mode 100644 index bbc0241f148..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.70-0.7.71.php +++ /dev/null @@ -1,19 +0,0 @@ -startSetup(); -$this->getConnection()->query("DROP TABLE IF EXISTS `{$this->getTable('catalog/category_flat')}`;"); -$this->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.71-0.7.72.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.71-0.7.72.php deleted file mode 100644 index 1f663d5d78c..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.71-0.7.72.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->removeAttribute('catalog_product', 'category_ids'); -$installer->getConnection()->dropColumn($installer->getTable('catalog/product'), 'category_ids'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.72-0.7.73.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.72-0.7.73.php deleted file mode 100644 index a02959d4502..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.72-0.7.73.php +++ /dev/null @@ -1,65 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_super_attribute_label'), - 'FK_SUPER_PRODUCT_ATTRIBUTE_LABEL', -); -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_super_attribute_label'), - 'catalog_product_super_attribute_label_ibfk_1', -); -$installer->getConnection()->dropKey( - $installer->getTable('catalog/product_super_attribute_label'), - 'IDX_CATALOG_PRODUCT_SUPER_ATTRIBUTE_STORE_PSAI_SI', -); -$installer->getConnection()->addColumn( - $installer->getTable('catalog/product_super_attribute_label'), - 'use_default', - 'tinyint(1) UNSIGNED DEFAULT 0 AFTER store_id', -); -$installer->getConnection()->addConstraint( - 'FK_CATALOG_PRODUCT_SUPER_ATTRIBUTE_LABEL_ATTRIBUTE', - $installer->getTable('catalog/product_super_attribute_label'), - 'product_super_attribute_id', - $installer->getTable('catalog/product_super_attribute'), - 'product_super_attribute_id', - 'cascade', - 'cascade', - true, -); -$installer->getConnection()->addConstraint( - 'FK_CATALOG_PRODUCT_SUPER_ATTRIBUTE_LABEL_STORE', - $installer->getTable('catalog/product_super_attribute_label'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'cascade', - 'cascade', - true, -); -$installer->getConnection()->addKey( - $installer->getTable('catalog/product_super_attribute_label'), - 'UNQ_ATTRIBUTE_STORE', - ['product_super_attribute_id', 'store_id'], - 'unique', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.73-1.4.0.0.0.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.73-1.4.0.0.0.php deleted file mode 100644 index 97aef3b1a50..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.73-1.4.0.0.0.php +++ /dev/null @@ -1,88 +0,0 @@ -startSetup(); - -$installer->updateEntityType('catalog_category', 'additional_attribute_table', 'catalog/eav_attribute'); -$installer->updateEntityType('catalog_product', 'additional_attribute_table', 'catalog/eav_attribute'); -$installer->updateEntityType('catalog_category', 'entity_attribute_collection', 'catalog/attribute_collection'); -$installer->updateEntityType('catalog_product', 'entity_attribute_collection', 'catalog/attribute_collection'); -$installer->run(" -CREATE TABLE `{$installer->getTable('catalog/eav_attribute')}` ( - `attribute_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, - `frontend_input_renderer` varchar(255) DEFAULT NULL, - `is_global` tinyint(1) unsigned NOT NULL DEFAULT '1', - `is_visible` tinyint(1) unsigned NOT NULL DEFAULT '1', - `is_searchable` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_filterable` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_comparable` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_visible_on_front` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_html_allowed_on_front` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_used_for_price_rules` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_filterable_in_search` tinyint(1) unsigned NOT NULL DEFAULT '0', - `used_in_product_listing` tinyint(1) unsigned NOT NULL DEFAULT '0', - `used_for_sort_by` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_configurable` tinyint(1) unsigned NOT NULL DEFAULT '1', - `apply_to` varchar(255) NOT NULL, - `is_visible_in_advanced_search` tinyint(1) unsigned NOT NULL DEFAULT '0', - `position` int(11) NOT NULL, - PRIMARY KEY (`attribute_id`), - KEY `IDX_USED_FOR_SORT_BY` (`used_for_sort_by`), - KEY `IDX_USED_IN_PRODUCT_LISTING` (`used_in_product_listing`), - CONSTRAINT `FK_CATALOG_EAV_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav/attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$fields = []; -$describe = $installer->getConnection()->describeTable($installer->getTable('catalog/eav_attribute')); -foreach ($describe as $columnData) { - $fields[] = $columnData['COLUMN_NAME']; -} -$stmt = $installer->getConnection()->select() - ->from($installer->getTable('eav/attribute'), $fields) - ->where('entity_type_id = ?', $installer->getEntityTypeId('catalog_category')) - ->orWhere('entity_type_id = ?', $installer->getEntityTypeId('catalog_product')); -$result = $installer->getConnection()->fetchAll($stmt); -$table = $installer->getTable('catalog/eav_attribute'); -foreach ($result as $data) { - $installer->getConnection()->insert($table, $data); -} - -$describe = $installer->getConnection()->describeTable($installer->getTable('catalog/eav_attribute')); -foreach ($describe as $columnData) { - if ($columnData['COLUMN_NAME'] == 'attribute_id') { - continue; - } - $installer->getConnection()->dropColumn($installer->getTable('eav/attribute'), $columnData['COLUMN_NAME']); -} - -$prefix = Mage_Catalog_Model_Entity_Attribute::MODULE_NAME . Mage_Core_Model_Translate::SCOPE_SEPARATOR; -$sql = " - INSERT - INTO `{$installer->getTable('eav/attribute_label')}` (`attribute_id`, `store_id`, `value`) - SELECT - `attribute`.attribute_id, `translate`.store_id, `translate`.translate - FROM - `{$installer->getTable('eav/attribute')}` AS `attribute` - INNER JOIN `{$installer->getTable('core/translate')}` AS `translate` ON `translate`.string = CONCAT('{$prefix}', `attribute`.frontend_label) - WHERE - `translate`.store_id != 0 -"; -$installer->getConnection()->query($sql); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.8-0.7.9.php deleted file mode 100644 index 28b0d601db1..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ /dev/null @@ -1,29 +0,0 @@ -startSetup(); - -$installer->run(" - DROP TABLE IF EXISTS `{$this->getTable('catalog_product_entity_media_gallery_image')}`; -"); -$installer->getConnection()->dropColumn($this->getTable('catalog_product_entity_media_gallery'), 'entity_type_id'); -$installer->updateAttribute('catalog_product', 'image', 'frontend_input', 'media_image'); -$installer->updateAttribute('catalog_product', 'small_image', 'frontend_input', 'media_image'); -$installer->updateAttribute('catalog_product', 'thumbnail', 'frontend_input', 'media_image'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php deleted file mode 100644 index e695a1d1218..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$installer->getConnection()->modifyColumn( - $installer->getTable('catalog/product') . '_int', - 'value', - 'int(11) default NULL', -); -$installer->getConnection()->modifyColumn( - $installer->getTable('catalog/product') . '_decimal', - 'value', - 'decimal(12,4) default NULL', -); -$installer->getConnection()->modifyColumn( - $installer->getTable('catalog/product') . '_datetime', - 'value', - 'datetime default NULL', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php deleted file mode 100644 index 7fb40338e56..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$installer->getConnection()->modifyColumn( - $installer->getTable('catalog/category') . '_int', - 'value', - 'int(11) default NULL', -); -$installer->getConnection()->modifyColumn( - $installer->getTable('catalog/category') . '_decimal', - 'value', - 'decimal(12,4) default NULL', -); -$installer->getConnection()->modifyColumn( - $installer->getTable('catalog/category') . '_datetime', - 'value', - 'datetime default NULL', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php deleted file mode 100644 index 70a8853b420..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php +++ /dev/null @@ -1,25 +0,0 @@ -updateAttribute( - 'catalog_product', - 'custom_layout_update', - 'is_global', - Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, -); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.11-1.4.0.0.12.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.11-1.4.0.0.12.php deleted file mode 100644 index 978c90ffc09..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.11-1.4.0.0.12.php +++ /dev/null @@ -1,21 +0,0 @@ -updateAttribute('catalog_category', 'url_path', 'is_unique', 0); -$installer->updateAttribute('catalog_product', 'url_path', 'is_unique', 0); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php deleted file mode 100644 index 76b6308f129..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php +++ /dev/null @@ -1,38 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$installer->getTable('catalog/product_index_eav_decimal')}` ( - `entity_id` int(10) unsigned NOT NULL, - `attribute_id` smallint(5) unsigned NOT NULL, - `store_id` smallint(5) unsigned NOT NULL, - `value` decimal(12, 4) NOT NULL, - PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`), - KEY `IDX_ENTITY` (`entity_id`), - KEY `IDX_ATTRIBUTE` (`attribute_id`), - KEY `IDX_STORE` (`store_id`), - KEY `IDX_VALUE` (`value`), - CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav/attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('catalog/product')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.13-1.4.0.0.14.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.13-1.4.0.0.14.php deleted file mode 100644 index 8dcc4077df8..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.13-1.4.0.0.14.php +++ /dev/null @@ -1,65 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropKey( - $installer->getTable('catalog/product_option_price'), - 'IDX_CATALOG_PRODUCT_OPTION_PRICE_SI_OI', -); -$installer->getConnection()->addKey( - $installer->getTable('catalog/product_option_price'), - 'UNQ_OPTION_STORE', - ['option_id', 'store_id'], - 'unique', -); - -$installer->getConnection()->dropKey( - $installer->getTable('catalog/product_option_title'), - 'IDX_CATALOG_PRODUCT_OPTION_TITLE_SI_OI', -); -$installer->getConnection()->addKey( - $installer->getTable('catalog/product_option_title'), - 'UNQ_OPTION_STORE', - ['option_id', 'store_id'], - 'unique', -); - -$installer->getConnection()->dropKey( - $installer->getTable('catalog/product_option_type_price'), - 'IDX_CATALOG_PRODUCT_OPTION_TYPE_PRICE_SI_OTI', -); -$installer->getConnection()->addKey( - $installer->getTable('catalog/product_option_type_price'), - 'UNQ_OPTION_TYPE_STORE', - ['option_type_id', 'store_id'], - 'unique', -); - -$installer->getConnection()->dropKey( - $installer->getTable('catalog/product_option_type_title'), - 'IDX_CATALOG_PRODUCT_OPTION_TYPE_TITLE_SI_OTI', -); -$installer->getConnection()->addKey( - $installer->getTable('catalog/product_option_type_title'), - 'UNQ_OPTION_TYPE_STORE', - ['option_type_id', 'store_id'], - 'unique', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.14-1.4.0.0.15.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.14-1.4.0.0.15.php deleted file mode 100644 index 9c15375db47..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.14-1.4.0.0.15.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('catalog/eav_attribute'), - 'is_wysiwyg_enabled', - "TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'", -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.15-1.4.0.0.16.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.15-1.4.0.0.16.php deleted file mode 100644 index fa22b3cf9e6..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.15-1.4.0.0.16.php +++ /dev/null @@ -1,15 +0,0 @@ -startSetup(); -$installer->getConnection()->dropColumn($installer->getTable('catalog/compare_item'), 'is_dirty'); -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.17-1.4.0.0.18.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.17-1.4.0.0.18.php deleted file mode 100644 index b04d22632cd..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.17-1.4.0.0.18.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup(); - -$installer->getConnection()->addKey( - $installer->getTable('catalog/product_attribute_tier_price'), - 'UNQ_CATALOG_PRODUCT_TIER_PRICE', - ['entity_id', 'all_groups', 'customer_group_id', 'qty', 'website_id'], - 'unique', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.18-1.4.0.0.19.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.18-1.4.0.0.19.php deleted file mode 100644 index 33262336736..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.18-1.4.0.0.19.php +++ /dev/null @@ -1,25 +0,0 @@ -getTable('catalog/category_product'); - -/** - * Remove data duplicates - */ -$installer->getConnection()->changeColumn($table, 'position', 'position', "INT( 10 ) NOT NULL DEFAULT '0'"); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.19-1.4.0.0.20.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.19-1.4.0.0.20.php deleted file mode 100644 index 6495ae18d88..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.19-1.4.0.0.20.php +++ /dev/null @@ -1,48 +0,0 @@ -run(" --- Removing old index tables if exists -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product')}_tier_price_idx`; -DROP TABLE IF EXISTS `{$installer->getTable('core/website')}_date_idx`; - -CREATE TABLE IF NOT EXISTS `{$installer->getTable('catalog/product_index_tier_price')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `customer_group_id` SMALLINT(5) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `min_price` DECIMAL(12,4) DEFAULT NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_ENTITY` FOREIGN KEY (`entity_id`) - REFERENCES `{$this->getTable('catalog/product')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_CUSTOMER` FOREIGN KEY (`customer_group_id`) - REFERENCES `{$this->getTable('customer/customer_group')}` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_WEBSITE` FOREIGN KEY (`website_id`) - REFERENCES `{$this->getTable('core/website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=INNODB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `{$installer->getTable('catalog/product_index_website')}` ( - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `date` DATE DEFAULT NULL, - `rate` FLOAT(12, 4) UNSIGNED DEFAULT 1, - PRIMARY KEY (`website_id`), - KEY `IDX_DATE` (`date`), - CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_WEBSITE` FOREIGN KEY (`website_id`) - REFERENCES `{$this->getTable('core/website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=INNODB DEFAULT CHARSET=utf8; -"); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php deleted file mode 100644 index 11d59f868c2..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php +++ /dev/null @@ -1,38 +0,0 @@ -startSetup(); - -$attributes = [ - $installer->getAttributeId('catalog_product', 'cost'), -]; - -$sql = $installer->getConnection()->quoteInto("SELECT * FROM `{$installer->getTable('catalog/eav_attribute')}` WHERE attribute_id IN (?)", $attributes); -$data = $installer->getConnection()->fetchAll($sql); - -foreach ($data as $row) { - $row['apply_to'] = array_flip(explode(',', $row['apply_to'])); - unset($row['apply_to']['configurable']); - $row['apply_to'] = implode(',', array_flip($row['apply_to'])); - - $installer->run("UPDATE `{$installer->getTable('catalog/eav_attribute')}` - SET `apply_to` = '{$row['apply_to']}' - WHERE `attribute_id` = {$row['attribute_id']}"); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.20-1.4.0.0.21.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.20-1.4.0.0.21.php deleted file mode 100644 index 52abb9315d1..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.20-1.4.0.0.21.php +++ /dev/null @@ -1,25 +0,0 @@ -getTable('catalog/category_product_index'); - -/** - * Remove data duplicates - */ -$installer->getConnection()->changeColumn($table, 'position', 'position', "INT( 10 ) NOT NULL DEFAULT '0'"); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.21-1.4.0.0.22.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.21-1.4.0.0.22.php deleted file mode 100644 index 2112fd1c626..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.21-1.4.0.0.22.php +++ /dev/null @@ -1,52 +0,0 @@ -startSetup(); - -$entityTypeId = $installer->getEntityTypeId('catalog_category'); -$attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId); -$attributeGroupId = $installer->getDefaultAttributeGroupId($entityTypeId, $attributeSetId); - -$installer->addAttribute('catalog_category', 'include_in_menu', [ - 'type' => 'int', - 'label' => 'Include in Navigation Menu', - 'input' => 'select', - 'source' => 'eav/entity_attribute_source_boolean', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, - 'required' => false, - 'default' => 1, -]); - -$installer->addAttributeToGroup( - $entityTypeId, - $attributeSetId, - $attributeGroupId, - 'include_in_menu', - '10', -); - -$attributeId = $installer->getAttributeId($entityTypeId, 'include_in_menu'); - -$installer->run(" -INSERT INTO `{$installer->getTable('catalog_category_entity_int')}` -(`entity_type_id`, `attribute_id`, `entity_id`, `value`) - SELECT '{$entityTypeId}', '{$attributeId}', `entity_id`, '1' - FROM `{$installer->getTable('catalog_category_entity')}`; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.22-1.4.0.0.23.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.22-1.4.0.0.23.php deleted file mode 100644 index d94abc2679b..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.22-1.4.0.0.23.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup(); - -$installer->getConnection()->addKey( - $installer->getTable('catalog/product_link'), - 'IDX_UNIQUE', - ['link_type_id', 'product_id', 'linked_product_id'], - 'unique', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.23-1.4.0.0.24.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.23-1.4.0.0.24.php deleted file mode 100644 index 32b6c4c81ef..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.23-1.4.0.0.24.php +++ /dev/null @@ -1,314 +0,0 @@ -startSetup(); - -$installer->run(" - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_index_price')}_idx_cfg_opt_aggregate`; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_price_indexer_cfg_option_aggregate_idx')}`; -CREATE TABLE `{$installer->getTable('catalog/product_price_indexer_cfg_option_aggregate_idx')}` ( - `parent_id` int(10) unsigned NOT NULL, - `child_id` int(10) unsigned NOT NULL, - `customer_group_id` smallint(5) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `price` decimal(12,4) default NULL, - `tier_price` decimal(12,4) default NULL, - PRIMARY KEY (`parent_id`,`child_id`,`customer_group_id`,`website_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_price_indexer_cfg_option_aggregate_tmp')}`; -CREATE TABLE `{$installer->getTable('catalog/product_price_indexer_cfg_option_aggregate_tmp')}` ( - `entity_id` int(10) unsigned NOT NULL, - `customer_group_id` smallint(5) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `min_price` decimal(12,4) default NULL, - `max_price` decimal(12,4) default NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_index_price')}_idx_cfg_option`; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_price_indexer_cfg_option_idx')}`; -CREATE TABLE `{$installer->getTable('catalog/product_price_indexer_cfg_option_idx')}` ( - `entity_id` int(10) unsigned NOT NULL, - `customer_group_id` smallint(5) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `min_price` decimal(12,4) default NULL, - `max_price` decimal(12,4) default NULL, - `tier_price` decimal(12,4) default NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_price_indexer_cfg_option_tmp')}`; -CREATE TABLE `{$installer->getTable('catalog/product_price_indexer_cfg_option_tmp')}` ( - `entity_id` int(10) unsigned NOT NULL, - `customer_group_id` smallint(5) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `min_price` decimal(12,4) default NULL, - `max_price` decimal(12,4) default NULL, - `tier_price` decimal(12,4) default NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_index_price')}_final_idx`; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_price_indexer_final_idx')}`; -CREATE TABLE `{$installer->getTable('catalog/product_price_indexer_final_idx')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `customer_group_id` SMALLINT(5) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `tax_class_id` SMALLINT(5) UNSIGNED DEFAULT '0', - `orig_price` DECIMAL(12,4) DEFAULT NULL, - `price` DECIMAL(12,4) DEFAULT NULL, - `min_price` DECIMAL(12,4) DEFAULT NULL, - `max_price` DECIMAL(12,4) DEFAULT NULL, - `tier_price` DECIMAL(12,4) DEFAULT NULL, - `base_tier` DECIMAL(12,4) DEFAULT NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_price_indexer_final_tmp')}`; -CREATE TABLE `{$installer->getTable('catalog/product_price_indexer_final_tmp')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `customer_group_id` SMALLINT(5) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `tax_class_id` SMALLINT(5) UNSIGNED DEFAULT '0', - `orig_price` DECIMAL(12,4) DEFAULT NULL, - `price` DECIMAL(12,4) DEFAULT NULL, - `min_price` DECIMAL(12,4) DEFAULT NULL, - `max_price` DECIMAL(12,4) DEFAULT NULL, - `tier_price` DECIMAL(12,4) DEFAULT NULL, - `base_tier` DECIMAL(12,4) DEFAULT NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_index_price')}_idx_option`; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_price_indexer_option_idx')}`; -CREATE TABLE `{$installer->getTable('catalog/product_price_indexer_option_idx')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `customer_group_id` SMALLINT(5) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `min_price` DECIMAL(12,4) DEFAULT NULL, - `max_price` DECIMAL(12,4) DEFAULT NULL, - `tier_price` DECIMAL(12,4) DEFAULT NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_price_indexer_option_tmp')}`; -CREATE TABLE `{$installer->getTable('catalog/product_price_indexer_option_tmp')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `customer_group_id` SMALLINT(5) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `min_price` DECIMAL(12,4) DEFAULT NULL, - `max_price` DECIMAL(12,4) DEFAULT NULL, - `tier_price` DECIMAL(12,4) DEFAULT NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_index_price')}_idx_option_aggregate`; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_price_indexer_option_aggregate_idx')}`; -CREATE TABLE `{$installer->getTable('catalog/product_price_indexer_option_aggregate_idx')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `customer_group_id` SMALLINT(5) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `option_id` INT(10) UNSIGNED DEFAULT '0', - `min_price` DECIMAL(12,4) DEFAULT NULL, - `max_price` DECIMAL(12,4) DEFAULT NULL, - `tier_price` DECIMAL(12,4) DEFAULT NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`, `option_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_price_indexer_option_aggregate_tmp')}`; -CREATE TABLE `{$installer->getTable('catalog/product_price_indexer_option_aggregate_tmp')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `customer_group_id` SMALLINT(5) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `option_id` INT(10) UNSIGNED DEFAULT '0', - `min_price` DECIMAL(12,4) DEFAULT NULL, - `max_price` DECIMAL(12,4) DEFAULT NULL, - `tier_price` DECIMAL(12,4) DEFAULT NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`, `option_id`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_index_eav')}_idx`; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_eav_indexer_idx')}`; -CREATE TABLE `{$installer->getTable('catalog/product_eav_indexer_idx')}` ( - `entity_id` int(10) unsigned NOT NULL, - `attribute_id` smallint(5) unsigned NOT NULL, - `store_id` smallint(5) unsigned NOT NULL, - `value` int(10) unsigned NOT NULL, - PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`), - KEY `IDX_ENTITY` (`entity_id`), - KEY `IDX_ATTRIBUTE` (`attribute_id`), - KEY `IDX_STORE` (`store_id`), - KEY `IDX_VALUE` (`value`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_eav_indexer_tmp')}`; -CREATE TABLE `{$installer->getTable('catalog/product_eav_indexer_tmp')}` ( - `entity_id` int(10) unsigned NOT NULL, - `attribute_id` smallint(5) unsigned NOT NULL, - `store_id` smallint(5) unsigned NOT NULL, - `value` int(10) unsigned NOT NULL, - PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`), - KEY `IDX_ENTITY` (`entity_id`), - KEY `IDX_ATTRIBUTE` (`attribute_id`), - KEY `IDX_STORE` (`store_id`), - KEY `IDX_VALUE` (`value`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_index_eav_decimal')}_idx`; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_eav_decimal_indexer_idx')}`; -CREATE TABLE `{$installer->getTable('catalog/product_eav_decimal_indexer_idx')}` ( - `entity_id` int(10) unsigned NOT NULL, - `attribute_id` smallint(5) unsigned NOT NULL, - `store_id` smallint(5) unsigned NOT NULL, - `value` decimal(12,4) NOT NULL, - PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`), - KEY `IDX_ENTITY` (`entity_id`), - KEY `IDX_ATTRIBUTE` (`attribute_id`), - KEY `IDX_STORE` (`store_id`), - KEY `IDX_VALUE` (`value`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_eav_decimal_indexer_tmp')}`; -CREATE TABLE `{$installer->getTable('catalog/product_eav_decimal_indexer_tmp')}` ( - `entity_id` int(10) unsigned NOT NULL, - `attribute_id` smallint(5) unsigned NOT NULL, - `store_id` smallint(5) unsigned NOT NULL, - `value` decimal(12,4) NOT NULL, - PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`), - KEY `IDX_ENTITY` (`entity_id`), - KEY `IDX_ATTRIBUTE` (`attribute_id`), - KEY `IDX_STORE` (`store_id`), - KEY `IDX_VALUE` (`value`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_index_price')}_idx`; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_price_indexer_idx')}`; -CREATE TABLE `{$installer->getTable('catalog/product_price_indexer_idx')}` ( - `entity_id` int(10) unsigned NOT NULL, - `customer_group_id` smallint(5) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `tax_class_id` smallint(5) unsigned default '0', - `price` decimal(12,4) default NULL, - `final_price` decimal(12,4) default NULL, - `min_price` decimal(12,4) default NULL, - `max_price` decimal(12,4) default NULL, - `tier_price` decimal(12,4) default NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`), - KEY `IDX_CUSTOMER_GROUP` (`customer_group_id`), - KEY `IDX_WEBSITE` (`website_id`), - KEY `IDX_MIN_PRICE` (`min_price`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_price_indexer_tmp')}`; -CREATE TABLE `{$installer->getTable('catalog/product_price_indexer_tmp')}` ( - `entity_id` int(10) unsigned NOT NULL, - `customer_group_id` smallint(5) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `tax_class_id` smallint(5) unsigned default '0', - `price` decimal(12,4) default NULL, - `final_price` decimal(12,4) default NULL, - `min_price` decimal(12,4) default NULL, - `max_price` decimal(12,4) default NULL, - `tier_price` decimal(12,4) default NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`), - KEY `IDX_CUSTOMER_GROUP` (`customer_group_id`), - KEY `IDX_WEBSITE` (`website_id`), - KEY `IDX_MIN_PRICE` (`min_price`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/category_product_index')}_idx`; - -CREATE TABLE `{$installer->getTable('catalog/category_product_indexer_idx')}` ( - `category_id` int(10) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `position` int(10) NOT NULL default '0', - `is_parent` tinyint(1) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `visibility` tinyint(3) unsigned NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/category_product_indexer_tmp')}`; -CREATE TABLE `{$installer->getTable('catalog/category_product_indexer_tmp')}` ( - `category_id` int(10) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `position` int(10) NOT NULL default '0', - `is_parent` tinyint(1) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `visibility` tinyint(3) unsigned NOT NULL -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('tmp_category_index_enabled_products')}`; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/category_product_enabled_indexer_idx')}`; -CREATE TABLE `{$installer->getTable('catalog/category_product_enabled_indexer_idx')}` ( - `product_id` int(10) unsigned NOT NULL DEFAULT '0', - `visibility` int(11) unsigned NOT NULL DEFAULT '0', - KEY `IDX_PRODUCT` (`product_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/category_product_enabled_indexer_tmp')}`; -CREATE TABLE `{$installer->getTable('catalog/category_product_enabled_indexer_tmp')}` ( - `product_id` int(10) unsigned NOT NULL DEFAULT '0', - `visibility` int(11) unsigned NOT NULL DEFAULT '0', - KEY `IDX_PRODUCT` (`product_id`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('tmp_category_index_anchor_categories')}`; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/category_anchor_indexer_idx')}`; -CREATE TABLE `{$installer->getTable('catalog/category_anchor_indexer_idx')}` ( - `category_id` int(10) unsigned NOT NULL DEFAULT '0', - `path` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '', - KEY `IDX_CATEGORY` (`category_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/category_anchor_indexer_tmp')}`; -CREATE TABLE `{$installer->getTable('catalog/category_anchor_indexer_tmp')}` ( - `category_id` int(10) unsigned NOT NULL DEFAULT '0', - `path` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '', - KEY `IDX_CATEGORY` (`category_id`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('tmp_category_index_anchor_products')}`; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/category_anchor_products_indexer_idx')}`; -CREATE TABLE `{$installer->getTable('catalog/category_anchor_products_indexer_idx')}` ( - `category_id` int(10) unsigned NOT NULL DEFAULT '0', - `product_id` int(10) unsigned NOT NULL DEFAULT '0' -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('catalog/category_anchor_products_indexer_tmp')}`; -CREATE TABLE `{$installer->getTable('catalog/category_anchor_products_indexer_tmp')}` ( - `category_id` int(10) unsigned NOT NULL DEFAULT '0', - `product_id` int(10) unsigned NOT NULL DEFAULT '0' -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.24-1.4.0.0.25.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.24-1.4.0.0.25.php deleted file mode 100644 index 1587fe06aea..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.24-1.4.0.0.25.php +++ /dev/null @@ -1,33 +0,0 @@ -getConnection()->modifyColumn( - $installer->getTable('catalog/eav_attribute'), - 'is_used_for_price_rules', - "TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'deprecated after 1.4.0.1'", -); - -$installer->getConnection()->addColumn( - $installer->getTable('catalog/eav_attribute'), - 'is_used_for_promo_rules', - "TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'", -); - -$installer->run("UPDATE {$installer->getTable('catalog/eav_attribute')} - SET is_used_for_promo_rules = is_used_for_price_rules"); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.25-1.4.0.0.26.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.25-1.4.0.0.26.php deleted file mode 100644 index 9698c9bcd4e..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.25-1.4.0.0.26.php +++ /dev/null @@ -1,31 +0,0 @@ -run(" - DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_price_indexer_cfg_option_aggregate_tmp')}`; - CREATE TABLE `{$installer->getTable('catalog/product_price_indexer_cfg_option_aggregate_tmp')}` ( - `parent_id` int(10) unsigned NOT NULL, - `child_id` int(10) unsigned NOT NULL, - `customer_group_id` smallint(5) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `price` decimal(12,4) default NULL, - `tier_price` decimal(12,4) default NULL, - PRIMARY KEY (`parent_id`,`child_id`,`customer_group_id`,`website_id`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; -"); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.26-1.4.0.0.27.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.26-1.4.0.0.27.php deleted file mode 100644 index fb3f4fead44..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.26-1.4.0.0.27.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$productEntityTypeId = $installer->getEntityTypeId('catalog_product'); - -$installer->updateAttribute($productEntityTypeId, 'minimal_price', 'is_required', 0); -$installer->updateAttribute($productEntityTypeId, 'required_options', 'is_required', 0); -$installer->updateAttribute($productEntityTypeId, 'has_options', 'is_required', 0); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.27-1.4.0.0.28.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.27-1.4.0.0.28.php deleted file mode 100644 index d215f675819..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.27-1.4.0.0.28.php +++ /dev/null @@ -1,67 +0,0 @@ -addAttribute('catalog_product', 'is_recurring', [ - 'group' => 'Recurring Profile', - 'type' => 'int', - 'backend' => '', - 'frontend' => '', - 'label' => 'Enable Recurring Profile', - 'note' => 'Products with recurring profile participate in catalog as nominal items.', - 'input' => 'select', - 'class' => '', - 'source' => 'eav/entity_attribute_source_boolean', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, - 'visible' => true, - 'required' => false, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'simple,virtual', - 'is_configurable' => false, -]); - -// recurring payment profile -$installer->addAttribute('catalog_product', 'recurring_profile', [ - 'group' => 'Recurring Profile', - 'type' => 'text', - 'backend' => 'catalog/product_attribute_backend_recurring', - 'frontend' => '', - 'label' => 'Recurring Payment Profile', - 'input' => 'text', // doesn't matter - 'class' => '', - 'source' => '', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, - 'visible' => true, - 'required' => false, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'simple,virtual', - 'is_configurable' => false, -]); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.28-1.4.0.0.29.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.28-1.4.0.0.29.php deleted file mode 100644 index d9e55e38f7b..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.28-1.4.0.0.29.php +++ /dev/null @@ -1,87 +0,0 @@ -startSetup(); - -$entityTypeId = $installer->getEntityTypeId('catalog_category'); -$designApplyAttributeId = $installer->getAttributeId($entityTypeId, 'custom_design_apply'); -$designAttributeId = $installer->getAttributeId($entityTypeId, 'custom_design'); -$catalogCategoryEntityIntTable = $installer->getAttributeTable($entityTypeId, $designApplyAttributeId); -$eavAttributeTable = $installer->getTable('eav/attribute'); - -$installer->addAttribute($entityTypeId, 'custom_use_parent_settings', [ - 'type' => 'int', - 'input' => 'select', - 'label' => 'Use Parent Category Settings', - 'source' => 'eav/entity_attribute_source_boolean', - 'required' => 0, - 'group' => 'Custom Design', - 'sort_order' => '5', - 'global' => 0, -]); -$installer->addAttribute($entityTypeId, 'custom_apply_to_products', [ - 'type' => 'int', - 'input' => 'select', - 'label' => 'Apply To Products', - 'source' => 'eav/entity_attribute_source_boolean', - 'required' => 0, - 'group' => 'Custom Design', - 'sort_order' => '6', - 'global' => 0, -]); -$useParentSettingsAttributeId = $installer->getAttributeId($entityTypeId, 'custom_use_parent_settings'); -$applyToProductsAttributeId = $installer->getAttributeId($entityTypeId, 'custom_apply_to_products'); - -$attributeIdExpr = new Zend_Db_Expr( - 'IF (e_a.attribute_id = e.attribute_id,' . - $useParentSettingsAttributeId . ', ' . - $applyToProductsAttributeId . ')', -); -$productValueExpr = new Zend_Db_Expr('IF (e.value IN (1,3), 1, 0)'); -$valueExpr = new Zend_Db_Expr('IF (e_a.attribute_id = e.attribute_id, 1, ' . $productValueExpr . ')'); -$select = $installer->getConnection()->select() - ->from( - ['e' => $catalogCategoryEntityIntTable], - [ - 'entity_type_id', - 'attribute_id' => $attributeIdExpr, - 'store_id', - 'entity_id', - 'value' => $valueExpr, - ], - ) - ->joinCross( - ['e_a' => $eavAttributeTable], - [], - ) - ->where('e_a.attribute_id IN (?)', [$designApplyAttributeId, $designAttributeId]) - ->where('e.attribute_id = ?', $designApplyAttributeId) - ->order(['e.entity_id', 'attribute_id']); - -$insertArray = [ - 'entity_type_id', - 'attribute_id', - 'store_id', - 'entity_id', - 'value', -]; - -$sqlQuery = $select->insertFromSelect($catalogCategoryEntityIntTable, $insertArray, false); -$installer->getConnection()->query($sqlQuery); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php deleted file mode 100644 index 2cd3d7d1b9a..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->updateEntityType('catalog_category', 'entity_attribute_collection', 'catalog/category_attribute_collection'); -$installer->updateEntityType('catalog_product', 'entity_attribute_collection', 'catalog/product_attribute_collection'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.30-1.4.0.0.31.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.30-1.4.0.0.31.php deleted file mode 100644 index 484720e4949..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.30-1.4.0.0.31.php +++ /dev/null @@ -1,28 +0,0 @@ -addAttribute('catalog_category', 'filter_price_range', [ - 'group' => 'Display Settings', - 'type' => 'int', - 'label' => 'Layered Navigation Price Step', - 'required' => false, - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, - 'visible' => 1, - 'input_renderer' => 'adminhtml/catalog_category_helper_pricestep', -]); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.31-1.4.0.0.32.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.31-1.4.0.0.32.php deleted file mode 100644 index b1229134408..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.31-1.4.0.0.32.php +++ /dev/null @@ -1,26 +0,0 @@ -getConnection(); - -$indexTable = $installer->getTable('catalog/category_product_index'); -$connection->modifyColumn($indexTable, 'position', 'int(10) unsigned NULL default NULL'); - -$tmpTable = $installer->getTable('catalog/category_anchor_products_indexer_idx'); -$connection->addColumn($tmpTable, 'position', 'int(10) unsigned NULL default NULL'); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.32-1.4.0.0.33.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.32-1.4.0.0.33.php deleted file mode 100644 index effe443ce1d..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.32-1.4.0.0.33.php +++ /dev/null @@ -1,30 +0,0 @@ -startSetup(); - -$categoryEntityTypeId = $installer->getEntityTypeId('catalog_category'); -$productEntityTypeId = $installer->getEntityTypeId('catalog_product'); -$installer->updateAttribute($categoryEntityTypeId, 'description', 'is_wysiwyg_enabled', 1); -$installer->updateAttribute($categoryEntityTypeId, 'description', 'is_html_allowed_on_front', 1); -$installer->updateAttribute($productEntityTypeId, 'description', 'is_wysiwyg_enabled', 1); -$installer->updateAttribute($productEntityTypeId, 'description', 'is_html_allowed_on_front', 1); -$installer->updateAttribute($productEntityTypeId, 'short_description', 'is_wysiwyg_enabled', 1); -$installer->updateAttribute($productEntityTypeId, 'short_description', 'is_html_allowed_on_front', 1); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.33-1.4.0.0.34.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.33-1.4.0.0.34.php deleted file mode 100644 index 00eec9cf9ae..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.33-1.4.0.0.34.php +++ /dev/null @@ -1,23 +0,0 @@ -removeAttribute('catalog_category', 'custom_design_apply'); - -// the fix for a typo that was in mysql4-upgrade-0.7.71-0.7.72 line 32 -$installer->removeAttribute('catalog_product', 'category_ids'); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.34-1.4.0.0.35.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.34-1.4.0.0.35.php deleted file mode 100644 index 667240a1658..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.34-1.4.0.0.35.php +++ /dev/null @@ -1,24 +0,0 @@ -getEntityTypeId('catalog_product'); -$installer->run(" - UPDATE `{$installer->getTable('eav/attribute')}` - SET `source_model` = 'eav/entity_attribute_source_boolean' - WHERE `entity_type_id` = {$entityTypeId} AND `frontend_input` = 'boolean'"); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.35-1.4.0.0.36.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.35-1.4.0.0.36.php deleted file mode 100644 index 78bf55fa88f..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.35-1.4.0.0.36.php +++ /dev/null @@ -1,43 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_super_attribute_label'), - 'FK_CATALOG_PRODUCT_SUPER_ATTRIBUTE_LABEL_ATTRIBUTE', -); -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_super_attribute_label'), - 'FK_CATALOG_PRODUCT_SUPER_ATTRIBUTE_LABEL_STORE', -); -$installer->getConnection()->addConstraint( - 'FK_CATALOG_PROD_SUPER_ATTR_LABEL_ATTR', - $installer->getTable('catalog/product_super_attribute_label'), - 'product_super_attribute_id', - $installer->getTable('catalog/product_super_attribute'), - 'product_super_attribute_id', -); -$installer->getConnection()->addConstraint( - 'FK_CATALOG_PROD_SUPER_ATTR_LABEL_STORE', - $installer->getTable('catalog/product_super_attribute_label'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.36-1.4.0.0.37.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.36-1.4.0.0.37.php deleted file mode 100644 index 9e6d3b93974..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.36-1.4.0.0.37.php +++ /dev/null @@ -1,89 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog_product_entity_datetime'), - 'FK_CATALOG_PRODUCT_ENTITY_DATETIME_PRODUCT_ENTITY', -); -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog_product_entity_decimal'), - 'FK_CATALOG_PRODUCT_ENTITY_DECIMAL_PRODUCT_ENTITY', -); -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog_product_entity_varchar'), - 'FK_CATALOG_PRODUCT_ENTITY_VARCHAR_PRODUCT_ENTITY', -); -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog_product_entity_tier_price'), - 'FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_PRODUCT_ENTITY', -); -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog_category_product_index'), - 'FK_CATALOG_CATEGORY_PRODUCT_INDEX_CATEGORY_ENTITY', -); -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog_category_product_index'), - 'FK_CATALOG_CATEGORY_PRODUCT_INDEX_PRODUCT_ENTITY', -); - -$installer->getConnection()->addConstraint( - 'FK_CATALOG_PROD_ENTITY_DATETIME_PROD_ENTITY', - $installer->getTable('catalog_product_entity_datetime'), - 'entity_id', - $installer->getTable('catalog_product_entity'), - 'entity_id', -); -$installer->getConnection()->addConstraint( - 'FK_CATALOG_PROD_ENTITY_DECIMAL_PROD_ENTITY', - $installer->getTable('catalog_product_entity_decimal'), - 'entity_id', - $installer->getTable('catalog_product_entity'), - 'entity_id', -); -$installer->getConnection()->addConstraint( - 'FK_CATALOG_PROD_ENTITY_VARCHAR_PROD_ENTITY', - $installer->getTable('catalog_product_entity_varchar'), - 'entity_id', - $installer->getTable('catalog_product_entity'), - 'entity_id', -); -$installer->getConnection()->addConstraint( - 'FK_CATALOG_PROD_ENTITY_TIER_PRICE_PROD_ENTITY', - $installer->getTable('catalog_product_entity_tier_price'), - 'entity_id', - $installer->getTable('catalog_product_entity'), - 'entity_id', -); -$installer->getConnection()->addConstraint( - 'FK_CATALOG_CATEGORY_PROD_IDX_CATEGORY_ENTITY', - $installer->getTable('catalog_category_product_index'), - 'category_id', - $installer->getTable('catalog_category_entity'), - 'entity_id', -); -$installer->getConnection()->addConstraint( - 'FK_CATALOG_CATEGORY_PROD_IDX_PROD_ENTITY', - $installer->getTable('catalog_category_product_index'), - 'product_id', - $installer->getTable('catalog_product_entity'), - 'entity_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.37-1.4.0.0.38.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.37-1.4.0.0.38.php deleted file mode 100644 index ec0532aeee5..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.37-1.4.0.0.38.php +++ /dev/null @@ -1,21 +0,0 @@ -getEntityTypeId('catalog_category'); -$installer->updateAttribute($productEntityTypeId, 'include_in_menu', 'is_required', true); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.38-1.4.0.0.39.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.38-1.4.0.0.39.php deleted file mode 100644 index 9f3bafe06d8..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.38-1.4.0.0.39.php +++ /dev/null @@ -1,24 +0,0 @@ -getEntityTypeId('catalog_product'); -$installer->updateAttribute($entityTypeId, 'custom_layout_update', 'backend_model', 'catalog/attribute_backend_customlayoutupdate'); - -$entityTypeId = $installer->getEntityTypeId('catalog_category'); -$installer->updateAttribute($entityTypeId, 'custom_layout_update', 'backend_model', 'catalog/attribute_backend_customlayoutupdate'); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.39-1.4.0.0.40.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.39-1.4.0.0.40.php deleted file mode 100644 index 1bc4e56cff0..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.39-1.4.0.0.40.php +++ /dev/null @@ -1,21 +0,0 @@ -getEntityTypeId('catalog_product'); -$installer->updateAttribute($entityTypeId, 'meta_description', 'frontend_class', 'validate-length maximum-length-255'); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php deleted file mode 100644 index e5ff94260b8..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php +++ /dev/null @@ -1,63 +0,0 @@ -startSetup(); - -$groupedLinkType = Mage_Catalog_Model_Product_Link::LINK_TYPE_GROUPED; -$installer->run(" - -CREATE TABLE `{$installer->getTable('catalog/product_relation')}` ( - `parent_id` INT(10) UNSIGNED NOT NULL, - `child_id` INT(10) UNSIGNED NOT NULL, - PRIMARY KEY (`parent_id`,`child_id`), - KEY `IDX_CHILD` (`child_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_RELATION_CHILD` FOREIGN KEY (`child_id`) REFERENCES `{$installer->getTable('catalog/product')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_RELATION_PARENT` FOREIGN KEY (`parent_id`) REFERENCES `{$installer->getTable('catalog/product')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=INNODB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - -INSERT IGNORE INTO `{$installer->getTable('catalog/product_relation')}` -SELECT - `product_id`, - `linked_product_id` -FROM `{$installer->getTable('catalog/product_link')}` -WHERE `link_type_id`={$groupedLinkType}; - -INSERT IGNORE INTO `{$installer->getTable('catalog/product_relation')}` -SELECT - `parent_id`, - `product_id` -FROM `{$installer->getTable('catalog/product_super_link')}`; - -CREATE TABLE `{$installer->getTable('catalog/product_index_eav')}` ( - `entity_id` int(10) unsigned NOT NULL, - `attribute_id` smallint(5) unsigned NOT NULL, - `store_id` smallint(5) unsigned NOT NULL, - `value` int(10) unsigned NOT NULL, - PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`), - KEY `IDX_ENTITY` (`entity_id`), - KEY `IDX_ATTRIBUTE` (`attribute_id`), - KEY `IDX_STORE` (`store_id`), - KEY `IDX_VALUE` (`value`), - CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_EAV_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav/attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_EAV_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('catalog/product')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_EAV_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.40-1.4.0.0.41.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.40-1.4.0.0.41.php deleted file mode 100644 index 1804fae325d..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.40-1.4.0.0.41.php +++ /dev/null @@ -1,25 +0,0 @@ -startSetup(); - -$installer->run(" - ALTER TABLE {$installer->getTable('catalog/product_super_attribute_pricing')} - CHANGE `pricing_value` `pricing_value` DECIMAL(20,4) NULL"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.41-1.4.0.0.42.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.41-1.4.0.0.42.php deleted file mode 100644 index 28c5e829255..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.41-1.4.0.0.42.php +++ /dev/null @@ -1,22 +0,0 @@ -getConnection(); -$table = $installer->getTable('catalog/product_super_attribute_pricing'); -$connection->changeColumn($table, 'pricing_value', 'pricing_value', 'DECIMAL(12, 4) NULL DEFAULT NULL'); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.43-1.4.0.0.44.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.43-1.4.0.0.44.php deleted file mode 100644 index 06bd7a931c8..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.43-1.4.0.0.44.php +++ /dev/null @@ -1,22 +0,0 @@ -getConnection(); -$table = $installer->getTable('catalog/category_product_indexer_idx'); -$connection->addKey($table, 'IDX_PRODUCT_CATEGORY_STORE', ['product_id', 'category_id', 'store_id']); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php deleted file mode 100644 index 0f83ff55c2b..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php +++ /dev/null @@ -1,42 +0,0 @@ -startSetup(); - -$installer->run(" - -CREATE TABLE `{$installer->getTable('catalog/product_index_price')}` ( - `entity_id` INT(10) UNSIGNED NOT NULL, - `customer_group_id` SMALLINT(5) UNSIGNED NOT NULL, - `website_id` SMALLINT(5) UNSIGNED NOT NULL, - `tax_class_id` SMALLINT(5) UNSIGNED DEFAULT '0', - `price` DECIMAL(12,4) DEFAULT NULL, - `min_price` DECIMAL(12,4) DEFAULT NULL, - `max_price` DECIMAL(12,4) DEFAULT NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`), - KEY `IDX_CUSTOMER_GROUP` (`customer_group_id`), - KEY `IDX_WEBSITE` (`website_id`), - KEY `IDX_MIN_PRICE` (`min_price`), - CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_PRICE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `{$installer->getTable('core/website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_PRICE_CUSTOMER_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES `{$installer->getTable('customer/customer_group')}` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_PRICE_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('catalog/product')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=INNODB DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php deleted file mode 100644 index d6d31047460..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->updateAttribute($installer->getEntityTypeId('catalog_category'), 'is_active', 'is_required', true); -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php deleted file mode 100644 index 7cfd4556ab3..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php +++ /dev/null @@ -1,23 +0,0 @@ -updateAttribute('catalog_category', 'url_key', 'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE); -$installer->updateAttribute('catalog_category', 'url_path', 'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE); -$installer->updateAttribute('catalog_product', 'url_key', 'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE); -$installer->updateAttribute('catalog_product', 'url_path', 'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php deleted file mode 100644 index 3ae8d567c73..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php +++ /dev/null @@ -1,32 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('catalog/product_index_price'), - 'final_price', - 'DECIMAL(12,4) DEFAULT NULL AFTER `price`', -); -$installer->getConnection()->addColumn( - $installer->getTable('catalog/product_index_price'), - 'tier_price', - 'DECIMAL(12,4) DEFAULT NULL', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php deleted file mode 100644 index 43b5354e995..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php +++ /dev/null @@ -1,41 +0,0 @@ -getTable('catalog/category_product_index'); - -/** - * Remove data duplicates - */ -$stmt = $installer->getConnection()->query( - 'SELECT * FROM ' . $table . ' GROUP BY category_id, product_id, store_id HAVING count(*)>1', -); - -while ($row = $stmt->fetch()) { - $condition = 'category_id=' . $row['category_id'] - . ' AND product_id=' . $row['product_id'] - . ' AND store_id=' . $row['store_id'] . ' AND is_parent=0'; - $installer->getConnection()->delete($table, $condition); -} - -$installer->getConnection()->addKey( - $table, - 'UNQ_CATEGORY_PRODUCT', - ['category_id', 'product_id', 'store_id'], - 'unique', -); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 1a3948ea416..00000000000 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,6056 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/category_product'), - 'CATALOG_CATEGORY_PRODUCT_CATEGORY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/category_product'), - 'CATALOG_CATEGORY_PRODUCT_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/category_product_index'), - 'FK_CATALOG_CATEGORY_PROD_IDX_CATEGORY_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/category_product_index'), - 'FK_CATALOG_CATEGORY_PROD_IDX_PROD_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/category_product_index'), - 'FK_CATEGORY_PRODUCT_INDEX_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/compare_item'), - 'FK_CATALOG_COMPARE_ITEM_CUSTOMER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/compare_item'), - 'FK_CATALOG_COMPARE_ITEM_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/compare_item'), - 'FK_CATALOG_COMPARE_ITEM_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/eav_attribute'), - 'FK_CATALOG_EAV_ATTRIBUTE_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_enabled_index'), - 'FK_CATALOG_PRODUCT_ENABLED_INDEX_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_enabled_index'), - 'FK_CATALOG_PRODUCT_ENABLED_INDEX_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product'), - 'FK_CATALOG_PRODUCT_ENTITY_ATTRIBUTE_SET_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product'), - 'FK_CATALOG_PRODUCT_ENTITY_ENTITY_TYPE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_attribute_media_gallery'), - 'FK_CATALOG_PRODUCT_MEDIA_GALLERY_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_attribute_media_gallery'), - 'FK_CATALOG_PRODUCT_MEDIA_GALLERY_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_attribute_media_gallery_value'), - 'FK_CATALOG_PRODUCT_MEDIA_GALLERY_VALUE_GALLERY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_attribute_media_gallery_value'), - 'FK_CATALOG_PRODUCT_MEDIA_GALLERY_VALUE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_attribute_tier_price'), - 'FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_GROUP', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_attribute_tier_price'), - 'FK_CATALOG_PRODUCT_TIER_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_attribute_tier_price'), - 'FK_CATALOG_PROD_ENTITY_TIER_PRICE_PROD_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_index_eav'), - 'FK_CATALOG_PRODUCT_INDEX_EAV_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_index_eav'), - 'FK_CATALOG_PRODUCT_INDEX_EAV_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_index_eav'), - 'FK_CATALOG_PRODUCT_INDEX_EAV_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_index_eav_decimal'), - 'FK_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_index_eav_decimal'), - 'FK_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_index_eav_decimal'), - 'FK_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_index_price'), - 'FK_CATALOG_PRODUCT_INDEX_PRICE_CUSTOMER_GROUP', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_index_price'), - 'FK_CATALOG_PRODUCT_INDEX_PRICE_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_index_price'), - 'FK_CATALOG_PRODUCT_INDEX_PRICE_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_index_tier_price'), - 'FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_CUSTOMER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_index_tier_price'), - 'FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_index_tier_price'), - 'FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_index_website'), - 'FK_CATALOG_PRODUCT_INDEX_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_link'), - 'FK_PRODUCT_LINK_LINKED_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_link'), - 'FK_PRODUCT_LINK_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_link'), - 'FK_PRODUCT_LINK_TYPE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_link_attribute'), - 'FK_ATTRIBUTE_PRODUCT_LINK_TYPE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_link_attribute_decimal'), - 'FK_DECIMAL_LINK', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_link_attribute_decimal'), - 'FK_DECIMAL_PRODUCT_LINK_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_link_attribute_int'), - 'FK_INT_PRODUCT_LINK', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_link_attribute_int'), - 'FK_INT_PRODUCT_LINK_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_link_attribute_varchar'), - 'FK_VARCHAR_LINK', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_link_attribute_varchar'), - 'FK_VARCHAR_PRODUCT_LINK_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_option'), - 'FK_CATALOG_PRODUCT_OPTION_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_option_price'), - 'FK_CATALOG_PRODUCT_OPTION_PRICE_OPTION', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_option_price'), - 'FK_CATALOG_PRODUCT_OPTION_PRICE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_option_title'), - 'FK_CATALOG_PRODUCT_OPTION_TITLE_OPTION', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_option_title'), - 'FK_CATALOG_PRODUCT_OPTION_TITLE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_option_type_price'), - 'FK_CATALOG_PRODUCT_OPTION_TYPE_PRICE_OPTION', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_option_type_price'), - 'FK_CATALOG_PRODUCT_OPTION_TYPE_PRICE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_option_type_title'), - 'FK_CATALOG_PRODUCT_OPTION_TYPE_TITLE_OPTION', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_option_type_title'), - 'FK_CATALOG_PRODUCT_OPTION_TYPE_TITLE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_option_type_value'), - 'FK_CATALOG_PRODUCT_OPTION_TYPE_VALUE_OPTION', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_relation'), - 'FK_CATALOG_PRODUCT_RELATION_CHILD', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_relation'), - 'FK_CATALOG_PRODUCT_RELATION_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_super_attribute'), - 'FK_SUPER_PRODUCT_ATTRIBUTE_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_super_attribute_label'), - 'FK_CATALOG_PROD_SUPER_ATTR_LABEL_ATTR', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_super_attribute_label'), - 'FK_CATALOG_PROD_SUPER_ATTR_LABEL_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_super_attribute_pricing'), - 'CATALOG_PRODUCT_SUPER_ATTRIBUTE_PRICING_IBFK_1', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_super_attribute_pricing'), - 'FK_CATALOG_PRODUCT_SUPER_PRICE_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_super_attribute_pricing'), - 'FK_SUPER_PRODUCT_ATTRIBUTE_PRICING', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_super_link'), - 'CATALOG_PRODUCT_SUPER_LINK_IBFK_1', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_super_link'), - 'CATALOG_PRODUCT_SUPER_LINK_IBFK_2', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_super_link'), - 'FK_SUPER_PRODUCT_LINK_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_super_link'), - 'FK_SUPER_PRODUCT_LINK_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_website'), - 'FK_CATALOG_PRODUCT_WEBSITE_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalog/product_website'), - 'FK_CATALOG_WEBSITE_PRODUCT_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'datetime']), - 'FK_CATALOG_CATEGORY_ENTITY_DATETIME_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'datetime']), - 'FK_CATALOG_CATEGORY_ENTITY_DATETIME_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'datetime']), - 'FK_CATALOG_CATEGORY_ENTITY_DATETIME_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'decimal']), - 'FK_CATALOG_CATEGORY_ENTITY_DECIMAL_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'decimal']), - 'FK_CATALOG_CATEGORY_ENTITY_DECIMAL_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'decimal']), - 'FK_CATALOG_CATEGORY_ENTITY_DECIMAL_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'int']), - 'FK_CATALOG_CATEGORY_EMTITY_INT_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'int']), - 'FK_CATALOG_CATEGORY_EMTITY_INT_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'int']), - 'FK_CATALOG_CATEGORY_EMTITY_INT_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'text']), - 'FK_CATALOG_CATEGORY_ENTITY_TEXT_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'text']), - 'FK_CATALOG_CATEGORY_ENTITY_TEXT_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'text']), - 'FK_CATALOG_CATEGORY_ENTITY_TEXT_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'varchar']), - 'FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'varchar']), - 'FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/category', 'varchar']), - 'FK_CATALOG_CATEGORY_ENTITY_VARCHAR_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'datetime']), - 'FK_CATALOG_PRODUCT_ENTITY_DATETIME_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'datetime']), - 'FK_CATALOG_PRODUCT_ENTITY_DATETIME_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'datetime']), - 'FK_CATALOG_PROD_ENTITY_DATETIME_PROD_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'decimal']), - 'FK_CATALOG_PRODUCT_ENTITY_DECIMAL_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'decimal']), - 'FK_CATALOG_PRODUCT_ENTITY_DECIMAL_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'decimal']), - 'FK_CATALOG_PROD_ENTITY_DECIMAL_PROD_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'gallery']), - 'FK_CATALOG_PRODUCT_ENTITY_GALLERY_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'gallery']), - 'FK_CATALOG_PRODUCT_ENTITY_GALLERY_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'gallery']), - 'FK_CATALOG_PRODUCT_ENTITY_GALLERY_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'int']), - 'FK_CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'int']), - 'FK_CATALOG_PRODUCT_ENTITY_INT_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'int']), - 'FK_CATALOG_PRODUCT_ENTITY_INT_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'text']), - 'FK_CATALOG_PRODUCT_ENTITY_TEXT_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'text']), - 'FK_CATALOG_PRODUCT_ENTITY_TEXT_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'text']), - 'FK_CATALOG_PRODUCT_ENTITY_TEXT_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'varchar']), - 'FK_CATALOG_PRODUCT_ENTITY_VARCHAR_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'varchar']), - 'FK_CATALOG_PRODUCT_ENTITY_VARCHAR_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['catalog/product', 'varchar']), - 'FK_CATALOG_PROD_ENTITY_VARCHAR_PROD_ENTITY', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('eav/attribute'), - 'IDX_USED_FOR_SORT_BY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/attribute'), - 'IDX_USED_IN_PRODUCT_LISTING', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/category_anchor_indexer_idx'), - 'IDX_CATEGORY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/category_anchor_indexer_tmp'), - 'IDX_CATEGORY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/category'), - 'IDX_LEVEL', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/category_product'), - 'UNQ_CATEGORY_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/category_product'), - 'CATALOG_CATEGORY_PRODUCT_CATEGORY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/category_product'), - 'CATALOG_CATEGORY_PRODUCT_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/category_product_index'), - 'UNQ_CATEGORY_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/category_product_index'), - 'FK_CATALOG_CATEGORY_PRODUCT_INDEX_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/category_product_index'), - 'FK_CATALOG_CATEGORY_PRODUCT_INDEX_CATEGORY_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/category_product_index'), - 'IDX_JOIN', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/category_product_index'), - 'IDX_BASE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/category_product_enabled_indexer_idx'), - 'IDX_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/category_product_enabled_indexer_tmp'), - 'IDX_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/category_product_indexer_idx'), - 'IDX_PRODUCT_CATEGORY_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/compare_item'), - 'FK_CATALOG_COMPARE_ITEM_CUSTOMER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/compare_item'), - 'FK_CATALOG_COMPARE_ITEM_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/compare_item'), - 'IDX_VISITOR_PRODUCTS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/compare_item'), - 'IDX_CUSTOMER_PRODUCTS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/compare_item'), - 'FK_CATALOG_COMPARE_ITEM_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/eav_attribute'), - 'IDX_USED_FOR_SORT_BY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/eav_attribute'), - 'IDX_USED_IN_PRODUCT_LISTING', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_enabled_index'), - 'UNQ_PRODUCT_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_enabled_index'), - 'IDX_PRODUCT_VISIBILITY_IN_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_enabled_index'), - 'FK_CATALOG_PRODUCT_ENABLED_INDEX_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product'), - 'FK_CATALOG_PRODUCT_ENTITY_ENTITY_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product'), - 'FK_CATALOG_PRODUCT_ENTITY_ATTRIBUTE_SET_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product'), - 'SKU', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_attribute_media_gallery'), - 'FK_CATALOG_PRODUCT_MEDIA_GALLERY_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_attribute_media_gallery'), - 'FK_CATALOG_PRODUCT_MEDIA_GALLERY_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_attribute_media_gallery_value'), - 'FK_CATALOG_PRODUCT_MEDIA_GALLERY_VALUE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_attribute_tier_price'), - 'UNQ_CATALOG_PRODUCT_TIER_PRICE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_attribute_tier_price'), - 'FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_attribute_tier_price'), - 'FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_GROUP', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_attribute_tier_price'), - 'FK_CATALOG_PRODUCT_TIER_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_index_eav'), - 'IDX_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_index_eav'), - 'IDX_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_index_eav'), - 'IDX_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_index_eav'), - 'IDX_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_index_eav_decimal'), - 'IDX_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_index_eav_decimal'), - 'IDX_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_index_eav_decimal'), - 'IDX_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_index_eav_decimal'), - 'IDX_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_idx'), - 'IDX_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_idx'), - 'IDX_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_idx'), - 'IDX_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_idx'), - 'IDX_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_tmp'), - 'IDX_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_tmp'), - 'IDX_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_tmp'), - 'IDX_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_tmp'), - 'IDX_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_indexer_idx'), - 'IDX_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_indexer_idx'), - 'IDX_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_indexer_idx'), - 'IDX_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_indexer_idx'), - 'IDX_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_indexer_tmp'), - 'IDX_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_indexer_tmp'), - 'IDX_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_indexer_tmp'), - 'IDX_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_eav_indexer_tmp'), - 'IDX_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_index_price'), - 'IDX_CUSTOMER_GROUP', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_index_price'), - 'IDX_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_index_price'), - 'IDX_MIN_PRICE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_price_indexer_idx'), - 'IDX_CUSTOMER_GROUP', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_price_indexer_idx'), - 'IDX_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_price_indexer_idx'), - 'IDX_MIN_PRICE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_price_indexer_tmp'), - 'IDX_CUSTOMER_GROUP', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_price_indexer_tmp'), - 'IDX_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_price_indexer_tmp'), - 'IDX_MIN_PRICE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_index_tier_price'), - 'FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_CUSTOMER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_index_tier_price'), - 'FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_index_website'), - 'IDX_DATE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_link'), - 'IDX_UNIQUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_link'), - 'FK_LINK_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_link'), - 'FK_LINKED_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_link'), - 'FK_PRODUCT_LINK_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_link_attribute'), - 'FK_ATTRIBUTE_PRODUCT_LINK_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_link_attribute_decimal'), - 'FK_DECIMAL_PRODUCT_LINK_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_link_attribute_decimal'), - 'FK_DECIMAL_LINK', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_link_attribute_int'), - 'UNQ_PRODUCT_LINK_ATTRIBUTE_ID_LINK_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_link_attribute_int'), - 'FK_INT_PRODUCT_LINK_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_link_attribute_int'), - 'FK_INT_PRODUCT_LINK', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_link_attribute_varchar'), - 'FK_VARCHAR_PRODUCT_LINK_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_link_attribute_varchar'), - 'FK_VARCHAR_LINK', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_option'), - 'CATALOG_PRODUCT_OPTION_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_option_price'), - 'UNQ_OPTION_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_option_price'), - 'CATALOG_PRODUCT_OPTION_PRICE_OPTION', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_option_price'), - 'CATALOG_PRODUCT_OPTION_TITLE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_option_title'), - 'UNQ_OPTION_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_option_title'), - 'CATALOG_PRODUCT_OPTION_TITLE_OPTION', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_option_title'), - 'CATALOG_PRODUCT_OPTION_TITLE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_option_type_price'), - 'UNQ_OPTION_TYPE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_option_type_price'), - 'CATALOG_PRODUCT_OPTION_TYPE_PRICE_OPTION_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_option_type_price'), - 'CATALOG_PRODUCT_OPTION_TYPE_PRICE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_option_type_title'), - 'UNQ_OPTION_TYPE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_option_type_title'), - 'CATALOG_PRODUCT_OPTION_TYPE_TITLE_OPTION', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_option_type_title'), - 'CATALOG_PRODUCT_OPTION_TYPE_TITLE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_option_type_value'), - 'CATALOG_PRODUCT_OPTION_TYPE_VALUE_OPTION', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_relation'), - 'IDX_CHILD', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_super_attribute'), - 'UNQ_PRODUCT_ID_ATTRIBUTE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_super_attribute'), - 'FK_SUPER_PRODUCT_ATTRIBUTE_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_super_attribute_label'), - 'FK_CATALOG_PRODUCT_SUPER_ATTRIBUTE_LABEL_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_super_attribute_label'), - 'UNQ_ATTRIBUTE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_super_attribute_label'), - 'FK_SUPER_PRODUCT_ATTRIBUTE_LABEL', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_super_attribute_label'), - 'FK_CATALOG_PROD_SUPER_ATTR_LABEL_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_super_attribute_pricing'), - 'UNQ_PRODUCT_SUPER_ATTRIBUTE_ID_VALUE_INDEX_WEBSITE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_super_attribute_pricing'), - 'FK_SUPER_PRODUCT_ATTRIBUTE_PRICING', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_super_attribute_pricing'), - 'FK_CATALOG_PRODUCT_SUPER_PRICE_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_super_link'), - 'UNQ_PRODUCT_ID_PARENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_super_link'), - 'FK_SUPER_PRODUCT_LINK_PARENT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_super_link'), - 'FK_CATALOG_PRODUCT_SUPER_LINK', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalog/product_website'), - 'FK_CATALOG_PRODUCT_WEBSITE_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'datetime']), - 'IDX_BASE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'datetime']), - 'FK_ATTRIBUTE_DATETIME_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'datetime']), - 'FK_CATALOG_CATEGORY_ENTITY_DATETIME_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'datetime']), - 'FK_CATALOG_CATEGORY_ENTITY_DATETIME_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'decimal']), - 'IDX_BASE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'decimal']), - 'FK_ATTRIBUTE_DECIMAL_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'decimal']), - 'FK_CATALOG_CATEGORY_ENTITY_DECIMAL_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'decimal']), - 'FK_CATALOG_CATEGORY_ENTITY_DECIMAL_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'int']), - 'IDX_BASE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'int']), - 'FK_ATTRIBUTE_INT_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'int']), - 'FK_CATALOG_CATEGORY_EMTITY_INT_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'int']), - 'FK_CATALOG_CATEGORY_EMTITY_INT_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'text']), - 'IDX_BASE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'text']), - 'FK_ATTRIBUTE_TEXT_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'text']), - 'FK_CATALOG_CATEGORY_ENTITY_TEXT_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'text']), - 'FK_CATALOG_CATEGORY_ENTITY_TEXT_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'varchar']), - 'IDX_BASE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'varchar']), - 'FK_ATTRIBUTE_VARCHAR_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'varchar']), - 'FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/category', 'varchar']), - 'FK_CATALOG_CATEGORY_ENTITY_VARCHAR_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'datetime']), - 'IDX_ATTRIBUTE_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'datetime']), - 'FK_CATALOG_PRODUCT_ENTITY_DATETIME_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'datetime']), - 'FK_CATALOG_PRODUCT_ENTITY_DATETIME_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'datetime']), - 'FK_CATALOG_PRODUCT_ENTITY_DATETIME_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'decimal']), - 'IDX_ATTRIBUTE_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'decimal']), - 'FK_CATALOG_PRODUCT_ENTITY_DECIMAL_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'decimal']), - 'FK_CATALOG_PRODUCT_ENTITY_DECIMAL_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'decimal']), - 'FK_CATALOG_PRODUCT_ENTITY_DECIMAL_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'gallery']), - 'IDX_BASE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'gallery']), - 'FK_ATTRIBUTE_GALLERY_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'gallery']), - 'FK_CATALOG_CATEGORY_ENTITY_GALLERY_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'gallery']), - 'FK_CATALOG_CATEGORY_ENTITY_GALLERY_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'int']), - 'IDX_ATTRIBUTE_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'int']), - 'FK_CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'int']), - 'FK_CATALOG_PRODUCT_ENTITY_INT_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'int']), - 'FK_CATALOG_PRODUCT_ENTITY_INT_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'text']), - 'IDX_ATTRIBUTE_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'text']), - 'FK_CATALOG_PRODUCT_ENTITY_TEXT_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'text']), - 'FK_CATALOG_PRODUCT_ENTITY_TEXT_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'text']), - 'FK_CATALOG_PRODUCT_ENTITY_TEXT_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'varchar']), - 'IDX_ATTRIBUTE_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'varchar']), - 'FK_CATALOG_PRODUCT_ENTITY_VARCHAR_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'varchar']), - 'FK_CATALOG_PRODUCT_ENTITY_VARCHAR_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['catalog/product', 'varchar']), - 'FK_CATALOG_PRODUCT_ENTITY_VARCHAR_PRODUCT_ENTITY', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('catalog/product') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity ID', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type ID', - ], - 'attribute_set_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Set ID', - ], - 'type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'default' => 'simple', - 'comment' => 'Type ID', - ], - 'sku' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'comment' => 'SKU', - ], - 'has_options' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Has Options', - ], - 'required_options' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Required Options', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Creation Time', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Update Time', - ], - ], - 'comment' => 'Catalog Product Table', - ], - $installer->getTable('catalog/category') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity ID', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type ID', - ], - 'attribute_set_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attriute Set ID', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Parent Category ID', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Creation Time', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Update Time', - ], - 'path' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Tree Path', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Position', - ], - 'level' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Tree Level', - ], - 'children_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Child Count', - ], - ], - 'comment' => 'Catalog Category Table', - ], - $installer->getTable('catalog/category_product') => [ - 'columns' => [ - 'category_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Category ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Position', - ], - ], - 'comment' => 'Catalog Product To Category Linkage Table', - ], - $installer->getTable('catalog/category_product_index') => [ - 'columns' => [ - 'category_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Category ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Position', - ], - 'is_parent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Parent', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'visibility' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Visibility', - ], - ], - 'comment' => 'Catalog Category Product Index', - ], - $installer->getTable('catalog/compare_item') => [ - 'columns' => [ - 'catalog_compare_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Compare Item ID', - ], - 'visitor_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Visitor ID', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Customer ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store ID', - ], - ], - 'comment' => 'Catalog Compare Table', - ], - $installer->getTable('catalog/product_website') => [ - 'columns' => [ - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - ], - 'comment' => 'Catalog Product To Website Linkage Table', - ], - $installer->getTable('catalog/product_enabled_index') => [ - 'columns' => [ - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'visibility' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Visibility', - ], - ], - 'comment' => 'Catalog Product Visibility Index Table', - ], - $installer->getTable('catalog/product_link_type') => [ - 'columns' => [ - 'link_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Link Type ID', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'comment' => 'Code', - ], - ], - 'comment' => 'Catalog Product Link Type Table', - ], - $installer->getTable('catalog/product_link') => [ - 'columns' => [ - 'link_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Link ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'linked_product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Linked Product ID', - ], - 'link_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Link Type ID', - ], - ], - 'comment' => 'Catalog Product To Product Linkage Table', - ], - $installer->getTable('catalog/product_link_attribute') => [ - 'columns' => [ - 'product_link_attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Product Link Attribute ID', - ], - 'link_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Link Type ID', - ], - 'product_link_attribute_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'comment' => 'Product Link Attribute Code', - ], - 'data_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'comment' => 'Data Type', - ], - ], - 'comment' => 'Catalog Product Link Attribute Table', - ], - $installer->getTable('catalog/product_link_attribute_decimal') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'product_link_attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Product Link Attribute ID', - ], - 'link_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Link ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product Link Decimal Attribute Table', - ], - $installer->getTable('catalog/product_link_attribute_int') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'product_link_attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Product Link Attribute ID', - ], - 'link_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Link ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product Link Integer Attribute Table', - ], - $installer->getTable('catalog/product_link_attribute_varchar') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'product_link_attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product Link Attribute ID', - ], - 'link_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Link ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product Link Varchar Attribute Table', - ], - $installer->getTable('catalog/product_super_attribute') => [ - 'columns' => [ - 'product_super_attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Product Super Attribute ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute ID', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Position', - ], - ], - 'comment' => 'Catalog Product Super Attribute Table', - ], - $installer->getTable('catalog/product_super_attribute_label') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'product_super_attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product Super Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'use_default' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Use Default Value', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product Super Attribute Label Table', - ], - $installer->getTable('catalog/product_super_attribute_pricing') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'product_super_attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product Super Attribute ID', - ], - 'value_index' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Value Index', - ], - 'is_percent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Is Percent', - ], - 'pricing_value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Pricing Value', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Website ID', - ], - ], - 'comment' => 'Catalog Product Super Attribute Pricing Table', - ], - $installer->getTable('catalog/product_super_link') => [ - 'columns' => [ - 'link_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Link ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Parent ID', - ], - ], - 'comment' => 'Catalog Product Super Link Table', - ], - $installer->getTable('catalog/product_attribute_tier_price') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'all_groups' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Is Applicable To All Customer Groups', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '1.0000', - 'comment' => 'QTY', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Value', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Website ID', - ], - ], - 'comment' => 'Catalog Product Tier Price Attribute Backend Table', - ], - $installer->getTable('catalog/product_attribute_media_gallery') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute ID', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product Media Gallery Attribute Backend Table', - ], - $installer->getTable('catalog/product_attribute_media_gallery_value') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Value ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'label' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Label', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Position', - ], - 'disabled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Disabled', - ], - ], - 'comment' => 'Catalog Product Media Gallery Attribute Value Table', - ], - $installer->getTable('catalog/product_option') => [ - 'columns' => [ - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Option ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'nullable' => false, - 'comment' => 'Type', - ], - 'is_require' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Is Required', - ], - 'sku' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'comment' => 'SKU', - ], - 'max_characters' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Max Characters', - ], - 'file_extension' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'File Extension', - ], - 'image_size_x' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Image Size X', - ], - 'image_size_y' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Image Size Y', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - ], - 'comment' => 'Catalog Product Option Table', - ], - $installer->getTable('catalog/product_option_price') => [ - 'columns' => [ - 'option_price_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Option Price ID', - ], - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Option ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Price', - ], - 'price_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 7, - 'nullable' => false, - 'default' => 'fixed', - 'comment' => 'Price Type', - ], - ], - 'comment' => 'Catalog Product Option Price Table', - ], - $installer->getTable('catalog/product_option_title') => [ - 'columns' => [ - 'option_title_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Option Title ID', - ], - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Option ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'title' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Title', - ], - ], - 'comment' => 'Catalog Product Option Title Table', - ], - $installer->getTable('catalog/product_option_type_value') => [ - 'columns' => [ - 'option_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Option Type ID', - ], - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Option ID', - ], - 'sku' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'comment' => 'SKU', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - ], - 'comment' => 'Catalog Product Option Type Value Table', - ], - $installer->getTable('catalog/product_option_type_price') => [ - 'columns' => [ - 'option_type_price_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Option Type Price ID', - ], - 'option_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Option Type ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Price', - ], - 'price_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 7, - 'nullable' => false, - 'default' => 'fixed', - 'comment' => 'Price Type', - ], - ], - 'comment' => 'Catalog Product Option Type Price Table', - ], - $installer->getTable('catalog/product_option_type_title') => [ - 'columns' => [ - 'option_type_title_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Option Type Title ID', - ], - 'option_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Option Type ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'title' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Title', - ], - ], - 'comment' => 'Catalog Product Option Type Title Table', - ], - $installer->getTable('catalog/eav_attribute') => [ - 'columns' => [ - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Attribute ID', - ], - 'frontend_input_renderer' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Frontend Input Renderer', - ], - 'is_global' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Is Global', - ], - 'is_visible' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Is Visible', - ], - 'is_searchable' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Searchable', - ], - 'is_filterable' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Filterable', - ], - 'is_comparable' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Comparable', - ], - 'is_visible_on_front' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Visible On Front', - ], - 'is_html_allowed_on_front' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is HTML Allowed On Front', - ], - 'is_used_for_price_rules' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Used For Price Rules', - ], - 'is_filterable_in_search' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Filterable In Search', - ], - 'used_in_product_listing' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Used In Product Listing', - ], - 'used_for_sort_by' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Used For Sorting', - ], - 'is_configurable' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Is Configurable', - ], - 'apply_to' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Apply To', - ], - 'is_visible_in_advanced_search' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Visible In Advanced Search', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Position', - ], - 'is_wysiwyg_enabled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is WYSIWYG Enabled', - ], - 'is_used_for_promo_rules' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Used For Promo Rules', - ], - ], - 'comment' => 'Catalog EAV Attribute Table', - ], - $installer->getTable('catalog/product_relation') => [ - 'columns' => [ - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Parent ID', - ], - 'child_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Child ID', - ], - ], - 'comment' => 'Catalog Product Relation Table', - ], - $installer->getTable('catalog/product_index_eav') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product EAV Index Table', - ], - $installer->getTable('catalog/product_index_eav_decimal') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'primary' => true, - 'default' => '0.0000', - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product EAV Decimal Index Table', - ], - $installer->getTable('catalog/product_index_price') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'tax_class_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Tax Class ID', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'final_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Final Price', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - ], - 'comment' => 'Catalog Product Price Index Table', - ], - $installer->getTable('catalog/product_index_tier_price') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - ], - 'comment' => 'Catalog Product Tier Price Index Table', - ], - $installer->getTable('catalog/product_index_website') => [ - 'columns' => [ - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_FLOAT, - 'default' => '1', - 'comment' => 'Rate', - ], - ], - 'comment' => 'Catalog Product Website Index Table', - ], - $installer->getTable('catalog/product_price_indexer_cfg_option_aggregate_idx') => [ - 'columns' => [ - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Parent ID', - ], - 'child_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Child ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - ], - 'comment' => 'Catalog Product Price Indexer Config Option Aggregate Index ', - ], - $installer->getTable('catalog/product_price_indexer_cfg_option_aggregate_tmp') => [ - 'columns' => [ - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Parent ID', - ], - 'child_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Child ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - ], - 'comment' => 'Catalog Product Price Indexer Config Option Aggregate Temp Table', - 'engine' => 'InnoDB', - ], - $installer->getTable('catalog/product_price_indexer_cfg_option_idx') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - ], - 'comment' => 'Catalog Product Price Indexer Config Option Index Table', - ], - $installer->getTable('catalog/product_price_indexer_cfg_option_tmp') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - ], - 'comment' => 'Catalog Product Price Indexer Config Option Temp Table', - 'engine' => 'InnoDB', - ], - $installer->getTable('catalog/product_price_indexer_final_idx') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'tax_class_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Tax Class ID', - ], - 'orig_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Original Price', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - 'base_tier' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Tier', - ], - ], - 'comment' => 'Catalog Product Price Indexer Final Index Table', - ], - $installer->getTable('catalog/product_price_indexer_final_tmp') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'tax_class_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Tax Class ID', - ], - 'orig_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Original Price', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - 'base_tier' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Tier', - ], - ], - 'comment' => 'Catalog Product Price Indexer Final Temp Table', - 'engine' => 'InnoDB', - ], - $installer->getTable('catalog/product_price_indexer_option_idx') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - ], - 'comment' => 'Catalog Product Price Indexer Option Index Table', - ], - $installer->getTable('catalog/product_price_indexer_option_tmp') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - ], - 'comment' => 'Catalog Product Price Indexer Option Temp Table', - 'engine' => 'InnoDB', - ], - $installer->getTable('catalog/product_price_indexer_option_aggregate_idx') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Option ID', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - ], - 'comment' => 'Catalog Product Price Indexer Option Aggregate Index Table', - ], - $installer->getTable('catalog/product_price_indexer_option_aggregate_tmp') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Option ID', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - ], - 'comment' => 'Catalog Product Price Indexer Option Aggregate Temp Table', - 'engine' => 'InnoDB', - ], - $installer->getTable('catalog/product_eav_indexer_idx') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product EAV Indexer Index Table', - ], - $installer->getTable('catalog/product_eav_indexer_tmp') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product EAV Indexer Temp Table', - 'engine' => 'InnoDB', - ], - $installer->getTable('catalog/product_eav_decimal_indexer_idx') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'primary' => true, - 'default' => '0.0000', - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product EAV Decimal Indexer Index Table', - ], - $installer->getTable('catalog/product_eav_decimal_indexer_tmp') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'primary' => true, - 'default' => '0.0000', - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product EAV Decimal Indexer Temp Table', - 'engine' => 'InnoDB', - ], - $installer->getTable('catalog/product_price_indexer_idx') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'tax_class_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Tax Class ID', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'final_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Final Price', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - ], - 'comment' => 'Catalog Product Price Indexer Index Table', - ], - $installer->getTable('catalog/product_price_indexer_tmp') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'tax_class_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Tax Class ID', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'final_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Final Price', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Min Price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Max Price', - ], - 'tier_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tier Price', - ], - ], - 'comment' => 'Catalog Product Price Indexer Temp Table', - 'engine' => 'InnoDB', - ], - $installer->getTable('catalog/category_product_indexer_idx') => [ - 'columns' => [ - 'category_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Category ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Position', - ], - 'is_parent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Parent', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'visibility' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Visibility', - ], - ], - 'comment' => 'Catalog Category Product Indexer Index Table', - ], - $installer->getTable('catalog/category_product_indexer_tmp') => [ - 'columns' => [ - 'category_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Category ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Position', - ], - 'is_parent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Parent', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'visibility' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Visibility', - ], - ], - 'comment' => 'Catalog Category Product Indexer Temp Table', - 'engine' => 'InnoDB', - ], - $installer->getTable('catalog/category_product_enabled_indexer_idx') => [ - 'columns' => [ - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'visibility' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Visibility', - ], - ], - 'comment' => 'Catalog Category Product Enabled Indexer Index Table', - ], - $installer->getTable('catalog/category_product_enabled_indexer_tmp') => [ - 'columns' => [ - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'visibility' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Visibility', - ], - ], - 'comment' => 'Catalog Category Product Enabled Indexer Temp Table', - 'engine' => 'InnoDB', - ], - $installer->getTable('catalog/category_anchor_indexer_idx') => [ - 'columns' => [ - 'category_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Category ID', - ], - 'path' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Path', - ], - ], - 'comment' => 'Catalog Category Anchor Indexer Index Table', - ], - $installer->getTable('catalog/category_anchor_indexer_tmp') => [ - 'columns' => [ - 'category_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Category ID', - ], - 'path' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Path', - ], - ], - 'comment' => 'Catalog Category Anchor Indexer Temp Table', - 'engine' => 'InnoDB', - ], - $installer->getTable('catalog/category_anchor_products_indexer_idx') => [ - 'columns' => [ - 'category_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Category ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Position', - ], - ], - 'comment' => 'Catalog Category Anchor Product Indexer Index Table', - ], - $installer->getTable('catalog/category_anchor_products_indexer_tmp') => [ - 'columns' => [ - 'category_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Category ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product ID', - ], - ], - 'comment' => 'Catalog Category Anchor Product Indexer Temp Table', - 'engine' => 'InnoDB', - ], - $installer->getTable(['catalog/product','datetime']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATETIME, - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product Datetime Attribute Backend Table', - ], - $installer->getTable(['catalog/product','decimal']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product Decimal Attribute Backend Table', - ], - $installer->getTable(['catalog/product','int']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product Integer Attribute Backend Table', - ], - $installer->getTable(['catalog/product','text']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product Text Attribute Backend Table', - ], - $installer->getTable(['catalog/product','varchar']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product Varchar Attribute Backend Table', - ], - $installer->getTable(['catalog/product','gallery']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity ID', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Position', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Product Gallery Attribute Backend Table', - ], - $installer->getTable(['catalog/category','datetime']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATETIME, - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Category Datetime Attribute Backend Table', - ], - $installer->getTable(['catalog/category','decimal']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Category Decimal Attribute Backend Table', - ], - $installer->getTable(['catalog/category','int']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Category Integer Attribute Backend Table', - ], - $installer->getTable(['catalog/category','text']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Category Text Attribute Backend Table', - ], - $installer->getTable(['catalog/category','varchar']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value ID', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type ID', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity ID', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Value', - ], - ], - 'comment' => 'Catalog Category Varchar Attribute Backend Table', - ], - $installer->getTable('core/url_rewrite') => [ - 'columns' => [ - 'category_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => true, - 'comment' => 'Category Id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => true, - 'comment' => 'Product Id', - ], - ], - ], -]; - -$installer->getConnection()->modifyTables($tables); - -$installer->getConnection()->changeColumn( - $installer->getTable('catalog/product_index_website'), - 'date', - 'website_date', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Website Date', - ], -); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('catalog/category_anchor_indexer_idx'), - $installer->getIdxName('catalog/category_anchor_indexer_idx', ['category_id']), - ['category_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/category_anchor_indexer_tmp'), - $installer->getIdxName('catalog/category_anchor_indexer_tmp', ['category_id']), - ['category_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/category'), - $installer->getIdxName('catalog/category', ['level']), - ['level'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/category_product'), - 'PRIMARY', - ['category_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/category_product'), - $installer->getIdxName('catalog/category_product', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/category_product_index'), - 'PRIMARY', - ['category_id', 'product_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/category_product_index'), - $installer->getIdxName( - 'catalog/category_product_index', - ['product_id', 'store_id', 'category_id', 'visibility'], - ), - ['product_id', 'store_id', 'category_id', 'visibility'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/category_product_index'), - $installer->getIdxName( - 'catalog/category_product_index', - ['store_id', 'category_id', 'visibility', 'is_parent', 'position'], - ), - ['store_id', 'category_id', 'visibility', 'is_parent', 'position'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/category_product_index'), - $installer->getIdxName( - 'catalog/category_product_index', - ['product_id', 'store_id', 'category_id', 'visibility'], - ), - ['product_id', 'store_id', 'category_id', 'visibility'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/category_product_enabled_indexer_idx'), - $installer->getIdxName('catalog/category_product_enabled_indexer_idx', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/category_product_enabled_indexer_tmp'), - $installer->getIdxName('catalog/category_product_enabled_indexer_tmp', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/category_product_indexer_idx'), - $installer->getIdxName('catalog/category_product_indexer_idx', ['product_id', 'category_id', 'store_id']), - ['product_id', 'category_id', 'store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/compare_item'), - $installer->getIdxName('catalog/compare_item', ['customer_id']), - ['customer_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/compare_item'), - $installer->getIdxName('catalog/compare_item', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/compare_item'), - $installer->getIdxName('catalog/compare_item', ['visitor_id', 'product_id']), - ['visitor_id', 'product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/compare_item'), - $installer->getIdxName('catalog/compare_item', ['customer_id', 'product_id']), - ['customer_id', 'product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/compare_item'), - $installer->getIdxName('catalog/compare_item', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/eav_attribute'), - $installer->getIdxName('catalog/eav_attribute', ['used_for_sort_by']), - ['used_for_sort_by'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/eav_attribute'), - $installer->getIdxName('catalog/eav_attribute', ['used_in_product_listing']), - ['used_in_product_listing'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_enabled_index'), - $installer->getIdxName('catalog/product_enabled_index', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_enabled_index'), - 'PRIMARY', - ['product_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product'), - $installer->getIdxName('catalog/product', ['entity_type_id']), - ['entity_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product'), - $installer->getIdxName('catalog/product', ['attribute_set_id']), - ['attribute_set_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product'), - $installer->getIdxName('catalog/product', ['sku']), - ['sku'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_attribute_media_gallery'), - $installer->getIdxName('catalog/product_attribute_media_gallery', ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_attribute_media_gallery'), - $installer->getIdxName('catalog/product_attribute_media_gallery', ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_attribute_media_gallery_value'), - $installer->getIdxName('catalog/product_attribute_media_gallery_value', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_attribute_tier_price'), - $installer->getIdxName( - 'catalog/product_attribute_tier_price', - ['entity_id', 'all_groups', 'customer_group_id', 'qty', 'website_id'], - ), - ['entity_id', 'all_groups', 'customer_group_id', 'qty', 'website_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_attribute_tier_price'), - $installer->getIdxName('catalog/product_attribute_tier_price', ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_attribute_tier_price'), - $installer->getIdxName('catalog/product_attribute_tier_price', ['customer_group_id']), - ['customer_group_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_attribute_tier_price'), - $installer->getIdxName('catalog/product_attribute_tier_price', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_index_eav'), - $installer->getIdxName('catalog/product_index_eav', ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_index_eav'), - $installer->getIdxName('catalog/product_index_eav', ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_index_eav'), - $installer->getIdxName('catalog/product_index_eav', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_index_eav'), - $installer->getIdxName('catalog/product_index_eav', ['value']), - ['value'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_index_eav_decimal'), - $installer->getIdxName('catalog/product_index_eav_decimal', ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_index_eav_decimal'), - $installer->getIdxName('catalog/product_index_eav_decimal', ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_index_eav_decimal'), - $installer->getIdxName('catalog/product_index_eav_decimal', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_index_eav_decimal'), - $installer->getIdxName('catalog/product_index_eav_decimal', ['value']), - ['value'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_idx'), - $installer->getIdxName('catalog/product_eav_decimal_indexer_idx', ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_idx'), - $installer->getIdxName('catalog/product_eav_decimal_indexer_idx', ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_idx'), - $installer->getIdxName('catalog/product_eav_decimal_indexer_idx', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_idx'), - $installer->getIdxName('catalog/product_eav_decimal_indexer_idx', ['value']), - ['value'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_tmp'), - $installer->getIdxName('catalog/product_eav_decimal_indexer_tmp', ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_tmp'), - $installer->getIdxName('catalog/product_eav_decimal_indexer_tmp', ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_tmp'), - $installer->getIdxName('catalog/product_eav_decimal_indexer_tmp', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_decimal_indexer_tmp'), - $installer->getIdxName('catalog/product_eav_decimal_indexer_tmp', ['value']), - ['value'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_indexer_idx'), - $installer->getIdxName('catalog/product_eav_indexer_idx', ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_indexer_idx'), - $installer->getIdxName('catalog/product_eav_indexer_idx', ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_indexer_idx'), - $installer->getIdxName('catalog/product_eav_indexer_idx', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_indexer_idx'), - $installer->getIdxName('catalog/product_eav_indexer_idx', ['value']), - ['value'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_indexer_tmp'), - $installer->getIdxName('catalog/product_eav_indexer_tmp', ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_indexer_tmp'), - $installer->getIdxName('catalog/product_eav_indexer_tmp', ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_indexer_tmp'), - $installer->getIdxName('catalog/product_eav_indexer_tmp', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_eav_indexer_tmp'), - $installer->getIdxName('catalog/product_eav_indexer_tmp', ['value']), - ['value'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_index_price'), - $installer->getIdxName('catalog/product_index_price', ['customer_group_id']), - ['customer_group_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_index_price'), - $installer->getIdxName('catalog/product_index_price', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_index_price'), - $installer->getIdxName('catalog/product_index_price', ['min_price']), - ['min_price'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_price_indexer_idx'), - $installer->getIdxName('catalog/product_price_indexer_idx', ['customer_group_id']), - ['customer_group_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_price_indexer_idx'), - $installer->getIdxName('catalog/product_price_indexer_idx', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_price_indexer_idx'), - $installer->getIdxName('catalog/product_price_indexer_idx', ['min_price']), - ['min_price'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_price_indexer_tmp'), - $installer->getIdxName('catalog/product_price_indexer_tmp', ['customer_group_id']), - ['customer_group_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_price_indexer_tmp'), - $installer->getIdxName('catalog/product_price_indexer_tmp', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_price_indexer_tmp'), - $installer->getIdxName('catalog/product_price_indexer_tmp', ['min_price']), - ['min_price'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_index_tier_price'), - $installer->getIdxName('catalog/product_index_tier_price', ['customer_group_id']), - ['customer_group_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_index_tier_price'), - $installer->getIdxName('catalog/product_index_tier_price', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_index_website'), - $installer->getIdxName('catalog/product_index_website', ['website_date']), - ['website_date'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_link'), - $installer->getIdxName( - 'catalog/product_link', - ['link_type_id', 'product_id', 'linked_product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['link_type_id', 'product_id', 'linked_product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_link'), - $installer->getIdxName('catalog/product_link', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_link'), - $installer->getIdxName('catalog/product_link', ['linked_product_id']), - ['linked_product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_link'), - $installer->getIdxName('catalog/product_link', ['link_type_id']), - ['link_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_link_attribute'), - $installer->getIdxName('catalog/product_link_attribute', ['link_type_id']), - ['link_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_link_attribute_decimal'), - $installer->getIdxName( - 'catalog/product_link_attribute_decimal', - ['product_link_attribute_id', 'link_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['product_link_attribute_id', 'link_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_link_attribute_decimal'), - $installer->getIdxName('catalog/product_link_attribute_decimal', ['product_link_attribute_id']), - ['product_link_attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_link_attribute_decimal'), - $installer->getIdxName('catalog/product_link_attribute_decimal', ['link_id']), - ['link_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_link_attribute_int'), - $installer->getIdxName( - 'catalog/product_link_attribute_int', - ['product_link_attribute_id', 'link_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['product_link_attribute_id', 'link_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_link_attribute_int'), - $installer->getIdxName('catalog/product_link_attribute_int', ['product_link_attribute_id']), - ['product_link_attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_link_attribute_int'), - $installer->getIdxName('catalog/product_link_attribute_int', ['link_id']), - ['link_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_link_attribute_varchar'), - $installer->getIdxName( - 'catalog/product_link_attribute_varchar', - ['product_link_attribute_id', 'link_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['product_link_attribute_id', 'link_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_link_attribute_varchar'), - $installer->getIdxName('catalog/product_link_attribute_varchar', ['product_link_attribute_id']), - ['product_link_attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_link_attribute_varchar'), - $installer->getIdxName('catalog/product_link_attribute_varchar', ['link_id']), - ['link_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_option'), - $installer->getIdxName('catalog/product_option', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_option_price'), - $installer->getIdxName( - 'catalog/product_option_price', - ['option_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['option_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_option_price'), - $installer->getIdxName('catalog/product_option_price', ['option_id']), - ['option_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_option_price'), - $installer->getIdxName('catalog/product_option_price', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_option_title'), - $installer->getIdxName( - 'catalog/product_option_title', - ['option_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['option_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_option_title'), - $installer->getIdxName('catalog/product_option_title', ['option_id']), - ['option_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_option_title'), - $installer->getIdxName('catalog/product_option_title', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_option_type_price'), - $installer->getIdxName( - 'catalog/product_option_type_price', - ['option_type_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['option_type_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_option_type_price'), - $installer->getIdxName('catalog/product_option_type_price', ['option_type_id']), - ['option_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_option_type_price'), - $installer->getIdxName('catalog/product_option_type_price', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_option_type_title'), - $installer->getIdxName( - 'catalog/product_option_type_title', - ['option_type_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['option_type_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_option_type_title'), - $installer->getIdxName('catalog/product_option_type_title', ['option_type_id']), - ['option_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_option_type_title'), - $installer->getIdxName('catalog/product_option_type_title', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_option_type_value'), - $installer->getIdxName('catalog/product_option_type_value', ['option_id']), - ['option_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_relation'), - $installer->getIdxName('catalog/product_relation', ['child_id']), - ['child_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_super_attribute'), - $installer->getIdxName( - 'catalog/product_super_attribute', - ['product_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['product_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_super_attribute'), - $installer->getIdxName('catalog/product_super_attribute', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_super_attribute_label'), - $installer->getIdxName( - 'catalog/product_super_attribute_label', - ['product_super_attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['product_super_attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_super_attribute_label'), - $installer->getIdxName('catalog/product_super_attribute_label', ['product_super_attribute_id']), - ['product_super_attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_super_attribute_label'), - $installer->getIdxName('catalog/product_super_attribute_label', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_super_attribute_pricing'), - $installer->getIdxName( - 'catalog/product_super_attribute_pricing', - ['product_super_attribute_id', 'value_index', 'website_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['product_super_attribute_id', 'value_index', 'website_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_super_attribute_pricing'), - $installer->getIdxName('catalog/product_super_attribute_pricing', ['product_super_attribute_id']), - ['product_super_attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_super_attribute_pricing'), - $installer->getIdxName('catalog/product_super_attribute_pricing', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_super_link'), - $installer->getIdxName( - 'catalog/product_super_link', - ['product_id', 'parent_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['product_id', 'parent_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_super_link'), - $installer->getIdxName('catalog/product_super_link', ['parent_id']), - ['parent_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_super_link'), - $installer->getIdxName('catalog/product_super_link', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalog/product_website'), - $installer->getIdxName('catalog/product_website', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'datetime']), - $installer->getIdxName( - ['catalog/category', 'datetime'], - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'datetime']), - $installer->getIdxName(['catalog/category', 'datetime'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'datetime']), - $installer->getIdxName(['catalog/category', 'datetime'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'datetime']), - $installer->getIdxName(['catalog/category', 'datetime'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'decimal']), - $installer->getIdxName( - ['catalog/category', 'decimal'], - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'decimal']), - $installer->getIdxName(['catalog/category', 'decimal'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'decimal']), - $installer->getIdxName(['catalog/category', 'decimal'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'decimal']), - $installer->getIdxName(['catalog/category', 'decimal'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'int']), - $installer->getIdxName( - ['catalog/category', 'int'], - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'int']), - $installer->getIdxName(['catalog/category', 'int'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'int']), - $installer->getIdxName(['catalog/category', 'int'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'int']), - $installer->getIdxName(['catalog/category', 'int'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'text']), - $installer->getIdxName( - ['catalog/category', 'text'], - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'text']), - $installer->getIdxName(['catalog/category', 'text'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'text']), - $installer->getIdxName(['catalog/category', 'text'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'text']), - $installer->getIdxName(['catalog/category', 'text'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'varchar']), - $installer->getIdxName( - ['catalog/category', 'varchar'], - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'varchar']), - $installer->getIdxName(['catalog/category', 'varchar'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'varchar']), - $installer->getIdxName(['catalog/category', 'varchar'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/category', 'varchar']), - $installer->getIdxName(['catalog/category', 'varchar'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'datetime']), - $installer->getIdxName( - ['catalog/product', 'datetime'], - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'datetime']), - $installer->getIdxName(['catalog/product', 'datetime'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'datetime']), - $installer->getIdxName(['catalog/product', 'datetime'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'datetime']), - $installer->getIdxName(['catalog/product', 'datetime'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'decimal']), - $installer->getIdxName( - ['catalog/product', 'decimal'], - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'decimal']), - $installer->getIdxName(['catalog/product', 'decimal'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'decimal']), - $installer->getIdxName(['catalog/product', 'decimal'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'decimal']), - $installer->getIdxName(['catalog/product', 'decimal'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'gallery']), - $installer->getIdxName( - ['catalog/product', 'gallery'], - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'gallery']), - $installer->getIdxName(['catalog/product', 'gallery'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'gallery']), - $installer->getIdxName(['catalog/product', 'gallery'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'gallery']), - $installer->getIdxName(['catalog/product', 'gallery'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'int']), - $installer->getIdxName( - ['catalog/product', 'int'], - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'int']), - $installer->getIdxName(['catalog/product', 'int'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'int']), - $installer->getIdxName(['catalog/product', 'int'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'int']), - $installer->getIdxName(['catalog/product', 'int'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'text']), - $installer->getIdxName( - ['catalog/product', 'text'], - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'text']), - $installer->getIdxName(['catalog/product', 'text'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'text']), - $installer->getIdxName(['catalog/product', 'text'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'text']), - $installer->getIdxName(['catalog/product', 'text'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'varchar']), - $installer->getIdxName( - ['catalog/product', 'varchar'], - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'varchar']), - $installer->getIdxName(['catalog/product', 'varchar'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'varchar']), - $installer->getIdxName(['catalog/product', 'varchar'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['catalog/product', 'varchar']), - $installer->getIdxName(['catalog/product', 'varchar'], ['entity_id']), - ['entity_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/category_product', 'category_id', 'catalog/category', 'entity_id'), - $installer->getTable('catalog/category_product'), - 'category_id', - $installer->getTable('catalog/category'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/category_product', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/category_product'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/category_product_index', 'category_id', 'catalog/category', 'entity_id'), - $installer->getTable('catalog/category_product_index'), - 'category_id', - $installer->getTable('catalog/category'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/category_product_index', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/category_product_index'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/category_product_index', 'store_id', 'core/store', 'store_id'), - $installer->getTable('catalog/category_product_index'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/compare_item', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('catalog/compare_item'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/compare_item', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/compare_item'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/compare_item', 'store_id', 'core/store', 'store_id'), - $installer->getTable('catalog/compare_item'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/eav_attribute', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('catalog/eav_attribute'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_enabled_index', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_enabled_index'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_enabled_index', 'store_id', 'core/store', 'store_id'), - $installer->getTable('catalog/product_enabled_index'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product', 'attribute_set_id', 'eav_attribute_set', 'attribute_set_id'), - $installer->getTable('catalog/product'), - 'attribute_set_id', - $installer->getTable('eav_attribute_set'), - 'attribute_set_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product', 'entity_type_id', 'eav_entity_type', 'entity_type_id'), - $installer->getTable('catalog/product'), - 'entity_type_id', - $installer->getTable('eav_entity_type'), - 'entity_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_attribute_media_gallery', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('catalog/product_attribute_media_gallery'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_attribute_media_gallery', 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_attribute_media_gallery'), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'catalog/product_attribute_media_gallery_value', - 'value_id', - 'catalog/product_attribute_media_gallery', - 'value_id', - ), - $installer->getTable('catalog/product_attribute_media_gallery_value'), - 'value_id', - $installer->getTable('catalog/product_attribute_media_gallery'), - 'value_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_attribute_media_gallery_value', 'store_id', 'core/store', 'store_id'), - $installer->getTable('catalog/product_attribute_media_gallery_value'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'catalog/product_attribute_tier_price', - 'customer_group_id', - 'customer/customer_group', - 'customer_group_id', - ), - $installer->getTable('catalog/product_attribute_tier_price'), - 'customer_group_id', - $installer->getTable('customer/customer_group'), - 'customer_group_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_attribute_tier_price', 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_attribute_tier_price'), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_attribute_tier_price', 'website_id', 'core/website', 'website_id'), - $installer->getTable('catalog/product_attribute_tier_price'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_index_eav', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('catalog/product_index_eav'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_index_eav', 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_index_eav'), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_index_eav', 'store_id', 'core/store', 'store_id'), - $installer->getTable('catalog/product_index_eav'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_index_eav_decimal', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('catalog/product_index_eav_decimal'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_index_eav_decimal', 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_index_eav_decimal'), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_index_eav_decimal', 'store_id', 'core/store', 'store_id'), - $installer->getTable('catalog/product_index_eav_decimal'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'catalog/product_index_price', - 'customer_group_id', - 'customer/customer_group', - 'customer_group_id', - ), - $installer->getTable('catalog/product_index_price'), - 'customer_group_id', - $installer->getTable('customer/customer_group'), - 'customer_group_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_index_price', 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_index_price'), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_index_price', 'website_id', 'core/website', 'website_id'), - $installer->getTable('catalog/product_index_price'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'catalog/product_index_tier_price', - 'customer_group_id', - 'customer/customer_group', - 'customer_group_id', - ), - $installer->getTable('catalog/product_index_tier_price'), - 'customer_group_id', - $installer->getTable('customer/customer_group'), - 'customer_group_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_index_tier_price', 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_index_tier_price'), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_index_tier_price', 'website_id', 'core/website', 'website_id'), - $installer->getTable('catalog/product_index_tier_price'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_index_website', 'website_id', 'core/website', 'website_id'), - $installer->getTable('catalog/product_index_website'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_link', 'linked_product_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_link'), - 'linked_product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_link', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_link'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_link', 'link_type_id', 'catalog/product_link_type', 'link_type_id'), - $installer->getTable('catalog/product_link'), - 'link_type_id', - $installer->getTable('catalog/product_link_type'), - 'link_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'catalog/product_link_attribute', - 'link_type_id', - 'catalog/product_link_type', - 'link_type_id', - ), - $installer->getTable('catalog/product_link_attribute'), - 'link_type_id', - $installer->getTable('catalog/product_link_type'), - 'link_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_link_attribute_decimal', 'link_id', 'catalog/product_link', 'link_id'), - $installer->getTable('catalog/product_link_attribute_decimal'), - 'link_id', - $installer->getTable('catalog/product_link'), - 'link_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'catalog/product_link_attribute_decimal', - 'product_link_attribute_id', - 'catalog/product_link_attribute', - 'product_link_attribute_id', - ), - $installer->getTable('catalog/product_link_attribute_decimal'), - 'product_link_attribute_id', - $installer->getTable('catalog/product_link_attribute'), - 'product_link_attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'catalog/product_link_attribute_int', - 'product_link_attribute_id', - 'catalog/product_link_attribute', - 'product_link_attribute_id', - ), - $installer->getTable('catalog/product_link_attribute_int'), - 'product_link_attribute_id', - $installer->getTable('catalog/product_link_attribute'), - 'product_link_attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_link_attribute_int', 'link_id', 'catalog/product_link', 'link_id'), - $installer->getTable('catalog/product_link_attribute_int'), - 'link_id', - $installer->getTable('catalog/product_link'), - 'link_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_link_attribute_varchar', 'link_id', 'catalog/product_link', 'link_id'), - $installer->getTable('catalog/product_link_attribute_varchar'), - 'link_id', - $installer->getTable('catalog/product_link'), - 'link_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'catalog/product_link_attribute_varchar', - 'product_link_attribute_id', - 'catalog/product_link_attribute', - 'product_link_attribute_id', - ), - $installer->getTable('catalog/product_link_attribute_varchar'), - 'product_link_attribute_id', - $installer->getTable('catalog/product_link_attribute'), - 'product_link_attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_option', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_option'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_option_price', 'option_id', 'catalog/product_option', 'option_id'), - $installer->getTable('catalog/product_option_price'), - 'option_id', - $installer->getTable('catalog/product_option'), - 'option_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_option_price', 'store_id', 'core/store', 'store_id'), - $installer->getTable('catalog/product_option_price'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_option_title', 'option_id', 'catalog/product_option', 'option_id'), - $installer->getTable('catalog/product_option_title'), - 'option_id', - $installer->getTable('catalog/product_option'), - 'option_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_option_title', 'store_id', 'core/store', 'store_id'), - $installer->getTable('catalog/product_option_title'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'catalog/product_option_type_price', - 'option_type_id', - 'catalog/product_option_type_value', - 'option_type_id', - ), - $installer->getTable('catalog/product_option_type_price'), - 'option_type_id', - $installer->getTable('catalog/product_option_type_value'), - 'option_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_option_type_price', 'store_id', 'core/store', 'store_id'), - $installer->getTable('catalog/product_option_type_price'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'catalog/product_option_type_title', - 'option_type_id', - 'catalog/product_option_type_value', - 'option_type_id', - ), - $installer->getTable('catalog/product_option_type_title'), - 'option_type_id', - $installer->getTable('catalog/product_option_type_value'), - 'option_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_option_type_title', 'store_id', 'core/store', 'store_id'), - $installer->getTable('catalog/product_option_type_title'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_option_type_value', 'option_id', 'catalog/product_option', 'option_id'), - $installer->getTable('catalog/product_option_type_value'), - 'option_id', - $installer->getTable('catalog/product_option'), - 'option_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_relation', 'child_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_relation'), - 'child_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_relation', 'parent_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_relation'), - 'parent_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_super_attribute', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_super_attribute'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, - Varien_Db_Ddl_Table::ACTION_NO_ACTION, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'catalog/product_super_attribute_label', - 'product_super_attribute_id', - 'catalog/product_super_attribute', - 'product_super_attribute_id', - ), - $installer->getTable('catalog/product_super_attribute_label'), - 'product_super_attribute_id', - $installer->getTable('catalog/product_super_attribute'), - 'product_super_attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_super_attribute_label', 'store_id', 'core/store', 'store_id'), - $installer->getTable('catalog/product_super_attribute_label'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_super_attribute_pricing', 'website_id', 'core/website', 'website_id'), - $installer->getTable('catalog/product_super_attribute_pricing'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'catalog/product_super_attribute_pricing', - 'product_super_attribute_id', - 'catalog/product_super_attribute', - 'product_super_attribute_id', - ), - $installer->getTable('catalog/product_super_attribute_pricing'), - 'product_super_attribute_id', - $installer->getTable('catalog/product_super_attribute'), - 'product_super_attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_super_link', 'parent_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_super_link'), - 'parent_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_super_link', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_super_link'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_website', 'website_id', 'core/website', 'website_id'), - $installer->getTable('catalog/product_website'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalog/product_website', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalog/product_website'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'datetime'], 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable(['catalog/category', 'datetime']), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'datetime'], 'entity_id', 'catalog/category', 'entity_id'), - $installer->getTable(['catalog/category', 'datetime']), - 'entity_id', - $installer->getTable('catalog/category'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'datetime'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['catalog/category', 'datetime']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'decimal'], 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable(['catalog/category', 'decimal']), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'decimal'], 'entity_id', 'catalog/category', 'entity_id'), - $installer->getTable(['catalog/category', 'decimal']), - 'entity_id', - $installer->getTable('catalog/category'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'decimal'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['catalog/category', 'decimal']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'int'], 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable(['catalog/category', 'int']), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'int'], 'entity_id', 'catalog/category', 'entity_id'), - $installer->getTable(['catalog/category', 'int']), - 'entity_id', - $installer->getTable('catalog/category'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'int'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['catalog/category', 'int']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'text'], 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable(['catalog/category', 'text']), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'text'], 'entity_id', 'catalog/category', 'entity_id'), - $installer->getTable(['catalog/category', 'text']), - 'entity_id', - $installer->getTable('catalog/category'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'text'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['catalog/category', 'text']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'varchar'], 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable(['catalog/category', 'varchar']), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'varchar'], 'entity_id', 'catalog/category', 'entity_id'), - $installer->getTable(['catalog/category', 'varchar']), - 'entity_id', - $installer->getTable('catalog/category'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/category', 'varchar'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['catalog/category', 'varchar']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'datetime'], 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable(['catalog/product', 'datetime']), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'datetime'], 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable(['catalog/product', 'datetime']), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'datetime'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['catalog/product', 'datetime']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'decimal'], 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable(['catalog/product', 'decimal']), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'decimal'], 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable(['catalog/product', 'decimal']), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'decimal'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['catalog/product', 'decimal']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'gallery'], 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable(['catalog/product', 'gallery']), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'gallery'], 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable(['catalog/product', 'gallery']), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'gallery'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['catalog/product', 'gallery']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'int'], 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable(['catalog/product', 'int']), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'int'], 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable(['catalog/product', 'int']), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'int'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['catalog/product', 'int']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'text'], 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable(['catalog/product', 'text']), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'text'], 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable(['catalog/product', 'text']), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'text'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['catalog/product', 'text']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'varchar'], 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable(['catalog/product', 'varchar']), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'varchar'], 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable(['catalog/product', 'varchar']), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['catalog/product', 'varchar'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['catalog/product', 'varchar']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->endSetup(); -$installer->getConnection()->closeConnection(); diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-install-0.7.0.php deleted file mode 100644 index d21789cb9da..00000000000 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,55 +0,0 @@ -startSetup(); - -$installer->run(" --- DROP TABLE IF EXISTS `{$installer->getTable('catalogindex_eav')}`; -CREATE TABLE `{$installer->getTable('catalogindex_eav')}` ( - `index_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`index_id`), - KEY `IDX_VALUE` (`value`), - CONSTRAINT `FK_CATALOGINDEX_EAV_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINDEX_EAV_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINDEX_EAV_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('catalogindex_price')}`; -CREATE TABLE `{$installer->getTable('catalogindex_price')}` ( - `index_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `customer_group_id` smallint(3) unsigned NOT NULL default '0', - `qty` decimal(12,4) unsigned NOT NULL default '0.0000', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`index_id`), - KEY `IDX_VALUE` (`value`), - KEY `IDX_QTY` (`qty`), - CONSTRAINT `FK_CATALOGINDEX_PRICE_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINDEX_PRICE_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINDEX_PRICE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINDEX_PRICE_CUSTOMER_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES `{$installer->getTable('customer_group')}` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index e169b330277..00000000000 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropForeignKey($installer->getTable('catalogindex_price'), 'FK_CATALOGINDEX_PRICE_CUSTOMER_GROUP'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index 55f9f3d4b0a..00000000000 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,15 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$installer->getTable('catalogindex_minimal_price')}` ( - `index_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `customer_group_id` smallint(3) unsigned NOT NULL default '0', - `qty` decimal(12,4) unsigned NOT NULL default '0.0000', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`index_id`), - KEY `IDX_VALUE` (`value`), - KEY `IDX_QTY` (`qty`), - CONSTRAINT `FK_CATALOGINDEX_MINIMAL_PRICE_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINDEX_MINIMAL_PRICE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINDEX_MINIMAL_PRICE_CUSTOMER_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES `{$installer->getTable('customer_group')}` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.3-0.7.4.php deleted file mode 100644 index e780caaabdc..00000000000 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->run(" -TRUNCATE {$installer->getTable('catalogindex_eav')}; -TRUNCATE {$installer->getTable('catalogindex_price')}; -TRUNCATE {$installer->getTable('catalogindex_minimal_price')}; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index 01c12fe3a55..00000000000 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,105 +0,0 @@ -run(" - CREATE TABLE `{$installer->getTable('catalogindex_eav_tmp')}` ( - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0' - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - insert into `{$installer->getTable('catalogindex_eav_tmp')}` - select distinct store_id, entity_id, attribute_id, value - from `{$installer->getTable('catalogindex_eav')}`; - - DROP TABLE `{$installer->getTable('catalogindex_eav')}`; - - CREATE TABLE `{$installer->getTable('catalogindex_eav')}` ( - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`store_id`,`entity_id`,`attribute_id`,`value`), - KEY `IDX_VALUE` (`value`), - KEY `FK_CATALOGINDEX_EAV_ENTITY` (`entity_id`), - KEY `FK_CATALOGINDEX_EAV_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOGINDEX_EAV_STORE` (`store_id`), - CONSTRAINT `FK_CATALOGINDEX_EAV_ATTRIBUTE` FOREIGN KEY (`attribute_id`) - REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINDEX_EAV_ENTITY` FOREIGN KEY (`entity_id`) - REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINDEX_EAV_STORE` FOREIGN KEY (`store_id`) - REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - insert into `{$installer->getTable('catalogindex_eav')}` - select store_id, entity_id, attribute_id, value - from `{$installer->getTable('catalogindex_eav_tmp')}`; - - DROP TABLE `{$installer->getTable('catalogindex_eav_tmp')}`; - - - - - - - CREATE TABLE `{$installer->getTable('catalogindex_price_tmp')}` ( - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `customer_group_id` smallint(3) unsigned NOT NULL default '0', - `qty` decimal(12,4) unsigned NOT NULL default '0.0000', - `value` decimal(12,4) NOT NULL default '0.0000' - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - insert into `{$installer->getTable('catalogindex_price_tmp')}` - select distinct store_id, entity_id, attribute_id, customer_group_id, qty, value - from `{$installer->getTable('catalogindex_price')}`; - - DROP TABLE `{$installer->getTable('catalogindex_price')}`; - - CREATE TABLE `{$installer->getTable('catalogindex_price')}` ( - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `customer_group_id` smallint(3) unsigned NOT NULL default '0', - `qty` decimal(12,4) unsigned NOT NULL default '0.0000', - `value` decimal(12,4) NOT NULL default '0.0000', - KEY `IDX_VALUE` (`value`), - KEY `IDX_QTY` (`qty`), - KEY `FK_CATALOGINDEX_PRICE_ENTITY` (`entity_id`), - KEY `FK_CATALOGINDEX_PRICE_ATTRIBUTE` (`attribute_id`), - KEY `FK_CATALOGINDEX_PRICE_STORE` (`store_id`), - KEY `FK_CATALOGINDEX_PRICE_CUSTOMER_GROUP` (`customer_group_id`), - KEY `IDX_RANGE_VALUE` (`store_id`, `entity_id`,`attribute_id`,`customer_group_id`,`value`), - CONSTRAINT `FK_CATALOGINDEX_PRICE_ATTRIBUTE` FOREIGN KEY (`attribute_id`) - REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINDEX_PRICE_ENTITY` FOREIGN KEY (`entity_id`) - REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINDEX_PRICE_STORE` FOREIGN KEY (`store_id`) - REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - insert into `{$installer->getTable('catalogindex_price')}` - select store_id, entity_id, attribute_id, customer_group_id, qty, value - from `{$installer->getTable('catalogindex_price_tmp')}`; - - DROP TABLE `{$installer->getTable('catalogindex_price_tmp')}`; -"); diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.5-0.7.6.php deleted file mode 100644 index ba539022334..00000000000 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$installer->getConnection()->addConstraint( - 'FK_CATALOGRULE_PRODUCT_PRODUCT', - $installer->getTable('catalogrule_product'), - 'product_id', - $installer->getTable('catalog_product_entity'), - 'entity_id', -); - -$installer->getConnection()->addConstraint( - 'FK_CATALOGRULE_PRODUCT_PRICE_PRODUCT', - $installer->getTable('catalogrule_product_price'), - 'product_id', - $installer->getTable('catalog_product_entity'), - 'entity_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.6-0.7.7.php deleted file mode 100644 index 85bfd6b5cff..00000000000 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ /dev/null @@ -1,31 +0,0 @@ -startSetup(); - -$installer->run(" - ALTER TABLE {$installer->getTable('catalogindex_price')} - ADD COLUMN `tax_class_id` smallint(6) NOT NULL DEFAULT 0; -"); - -$installer->run(" - ALTER TABLE {$installer->getTable('catalogindex_minimal_price')} - ADD COLUMN `tax_class_id` smallint(6) NOT NULL DEFAULT 0; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.7-0.7.8.php deleted file mode 100644 index 03f79b48a8c..00000000000 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('catalogindex_price'), 'website_id', 'smallint(5) unsigned'); -$installer->getConnection()->addColumn($installer->getTable('catalogindex_minimal_price'), 'website_id', 'smallint(5) unsigned'); - -$installer->convertStoreToWebsite($installer->getTable('catalogindex_minimal_price')); -$installer->convertStoreToWebsite($installer->getTable('catalogindex_price')); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.8-0.7.9.php deleted file mode 100644 index 2aedef4386b..00000000000 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ /dev/null @@ -1,30 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropColumn($installer->getTable('catalogindex_price'), 'store_id'); -$installer->getConnection()->dropColumn($installer->getTable('catalogindex_minimal_price'), 'store_id'); - -$installer->getConnection()->addConstraint('FK_CI_PRICE_WEBSITE_ID', $installer->getTable('catalogindex_price'), 'website_id', $installer->getTable('core_website'), 'website_id'); -$installer->getConnection()->addConstraint('FK_CI_MINIMAL_PRICE_WEBSITE_ID', $installer->getTable('catalogindex_minimal_price'), 'website_id', $installer->getTable('core_website'), 'website_id'); - -$installer->getConnection()->addKey($installer->getTable('catalogindex_price'), 'IDX_FULL', ['entity_id', 'attribute_id', 'customer_group_id', 'value', 'website_id']); -$installer->getConnection()->addKey($installer->getTable('catalogindex_minimal_price'), 'IDX_FULL', ['entity_id', 'qty', 'customer_group_id', 'value', 'website_id']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.9-0.7.10.php deleted file mode 100644 index 660ec7003d7..00000000000 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ /dev/null @@ -1,56 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$installer->getTable('catalogindex_aggregation')}` ( - `aggregation_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned NOT NULL, - `created_at` datetime NOT NULL, - `key` varchar(255) default NULL, - `data` mediumtext, - PRIMARY KEY (`aggregation_id`), - UNIQUE KEY `IDX_STORE_KEY` (`store_id`,`key`), - CONSTRAINT `FK_CATALOGINDEX_AGGREGATION_STORE` FOREIGN KEY (`store_id`) - REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('catalogindex_aggregation_tag')}` ( - `tag_id` int(10) unsigned NOT NULL auto_increment, - `tag_code` varchar(255) NOT NULL, - PRIMARY KEY (`tag_id`), - UNIQUE KEY `IDX_CODE` (`tag_code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('catalogindex_aggregation_to_tag')}` ( - `aggregation_id` int(10) unsigned NOT NULL, - `tag_id` int(10) unsigned NOT NULL, - UNIQUE KEY `IDX_AGGREGATION_TAG` (`aggregation_id`,`tag_id`), - KEY `FK_CATALOGINDEX_AGGREGATION_TO_TAG_TAG` (`tag_id`), - CONSTRAINT `FK_CATALOGINDEX_AGGREGATION_TO_TAG_AGGREGATION` FOREIGN KEY (`aggregation_id`) - REFERENCES `{$installer->getTable('catalogindex_aggregation')}` (`aggregation_id`) - ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINDEX_AGGREGATION_TO_TAG_TAG` FOREIGN KEY (`tag_id`) - REFERENCES `{$installer->getTable('catalogindex_aggregation_tag')}` (`tag_id`) - ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 55f9f3d4b0a..00000000000 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,15 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS `{$this->getTable('cataloginventory_stock')}`; -CREATE TABLE `{$this->getTable('cataloginventory_stock')}` ( - `stock_id` smallint(4) unsigned NOT NULL auto_increment, - `stock_name` varchar(255) NOT NULL default '', - PRIMARY KEY (`stock_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog inventory Stocks list'; - -insert into `{$this->getTable('cataloginventory_stock')}`(`stock_id`,`stock_name`) values (1, 'Default'); - --- DROP TABLE IF EXISTS `{$this->getTable('cataloginventory_stock_item')}`; -CREATE TABLE `{$this->getTable('cataloginventory_stock_item')}` ( - `item_id` int(10) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - `stock_id` smallint(4) unsigned NOT NULL default '0', - `qty` decimal(12,4) NOT NULL default '0.0000', - `min_qty` decimal(12,4) NOT NULL default '0.0000', - `use_config_min_qty` tinyint(1) unsigned NOT NULL default '1', - `is_qty_decimal` tinyint(1) unsigned NOT NULL default '0', - `backorders` tinyint(3) unsigned NOT NULL default '0', - `use_config_backorders` tinyint(1) unsigned NOT NULL default '1', - `min_sale_qty` decimal(12,4) NOT NULL default '1.0000', - `use_config_min_sale_qty` tinyint(1) unsigned NOT NULL default '1', - `max_sale_qty` decimal(12,4) NOT NULL default '0.0000', - `use_config_max_sale_qty` tinyint(1) unsigned NOT NULL default '1', - `is_in_stock` tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (`item_id`), - UNIQUE KEY `IDX_STOCK_PRODUCT` (`product_id`,`stock_id`), - KEY `FK_CATALOGINVENTORY_STOCK_ITEM_PRODUCT` (`product_id`), - KEY `FK_CATALOGINVENTORY_STOCK_ITEM_STOCK` (`stock_id`), - CONSTRAINT `FK_CATALOGINVENTORY_STOCK_ITEM_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `{$this->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINVENTORY_STOCK_ITEM_STOCK` FOREIGN KEY (`stock_id`) REFERENCES `{$this->getTable('cataloginventory_stock')}` (`stock_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Inventory Stock Item Data'; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index b28e893c78b..00000000000 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,25 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($this->getTable('cataloginventory_stock_item'), 'low_stock_date', 'datetime'); -$installer->getConnection()->addColumn($this->getTable('cataloginventory_stock_item'), 'notify_stock_qty', 'decimal(12,4)'); -$installer->getConnection()->addColumn($this->getTable('cataloginventory_stock_item'), 'use_config_notify_stock_qty', "tinyint(1) unsigned NOT NULL default '1'"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index de69d441aa6..00000000000 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($this->getTable('cataloginventory_stock_item'), 'manage_stock', 'tinyint(1) unsigned NOT NULL DEFAULT 0'); -$installer->getConnection()->addColumn($this->getTable('cataloginventory_stock_item'), 'use_config_manage_stock', 'tinyint(1) unsigned NOT NULL DEFAULT 1'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index fd115cca972..00000000000 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($this->getTable('cataloginventory_stock_item'), 'stock_status_changed_automatically', 'tinyint(1) unsigned NOT NULL DEFAULT 0'); -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.3-0.7.4.php deleted file mode 100644 index 573c563f6cf..00000000000 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ /dev/null @@ -1,38 +0,0 @@ -startSetup(); - -foreach ([ - 'cataloginventory/options/min_qty' => 'cataloginventory/item_options/min_qty', - 'cataloginventory/options/min_sale_qty' => 'cataloginventory/item_options/min_sale_qty', - 'cataloginventory/options/max_sale_qty' => 'cataloginventory/item_options/max_sale_qty', - 'cataloginventory/options/backorders' => 'cataloginventory/item_options/backorders', - 'cataloginventory/options/notify_stock_qty' => 'cataloginventory/item_options/notify_stock_qty', - 'cataloginventory/options/manage_stock' => 'cataloginventory/item_options/manage_stock', -] as $was => $become -) { - $installer->run(sprintf( - "UPDATE `%s` SET `path` = '%s' WHERE `path` = '%s'", - $this->getTable('core/config_data'), - $become, - $was, - )); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index c653bc53305..00000000000 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,42 +0,0 @@ -startSetup(); - -/** @var Varien_Db_Adapter_Pdo_Mysql $connection */ -$connection = $installer->getConnection(); - -$installer->run(" - CREATE TABLE `{$installer->getTable('cataloginventory_stock_status')}` ( - `product_id` int(10) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `stock_id` smallint(4) unsigned NOT NULL, - `qty` decimal(12,4) NOT NULL DEFAULT '0.0000', - `stock_status` tinyint(3) unsigned NOT NULL, - PRIMARY KEY (`product_id`,`website_id`,`stock_id`), - CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_STOCK` FOREIGN KEY (`stock_id`) - REFERENCES `{$installer->getTable('cataloginventory_stock')}` (`stock_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_PRODUCT` FOREIGN KEY (`product_id`) - REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_WEBSITE` FOREIGN KEY (`website_id`) - REFERENCES `{$installer->getTable('core_website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -Mage::getModel('cataloginventory/stock_status')->rebuild(); -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.5-0.7.6.php deleted file mode 100644 index 2769ca5631e..00000000000 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ /dev/null @@ -1,25 +0,0 @@ -getConnection(); - -$tableCataloginventoryStockItem = $installer->getTable('cataloginventory_stock_item'); -$connection->addColumn($tableCataloginventoryStockItem, 'use_config_qty_increments', "tinyint(1) unsigned NOT NULL default '1'"); -$connection->addColumn($tableCataloginventoryStockItem, 'qty_increments', "decimal(12,4) NOT NULL DEFAULT '0.0000'"); diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.6-0.7.7.php deleted file mode 100644 index 784ea94566b..00000000000 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ /dev/null @@ -1,47 +0,0 @@ -startSetup(); - -$installer->run(" -DROP TABLE IF EXISTS `{$installer->getTable('cataloginventory/stock_status')}_idx`; - -CREATE TABLE `{$installer->getTable('cataloginventory/stock_status_indexer_idx')}` ( - `product_id` int(10) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `stock_id` smallint(4) unsigned NOT NULL, - `qty` decimal(12,4) NOT NULL default '0.0000', - `stock_status` tinyint(3) unsigned NOT NULL, - PRIMARY KEY (`product_id`,`website_id`,`stock_id`), - KEY `FK_CATALOGINVENTORY_STOCK_STATUS_STOCK` (`stock_id`), - KEY `FK_CATALOGINVENTORY_STOCK_STATUS_WEBSITE` (`website_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('cataloginventory/stock_status_indexer_tmp')}` ( - `product_id` int(10) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `stock_id` smallint(4) unsigned NOT NULL, - `qty` decimal(12,4) NOT NULL default '0.0000', - `stock_status` tinyint(3) unsigned NOT NULL, - PRIMARY KEY (`product_id`,`website_id`,`stock_id`), - KEY `FK_CATALOGINVENTORY_STOCK_STATUS_STOCK` (`stock_id`), - KEY `FK_CATALOGINVENTORY_STOCK_STATUS_WEBSITE` (`website_id`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.7-0.7.8.php deleted file mode 100644 index 767983b264d..00000000000 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ /dev/null @@ -1,25 +0,0 @@ -getConnection(); -/** @var Varien_Db_Adapter_Pdo_Mysql $connection */ - -$tableCataloginventoryStockItem = $installer->getTable('cataloginventory/stock_item'); -$connection->addColumn($tableCataloginventoryStockItem, 'use_config_enable_qty_increments', "tinyint(1) unsigned NOT NULL default '1'"); -$connection->addColumn($tableCataloginventoryStockItem, 'enable_qty_increments', "tinyint(1) unsigned NOT NULL default '0'"); diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index c8745fc4e30..00000000000 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,536 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('cataloginventory/stock_item'), - 'FK_CATALOGINVENTORY_STOCK_ITEM_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('cataloginventory/stock_item'), - 'FK_CATALOGINVENTORY_STOCK_ITEM_STOCK', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('cataloginventory/stock_status'), - 'FK_CATALOGINVENTORY_STOCK_STATUS_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('cataloginventory/stock_status'), - 'FK_CATALOGINVENTORY_STOCK_STATUS_STOCK', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('cataloginventory/stock_status'), - 'FK_CATALOGINVENTORY_STOCK_STATUS_WEBSITE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('cataloginventory/stock_item'), - 'IDX_STOCK_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('cataloginventory/stock_item'), - 'FK_CATALOGINVENTORY_STOCK_ITEM_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('cataloginventory/stock_item'), - 'FK_CATALOGINVENTORY_STOCK_ITEM_STOCK', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('cataloginventory/stock_status'), - 'FK_CATALOGINVENTORY_STOCK_STATUS_STOCK', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('cataloginventory/stock_status'), - 'FK_CATALOGINVENTORY_STOCK_STATUS_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('cataloginventory_stock_status_idx'), - 'FK_CATALOGINVENTORY_STOCK_STATUS_STOCK', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('cataloginventory/stock_status_indexer_idx'), - 'FK_CATALOGINVENTORY_STOCK_STATUS_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('cataloginventory_stock_status_tmp'), - 'FK_CATALOGINVENTORY_STOCK_STATUS_STOCK', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('cataloginventory/stock_status_indexer_tmp'), - 'FK_CATALOGINVENTORY_STOCK_STATUS_WEBSITE', -); - -/* - * Change columns - */ -$tables = [ - $installer->getTable('cataloginventory/stock') => [ - 'columns' => [ - 'stock_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Stock Id', - ], - 'stock_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Stock Name', - ], - ], - 'comment' => 'Cataloginventory Stock', - ], - $installer->getTable('cataloginventory/stock_item') => [ - 'columns' => [ - 'item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Item Id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product Id', - ], - 'stock_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Stock Id', - ], - 'qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Qty', - ], - 'min_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Min Qty', - ], - 'use_config_min_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Use Config Min Qty', - ], - 'is_qty_decimal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Qty Decimal', - ], - 'backorders' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Backorders', - ], - 'use_config_backorders' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Use Config Backorders', - ], - 'min_sale_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '1.0000', - 'comment' => 'Min Sale Qty', - ], - 'use_config_min_sale_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Use Config Min Sale Qty', - ], - 'max_sale_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Max Sale Qty', - ], - 'use_config_max_sale_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Use Config Max Sale Qty', - ], - 'is_in_stock' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is In Stock', - ], - 'low_stock_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Low Stock Date', - ], - 'notify_stock_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Notify Stock Qty', - ], - 'use_config_notify_stock_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Use Config Notify Stock Qty', - ], - 'manage_stock' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Manage Stock', - ], - 'use_config_manage_stock' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Use Config Manage Stock', - ], - 'use_config_qty_increments' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Use Config Qty Increments', - ], - 'qty_increments' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Qty Increments', - ], - 'enable_qty_increments' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Enable Qty Increments', - ], - ], - 'comment' => 'Cataloginventory Stock Item', - ], - $installer->getTable('cataloginventory/stock_status') => [ - 'columns' => [ - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Product Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'stock_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Stock Id', - ], - 'qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Qty', - ], - 'stock_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Stock Status', - ], - ], - 'comment' => 'Cataloginventory Stock Status', - ], - $installer->getTable('cataloginventory/stock_status_indexer_idx') => [ - 'columns' => [ - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Product Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'stock_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Stock Id', - ], - 'qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Qty', - ], - 'stock_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Stock Status', - ], - ], - 'comment' => 'Cataloginventory Stock Status Indexer Idx', - ], - $installer->getTable('cataloginventory/stock_status_indexer_tmp') => [ - 'columns' => [ - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Product Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'stock_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Stock Id', - ], - 'qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Qty', - ], - 'stock_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Stock Status', - ], - ], - 'comment' => 'Cataloginventory Stock Status Indexer Tmp', - 'engine' => 'InnoDB', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -$installer->getConnection()->changeColumn( - $installer->getTable('cataloginventory/stock_item'), - 'stock_status_changed_automatically', - 'stock_status_changed_auto', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Stock Status Changed Automatically', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('cataloginventory/stock_item'), - 'use_config_enable_qty_increments', - 'use_config_enable_qty_inc', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Use Config Enable Qty Increments', - ], -); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('cataloginventory/stock_item'), - $installer->getIdxName( - 'cataloginventory/stock_item', - ['product_id', 'stock_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['product_id', 'stock_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('cataloginventory/stock_item'), - $installer->getIdxName('cataloginventory/stock_item', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('cataloginventory/stock_item'), - $installer->getIdxName('cataloginventory/stock_item', ['stock_id']), - ['stock_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('cataloginventory/stock_status'), - $installer->getIdxName('cataloginventory/stock_status', ['stock_id']), - ['stock_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('cataloginventory/stock_status'), - $installer->getIdxName('cataloginventory/stock_status', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('cataloginventory/stock_status_indexer_idx'), - $installer->getIdxName('cataloginventory/stock_status_indexer_idx', ['stock_id']), - ['stock_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('cataloginventory/stock_status_indexer_idx'), - $installer->getIdxName('cataloginventory/stock_status_indexer_idx', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('cataloginventory/stock_status_indexer_tmp'), - $installer->getIdxName('cataloginventory/stock_status_indexer_tmp', ['stock_id']), - ['stock_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('cataloginventory/stock_status_indexer_tmp'), - $installer->getIdxName('cataloginventory/stock_status_indexer_tmp', ['website_id']), - ['website_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('cataloginventory/stock_item', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('cataloginventory/stock_item'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('cataloginventory/stock_item', 'stock_id', 'cataloginventory/stock', 'stock_id'), - $installer->getTable('cataloginventory/stock_item'), - 'stock_id', - $installer->getTable('cataloginventory/stock'), - 'stock_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('cataloginventory/stock_status', 'stock_id', 'cataloginventory/stock', 'stock_id'), - $installer->getTable('cataloginventory/stock_status'), - 'stock_id', - $installer->getTable('cataloginventory/stock'), - 'stock_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('cataloginventory/stock_status', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('cataloginventory/stock_status'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('cataloginventory/stock_status', 'website_id', 'core/website', 'website_id'), - $installer->getTable('cataloginventory/stock_status'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 835289ce08e..00000000000 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,83 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('catalogrule')}; -CREATE TABLE {$this->getTable('catalogrule')} ( - `rule_id` int(10) unsigned NOT NULL auto_increment, - `name` varchar(255) NOT NULL default '', - `description` text NOT NULL, - `from_date` date default NULL, - `to_date` date default NULL, - `store_ids` varchar(255) NOT NULL default '', - `customer_group_ids` varchar(255) NOT NULL default '', - `is_active` tinyint(1) NOT NULL default '0', - `conditions_serialized` text NOT NULL, - `actions_serialized` text NOT NULL, - `stop_rules_processing` tinyint(1) NOT NULL default '1', - `sort_order` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`rule_id`), - KEY `sort_order` (`is_active`,`sort_order`,`to_date`,`from_date`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - --- DROP TABLE IF EXISTS {$this->getTable('catalogrule_product')}; -CREATE TABLE {$this->getTable('catalogrule_product')} ( - `rule_product_id` int(10) unsigned NOT NULL auto_increment, - `rule_id` int(10) unsigned NOT NULL default '0', - `from_time` int(10) unsigned NOT NULL default '0', - `to_time` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `customer_group_id` smallint(5) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `action_operator` enum('to_fixed','to_percent','by_fixed','by_percent') NOT NULL default 'to_fixed', - `action_amount` decimal(12,4) NOT NULL default '0.0000', - `action_stop` tinyint(1) NOT NULL default '0', - `sort_order` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`rule_product_id`), - UNIQUE KEY `sort_order` (`from_time`,`to_time`,`store_id`,`customer_group_id`,`product_id`,`sort_order`), - KEY `FK_catalogrule_product_rule` (`rule_id`), - KEY `FK_catalogrule_product_store` (`store_id`), - KEY `FK_catalogrule_product_customergroup` (`customer_group_id`), - CONSTRAINT `FK_catalogrule_product_customergroup` FOREIGN KEY (`customer_group_id`) REFERENCES {$this->getTable('customer_group')} (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_catalogrule_product_rule` FOREIGN KEY (`rule_id`) REFERENCES {$this->getTable('catalogrule')} (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_catalogrule_product_store` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('catalogrule_product_price')}; -CREATE TABLE {$this->getTable('catalogrule_product_price')} ( - `rule_product_price_id` int(10) unsigned NOT NULL auto_increment, - `rule_date` date NOT NULL default '0000-00-00', - `store_id` smallint(5) unsigned NOT NULL default '0', - `customer_group_id` smallint(5) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `rule_price` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`rule_product_price_id`), - UNIQUE KEY `rule_date` (`rule_date`,`store_id`,`customer_group_id`,`product_id`), - KEY `FK_catalogrule_product_price_store` (`store_id`), - KEY `FK_catalogrule_product_price_customergroup` (`customer_group_id`), - CONSTRAINT `FK_catalogrule_product_price_customergroup` FOREIGN KEY (`customer_group_id`) REFERENCES {$this->getTable('customer_group')} (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_catalogrule_product_price_store` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 1bcfc660f17..00000000000 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($this->getTable('catalogrule'), 'simple_action', 'varchar(32) not null'); -$installer->getConnection()->addColumn($this->getTable('catalogrule'), 'discount_amount', 'decimal(12,4) not null'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index af681278ac6..00000000000 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,91 +0,0 @@ -startSetup(); - -$conn = $installer->getConnection(); -$websites = $conn->fetchPairs("SELECT store_id, website_id FROM {$installer->getTable('core_store')}"); -$ruleTable = $this->getTable('catalogrule'); -if ($conn->tableColumnExists($ruleTable, 'store_ids')) { - // catalogrule - $conn->addColumn($ruleTable, 'website_ids', 'text'); - $select = $conn->select() - ->from($ruleTable, ['rule_id', 'store_ids']); - $rows = $conn->fetchAll($select); - - foreach ($rows as $r) { - $websiteIds = []; - foreach (explode(',', $r['store_ids']) as $storeId) { - if (($storeId !== '') && isset($websites[$storeId])) { - $websiteIds[$websites[$storeId]] = true; - } - } - - $conn->update($ruleTable, ['website_ids' => implode(',', array_keys($websiteIds))], 'rule_id=' . $r['rule_id']); - } - $conn->dropColumn($ruleTable, 'store_ids'); -} - -// catalogrule_product -$ruleProductTable = $this->getTable('catalogrule_product'); -if ($conn->tableColumnExists($ruleProductTable, 'store_id')) { - $conn->addColumn($ruleProductTable, 'website_id', 'smallint unsigned not null'); - $unique = []; - - $select = $conn->select() - ->from($ruleProductTable); - $rows = $conn->fetchAll($select); - - //$q = $conn->query("select * from `$ruleProductTable`"); - foreach ($rows as $r) { - $websiteId = $websites[$r['store_id']]; - $key = $r['from_time'] . '|' . $r['to_time'] . '|' . $websiteId . '|' . $r['customer_group_id'] . '|' . $r['product_id'] . '|' . $r['sort_order']; - if (isset($unique[$key])) { - $conn->delete($ruleProductTable, $conn->quoteInto('rule_product_id=?', $r['rule_product_id'])); - } else { - $conn->update($ruleProductTable, ['website_id' => $websiteId], 'rule_product_id=' . $r['rule_product_id']); - $unique[$key] = true; - } - } - $conn->dropKey($ruleProductTable, 'sort_order'); - $conn->raw_query("ALTER TABLE `$ruleProductTable` ADD UNIQUE KEY `sort_order` (`from_time`,`to_time`,`website_id`,`customer_group_id`,`product_id`,`sort_order`)"); - - $conn->dropForeignKey($ruleProductTable, 'FK_catalogrule_product_store'); - $conn->dropColumn($ruleProductTable, 'store_id'); - - $conn->dropForeignKey($ruleProductTable, 'FK_catalogrule_product_website'); - $conn->raw_query("ALTER TABLE `$ruleProductTable` ADD CONSTRAINT `FK_catalogrule_product_website` FOREIGN KEY (`website_id`) REFERENCES `{$this->getTable('core_website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE"); -} - -// catalogrule_product_price -$ruleProductPriceTable = $this->getTable('catalogrule_product_price'); -if ($conn->tableColumnExists($ruleProductPriceTable, 'store_id')) { - $conn->addColumn($ruleProductPriceTable, 'website_id', 'smallint unsigned not null'); - $conn->delete($ruleProductPriceTable); - - $conn->dropKey($ruleProductPriceTable, 'rule_date'); - $conn->raw_query("ALTER TABLE `$ruleProductPriceTable` ADD UNIQUE KEY `rule_date` (`rule_date`,`website_id`,`customer_group_id`,`product_id`)"); - - $conn->dropForeignKey($ruleProductPriceTable, 'FK_catalogrule_product_store'); - $conn->dropColumn($ruleProductPriceTable, 'store_id'); - - $conn->dropForeignKey($ruleProductPriceTable, 'FK_catalogrule_product_price_website'); - $conn->raw_query("ALTER TABLE `$ruleProductPriceTable` ADD CONSTRAINT `FK_catalogrule_product_price_website` FOREIGN KEY (`website_id`) REFERENCES `{$this->getTable('core_website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE"); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index e5316b14a60..00000000000 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($this->getTable('catalogrule_product_price'), 'latest_start_date', 'date'); -$installer->getConnection()->addColumn($this->getTable('catalogrule_product_price'), 'earliest_end_date', 'date'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.3-0.7.4.php deleted file mode 100644 index 3565d74b81e..00000000000 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -$installer->getConnection()->changeColumn( - $this->getTable('catalogrule'), - 'conditions_serialized', - 'conditions_serialized', - 'mediumtext CHARACTER SET utf8 NOT NULL', -); -$installer->getConnection()->changeColumn( - $this->getTable('catalogrule'), - 'actions_serialized', - 'actions_serialized', - 'mediumtext CHARACTER SET utf8 NOT NULL', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index 6d6ec69ff0f..00000000000 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE {$this->getTable('catalogrule_affected_product')} ( - `product_id` int(10) unsigned NOT NULL, - KEY `IDX_PRODUCT` (`product_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.5-0.7.6.php deleted file mode 100644 index 8a12a42c2b5..00000000000 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ /dev/null @@ -1,25 +0,0 @@ -getConnection()->addKey( - $installer->getTable('catalogrule_product'), - 'sort_order', - ['rule_id', 'from_time','to_time','website_id','customer_group_id','product_id','sort_order'], - 'unique', -); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.6-0.7.7.php deleted file mode 100644 index 2a9fa125629..00000000000 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ /dev/null @@ -1,31 +0,0 @@ -startSetup(); - -$installer->run(" -DROP TABLE IF EXISTS `{$this->getTable('catalogrule_affected_product')}`; -"); -$installer->run(" -CREATE TABLE `{$this->getTable('catalogrule_affected_product')}` ( - `product_id` int(10) unsigned NOT NULL, - PRIMARY KEY (`product_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.7-0.7.8.php deleted file mode 100644 index 2dcc8c53265..00000000000 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ /dev/null @@ -1,64 +0,0 @@ -startSetup(); - -$ruleGroupWebsiteTable = $installer->getTable('catalogrule/rule_group_website'); - -$installer->run("CREATE TABLE `{$ruleGroupWebsiteTable}` ( - `rule_id` int(10) unsigned NOT NULL default '0', - `customer_group_id` smallint(5) unsigned default NULL, - `website_id` smallint(5) unsigned default NULL, - KEY `rule_id` (`rule_id`), - KEY `customer_group_id` (`customer_group_id`), - KEY `website_id` (`website_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin"); - -$installer->getConnection()->addConstraint( - 'FK_CATALOGRULE_GROUP_WEBSITE_RULE', - $ruleGroupWebsiteTable, - 'rule_id', - $installer->getTable('catalogrule/rule'), - 'rule_id', - 'CASCADE', - 'CASCADE', -); -$installer->getConnection()->addConstraint( - 'FK_CATALOGRULE_GROUP_WEBSITE_GROUP', - $ruleGroupWebsiteTable, - 'customer_group_id', - $installer->getTable('customer/customer_group'), - 'customer_group_id', - 'CASCADE', - 'CASCADE', -); -$installer->getConnection()->addConstraint( - 'FK_CATALOGRULE_GROUP_WEBSITE_WEBSITE', - $ruleGroupWebsiteTable, - 'website_id', - $installer->getTable('core/website'), - 'website_id', - 'CASCADE', - 'CASCADE', -); - -$installer->run( - "ALTER TABLE `{$ruleGroupWebsiteTable}` ADD PRIMARY KEY ( `rule_id` , `customer_group_id`, `website_id` )", -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.8-0.7.9.php deleted file mode 100644 index 851fbee5cff..00000000000 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ /dev/null @@ -1,21 +0,0 @@ -getConnection(); -$connection->addKey($installer->getTable('catalogrule/rule_product'), 'IDX_FROM_TIME', 'from_time'); -$connection->addKey($installer->getTable('catalogrule/rule_product'), 'IDX_TO_TIME', 'to_time'); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.9-0.7.10.php deleted file mode 100644 index 3668e2ee409..00000000000 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup(); - -$installer->getConnection() - ->modifyColumn( - $this->getTable('catalogrule'), - 'customer_group_ids', - 'TEXT', - ); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 67e858c86dc..00000000000 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,606 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalogrule/rule_group_website'), - 'FK_CATALOGRULE_GROUP_WEBSITE_GROUP', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalogrule/rule_group_website'), - 'FK_CATALOGRULE_GROUP_WEBSITE_RULE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalogrule/rule_group_website'), - 'FK_CATALOGRULE_GROUP_WEBSITE_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalogrule/rule_product'), - 'FK_CATALOGRULE_PRODUCT_CUSTOMERGROUP', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalogrule/rule_product'), - 'FK_CATALOGRULE_PRODUCT_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalogrule/rule_product'), - 'FK_CATALOGRULE_PRODUCT_RULE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalogrule/rule_product'), - 'FK_CATALOGRULE_PRODUCT_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalogrule/rule_product_price'), - 'FK_CATALOGRULE_PRODUCT_PRICE_CUSTOMERGROUP', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalogrule/rule_product_price'), - 'FK_CATALOGRULE_PRODUCT_PRICE_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalogrule/rule_product_price'), - 'FK_CATALOGRULE_PRODUCT_PRICE_WEBSITE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule'), - 'SORT_ORDER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule_group_website'), - 'RULE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule_group_website'), - 'CUSTOMER_GROUP_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule_group_website'), - 'WEBSITE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule_product'), - 'SORT_ORDER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule_product'), - 'FK_CATALOGRULE_PRODUCT_RULE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule_product'), - 'FK_CATALOGRULE_PRODUCT_CUSTOMERGROUP', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule_product'), - 'FK_CATALOGRULE_PRODUCT_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule_product'), - 'FK_CATALOGRULE_PRODUCT_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule_product'), - 'IDX_FROM_TIME', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule_product'), - 'IDX_TO_TIME', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule_product_price'), - 'RULE_DATE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule_product_price'), - 'FK_CATALOGRULE_PRODUCT_PRICE_CUSTOMERGROUP', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule_product_price'), - 'FK_CATALOGRULE_PRODUCT_PRICE_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogrule/rule_product_price'), - 'FK_CATALOGRULE_PRODUCT_PRICE_PRODUCT', -); - -/* - * Change columns - */ -$tables = [ - $installer->getTable('catalogrule/rule') => [ - 'columns' => [ - 'rule_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Rule Id', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Name', - ], - 'description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Description', - ], - 'from_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'From Date', - ], - 'to_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'To Date', - ], - 'customer_group_ids' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Customer Group Ids', - ], - 'is_active' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Active', - ], - 'conditions_serialized' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '2M', - 'comment' => 'Conditions Serialized', - ], - 'actions_serialized' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '2M', - 'comment' => 'Actions Serialized', - ], - 'stop_rules_processing' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Stop Rules Processing', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - 'simple_action' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Simple Action', - ], - 'discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Discount Amount', - ], - 'website_ids' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Website Ids', - ], - ], - 'comment' => 'CatalogRule', - ], - $installer->getTable('catalogrule/rule_product') => [ - 'columns' => [ - 'rule_product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Rule Product Id', - ], - 'rule_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Rule Id', - ], - 'from_time' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'From Time', - ], - 'to_time' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'To time', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Customer Group Id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product Id', - ], - 'action_operator' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 10, - 'default' => 'to_fixed', - 'comment' => 'Action Operator', - ], - 'action_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Action Amount', - ], - 'action_stop' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Action Stop', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Website Id', - ], - ], - 'comment' => 'CatalogRule Product', - ], - $installer->getTable('catalogrule/rule_product_price') => [ - 'columns' => [ - 'rule_product_price_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Rule Product PriceId', - ], - 'rule_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'nullable' => false, - 'default' => '0000-00-00', - 'comment' => 'Rule Date', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Customer Group Id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product Id', - ], - 'rule_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Rule Price', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Website Id', - ], - 'latest_start_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Latest StartDate', - ], - 'earliest_end_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Earliest EndDate', - ], - ], - 'comment' => 'CatalogRule Product Price', - ], - $installer->getTable('catalogrule/affected_product') => [ - 'columns' => [ - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Product Id', - ], - ], - 'comment' => 'CatalogRule Affected Product', - ], - $installer->getTable('catalogrule/rule_group_website') => [ - 'columns' => [ - 'rule_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Rule Id', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Customer Group Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Website Id', - ], - ], - 'comment' => 'CatalogRule Group Website', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule'), - $installer->getIdxName('catalogrule/rule', ['is_active', 'sort_order', 'to_date', 'from_date']), - ['is_active', 'sort_order', 'to_date', 'from_date'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule_group_website'), - $installer->getIdxName('catalogrule/rule_group_website', ['rule_id']), - ['rule_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule_group_website'), - $installer->getIdxName('catalogrule/rule_group_website', ['customer_group_id']), - ['customer_group_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule_group_website'), - $installer->getIdxName('catalogrule/rule_group_website', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule_product'), - $installer->getIdxName( - 'catalogrule/rule_product', - ['rule_id', 'from_time', 'to_time', 'website_id', 'customer_group_id', 'product_id', 'sort_order'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['rule_id', 'from_time', 'to_time', 'website_id', 'customer_group_id', 'product_id', 'sort_order'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule_product'), - $installer->getIdxName('catalogrule/rule_product', ['rule_id']), - ['rule_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule_product'), - $installer->getIdxName('catalogrule/rule_product', ['customer_group_id']), - ['customer_group_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule_product'), - $installer->getIdxName('catalogrule/rule_product', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule_product'), - $installer->getIdxName('catalogrule/rule_product', ['from_time']), - ['from_time'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule_product'), - $installer->getIdxName('catalogrule/rule_product', ['to_time']), - ['to_time'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule_product'), - $installer->getIdxName('catalogrule/rule_product', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule_product_price'), - $installer->getIdxName( - 'catalogrule/rule_product_price', - ['rule_date', 'website_id', 'customer_group_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['rule_date', 'website_id', 'customer_group_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule_product_price'), - $installer->getIdxName('catalogrule/rule_product_price', ['customer_group_id']), - ['customer_group_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule_product_price'), - $installer->getIdxName('catalogrule/rule_product_price', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogrule/rule_product_price'), - $installer->getIdxName('catalogrule/rule_product_price', ['product_id']), - ['product_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalogrule/rule_group_website', 'customer_group_id', 'customer/customer_group', 'customer_group_id'), - $installer->getTable('catalogrule/rule_group_website'), - 'customer_group_id', - $installer->getTable('customer/customer_group'), - 'customer_group_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalogrule/rule_group_website', 'rule_id', 'catalogrule/rule', 'rule_id'), - $installer->getTable('catalogrule/rule_group_website'), - 'rule_id', - $installer->getTable('catalogrule/rule'), - 'rule_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalogrule/rule_group_website', 'website_id', 'core/website', 'website_id'), - $installer->getTable('catalogrule/rule_group_website'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalogrule/rule_product', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalogrule/rule_product'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalogrule/rule_product', 'customer_group_id', 'customer/customer_group', 'customer_group_id'), - $installer->getTable('catalogrule/rule_product'), - 'customer_group_id', - $installer->getTable('customer/customer_group'), - 'customer_group_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalogrule/rule_product', 'rule_id', 'catalogrule/rule', 'rule_id'), - $installer->getTable('catalogrule/rule_product'), - 'rule_id', - $installer->getTable('catalogrule/rule'), - 'rule_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalogrule/rule_product', 'website_id', 'core/website', 'website_id'), - $installer->getTable('catalogrule/rule_product'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalogrule/rule_product_price', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalogrule/rule_product_price'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalogrule/rule_product_price', 'customer_group_id', 'customer/customer_group', 'customer_group_id'), - $installer->getTable('catalogrule/rule_product_price'), - 'customer_group_id', - $installer->getTable('customer/customer_group'), - 'customer_group_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalogrule/rule_product_price', 'website_id', 'core/website', 'website_id'), - $installer->getTable('catalogrule/rule_product_price'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 4616786a933..00000000000 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,40 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('catalogsearch_query')}; -CREATE TABLE {$this->getTable('catalogsearch_query')} ( - `query_id` int(10) unsigned NOT NULL auto_increment, - `query_text` varchar(255) NOT NULL default '', - `num_results` int(10) unsigned NOT NULL default '0', - `popularity` int(10) unsigned NOT NULL default '0', - `redirect` varchar(255) NOT NULL default '', - `synonim_for` varchar(255) NOT NULL default '', - `store_id` smallint (5) unsigned NOT NULL, - PRIMARY KEY (`query_id`), - KEY `search_query` (`query_text`,`popularity`), - KEY `FK_catalogsearch_query` (`store_id`), - CONSTRAINT `FK_catalogsearch_query` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index e247e1dbb1a..00000000000 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,22 +0,0 @@ -run(" - ALTER TABLE {$this->getTable('catalogsearch_query')} ADD `display_in_terms` TINYINT( 1 ) NOT NULL DEFAULT '0'; -"); diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index a58347127af..00000000000 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,22 +0,0 @@ -run(" - ALTER TABLE {$this->getTable('catalogsearch_query')} CHANGE `display_in_terms` `display_in_terms` TINYINT( 1 ) NOT NULL DEFAULT '1'; -"); diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.3-0.7.4.php deleted file mode 100644 index 4431dab4e17..00000000000 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ /dev/null @@ -1,22 +0,0 @@ -run(" - ALTER TABLE {$this->getTable('catalogsearch_query')} ADD `updated_at` DATETIME NOT NULL; -"); diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index e2c4651058d..00000000000 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,15 +0,0 @@ -startSetup(); - -/** @var Varien_Db_Adapter_Pdo_Mysql $connection */ -$connection = $installer->getConnection(); - -$installer->run(" -DROP TABLE IF EXISTS `{$installer->getTable('catalogsearch_fulltext')}`; -CREATE TABLE `{$installer->getTable('catalogsearch_fulltext')}` ( - `product_id` int(10) unsigned NOT NULL, - `store_id` smallint(5) unsigned NOT NULL, - `data_index` longtext NOT NULL, - PRIMARY KEY (`product_id`,`store_id`), - FULLTEXT KEY `data_index` (`data_index`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('catalogsearch_result')}` ( - `query_id` int(10) unsigned NOT NULL, - `product_id` int(10) unsigned NOT NULL, - `relevance` decimal(6,4) NOT NULL default '0.0000', - PRIMARY KEY (`query_id`,`product_id`), - KEY `IDX_QUERY` (`query_id`), - KEY `IDX_PRODUCT` (`product_id`), - KEY `IDX_RELEVANCE` (`query_id`, `relevance`), - CONSTRAINT `FK_CATALOGSEARCH_RESULT_QUERY` FOREIGN KEY (`query_id`) REFERENCES `{$installer->getTable('catalogsearch_query')}` (`query_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGSEARCH_RESULT_CATALOG_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$connection->dropForeignKey($installer->getTable('catalogsearch_query'), 'FK_catalogsearch_query'); -$connection->dropKey($installer->getTable('catalogsearch_query'), 'FK_catalogsearch_query'); -$connection->addConstraint( - 'FK_CATALOGSEARCH_QUERY_STORE', - $installer->getTable('catalogsearch_query'), - 'store_id', - $installer->getTable('core_store'), - 'store_id', -); -$connection->addColumn($installer->getTable('catalogsearch_query'), 'is_active', 'tinyint(1) DEFAULT 1 AFTER `display_in_terms`'); -$connection->addColumn($installer->getTable('catalogsearch_query'), 'is_processed', 'tinyint(1) DEFAULT 0 AFTER `is_active`'); - -$connection->dropKey($installer->getTable('catalogsearch_query'), 'search_query'); -$connection->addKey($installer->getTable('catalogsearch_query'), 'IDX_SEARCH_QUERY', [ - 'query_text', 'store_id', 'popularity', -]); - -$installer->endSetup(); - -//Mage::app()->reinitStores(); -//Mage::getModel('catalogsearch/fulltext')->rebuildIndex(); diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.6-0.7.7.php deleted file mode 100644 index bc5bcbbf8f6..00000000000 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ /dev/null @@ -1,25 +0,0 @@ -startSetup(); - -$table = $installer->getTable('catalogsearch_query'); - -$installer->getConnection()->changeColumn($table, 'synonim_for', 'synonym_for', 'VARCHAR( 255 ) NOT NULL'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 61a2026405b..00000000000 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,296 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalogsearch/search_query'), - 'FK_CATALOGSEARCH_QUERY_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalogsearch/result'), - 'FK_CATALOGSEARCH_RESULT_CATALOG_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('catalogsearch/result'), - 'FK_CATALOGSEARCH_RESULT_QUERY', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('catalogsearch/fulltext'), - 'PRIMARY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogsearch/fulltext'), - 'data_index', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogsearch/search_query'), - 'FK_CATALOGSEARCH_QUERY_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogsearch/search_query'), - 'IDX_SEARCH_QUERY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogsearch/result'), - 'IDX_QUERY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogsearch/result'), - 'IDX_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('catalogsearch/result'), - 'IDX_RELEVANCE', -); - -/* - * Change columns - */ -$tables = [ - $installer->getTable('catalogsearch/search_query') => [ - 'columns' => [ - 'query_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Query ID', - ], - 'query_text' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Query text', - ], - 'num_results' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Num results', - ], - 'popularity' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Popularity', - ], - 'redirect' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Redirect', - ], - 'synonym_for' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Synonym for', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'display_in_terms' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Display in terms', - ], - 'is_active' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'default' => '1', - 'comment' => 'Active status', - ], - 'is_processed' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'default' => '0', - 'comment' => 'Processed status', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Updated at', - ], - ], - 'comment' => 'Catalog search query table', - ], - $installer->getTable('catalogsearch/result') => [ - 'columns' => [ - 'query_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Query ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Product ID', - ], - 'relevance' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 20, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Relevance', - ], - ], - 'comment' => 'Catalog search result table', - ], - $installer->getTable('catalogsearch/fulltext') => [ - 'columns' => [ - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Product ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - 'data_index' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '4g', - 'comment' => 'Data index', - ], - ], - 'comment' => 'Catalog search result table', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Change columns - */ -$installer->getConnection()->addColumn( - $installer->getTable('catalogsearch/fulltext'), - 'fulltext_id', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity ID', - ], -); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('catalogsearch/fulltext'), - $installer->getIdxName( - 'catalogsearch/fulltext', - ['product_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['product_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogsearch/fulltext'), - $installer->getIdxName( - 'catalogsearch/fulltext', - ['data_index'], - Varien_Db_Adapter_Interface::INDEX_TYPE_FULLTEXT, - ), - ['data_index'], - Varien_Db_Adapter_Interface::INDEX_TYPE_FULLTEXT, -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogsearch/search_query'), - $installer->getIdxName('catalogsearch/search_query', ['query_text', 'store_id', 'popularity']), - ['query_text', 'store_id', 'popularity'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogsearch/search_query'), - $installer->getIdxName('catalogsearch/search_query', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogsearch/result'), - $installer->getIdxName('catalogsearch/result', ['query_id']), - ['query_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('catalogsearch/result'), - $installer->getIdxName('catalogsearch/result', ['product_id']), - ['product_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalogsearch/search_query', 'store_id', 'core/store', 'store_id'), - $installer->getTable('catalogsearch/search_query'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalogsearch/result', 'query_id', 'catalogsearch/search_query', 'query_id'), - $installer->getTable('catalogsearch/result'), - 'query_id', - $installer->getTable('catalogsearch/search_query'), - 'query_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('catalogsearch/result', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('catalogsearch/result'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-install-0.9.1.php b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-install-0.9.1.php deleted file mode 100644 index 5945f8f4410..00000000000 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-install-0.9.1.php +++ /dev/null @@ -1,40 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$installer->getTable('checkout_agreement')}` ( - `agreement_id` int(10) unsigned NOT NULL auto_increment, - `name` varchar(255) NOT NULL default '', - `content` text NOT NULL, - `checkbox_text` text NOT NULL, - `is_active` tinyint(4) NOT NULL default '0', - PRIMARY KEY (`agreement_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$this->getTable('checkout_agreement_store')}` ( - `agreement_id` int(10) unsigned not null, - `store_id` smallint(5) unsigned not null, - UNIQUE KEY (`agreement_id`, `store_id`), - CONSTRAINT `FK_CHECKOUT_AGREEMENT` FOREIGN KEY (`agreement_id`) REFERENCES `{$installer->getTable('checkout_agreement')}` (`agreement_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CHECKOUT_AGREEMENT_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.0-0.9.1.php b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.0-0.9.1.php deleted file mode 100644 index 162abf73869..00000000000 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.0-0.9.1.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -$installer->run(" -// DROP TABLE IF EXISTS `{$installer->getTable('checkout_agreement')}`; -CREATE TABLE `{$installer->getTable('checkout_agreement')}` ( - `agreement_id` int(10) unsigned NOT NULL auto_increment, - `name` varchar(255) NOT NULL default '', - `content` text NOT NULL, - `checkbox_text` text NOT NULL, - `is_active` tinyint(4) NOT NULL default '0', - PRIMARY KEY (`agreement_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.1-0.9.2.php b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.1-0.9.2.php deleted file mode 100644 index 0bc6d9dc72b..00000000000 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.1-0.9.2.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('checkout_agreement'), - 'content_height', - 'varchar(25) NULL DEFAULT NULL AFTER `content`', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.2-0.9.3.php b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.2-0.9.3.php deleted file mode 100644 index 8d4ca7792e7..00000000000 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.2-0.9.3.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('checkout_agreement'), - 'is_html', - 'tinyint(4) NOT NULL DEFAULT 0 AFTER `is_active`', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.3-0.9.4.php b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.3-0.9.4.php deleted file mode 100644 index 8737ef34fee..00000000000 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.3-0.9.4.php +++ /dev/null @@ -1,691 +0,0 @@ -startSetup(); - -$setup = $installer->getConnection(); - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/prefix_show') - ->where('value!=?', '0'); -$showPrefix = (bool) Mage::helper('customer/address')->getConfig('prefix_show') - || ($setup->fetchOne($select) > 0); - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/middlename_show') - ->where('value!=?', '0'); -$showMiddlename = (bool) Mage::helper('customer/address')->getConfig('middlename_show') - || ($setup->fetchOne($select) > 0); - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/suffix_show') - ->where('value!=?', '0'); -$showSuffix = (bool) Mage::helper('customer/address')->getConfig('suffix_show') - || ($setup->fetchOne($select) > 0); - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/dob_show') - ->where('value!=?', '0'); -$showDob = (bool) Mage::helper('customer/address')->getConfig('dob_show') - || ($setup->fetchOne($select) > 0); - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/taxvat_show') - ->where('value!=?', '0'); -$showTaxVat = (bool) Mage::helper('customer/address')->getConfig('taxvat_show') - || ($setup->fetchOne($select) > 0); - -$customerEntityTypeId = $installer->getEntityTypeId('customer'); -$addressEntityTypeId = $installer->getEntityTypeId('customer_address'); - -/** - ***************************************************************************** - * checkout/onepage/register - ***************************************************************************** - */ - -$setup->insert($installer->getTable('eav/form_type'), [ - 'code' => 'checkout_onepage_register', - 'label' => 'checkout_onepage_register', - 'is_system' => 1, - 'theme' => '', - 'store_id' => 0, -]); -$formTypeId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_type_entity'), [ - 'type_id' => $formTypeId, - 'entity_type_id' => $customerEntityTypeId, -]); -$setup->insert($installer->getTable('eav/form_type_entity'), [ - 'type_id' => $formTypeId, - 'entity_type_id' => $addressEntityTypeId, -]); - -$elementSort = 0; -if ($showPrefix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'prefix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'firstname'), - 'sort_order' => $elementSort++, -]); -if ($showMiddlename) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'middlename'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'lastname'), - 'sort_order' => $elementSort++, -]); -if ($showSuffix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'suffix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'company'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($customerEntityTypeId, 'email'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'street'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'city'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'region'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'postcode'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'country_id'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'telephone'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'fax'), - 'sort_order' => $elementSort++, -]); -if ($showDob) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($customerEntityTypeId, 'dob'), - 'sort_order' => $elementSort++, - ]); -} -if ($showTaxVat) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($customerEntityTypeId, 'taxvat'), - 'sort_order' => $elementSort++, - ]); -} - -/** - ***************************************************************************** - * checkout/onepage/register_guest - ***************************************************************************** - */ - -$setup->insert($installer->getTable('eav/form_type'), [ - 'code' => 'checkout_onepage_register_guest', - 'label' => 'checkout_onepage_register_guest', - 'is_system' => 1, - 'theme' => '', - 'store_id' => 0, -]); -$formTypeId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_type_entity'), [ - 'type_id' => $formTypeId, - 'entity_type_id' => $customerEntityTypeId, -]); -$setup->insert($installer->getTable('eav/form_type_entity'), [ - 'type_id' => $formTypeId, - 'entity_type_id' => $addressEntityTypeId, -]); - -$elementSort = 0; -if ($showPrefix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'prefix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'firstname'), - 'sort_order' => $elementSort++, -]); -if ($showMiddlename) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'middlename'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'lastname'), - 'sort_order' => $elementSort++, -]); -if ($showSuffix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'suffix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'company'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($customerEntityTypeId, 'email'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'street'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'city'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'region'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'postcode'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'country_id'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'telephone'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'fax'), - 'sort_order' => $elementSort++, -]); -if ($showDob) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($customerEntityTypeId, 'dob'), - 'sort_order' => $elementSort++, - ]); -} -if ($showTaxVat) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($customerEntityTypeId, 'taxvat'), - 'sort_order' => $elementSort++, - ]); -} - -/** - ***************************************************************************** - * checkout/onepage/billing_address - ***************************************************************************** - */ - -$setup->insert($installer->getTable('eav/form_type'), [ - 'code' => 'checkout_onepage_billing_address', - 'label' => 'checkout_onepage_billing_address', - 'is_system' => 1, - 'theme' => '', - 'store_id' => 0, -]); -$formTypeId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_type_entity'), [ - 'type_id' => $formTypeId, - 'entity_type_id' => $addressEntityTypeId, -]); - -$elementSort = 0; -if ($showPrefix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'prefix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'firstname'), - 'sort_order' => $elementSort++, -]); -if ($showMiddlename) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'middlename'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'lastname'), - 'sort_order' => $elementSort++, -]); -if ($showSuffix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'suffix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'company'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'street'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'city'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'region'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'postcode'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'country_id'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'telephone'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'fax'), - 'sort_order' => $elementSort++, -]); - -/** - ***************************************************************************** - * checkout/onepage/shipping_address - ***************************************************************************** - */ - -$setup->insert($installer->getTable('eav/form_type'), [ - 'code' => 'checkout_onepage_shipping_address', - 'label' => 'checkout_onepage_shipping_address', - 'is_system' => 1, - 'theme' => '', - 'store_id' => 0, -]); -$formTypeId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_type_entity'), [ - 'type_id' => $formTypeId, - 'entity_type_id' => $addressEntityTypeId, -]); - -$elementSort = 0; -if ($showPrefix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'prefix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'firstname'), - 'sort_order' => $elementSort++, -]); -if ($showMiddlename) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'middlename'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'lastname'), - 'sort_order' => $elementSort++, -]); -if ($showSuffix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'suffix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'company'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'street'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'city'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'region'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'postcode'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'country_id'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'telephone'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => null, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'fax'), - 'sort_order' => $elementSort++, -]); - -/** - ***************************************************************************** - * checkout/multishipping/register/ - ***************************************************************************** - */ - -$setup->insert($installer->getTable('eav/form_type'), [ - 'code' => 'checkout_multishipping_register', - 'label' => 'checkout_multishipping_register', - 'is_system' => 1, - 'theme' => '', - 'store_id' => 0, -]); -$formTypeId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_type_entity'), [ - 'type_id' => $formTypeId, - 'entity_type_id' => $customerEntityTypeId, -]); -$setup->insert($installer->getTable('eav/form_type_entity'), [ - 'type_id' => $formTypeId, - 'entity_type_id' => $addressEntityTypeId, -]); - -$setup->insert($installer->getTable('eav/form_fieldset'), [ - 'type_id' => $formTypeId, - 'code' => 'general', - 'sort_order' => 1, -]); -$fieldsetId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_fieldset_label'), [ - 'fieldset_id' => $fieldsetId, - 'store_id' => 0, - 'label' => 'Personal Information', -]); - -$elementSort = 0; -if ($showPrefix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($customerEntityTypeId, 'prefix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($customerEntityTypeId, 'firstname'), - 'sort_order' => $elementSort++, -]); -if ($showMiddlename) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($customerEntityTypeId, 'middlename'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($customerEntityTypeId, 'lastname'), - 'sort_order' => $elementSort++, -]); -if ($showSuffix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($customerEntityTypeId, 'suffix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($customerEntityTypeId, 'email'), - 'sort_order' => $elementSort++, -]); -if ($showDob) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($customerEntityTypeId, 'dob'), - 'sort_order' => $elementSort++, - ]); -} -if ($showTaxVat) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($customerEntityTypeId, 'taxvat'), - 'sort_order' => $elementSort++, - ]); -} - -$setup->insert($installer->getTable('eav/form_fieldset'), [ - 'type_id' => $formTypeId, - 'code' => 'address', - 'sort_order' => 2, -]); -$fieldsetId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_fieldset_label'), [ - 'fieldset_id' => $fieldsetId, - 'store_id' => 0, - 'label' => 'Address Information', -]); - -$elementSort = 0; -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'company'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'telephone'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'street'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'city'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'region'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'postcode'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($addressEntityTypeId, 'country_id'), - 'sort_order' => $elementSort++, -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.4-0.9.5.php b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.4-0.9.5.php deleted file mode 100644 index 57bca161491..00000000000 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.4-0.9.5.php +++ /dev/null @@ -1,49 +0,0 @@ -startSetup(); - -$connection = $installer->getConnection(); -$table = $installer->getTable('core/config_data'); - -$select = $connection->select() - ->from($table, ['config_id', 'value']) - ->where('path = ?', 'checkout/options/onepage_checkout_disabled'); - -$data = $connection->fetchAll($select); - -if ($data) { - try { - $connection->beginTransaction(); - - foreach ($data as $value) { - $bind = [ - 'path' => 'checkout/options/onepage_checkout_enabled', - 'value' => !((bool) $value['value']), - ]; - $where = 'config_id = ' . $value['config_id']; - $connection->update($table, $bind, $where); - } - - $connection->commit(); - } catch (Exception $e) { - $installer->getConnection()->rollBack(); - throw $e; - } -} -$installer->endSetup(); diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index cb82a3eccdb..00000000000 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,148 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('checkout/agreement_store'), - 'FK_CHECKOUT_AGREEMENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('checkout/agreement_store'), - 'FK_CHECKOUT_AGREEMENT_STORE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('checkout/agreement_store'), - 'AGREEMENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('checkout/agreement_store'), - 'FK_CHECKOUT_AGREEMENT_STORE', -); - -/* - * Change columns - */ -$tables = [ - $installer->getTable('checkout/agreement') => [ - 'columns' => [ - 'agreement_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Agreement Id', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Name', - ], - 'content' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Content', - ], - 'content_height' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 25, - 'comment' => 'Content Height', - ], - 'checkbox_text' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Checkbox Text', - ], - 'is_active' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Active', - ], - 'is_html' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Html', - ], - ], - 'comment' => 'Checkout Agreement', - ], - $installer->getTable('checkout/agreement_store') => [ - 'columns' => [ - 'agreement_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Agreement Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Store Id', - ], - ], - 'comment' => 'Checkout Agreement Store', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('checkout/agreement_store'), - 'PRIMARY', - ['agreement_id','store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY, -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('checkout/agreement_store', 'agreement_id', 'checkout/agreement', 'agreement_id'), - $installer->getTable('checkout/agreement_store'), - 'agreement_id', - $installer->getTable('checkout/agreement'), - 'agreement_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('checkout/agreement_store', 'store_id', 'core/store', 'store_id'), - $installer->getTable('checkout/agreement_store'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.7.1.php b/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.7.1.php deleted file mode 100644 index 114ccf02ff0..00000000000 --- a/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.7.1.php +++ /dev/null @@ -1,25 +0,0 @@ -startSetup(); - -$installer->run(" -INSERT INTO {$this->getTable('core_email_template')} (`template_code`, `template_text`, `template_type`, `template_subject`, `template_sender_name`, `template_sender_email`, `added_at`, `modified_at`) VALUES -('Contact Form (Plain)', 'Name: {{var data.name}}\r\nTitle: {{var data.title}}\r\nE-mail: {{var data.email}}\r\nTelephone: {{var data.telephone}}\r\nCompany: {{var data.company}}\r\nWebsite URL: {{var data.website}}\r\n\r\nComment: {{var data.comment}}', 1, 'Contact Form', NULL, NULL, NOW(), NOW()); -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.8.0.php b/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.8.0.php deleted file mode 100644 index 96426372f4b..00000000000 --- a/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.8.0.php +++ /dev/null @@ -1,18 +0,0 @@ -startSetup(); - -$installer->run(" -UPDATE {$this->getTable('core_email_template')} SET `template_text` = 'Name: {{var data.name}}\r\nE-mail: {{var data.email}}\r\nTelephone: {{var data.telephone}}\r\n\r\nComment: {{var data.comment}}' WHERE template_code = 'Contact Form (Plain)'; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 69c6bd20510..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,193 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('core_config_data')}; -CREATE TABLE {$this->getTable('core_config_data')} ( - `config_id` int(10) unsigned NOT NULL auto_increment, - `scope` enum('default','websites','stores','config') NOT NULL default 'default', - `scope_id` int(11) NOT NULL default '0', - `path` varchar(255) NOT NULL default 'general', - `value` text NOT NULL, - PRIMARY KEY (`config_id`), - UNIQUE KEY `config_scope` (`scope`,`scope_id`,`path`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('core_email_template')}; -CREATE TABLE {$this->getTable('core_email_template')} ( - `template_id` int(7) unsigned NOT NULL auto_increment, - `template_code` varchar(150) default NULL, - `template_text` text, - `template_type` int(3) unsigned default NULL, - `template_subject` varchar(200) default NULL, - `template_sender_name` varchar(200) default NULL, - `template_sender_email` varchar(200) character set latin1 collate latin1_general_ci default NULL, - `added_at` datetime default NULL, - `modified_at` datetime default NULL, - PRIMARY KEY (`template_id`), - UNIQUE KEY `template_code` (`template_code`), - KEY `added_at` (`added_at`), - KEY `modified_at` (`modified_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Email templates'; - --- DROP TABLE IF EXISTS {$this->getTable('core_language')}; -CREATE TABLE {$this->getTable('core_language')} ( - `language_code` varchar(2) NOT NULL default '', - `language_title` varchar(32) NOT NULL default '', - PRIMARY KEY (`language_code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Languages'; - -insert into {$this->getTable('core_language')}(`language_code`,`language_title`) values ('aa','Afar'),('ab','Abkhazian'),('af','Afrikaans'),('am','Amharic'),('ar','Arabic'),('as','Assamese'),('ay','Aymara'),('az','Azerbaijani'),('ba','Bashkir'),('be','Byelorussian'),('bg','Bulgarian'),('bh','Bihari'),('bi','Bislama'),('bn','Bengali'),('bo','Tibetan'),('br','Breton'),('ca','Catalan'),('co','Corsican'),('cs','Czech'),('cy','Welsh'),('da','Danish'),('de','German'),('dz','Bhutani'),('el','Greek'),('en','English'),('eo','Esperanto'),('es','Spanish'),('et','Estonian'),('eu','Basque'),('fa','Persian'),('fi','Finnish'),('fj','Fiji'),('fo','Faeroese'),('fr','French'),('fy','Frisian'),('ga','Irish'),('gd','Gaelic'),('gl','Galician'),('gn','Guarani'),('gu','Gujarati'),('ha','Hausa'),('hi','Hindi'),('hr','Croatian'),('hu','Hungarian'),('hy','Armenian'),('ia','Interlingua'),('ie','Interlingue'),('ik','Inupiak'),('in','Indonesian'),('is','Icelandic'),('it','Italian'),('iw','Hebrew'),('ja','Japanese'),('ji','Yiddish'),('jw','Javanese'),('ka','Georgian'),('kk','Kazakh'),('kl','Greenlandic'),('km','Cambodian'),('kn','Kannada'),('ko','Korean'),('ks','Kashmiri'),('ku','Kurdish'),('ky','Kirghiz'),('la','Latin'),('ln','Lingala'),('lo','Laothian'),('lt','Lithuanian'),('lv','Latvian'),('mg','Malagasy'),('mi','Maori'),('mk','Macedonian'),('ml','Malayalam'),('mn','Mongolian'),('mo','Moldavian'),('mr','Marathi'),('ms','Malay'),('mt','Maltese'),('my','Burmese'),('na','Nauru'),('ne','Nepali'),('nl','Dutch'),('no','Norwegian'),('oc','Occitan'),('om','Oromo'),('or','Oriya'),('pa','Punjabi'),('pl','Polish'),('ps','Pashto'),('pt','Portuguese'),('qu','Quechua'),('rm','Rhaeto-Romance'),('rn','Kirundi'),('ro','Romanian'),('ru','Russian'),('rw','Kinyarwanda'),('sa','Sanskrit'),('sd','Sindhi'),('sg','Sangro'),('sh','Serbo-Croatian'),('si','Singhalese'),('sk','Slovak'),('sl','Slovenian'),('sm','Samoan'),('sn','Shona'),('so','Somali'),('sq','Albanian'),('sr','Serbian'),('ss','Siswati'),('st','Sesotho'),('su','Sudanese'),('sv','Swahili'),('sw','Swedish'),('ta','Tamil'),('te','Tegulu'),('tg','Tajik'),('th','Thai'),('ti','Tigrinya'),('tk','Turkmen'),('tl','Tagalog'),('tn','Setswana'),('to','Tonga'),('tr','Turkish'),('ts','Tsonga'),('tt','Tatar'),('tw','Twi'),('uk','Ukrainian'),('ur','Urdu'),('uz','Uzbek'),('vi','Vietnamese'),('vo','Volapuk'),('wo','Wolof'),('xh','Xhosa'),('yo','Yoruba'),('zh','Chinese'),('zu','Zulu'); - --- DROP TABLE IF EXISTS {$this->getTable('core_resource')}; -CREATE TABLE {$this->getTable('core_resource')} ( - `code` varchar(50) NOT NULL default '', - `version` varchar(50) NOT NULL default '', - PRIMARY KEY (`code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Resource version registry'; - --- DROP TABLE IF EXISTS {$this->getTable('core_session')}; -CREATE TABLE {$this->getTable('core_session')} ( - `session_id` varchar(255) NOT NULL default '', - `website_id` smallint(5) unsigned default NULL, - `session_expires` int(10) unsigned NOT NULL default '0', - `session_data` text NOT NULL, - PRIMARY KEY (`session_id`), - KEY `FK_SESSION_WEBSITE` (`website_id`), - CONSTRAINT `FK_SESSION_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES {$this->getTable('core_website')} (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Session data store'; - --- DROP TABLE IF EXISTS {$this->getTable('core_store')}; -CREATE TABLE {$this->getTable('core_store')} ( - `store_id` smallint(5) unsigned NOT NULL auto_increment, - `code` varchar(32) NOT NULL default '', - `language_code` varchar(2) default NULL, - `website_id` smallint(5) unsigned default '0', - `name` varchar(32) NOT NULL default '', - `sort_order` smallint(5) unsigned NOT NULL default '0', - `is_active` tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (`store_id`), - UNIQUE KEY `code` (`code`), - KEY `FK_STORE_LANGUAGE` (`language_code`), - KEY `FK_STORE_WEBSITE` (`website_id`), - KEY `is_active` (`is_active`,`sort_order`), - CONSTRAINT `FK_STORE_LANGUAGE` FOREIGN KEY (`language_code`) REFERENCES {$this->getTable('core_language')} (`language_code`) ON DELETE SET NULL ON UPDATE SET NULL, - CONSTRAINT `FK_STORE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES {$this->getTable('core_website')} (`website_id`) ON DELETE SET NULL ON UPDATE SET NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores'; - -insert into {$this->getTable('core_store')}(`store_id`,`code`,`language_code`,`website_id`,`name`,`sort_order`,`is_active`) values (0,'default','en',0,'Default',0,1),(1,'base','en',1,'English',0,1); - --- DROP TABLE IF EXISTS {$this->getTable('core_translate')}; -CREATE TABLE {$this->getTable('core_translate')} ( - `key_id` int(10) unsigned NOT NULL auto_increment, - `string` varchar(255) NOT NULL default '', - `store_id` smallint(5) unsigned NOT NULL default '0', - `translate` varchar(255) NOT NULL default '', - PRIMARY KEY (`key_id`), - UNIQUE KEY `IDX_CODE` (`string`,`store_id`), - KEY `FK_CORE_TRANSLATE_STORE` (`store_id`), - CONSTRAINT `FK_CORE_TRANSLATE_STORE` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Translation data'; - - --- DROP TABLE IF EXISTS {$this->getTable('core_website')}; -CREATE TABLE {$this->getTable('core_website')} ( - `website_id` smallint(5) unsigned NOT NULL auto_increment, - `code` varchar(32) NOT NULL default '', - `name` varchar(64) NOT NULL default '', - `sort_order` smallint(5) unsigned NOT NULL default '0', - `is_active` tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (`website_id`), - UNIQUE KEY `code` (`code`), - KEY `is_active` (`is_active`,`sort_order`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Websites'; - -insert into {$this->getTable('core_website')}(`website_id`,`code`,`name`,`sort_order`,`is_active`) values (0,'default','Default',0,1),(1,'base','Main Website',0,1); - --- DROP TABLE IF EXISTS {$this->getTable('core_layout_update')}; -CREATE TABLE {$this->getTable('core_layout_update')} ( - `layout_update_id` int(10) unsigned NOT NULL auto_increment, - `handle` varchar(255) default NULL, - `xml` text, - PRIMARY KEY (`layout_update_id`), - KEY `handle` (`handle`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('core_layout_link')}; -CREATE TABLE {$this->getTable('core_layout_link')} ( - `layout_link_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned NOT NULL default '0', - `package` varchar(64) NOT NULL default '', - `theme` varchar(64) NOT NULL default '', - `layout_update_id` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`layout_link_id`), - UNIQUE KEY `store_id` (`store_id`,`package`,`theme`,`layout_update_id`), - KEY `FK_core_layout_link_update` (`layout_update_id`), - CONSTRAINT `FK_core_layout_link_store` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_core_layout_link_update` FOREIGN KEY (`layout_update_id`) REFERENCES {$this->getTable('core_layout_update')} (`layout_update_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE if exists {$this->getTable('core_url_rewrite')}; -create table {$this->getTable('core_url_rewrite')} ( - `url_rewrite_id` int unsigned not null auto_increment primary key, - `store_id` smallint unsigned not null, - `id_path` varchar(255) not null, - `request_path` varchar(255) not null, - `target_path` varchar(255) not null, - `options` varchar(255) not null, - `type` int(1) NOT NULL DEFAULT '0', - `description` varchar(255) NULL, - unique (`id_path`, `store_id`), - unique (`request_path`, `store_id`), - key (`target_path`, `store_id`), - foreign key (`store_id`) references {$this->getTable('core_store')} (`store_id`) on delete cascade on update cascade -) engine=InnoDB default charset=utf8; - --- DROP TABLE if exists {$this->getTable('core_url_rewrite_tag')}; -create table {$this->getTable('core_url_rewrite_tag')} ( - `url_rewrite_tag_id` int unsigned not null auto_increment primary key, - `url_rewrite_id` int unsigned not null, - `tag` varchar(255), - unique (`tag`, `url_rewrite_id`), - key (`url_rewrite_id`), - foreign key (`url_rewrite_id`) references {$this->getTable('core_url_rewrite')} (`url_rewrite_id`) on delete cascade on update cascade -) engine=InnoDB default charset=utf8; - --- DROP TABLE if exists {$this->getTable('design_change')}; -CREATE TABLE {$this->getTable('design_change')} ( -`design_change_id` INT NOT NULL AUTO_INCREMENT, -`store_id` smallint(5) unsigned NOT NULL , -`package` VARCHAR( 255 ) NOT NULL , -`theme` VARCHAR( 255 ) NOT NULL , -`date_from` DATE NOT NULL , -`date_to` DATE NOT NULL, -KEY `FK_DESIGN_CHANGE_STORE` (`store_id`), -PRIMARY KEY (`design_change_id`) -) ENGINE = innodb; - -ALTER TABLE {$this->getTable('design_change')} - ADD - CONSTRAINT `FK_DESIGN_CHANGE_STORE` - FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.8.0.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.8.0.php deleted file mode 100644 index f3c0bd773e2..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.8.0.php +++ /dev/null @@ -1,211 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$installer->getTable('core_resource')}` ( - `code` varchar(50) NOT NULL default '', - `version` varchar(50) NOT NULL default '', - PRIMARY KEY (`code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Resource version registry'; - -CREATE TABLE `{$installer->getTable('core_website')}` ( - `website_id` smallint(5) unsigned NOT NULL auto_increment, - `code` varchar(32) NOT NULL default '', - `name` varchar(64) NOT NULL default '', - `sort_order` smallint(5) unsigned NOT NULL default '0', - `default_group_id` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`website_id`), - UNIQUE KEY `code` (`code`), - KEY `sort_order` (`sort_order`), - KEY `default_group_id` (`default_group_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Websites'; - -INSERT INTO `{$installer->getTable('core_website')}` VALUES - (0, 'admin', 'Admin', 0, 0), - (1, 'base', 'Main Website', 0, 1); - --- DROP TABLE IF EXISTS `{$installer->getTable('core_store_group')}`; -CREATE TABLE `{$installer->getTable('core_store_group')}` ( - `group_id` smallint(5) unsigned NOT NULL auto_increment, - `website_id` smallint(5) unsigned NOT NULL default '0', - `name` varchar(32) NOT NULL default '', - `root_category_id` int(10) unsigned NOT NULL default '0', - `default_store_id` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`group_id`), - KEY `FK_STORE_GROUP_WEBSITE` (`website_id`), - KEY `default_store_id` (`default_store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -INSERT INTO `{$installer->getTable('core_store_group')}` VALUES - (0, 0, 'Default', 0, 0), - (1, 1, 'Main Website Store', 2, 1); - --- DROP TABLE IF EXISTS `{$installer->getTable('core_store')}`; -CREATE TABLE `{$installer->getTable('core_store')}` ( - `store_id` smallint(5) unsigned NOT NULL auto_increment, - `code` varchar(32) NOT NULL default '', - `website_id` smallint(5) unsigned default '0', - `group_id` smallint(5) unsigned NOT NULL default '0', - `name` varchar(32) NOT NULL default '', - `sort_order` smallint(5) unsigned NOT NULL default '0', - `is_active` tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (`store_id`), - UNIQUE KEY `code` (`code`), - KEY `FK_STORE_WEBSITE` (`website_id`), - KEY `is_active` (`is_active`,`sort_order`), - KEY `FK_STORE_GROUP` (`group_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores'; - -INSERT INTO `{$installer->getTable('core_store')}` VALUES - (0, 'admin', 0, 0, 'Admin', 0, 1), - (1, 'default', 1, 1, 'Default Store View', 0, 1); - -CREATE TABLE `{$installer->getTable('core_config_data')}` ( - `config_id` int(10) unsigned NOT NULL auto_increment, - `scope` enum('default','websites','stores','config') NOT NULL default 'default', - `scope_id` int(11) NOT NULL default '0', - `path` varchar(255) NOT NULL default 'general', - `value` text NOT NULL, - PRIMARY KEY (`config_id`), - UNIQUE KEY `config_scope` (`scope`,`scope_id`,`path`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('core_email_template')}` ( - `template_id` int(7) unsigned NOT NULL auto_increment, - `template_code` varchar(150) default NULL, - `template_text` text, - `template_type` int(3) unsigned default NULL, - `template_subject` varchar(200) default NULL, - `template_sender_name` varchar(200) default NULL, - `template_sender_email` varchar(200) character set latin1 collate latin1_general_ci default NULL, - `added_at` datetime default NULL, - `modified_at` datetime default NULL, - PRIMARY KEY (`template_id`), - UNIQUE KEY `template_code` (`template_code`), - KEY `added_at` (`added_at`), - KEY `modified_at` (`modified_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Email templates'; - -CREATE TABLE `{$installer->getTable('core_layout_update')}` ( - `layout_update_id` int(10) unsigned NOT NULL auto_increment, - `handle` varchar(255) default NULL, - `xml` text, - PRIMARY KEY (`layout_update_id`), - KEY `handle` (`handle`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('core_layout_link')}` ( - `layout_link_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned NOT NULL default '0', - `package` varchar(64) NOT NULL default '', - `theme` varchar(64) NOT NULL default '', - `layout_update_id` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`layout_link_id`), - UNIQUE KEY `store_id` (`store_id`,`package`,`theme`,`layout_update_id`), - KEY `FK_core_layout_link_update` (`layout_update_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('core_session')}` ( - `session_id` varchar(255) NOT NULL default '', - `website_id` smallint(5) unsigned default NULL, - `session_expires` int(10) unsigned NOT NULL default '0', - `session_data` text NOT NULL, - PRIMARY KEY (`session_id`), - KEY `FK_SESSION_WEBSITE` (`website_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Session data store'; - -CREATE TABLE `{$installer->getTable('core_translate')}` ( - `key_id` int(10) unsigned NOT NULL auto_increment, - `string` varchar(255) NOT NULL default '', - `store_id` smallint(5) unsigned NOT NULL default '0', - `translate` varchar(255) NOT NULL default '', - `locale` varchar(20) NOT NULL default 'en_US', - PRIMARY KEY (`key_id`), - UNIQUE KEY `IDX_CODE` (`store_id`,`locale`,`string`), - KEY `FK_CORE_TRANSLATE_STORE` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Translation data'; - -CREATE TABLE `{$installer->getTable('core_url_rewrite')}` ( - `url_rewrite_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned NOT NULL default '0', - `id_path` varchar(255) NOT NULL default '', - `request_path` varchar(255) NOT NULL default '', - `target_path` varchar(255) NOT NULL default '', - `options` varchar(255) NOT NULL default '', - `type` int(1) NOT NULL default '0', - `description` varchar(255) default NULL, - PRIMARY KEY (`url_rewrite_id`), - UNIQUE KEY `id_path` (`id_path`,`store_id`), - UNIQUE KEY `request_path` (`request_path`,`store_id`), - KEY `target_path` (`target_path`,`store_id`), - KEY `store_id` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('core_url_rewrite_tag')}` ( - `url_rewrite_tag_id` int(10) unsigned NOT NULL auto_increment, - `url_rewrite_id` int(10) unsigned NOT NULL default '0', - `tag` varchar(255) default NULL, - PRIMARY KEY (`url_rewrite_tag_id`), - UNIQUE KEY `tag` (`tag`,`url_rewrite_id`), - KEY `url_rewrite_id` (`url_rewrite_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('design_change')}` ( - `design_change_id` int(11) NOT NULL auto_increment, - `store_id` smallint(5) unsigned NOT NULL default '0', - `design` varchar(255) NOT NULL default '', - `date_from` date NOT NULL default '0000-00-00', - `date_to` date NOT NULL default '0000-00-00', - PRIMARY KEY (`design_change_id`), - KEY `FK_DESIGN_CHANGE_STORE` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 -"); - -$installer->run(" - -ALTER TABLE `{$installer->getTable('core_store_group')}` - ADD CONSTRAINT `FK_STORE_GROUP_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `{$installer->getTable('core_website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE; - -ALTER TABLE `{$installer->getTable('core_store')}` - ADD CONSTRAINT `FK_STORE_GROUP_STORE` FOREIGN KEY (`group_id`) REFERENCES `{$installer->getTable('core_store_group')}` (`group_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `FK_STORE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `{$installer->getTable('core_website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE; - -ALTER TABLE `{$installer->getTable('core_layout_link')}` - ADD CONSTRAINT `FK_CORE_LAYOUT_LINK_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `FK_CORE_LAYOUT_LINK_UPDATE` FOREIGN KEY (`layout_update_id`) REFERENCES `{$installer->getTable('core_layout_update')}` (`layout_update_id`) ON DELETE CASCADE ON UPDATE CASCADE; - -ALTER TABLE `{$installer->getTable('core_session')}` - ADD CONSTRAINT `FK_SESSION_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `{$installer->getTable('core_website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE; - -ALTER TABLE `{$installer->getTable('core_translate')}` - ADD CONSTRAINT `FK_CORE_TRANSLATE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE; - -ALTER TABLE `{$installer->getTable('core_url_rewrite')}` - ADD CONSTRAINT `FK_CORE_URL_REWRITE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE; - -ALTER TABLE `{$installer->getTable('core_url_rewrite_tag')}` - ADD CONSTRAINT `FK_CORE_URL_REWRITE_TAG_URL_REWRITE` FOREIGN KEY (`url_rewrite_id`) REFERENCES `{$installer->getTable('core_url_rewrite')}` (`url_rewrite_id`) ON DELETE CASCADE ON UPDATE CASCADE; - -ALTER TABLE `{$installer->getTable('design_change')}` - ADD CONSTRAINT `FK_DESIGN_CHANGE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.6.26-0.7.0.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.6.26-0.7.0.php deleted file mode 100644 index 77619087d7f..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.6.26-0.7.0.php +++ /dev/null @@ -1,29 +0,0 @@ -startSetup(); - -$installer->run(" - -ALTER TABLE {$this->getTable('core_url_rewrite')} -ADD COLUMN `type` int(1) NOT NULL DEFAULT '0' after `options`, -ADD COLUMN `description` varchar(255) NULL after `type`; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index b2d4ee76f23..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,41 +0,0 @@ -startSetup(); - -$installer->run(" -drop table if exists {$this->getTable('design_change')}; -CREATE TABLE {$this->getTable('design_change')} ( -`design_change_id` INT NOT NULL AUTO_INCREMENT, -`store_id` smallint(5) unsigned NOT NULL , -`package` VARCHAR( 255 ) NOT NULL , -`theme` VARCHAR( 255 ) NOT NULL , -`date_from` DATE NOT NULL , -`date_to` DATE NOT NULL, -KEY `FK_DESIGN_CHANGE_STORE` (`store_id`), -PRIMARY KEY (`design_change_id`) -) ENGINE = innodb; - -ALTER TABLE {$this->getTable('design_change')} - ADD - CONSTRAINT `FK_DESIGN_CHANGE_STORE` - FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index ae82523c7f0..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER table {$this->getTable('core_store')} DROP FOREIGN KEY `FK_STORE_WEBSITE`; -ALTER table {$this->getTable('core_store')} ADD CONSTRAINT `FK_STORE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES {$this->getTable('core_website')} (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.3-0.7.4.php deleted file mode 100644 index cb4a800e5a1..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ /dev/null @@ -1,39 +0,0 @@ -startSetup(); - -$rows = $installer->getConnection()->fetchAll( - "select * from {$this->getTable('core_config_data')} where - path in ( - 'paypal/wpp/api_password', 'paypal/wpp/api_signature', 'paypal/wpp/api_username', - 'paypal/wps/business_account', 'paypal/wpuk/user', 'paypal/wpuk/pwd', 'carriers/dhl/id', - 'carriers/dhl/password', 'carriers/dhl/shipping_key', 'carriers/dhl/shipping_intlkey', - 'carriers/fedex/account', 'carriers/ups/account_license_number', 'carriers/ups/username', - 'carriers/usps/userid', 'payment/authorizenet/login', 'payment/authorizenet/trans_key', - 'payment/verisign/pwd', 'payment/verisign/user')", -); - -$hlp = Mage::helper('core'); -foreach ($rows as $r) { - if (!empty($r['value'])) { - $r['value'] = $hlp->encrypt($r['value']); - $installer->getConnection()->update($this->getTable('core_config_data'), $r, 'config_id=' . $r['config_id']); - } -} -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index fbbba687c9d..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,119 +0,0 @@ -startSetup(); - -$installer->run(" -DROP TABLE IF EXISTS {$this->getTable('core_store_group')}; -CREATE TABLE {$this->getTable('core_store_group')} ( - `group_id` smallint(5) unsigned NOT NULL auto_increment, - `website_id` smallint(5) unsigned NOT NULL default '0', - `name` varchar(32) NOT NULL default '', - `root_category_id` int(10) unsigned NOT NULL default '0', - `default_store_id` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`group_id`), - KEY `FK_STORE_GROUP_WEBSITE` (`website_id`), - KEY (`default_store_id`), - CONSTRAINT `FK_STORE_GROUP_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES {$this->getTable('core_website')} (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -INSERT INTO {$this->getTable('core_store_group')} VALUES (0,0,'Default',0,0); -ALTER TABLE {$this->getTable('core_store')} - DROP FOREIGN KEY `FK_STORE_LANGUAGE`; -ALTER TABLE {$this->getTable('core_store')} - DROP INDEX `FK_STORE_LANGUAGE`; -DROP TABLE IF EXISTS {$this->getTable('core_language')}; -ALTER TABLE {$this->getTable('core_store')} - DROP `language_code`; -ALTER TABLE {$this->getTable('core_store')} - ADD `group_id` smallint(5) unsigned NOT NULL AFTER `website_id`; -ALTER TABLE {$this->getTable('core_store')} - ADD INDEX `FK_STORE_GROUP` (`group_id`); -ALTER TABLE {$this->getTable('core_store')} - ADD CONSTRAINT `FK_STORE_GROUP_STORE` FOREIGN KEY (`group_id`) - REFERENCES {$this->getTable('core_store_group')} (`group_id`) - ON DELETE CASCADE - ON UPDATE CASCADE; -ALTER TABLE {$this->getTable('core_website')} - DROP INDEX `is_active`, - ADD INDEX (`sort_order`); -ALTER TABLE {$this->getTable('core_website')} - DROP `is_active`; -ALTER TABLE {$this->getTable('core_website')} - ADD `default_group_id` smallint(5) unsigned NOT NULL default '0'; -ALTER TABLE {$this->getTable('core_website')} - ADD INDEX (`default_group_id`); -UPDATE {$this->getTable('core_website')} - SET `default_group_id`='0' - WHERE `website_id`=0; -"); - -$websiteRows = $installer->getConnection() - ->fetchAll($installer->getConnection() - ->select() - ->from($this->getTable('core_website')) - ->where($installer->getConnection()->quoteInto('website_id>?', 0))); - -$rows = $installer->getConnection() - ->fetchAll($installer->getConnection() - ->select() - ->from($this->getTable('core_config_data')) - ->where($installer->getConnection()->quoteInto('path LIKE ?', 'catalog/category/root_id'))); -$rootCategoryIds = []; -foreach ($rows as $row) { - $rootCategoryIds[$row['scope']][$row['scope_id']] = $row['value']; -} - -foreach ($websiteRows as $websiteRow) { - $rootCategoryId = 2; - if (isset($rootCategoryIds['website'][$websiteRow['website_id']])) { - $rootCategoryId = $rootCategoryIds['website'][$websiteRow['website_id']]; - } elseif (isset($rootCategoryIds['default'][0])) { - $rootCategoryId = $rootCategoryIds['default'][0]; - } - $defaultStoreId = (int) $installer->getConnection() - ->fetchOne($installer->getConnection() - ->select() - ->from($this->getTable('core_store')) - ->where($installer->getConnection()->quoteInto('website_id=?', $websiteRow['website_id'])) - ->limit(0, 1), 'store_id'); - - // create group for website - $installer->getConnection()->insert($this->getTable('core_store_group'), [ - 'website_id' => $websiteRow['website_id'], - 'name' => $websiteRow['name'] . ' Store', - 'root_category_id' => $rootCategoryId, - 'default_store_id' => $defaultStoreId, - ]); - $groupId = $installer->getConnection()->lastInsertId(); - // set group for store(s) - $installer->getConnection() - ->update( - $this->getTable('core_store'), - ['group_id' => $groupId], - $installer->getConnection()->quoteInto('website_id=?', $websiteRow['website_id']), - ); - // set created group as default for website - $installer->getConnection() - ->update( - $this->getTable('core_website'), - ['default_group_id' => $groupId], - $installer->getConnection()->quoteInto('website_id=?', $websiteRow['website_id']), - ); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.5-0.7.6.php deleted file mode 100644 index 8ef71ff0682..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('design_change')} - DROP `package`, - DROP `theme`; -ALTER TABLE {$this->getTable('design_change')} ADD `design` VARCHAR( 255 ) NOT NULL AFTER `store_id` ; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.6-0.7.7.php deleted file mode 100644 index 2e14d06d97c..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); - -$installer->run(" -UPDATE `{$this->getTable('core_store')}` SET `code` = 'admin', `name` = 'Admin' WHERE `code` LIKE 'default'; -UPDATE `{$this->getTable('core_store')}` SET `code` = 'default', `name` = 'Default Store View' WHERE `code` LIKE 'base'; - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.7-0.7.8.php deleted file mode 100644 index 2e5b90e12f0..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup(); - -$table = $this->getTable('core_translate'); -$conn = $installer->getConnection(); - -$conn->addColumn($table, 'locale', "varchar(20) not null default 'en_US'"); -$conn->dropKey($table, 'IDX_CODE'); -$conn->raw_query('alter table `' . $table . '` add unique key `IDX_CODE` (`store_id`, `locale`, `string`)'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.8-0.7.9.php deleted file mode 100644 index e71843c86a0..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ /dev/null @@ -1,46 +0,0 @@ - 'catalog_productalert_email_stock_template', - 'catalog/productalert/email_price_template' => 'catalog_productalert_email_price_template', - 'catalog/productalert_cron/error_email_template' => 'catalog_productalert_cron_error_email_template', - 'contacts/email/email_template' => 'contacts_email_email_template', - 'currency/import/error_email_template' => 'currency_import_error_email_template', - 'customer/create_account/email_template' => 'customer_create_account_email_template', - 'customer/password_forgot/email_template' => 'customer_password_forgot_email_template', - 'newsletter/subscription/confirm_email_template' => 'newsletter_subscription_confirm_email_template', - 'newsletter/subscription/success_email_template' => 'newsletter_subscription_success_email_template', - 'newsletter/subscription/un_email_template' => 'newsletter_subscription_un_email_template', - 'sales_email/order/template' => 'sales_email_order_template', - 'sales_email/order_comment/template' => 'sales_email_order_comment_template', - 'sales_email/invoice/template' => 'sales_email_invoice_comment_template', - 'sales_email/invoice_comment/template' => 'sales_email_invoice_comment_template', - 'sales_email/creditmemo/template' => 'sales_email_creditmemo_template', - 'sales_email/creditmemo_comment/template' => 'sales_email_creditmemo_comment_template', - 'sales_email/shipment/template' => 'sales_email_shipment_template', - 'sales_email/shipment_comment/template' => 'sales_email_shipment_comment_template', - 'sendfriend/email/template' => 'sendfriend_email_template', - 'sitemap/generate/error_email_template' => 'sitemap_generate_error_email_template', - 'wishlist/email/email_template' => 'wishlist_email_email_template', -]; - -foreach ($configValuesMap as $configPath => $configValue) { - $installer->setConfigData($configPath, $configValue); -} diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.0-0.8.1.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.0-0.8.1.php deleted file mode 100644 index 76ed786eaae..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.0-0.8.1.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($this->getTable('core/url_rewrite'), 'entity_id', 'INT( 10 ) NOT NULL AFTER `store_id`'); -$installer->run("UPDATE {$this->getTable('core/url_rewrite')} set `entity_id` = SUBSTR(`id_path`, LOCATE('/', `id_path`)+1, IF(LOCATE('/', `id_path`, LOCATE('/', `id_path`)+1) = 0, LENGTH(`id_path`) , LOCATE('/', `id_path`, LOCATE('/', `id_path`)+1)) - LOCATE('/', `id_path`)+1);"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.1-0.8.2.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.1-0.8.2.php deleted file mode 100644 index f0c53b56b13..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.1-0.8.2.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->run("CREATE INDEX entity_id ON {$this->getTable('core/url_rewrite')} (entity_id);"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php deleted file mode 100644 index 5c91b585785..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php +++ /dev/null @@ -1,40 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropForeignKey($installer->getTable('design_change'), 'FK_DESIGN_CHANGE_STORE'); - -$storeIds = $installer->getConnection()->fetchCol( - "SELECT store_id FROM {$installer->getTable('core_store')}", -); - -if (!empty($storeIds)) { - $storeIds = implode(',', $storeIds); - $installer->run("DELETE FROM {$installer->getTable('design_change')} WHERE store_id NOT IN ($storeIds)"); -} - -$installer->getConnection()->addConstraint( - 'FK_DESIGN_CHANGE_STORE', - $installer->getTable('design_change'), - 'store_id', - $installer->getTable('core_store'), - 'store_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.11-0.8.12.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.11-0.8.12.php deleted file mode 100644 index 204420c3fba..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.11-0.8.12.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$installer->getConnection()->changeColumn( - $installer->getTable('core_store'), - 'name', - 'name', - 'varchar(255) not null', - true, -); - -$installer->getConnection()->changeColumn( - $installer->getTable('core_store_group'), - 'name', - 'name', - 'varchar(255) not null', - true, -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.12-0.8.13.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.12-0.8.13.php deleted file mode 100644 index 4ca5da5045b..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.12-0.8.13.php +++ /dev/null @@ -1,32 +0,0 @@ -startSetup(); - -$installer->getConnection()->addConstraint( - 'FK_CORE_URL_REWRITE_STORE', - $installer->getTable('core/url_rewrite'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'CASCADE', - 'CASCADE', - true, -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.13-0.8.14.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.13-0.8.14.php deleted file mode 100644 index 5dd9cf335a6..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.13-0.8.14.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($installer->getTable('core/layout_update'), 'sort_order', "smallint(5) NOT NULL DEFAULT '0'"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php deleted file mode 100644 index bc74e5a4536..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($installer->getTable('core/email_template'), 'orig_template_code', 'VARCHAR(200) DEFAULT NULL'); -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php deleted file mode 100644 index 66b0f2f38fe..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('core_email_template'), - 'template_styles', - 'text AFTER `template_text`', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php deleted file mode 100644 index 86c4bb313da..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php +++ /dev/null @@ -1,45 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE IF NOT EXISTS `{$installer->getTable('core_email_variable')}` ( - `variable_id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `code` varchar(255) NOT NULL DEFAULT '', - `name` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '', - PRIMARY KEY (`variable_id`), - UNIQUE KEY `IDX_CODE` (`code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `{$installer->getTable('core_email_variable_value')}` ( - `value_id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `variable_id` int(11) unsigned NOT NULL DEFAULT '0', - `store_id` smallint(5) unsigned NOT NULL DEFAULT '0', - `value` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_VARIABLE_STORE` (`variable_id`,`store_id`), - KEY `IDX_VARIABLE_ID` (`variable_id`), - KEY `IDX_STORE_ID` (`store_id`), - CONSTRAINT `FK_CORE_EMAIL_VARIABLE_VALUE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CORE_EMAIL_VARIABLE_VALUE_VARIABLE_ID` FOREIGN KEY (`variable_id`) REFERENCES `{$installer->getTable('core_email_variable')}` (`variable_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 -"); -$installer->getConnection()->addColumn($installer->getTable('core/email_template'), 'orig_template_variables', 'text NOT NULL'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.17-0.8.18.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.17-0.8.18.php deleted file mode 100644 index 7fbabc071ee..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.17-0.8.18.php +++ /dev/null @@ -1,33 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('core_email_variable'), - 'is_html', - "tinyint(1) NOT NULL DEFAULT '0'", -); -$installer->getConnection()->changeColumn( - $installer->getTable('core_email_variable_value'), - 'value', - 'value', - 'TEXT NOT NULL', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.18-0.8.19.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.18-0.8.19.php deleted file mode 100644 index 3d909dd6249..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.18-0.8.19.php +++ /dev/null @@ -1,44 +0,0 @@ -startSetup(); - -$installer->run(" - ALTER TABLE `{$installer->getTable('core_email_variable')}` RENAME TO `{$installer->getTable('core/variable')}`; - ALTER TABLE `{$installer->getTable('core_email_variable_value')}` RENAME TO `{$installer->getTable('core/variable_value')}`; -"); - -$installer->getConnection()->dropForeignKey($installer->getTable('core/variable_value'), 'FK_CORE_EMAIL_VARIABLE_VALUE_STORE_ID'); -$installer->getConnection()->dropForeignKey($installer->getTable('core/variable_value'), 'FK_CORE_EMAIL_VARIABLE_VALUE_VARIABLE_ID'); - -$installer->getConnection()->addConstraint( - 'FK_CORE_VARIABLE_VALUE_STORE_ID', - $installer->getTable('core/variable_value'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); -$installer->getConnection()->addConstraint( - 'FK_CORE_VARIABLE_VALUE_VARIABLE_ID', - $installer->getTable('core/variable_value'), - 'variable_id', - $installer->getTable('core/variable'), - 'variable_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.19-0.8.20.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.19-0.8.20.php deleted file mode 100644 index a75552a0576..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.19-0.8.20.php +++ /dev/null @@ -1,54 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('core/variable_value'), 'plain_value', 'TEXT NOT NULL'); -$installer->getConnection()->addColumn($installer->getTable('core/variable_value'), 'html_value', 'TEXT NOT NULL'); - -$select = $installer->getConnection()->select() - ->from(['main_table' => $installer->getTable('core/variable')], []) - ->join( - ['value_table' => $installer->getTable('core/variable_value')], - 'value_table.variable_id = main_table.variable_id', - [], - ) - ->columns(['main_table.variable_id', 'main_table.is_html', 'value_table.value']); - -$data = []; -foreach ($installer->getConnection()->fetchAll($select) as $row) { - if ($row['is_html']) { - $value = ['html_value' => $row['value']]; - } else { - $value = ['plain_value' => $row['value']]; - } - $data[$row['variable_id']] = $value; -} - -foreach ($data as $variableId => $value) { - $installer->getConnection()->update( - $installer->getTable('core/variable_value'), - $value, - ['variable_id = ?' => $variableId], - ); -} - -$installer->getConnection()->dropColumn($installer->getTable('core/variable'), 'is_html'); -$installer->getConnection()->dropColumn($installer->getTable('core/variable_value'), 'value'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.2-0.8.3.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.2-0.8.3.php deleted file mode 100644 index 7837be83904..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.2-0.8.3.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->run("UPDATE {$this->getTable('core/url_rewrite')} SET type = IF(id_path LIKE 'category/%', 1, IF(id_path LIKE 'product/%', 2, 3));"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.20-0.8.21.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.20-0.8.21.php deleted file mode 100644 index 439bd491c0f..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.20-0.8.21.php +++ /dev/null @@ -1,29 +0,0 @@ -getConnection()->addColumn($installer->getTable('core/resource'), 'data_version', 'varchar(50)'); - -/* - * Update core_resource table to prevent running data upgrade install scripts, - * New 'data_version' column will contain value from 'version' column - */ -$installer->getConnection()->update( - $this->getTable('core/resource'), - ['data_version' => new Zend_Db_Expr('version')], -); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.21-0.8.22.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.21-0.8.22.php deleted file mode 100644 index 5d221fc12b8..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.21-0.8.22.php +++ /dev/null @@ -1,47 +0,0 @@ -run(" -CREATE TABLE IF NOT EXISTS `{$installer->getTable('core/cache')}` ( - `id` VARCHAR(255) NOT NULL, - `data` mediumblob, - `create_time` int(11), - `update_time` int(11), - `expire_time` int(11), - PRIMARY KEY (`id`), - KEY `IDX_EXPIRE_TIME` (`expire_time`) -)ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `{$installer->getTable('core/cache_tag')}` ( - `tag` VARCHAR(255) NOT NULL, - `cache_id` VARCHAR(255) NOT NULL, - KEY `IDX_TAG` (`tag`), - KEY `IDX_CACHE_ID` (`cache_id`), - CONSTRAINT `FK_CORE_CACHE_TAG` FOREIGN KEY (`cache_id`) REFERENCES `{$installer->getTable('core/cache')}` (`id`) - ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -CREATE TABLE IF NOT EXISTS `{$installer->getTable('core/cache_option')}` ( - `code` VARCHAR(32) NOT NULL, - `value` tinyint(3), - PRIMARY KEY (`code`) -)ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.22-0.8.23.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.22-0.8.23.php deleted file mode 100644 index a4bc5eb67f3..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.22-0.8.23.php +++ /dev/null @@ -1,32 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('core/layout_link'), - 'area', - "VARCHAR(64) NOT NULL DEFAULT '' AFTER `store_id`", -); - -$installer->getConnection()->update( - $installer->getTable('core/layout_link'), - ['area' => Mage::getSingleton('core/design_package')->getArea()], -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.23-0.8.24.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.23-0.8.24.php deleted file mode 100644 index a147b79588d..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.23-0.8.24.php +++ /dev/null @@ -1,31 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE `{$installer->getTable('core/url_rewrite')}` - DROP INDEX `UNQ_PATH`, - DROP INDEX `UNQ_REQUEST_PATH`, - DROP INDEX `IDX_TARGET_PATH`, - ADD UNIQUE `UNQ_PATH` (`id_path`, `is_system`, `store_id`), - ADD UNIQUE `UNQ_REQUEST_PATH` (`request_path`, `store_id`), - ADD INDEX `IDX_TARGET_PATH` (`target_path`, `store_id`); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.24-0.8.25.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.24-0.8.25.php deleted file mode 100644 index bad562ad98b..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.24-0.8.25.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->getConnection()->modifyColumn( - $this->getTable('core/flag'), - 'flag_id', - 'INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.25-0.8.26.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.25-0.8.26.php deleted file mode 100644 index a568cfa55d7..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.25-0.8.26.php +++ /dev/null @@ -1,21 +0,0 @@ -getConnection()->dropForeignKey($installer->getTable('core/cache_tag'), 'FK_CORE_CACHE_TAG'); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.27-0.8.28.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.27-0.8.28.php deleted file mode 100644 index 6c0435a4cb2..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.27-0.8.28.php +++ /dev/null @@ -1,25 +0,0 @@ -getTable('core/cache_tag'); -$installer->getConnection()->truncate($tagsTableName); -$installer->getConnection()->modifyColumn($tagsTableName, 'tag', 'VARCHAR(100)'); -$installer->getConnection()->modifyColumn($tagsTableName, 'cache_id', 'VARCHAR(200)'); -$installer->getConnection()->addKey($tagsTableName, '', ['tag', 'cache_id'], 'PRIMARY'); -$installer->getConnection()->dropKey($tagsTableName, 'IDX_TAG'); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.3-0.8.4.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.3-0.8.4.php deleted file mode 100644 index 779bb5e736e..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.3-0.8.4.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE `{$installer->getTable('core_url_rewrite')}` - DROP `entity_id`, - DROP `type`, - ADD `is_system` tinyint(1) unsigned default '1' AFTER `target_path`, - DROP INDEX `store_id`, - ADD INDEX `FK_CORE_URL_REWRITE_STORE` (`store_id`), - DROP INDEX `id_path`, - ADD UNIQUE `UNQ_PATH` (`store_id`, `id_path`, `is_system`), - DROP INDEX `request_path`, - ADD UNIQUE `UNQ_REQUEST_PATH` (`store_id`, `request_path`), - DROP INDEX `target_path`, - ADD INDEX `IDX_TARGET_PATH` (`store_id`, `target_path`); -DROP TABLE IF EXISTS `{$installer->getTable('core_url_rewrite_tag')}`; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.4-0.8.5.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.4-0.8.5.php deleted file mode 100644 index 943c6fadd07..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.4-0.8.5.php +++ /dev/null @@ -1,29 +0,0 @@ -getConnection(); -$table = $this->getTable('design_change'); - -try { - $conn->addColumn($table, 'design', "varchar(255) not null default ''"); -} catch (Exception $e) { -} - -$conn->dropColumn($table, 'package'); -$conn->dropColumn($table, 'theme'); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.5-0.8.6.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.5-0.8.6.php deleted file mode 100644 index 8d4c66277b4..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.5-0.8.6.php +++ /dev/null @@ -1,38 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('core_website'), 'is_default', 'tinyint(1) unsigned default 0'); -$select = $installer->getConnection()->select() - ->from($installer->getTable('core_website')) - ->where('website_id > ?', 0) - ->order('website_id') - ->limit(1); -$row = $installer->getConnection()->fetchRow($select); - -if ($row) { - $whereBind = $installer->getConnection()->quoteInto('website_id=?', $row['website_id']); - $installer->getConnection()->update( - $installer->getTable('core_website'), - ['is_default' => 1], - $whereBind, - ); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.6-0.8.7.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.6-0.8.7.php deleted file mode 100644 index 6a35948f8b6..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.6-0.8.7.php +++ /dev/null @@ -1,29 +0,0 @@ -startSetup(); - -$installer->run(" - -ALTER TABLE `{$this->getTable('design_change')}` - CHANGE `date_from` `date_from` DATE NULL, - CHANGE `date_to` `date_to` DATE NULL - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.7-0.8.8.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.7-0.8.8.php deleted file mode 100644 index add1483f9de..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.7-0.8.8.php +++ /dev/null @@ -1,25 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE `{$this->getTable('core_url_rewrite')}` ADD INDEX `IDX_ID_PATH` ( `id_path` ); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.8-0.8.9.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.8-0.8.9.php deleted file mode 100644 index 5c1687bfb3e..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.8-0.8.9.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup(); - -$installer->getConnection()->changeColumn( - $this->getTable('core_session'), - 'session_data', - 'session_data', - 'MEDIUMBLOB NOT NULL', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.9-0.8.10.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.9-0.8.10.php deleted file mode 100644 index 20b607ac84f..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.9-0.8.10.php +++ /dev/null @@ -1,33 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE {$this->getTable('core_flag')} ( - `flag_id` smallint(5) unsigned NOT NULL auto_increment, - `flag_code` varchar(255) NOT NULL, - `state` smallint(5) unsigned NOT NULL default '0', - `flag_data` text, - `last_update` datetime NOT NULL, - PRIMARY KEY (`flag_id`), - KEY (`last_update`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 8f0cb0b0256..00000000000 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,1445 +0,0 @@ -startSetup(); - -$usedDatabaseStorage = $installer->getConnection()->isTableExists( - $installer->getTable('core/file_storage'), -); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('core/layout_link'), - 'FK_CORE_LAYOUT_LINK_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core/layout_link'), - 'FK_CORE_LAYOUT_LINK_UPDATE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core/store'), - 'FK_STORE_GROUP_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core/store'), - 'FK_STORE_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core/session'), - 'FK_SESSION_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core/store_group'), - 'FK_STORE_GROUP_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core/translate'), - 'FK_CORE_TRANSLATE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core/url_rewrite'), - 'CORE_URL_REWRITE_IBFK_1', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core/url_rewrite'), - 'FK_CORE_URL_REWRITE_CATEGORY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core/url_rewrite'), - 'FK_CORE_URL_REWRITE_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core/url_rewrite'), - 'FK_CORE_URL_REWRITE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core/variable_value'), - 'FK_CORE_VARIABLE_VALUE_STORE_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core/variable_value'), - 'FK_CORE_VARIABLE_VALUE_VARIABLE_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core/design_change'), - 'FK_DESIGN_CHANGE_STORE', -); - -if ($usedDatabaseStorage) { - $installer->getConnection()->dropForeignKey( - $installer->getTable('core/file_storage'), - 'FK_FILE_DIRECTORY', - ); - - $installer->getConnection()->dropForeignKey( - $installer->getTable('core/directory_storage'), - 'FK_DIRECTORY_PARENT_ID', - ); -} - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('core/cache'), - 'IDX_EXPIRE_TIME', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/cache_tag'), - 'IDX_CACHE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/config_data'), - 'CONFIG_SCOPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/email_template'), - 'TEMPLATE_CODE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/email_template'), - 'ADDED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/email_template'), - 'MODIFIED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/flag'), - 'LAST_UPDATE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/layout_link'), - 'STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/layout_link'), - 'FK_CORE_LAYOUT_LINK_UPDATE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/layout_update'), - 'HANDLE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/store'), - 'CODE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/store'), - 'FK_STORE_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/store'), - 'IS_ACTIVE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/store'), - 'FK_STORE_GROUP', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/store_group'), - 'FK_STORE_GROUP_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/store_group'), - 'DEFAULT_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/translate'), - 'IDX_CODE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/translate'), - 'FK_CORE_TRANSLATE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/session'), - 'FK_SESSION_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/url_rewrite'), - 'UNQ_REQUEST_PATH', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/url_rewrite'), - 'UNQ_PATH', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/url_rewrite'), - 'FK_CORE_URL_REWRITE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/url_rewrite'), - 'FK_CORE_URL_REWRITE_CATEGORY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/url_rewrite'), - 'FK_CORE_URL_REWRITE_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/url_rewrite'), - 'IDX_ID_PATH', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/url_rewrite'), - 'IDX_CATEGORY_REWRITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/url_rewrite'), - 'IDX_TARGET_PATH', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/variable'), - 'IDX_CODE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/variable_value'), - 'IDX_VARIABLE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/variable_value'), - 'IDX_VARIABLE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/variable_value'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/website'), - 'CODE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/website'), - 'SORT_ORDER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/website'), - 'DEFAULT_GROUP_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('core/design_change'), - 'FK_DESIGN_CHANGE_STORE', -); - -if ($usedDatabaseStorage) { - $installer->getConnection()->dropIndex( - $installer->getTable('core/file_storage'), - 'IDX_FILENAME', - ); - - $installer->getConnection()->dropIndex( - $installer->getTable('core/file_storage'), - 'directory_id', - ); - - $installer->getConnection()->dropIndex( - $installer->getTable('core/directory_storage'), - 'IDX_DIRECTORY_PATH', - ); - - $installer->getConnection()->dropIndex( - $installer->getTable('core/directory_storage'), - 'parent_id', - ); -} - -/* - * Change columns - */ -$tables = [ - $installer->getTable('core/config_data') => [ - 'columns' => [ - 'config_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Config Id', - ], - 'scope' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 8, - 'nullable' => false, - 'default' => 'default', - 'comment' => 'Config Scope', - ], - 'scope_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Config Scope Id', - ], - 'path' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'default' => 'general', - 'comment' => 'Config Path', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Config Value', - ], - ], - 'comment' => 'Config Data', - ], - $installer->getTable('core/website') => [ - 'columns' => [ - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Code', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'comment' => 'Website Name', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - 'default_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Default Group Id', - ], - 'is_default' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Defines Is Website Default', - ], - ], - 'comment' => 'Websites', - ], - $installer->getTable('core/store') => [ - 'columns' => [ - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Store Id', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Code', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Website Id', - ], - 'group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Group Id', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Store Name', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Sort Order', - ], - 'is_active' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Activity', - ], - ], - 'comment' => 'Stores', - ], - $installer->getTable('core/resource') => [ - 'columns' => [ - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Resource Code', - ], - 'version' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Resource Version', - ], - 'data_version' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Data Version', - ], - ], - 'comment' => 'Resources', - ], - $installer->getTable('core/cache') => [ - 'columns' => [ - 'id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 200, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Cache Id', - ], - 'data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BLOB, - 'length' => '2M', - 'comment' => 'Cache Data', - ], - 'create_time' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Cache Creation Time', - ], - 'update_time' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Time of Cache Updating', - ], - 'expire_time' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Cache Expiration Time', - ], - ], - 'comment' => 'Caches', - ], - $installer->getTable('core/cache_tag') => [ - 'columns' => [ - 'tag' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 100, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Tag', - ], - 'cache_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 200, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Cache Id', - ], - ], - 'comment' => 'Tag Caches', - ], - $installer->getTable('core/cache_option') => [ - 'columns' => [ - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Code', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'comment' => 'Value', - ], - ], - 'comment' => 'Cache Options', - ], - $installer->getTable('core/store_group') => [ - 'columns' => [ - 'group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Group Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Website Id', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Store Group Name', - ], - 'root_category_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Root Category Id', - ], - 'default_store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Default Store Id', - ], - ], - 'comment' => 'Store Groups', - ], - $installer->getTable('core/email_template') => [ - 'columns' => [ - 'template_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Template Id', - ], - 'template_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 150, - 'nullable' => false, - 'comment' => 'Template Name', - ], - 'template_text' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'nullable' => false, - 'comment' => 'Template Content', - ], - 'template_styles' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Templste Styles', - ], - 'template_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Template Type', - ], - 'template_subject' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 200, - 'nullable' => false, - 'comment' => 'Template Subject', - ], - 'template_sender_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 200, - 'comment' => 'Template Sender Name', - ], - 'template_sender_email' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 200, - 'comment' => 'Template Sender Email', - ], - 'added_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Date of Template Creation', - ], - 'modified_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Date of Template Modification', - ], - 'orig_template_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 200, - 'comment' => 'Original Template Code', - ], - 'orig_template_variables' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Original Template Variables', - ], - ], - 'comment' => 'Email Templates', - ], - $installer->getTable('core/variable') => [ - 'columns' => [ - 'variable_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Variable Id', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Variable Code', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Variable Name', - ], - ], - 'comment' => 'Variables', - ], - $installer->getTable('core/variable_value') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Variable Value Id', - ], - 'variable_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Variable Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'plain_value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Plain Text Value', - ], - 'html_value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Html Value', - ], - ], - 'comment' => 'Variable Value', - ], - $installer->getTable('core/translate') => [ - 'columns' => [ - 'key_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Key Id of Translation', - ], - 'string' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'default' => Mage_Core_Model_Translate::DEFAULT_STRING, - 'comment' => 'Translation String', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'translate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Translate', - ], - 'locale' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 20, - 'nullable' => false, - 'default' => 'en_US', - 'comment' => 'Locale', - ], - ], - 'comment' => 'Translations', - ], - $installer->getTable('core/session') => [ - 'columns' => [ - 'session_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Session Id', - ], - 'session_expires' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Date of Session Expiration', - ], - 'session_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BLOB, - 'length' => '2M', - 'nullable' => false, - 'comment' => 'Session Data', - ], - ], - 'comment' => 'Database Sessions Storage', - ], - $installer->getTable('core/layout_update') => [ - 'columns' => [ - 'layout_update_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Layout Update Id', - ], - 'handle' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Handle', - ], - 'xml' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Xml', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - ], - 'comment' => 'Layout Updates', - ], - $installer->getTable('core/layout_link') => [ - 'columns' => [ - 'layout_link_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Link Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'area' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'comment' => 'Area', - ], - 'package' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'comment' => 'Package', - ], - 'theme' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'comment' => 'Theme', - ], - 'layout_update_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Layout Update Id', - ], - ], - 'comment' => 'Layout Link', - ], - $installer->getTable('core/url_rewrite') => [ - 'columns' => [ - 'url_rewrite_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Rewrite Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'id_path' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Id Path', - ], - 'request_path' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Request Path', - ], - 'target_path' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Target Path', - ], - 'is_system' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '1', - 'comment' => 'Defines is Rewrite System', - ], - 'options' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Options', - ], - 'description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Deascription', - ], - ], - 'comment' => 'Url Rewrites', - ], - $installer->getTable('core/design_change') => [ - 'columns' => [ - 'design_change_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Design Change Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'design' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Design', - ], - 'date_from' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'First Date of Design Activity', - ], - 'date_to' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Last Date of Design Activity', - ], - ], - 'comment' => 'Design Changes', - ], - $installer->getTable('core/flag') => [ - 'columns' => [ - 'flag_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Flag Id', - ], - 'flag_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Flag Code', - ], - 'state' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Flag State', - ], - 'flag_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Flag Data', - ], - 'last_update' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'default' => Varien_Db_Ddl_Table::TIMESTAMP_INIT_UPDATE, - 'comment' => 'Date of Last Flag Update', - ], - ], - 'comment' => 'Flag', - ], -]; - -if ($usedDatabaseStorage) { - $storageTables = [ - $installer->getTable('core/file_storage') => [ - 'columns' => [ - 'file_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'File Id', - ], - 'content' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_VARBINARY, - 'length' => Varien_Db_Ddl_Table::MAX_VARBINARY_SIZE, - 'nullable' => false, - 'comment' => 'File Content', - ], - 'upload_time' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'default' => Varien_Db_Ddl_Table::TIMESTAMP_INIT, - 'comment' => 'Upload Timestamp', - ], - 'filename' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 100, - 'nullable' => false, - 'comment' => 'Filename', - ], - 'directory_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'default' => null, - 'comment' => 'Identifier of Directory where File is Located', - ], - 'directory' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'default' => null, - 'comment' => 'Directory Path', - ], - ], - 'comment' => 'File Storage', - ], - $installer->getTable('core/directory_storage') => [ - 'columns' => [ - 'directory_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Directory Id', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 100, - 'nullable' => false, - 'comment' => 'Directory Name', - ], - 'path' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'default' => null, - 'comment' => 'Path to the Directory', - ], - 'upload_time' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'default' => Varien_Db_Ddl_Table::TIMESTAMP_INIT, - 'comment' => 'Upload Timestamp', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'default' => null, - 'comment' => 'Parent Directory Id', - ], - ], - 'comment' => 'Directory Storage', - ], - ]; - $tables = array_merge($tables, $storageTables); -} - -$installer->getConnection()->modifyTables($tables); - -$installer->getConnection()->dropColumn( - $installer->getTable('core/session'), - 'website_id', -); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('core/variable'), - $installer->getIdxName( - 'core/variable', - ['code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/variable_value'), - $installer->getIdxName( - 'core/variable_value', - ['variable_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['variable_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/variable_value'), - $installer->getIdxName('core/variable_value', ['variable_id']), - ['variable_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/variable_value'), - $installer->getIdxName('core/variable_value', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/cache'), - $installer->getIdxName('core/cache', ['expire_time']), - ['expire_time'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/cache_tag'), - $installer->getIdxName('core/cache_tag', ['cache_id']), - ['cache_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/config_data'), - $installer->getIdxName( - 'core/config_data', - ['scope', 'scope_id', 'path'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['scope', 'scope_id', 'path'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/email_template'), - $installer->getIdxName( - 'core/email_template', - ['template_code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['template_code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/email_template'), - $installer->getIdxName('core/email_template', ['added_at']), - ['added_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/email_template'), - $installer->getIdxName('core/email_template', ['modified_at']), - ['modified_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/flag'), - $installer->getIdxName('core/flag', ['last_update']), - ['last_update'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/layout_link'), - $installer->getIdxName( - 'core/layout_link', - ['store_id', 'package', 'theme', 'layout_update_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['store_id', 'package', 'theme', 'layout_update_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/layout_link'), - $installer->getIdxName('core/layout_link', ['layout_update_id']), - ['layout_update_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/layout_update'), - $installer->getIdxName('core/layout_update', ['handle']), - ['handle'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/store'), - $installer->getIdxName( - 'core/store', - ['code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/store'), - $installer->getIdxName('core/store', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/store'), - $installer->getIdxName('core/store', ['is_active', 'sort_order']), - ['is_active', 'sort_order'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/store'), - $installer->getIdxName('core/store', ['group_id']), - ['group_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/store_group'), - $installer->getIdxName('core/store_group', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/store_group'), - $installer->getIdxName('core/store_group', ['default_store_id']), - ['default_store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/translate'), - $installer->getIdxName( - 'core/translate', - ['store_id', 'locale', 'string'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['store_id', 'locale', 'string'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/translate'), - $installer->getIdxName('core/translate', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/url_rewrite'), - $installer->getIdxName( - 'core/url_rewrite', - ['request_path', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['request_path', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/url_rewrite'), - $installer->getIdxName( - 'core/url_rewrite', - ['id_path', 'is_system', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['id_path', 'is_system', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/url_rewrite'), - $installer->getIdxName('core/url_rewrite', ['target_path', 'store_id']), - ['target_path', 'store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/url_rewrite'), - $installer->getIdxName('core/url_rewrite', ['id_path']), - ['id_path'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/url_rewrite'), - $installer->getIdxName('core/url_rewrite', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/website'), - $installer->getIdxName( - 'core/website', - ['code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/website'), - $installer->getIdxName('core/website', ['sort_order']), - ['sort_order'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/website'), - $installer->getIdxName('core/website', ['default_group_id']), - ['default_group_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('core/design_change'), - $installer->getIdxName('core/design_change', ['store_id']), - ['store_id'], -); - -if ($usedDatabaseStorage) { - $installer->getConnection()->addIndex( - $installer->getTable('core/file_storage'), - $installer->getIdxName( - 'core/file_storage', - ['filename', 'directory_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['filename', 'directory_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ); - - $installer->getConnection()->addIndex( - $installer->getTable('core/file_storage'), - $installer->getIdxName('core/file_storage', ['directory_id']), - ['directory_id'], - ); - - $installer->getConnection()->addIndex( - $installer->getTable('core/directory_storage'), - $installer->getIdxName( - 'core/directory_storage', - ['name', 'parent_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['name', 'parent_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ); - - $installer->getConnection()->addIndex( - $installer->getTable('core/directory_storage'), - $installer->getIdxName('core/directory_storage', ['parent_id']), - ['parent_id'], - ); -} - -/** - * Add foreign keys - */ - -$installer->getConnection()->addForeignKey( - $installer->getFkName('core/layout_link', 'store_id', 'core/store', 'store_id'), - $installer->getTable('core/layout_link'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('core/layout_link', 'layout_update_id', 'core/layout_update', 'layout_update_id'), - $installer->getTable('core/layout_link'), - 'layout_update_id', - $installer->getTable('core/layout_update'), - 'layout_update_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('core/store', 'group_id', 'core/store_group', 'group_id'), - $installer->getTable('core/store'), - 'group_id', - $installer->getTable('core/store_group'), - 'group_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('core/store', 'website_id', 'core/website', 'website_id'), - $installer->getTable('core/store'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('core/store_group', 'website_id', 'core/website', 'website_id'), - $installer->getTable('core/store_group'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('core/translate', 'store_id', 'core/store', 'store_id'), - $installer->getTable('core/translate'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('core/url_rewrite', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('core/url_rewrite'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('core/url_rewrite', 'category_id', 'catalog/category', 'entity_id'), - $installer->getTable('core/url_rewrite'), - 'category_id', - $installer->getTable('catalog/category'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('core/url_rewrite', 'store_id', 'core/store', 'store_id'), - $installer->getTable('core/url_rewrite'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('core/variable_value', 'store_id', 'core/store', 'store_id'), - $installer->getTable('core/variable_value'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('core/variable_value', 'variable_id', 'core/variable', 'variable_id'), - $installer->getTable('core/variable_value'), - 'variable_id', - $installer->getTable('core/variable'), - 'variable_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('core/design_change', 'store_id', 'core/store', 'store_id'), - $installer->getTable('core/design_change'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -if ($usedDatabaseStorage) { - $installer->getConnection()->addForeignKey( - $installer->getFkName('core/file_storage', 'directory_id', 'core/directory_storage', 'directory_id'), - $installer->getTable('core/file_storage'), - 'directory_id', - $installer->getTable('core/directory_storage'), - 'directory_id', - ); - - $installer->getConnection()->addForeignKey( - $installer->getFkName('core/directory_storage', 'parent_id', 'core/directory_storage', 'directory_id'), - $installer->getTable('core/directory_storage'), - 'parent_id', - $installer->getTable('core/directory_storage'), - 'directory_id', - ); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Cron/sql/cron_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Cron/sql/cron_setup/mysql4-install-0.7.0.php deleted file mode 100644 index de93eae08a7..00000000000 --- a/app/code/core/Mage/Cron/sql/cron_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,56 +0,0 @@ -startSetup(); - -$installer->run(" - -SET NAMES utf8; - -SET SQL_MODE=''; - -SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'; - -/*Table structure for table `cron_schedule` */ - --- DROP TABLE IF EXISTS {$this->getTable('cron_schedule')}; - -CREATE TABLE {$this->getTable('cron_schedule')} ( - `schedule_id` int(10) unsigned NOT NULL auto_increment, - `task_name` int(10) unsigned NOT NULL default '0', - `schedule_status` tinyint(4) NOT NULL default '0', - `schedule_type` tinyint(4) NOT NULL default '0', - `schedule_cmd` text NOT NULL, - `schedule_comments` text NOT NULL, - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `scheduled_at` datetime NOT NULL default '0000-00-00 00:00:00', - `executed_at` datetime NOT NULL default '0000-00-00 00:00:00', - `finished_at` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`schedule_id`), - KEY `task_name` (`task_name`), - KEY `scheduled_at` (`scheduled_at`,`schedule_status`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `cron_schedule` */ - -SET SQL_MODE=@OLD_SQL_MODE; - - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 1595ae215be..00000000000 --- a/app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,40 +0,0 @@ -startSetup(); - -$installer->run(" - -DROP TABLE IF EXISTS {$this->getTable('cron_schedule')}; -CREATE TABLE {$this->getTable('cron_schedule')} ( - `schedule_id` int(10) unsigned NOT NULL auto_increment, - `job_code` varchar(255) NOT NULL default '0', - `status` enum('pending','running','success','missed','error') NOT NULL default 'pending', - `messages` text, - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `scheduled_at` datetime NOT NULL default '0000-00-00 00:00:00', - `executed_at` datetime NOT NULL default '0000-00-00 00:00:00', - `finished_at` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`schedule_id`), - KEY `task_name` (`job_code`), - KEY `scheduled_at` (`scheduled_at`,`status`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 3594c2f6d6b..00000000000 --- a/app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,106 +0,0 @@ -startSetup(); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('cron/schedule'), - 'TASK_NAME', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('cron/schedule'), - 'SCHEDULED_AT', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('cron/schedule') => [ - 'columns' => [ - 'schedule_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Schedule Id', - ], - 'job_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Job Code', - ], - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 7, - 'nullable' => false, - 'default' => 'pending', - 'comment' => 'Status', - ], - 'messages' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Messages', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Created At', - ], - 'scheduled_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Scheduled At', - ], - 'executed_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Executed At', - ], - 'finished_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Finished At', - ], - ], - 'comment' => 'Cron Schedule', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('cron/schedule'), - $installer->getIdxName('cron/schedule', ['job_code']), - ['job_code'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('cron/schedule'), - $installer->getIdxName('cron/schedule', ['scheduled_at', 'status']), - ['scheduled_at', 'status'], -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 4ec931a850c..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,261 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS `{$this->getTable('customer_entity')}`; -CREATE TABLE `{$this->getTable('customer_entity')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(10) unsigned default NULL, - `store_id` smallint(5) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_CUSTOMER_ENTITY_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ENTITY_STORE` (`store_id`), - KEY `FK_CUSTOMER_ENTITY_PARENT_ENTITY` (`parent_id`) --- ,CONSTRAINT `FK_CUSTOMER_ENTITY_PARENT_ENTITY` FOREIGN KEY (`parent_id`) REFERENCES `{$this->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Customer Entityies'; - --- DROP TABLE IF EXISTS `{$this->getTable('customer_entity_datetime')}`; -CREATE TABLE `{$this->getTable('customer_entity_datetime')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_DATETIME_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_DATETIME_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_DATETIME_STORE` (`store_id`), - KEY `FK_CUSTOMER_DATETIME_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_DATETIME_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_DATETIME_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_DATETIME_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$this->getTable('customer_entity_decimal')}`; -CREATE TABLE `{$this->getTable('customer_entity_decimal')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_DECIMAL_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_DECIMAL_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_DECIMAL_STORE` (`store_id`), - KEY `FK_CUSTOMER_DECIMAL_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_DECIMAL_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$this->getTable('customer_entity_int')}`; -CREATE TABLE `{$this->getTable('customer_entity_int')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_INT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_INT_STORE` (`store_id`), - KEY `FK_CUSTOMER_INT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_INT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_INT_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$this->getTable('customer_entity_text')}`; -CREATE TABLE `{$this->getTable('customer_entity_text')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_TEXT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_TEXT_STORE` (`store_id`), - KEY `FK_CUSTOMER_TEXT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_TEXT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_TEXT_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$this->getTable('customer_entity_varchar')}`; -CREATE TABLE `{$this->getTable('customer_entity_varchar')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_VARCHAR_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_VARCHAR_STORE` (`store_id`), - KEY `FK_CUSTOMER_VARCHAR_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_VARCHAR_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_VARCHAR_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$this->getTable('customer_group')}`; -CREATE TABLE `{$this->getTable('customer_group')}` ( - `customer_group_id` smallint(3) unsigned NOT NULL auto_increment, - `customer_group_code` varchar(32) NOT NULL default '', - `tax_class_id` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`customer_group_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Customer groups'; - -insert into `{$this->getTable('customer_group')}` (`customer_group_id`,`customer_group_code`,`tax_class_id`) values (0,'NOT LOGGED IN',1),(1,'General',3),(2,'Wholesale',3),(3,'Retailer',3); - --- DROP TABLE IF EXISTS `{$this->getTable('customer_address_entity')}`; -CREATE TABLE `{$this->getTable('customer_address_entity')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(10) unsigned default NULL, - `store_id` smallint(5) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_CUSTOMER_ADDRESS_CUSTOMER_ID` (`parent_id`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_CUSTOMER_ID` FOREIGN KEY (`parent_id`) REFERENCES `{$this->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Customer Address Entities'; - --- DROP TABLE IF EXISTS `{$this->getTable('customer_address_entity_datetime')}`; -CREATE TABLE `{$this->getTable('customer_address_entity_datetime')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_DATETIME_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_DATETIME_STORE` (`store_id`), - KEY `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_DATETIME_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$this->getTable('customer_address_entity_decimal')}`; -CREATE TABLE `{$this->getTable('customer_address_entity_decimal')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_DECIMAL_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_DECIMAL_STORE` (`store_id`), - KEY `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_DECIMAL_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$this->getTable('customer_address_entity_int')}`; -CREATE TABLE `{$this->getTable('customer_address_entity_int')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_ADDRESS_INT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_INT_STORE` (`store_id`), - KEY `FK_CUSTOMER_ADDRESS_INT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_INT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_INT_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$this->getTable('customer_address_entity_text')}`; -CREATE TABLE `{$this->getTable('customer_address_entity_text')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_ADDRESS_TEXT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_TEXT_STORE` (`store_id`), - KEY `FK_CUSTOMER_ADDRESS_TEXT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_TEXT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_TEXT_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$this->getTable('customer_address_entity_varchar')}`; -CREATE TABLE `{$this->getTable('customer_address_entity_varchar')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_VARCHAR_STORE` (`store_id`), - KEY `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_VARCHAR_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); - -$installer->installEntities(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.8.0.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.8.0.php deleted file mode 100644 index 81e87347597..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.8.0.php +++ /dev/null @@ -1,230 +0,0 @@ -startSetup(); - -$installer->run(" --- DROP TABLE IF EXISTS `{$installer->getTable('customer_address_entity')}`; -CREATE TABLE `{$installer->getTable('customer_address_entity')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(10) unsigned default NULL, - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_CUSTOMER_ADDRESS_CUSTOMER_ID` (`parent_id`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_CUSTOMER_ID` FOREIGN KEY (`parent_id`) REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Customer Address Entities'; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_address_entity_datetime')}`; -CREATE TABLE `{$installer->getTable('customer_address_entity_datetime')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_DATETIME_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_address_entity_decimal')}`; -CREATE TABLE `{$installer->getTable('customer_address_entity_decimal')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_DECIMAL_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_address_entity_int')}`; -CREATE TABLE `{$installer->getTable('customer_address_entity_int')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_ADDRESS_INT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_INT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_INT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_address_entity_text')}`; -CREATE TABLE `{$installer->getTable('customer_address_entity_text')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_ADDRESS_TEXT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_TEXT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_TEXT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_address_entity_varchar')}`; -CREATE TABLE `{$installer->getTable('customer_address_entity_varchar')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_entity')}`; -CREATE TABLE `{$installer->getTable('customer_entity')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `website_id` smallint(5) unsigned default NULL, - `email` varchar(255) NOT NULL default '', - `group_id` smallint(3) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `store_id` smallint(5) unsigned default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_CUSTOMER_ENTITY_STORE` (`store_id`), - KEY `IDX_ENTITY_TYPE` (`entity_type_id`), - KEY `IDX_AUTH` (`email`,`website_id`), - KEY `FK_CUSTOMER_WEBSITE` (`website_id`), - CONSTRAINT `FK_CUSTOMER_ENTITY_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `{$installer->getTable('core_website')}` (`website_id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Customer Entityies'; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_entity_datetime')}`; -CREATE TABLE `{$installer->getTable('customer_entity_datetime')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_DATETIME_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_DATETIME_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_DATETIME_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_DATETIME_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_DATETIME_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_entity_decimal')}`; -CREATE TABLE `{$installer->getTable('customer_entity_decimal')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_DECIMAL_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_DECIMAL_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_DECIMAL_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_entity_int')}`; -CREATE TABLE `{$installer->getTable('customer_entity_int')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_INT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_INT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_INT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_entity_text')}`; -CREATE TABLE `{$installer->getTable('customer_entity_text')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_TEXT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_TEXT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_TEXT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_entity_varchar')}`; -CREATE TABLE `{$installer->getTable('customer_entity_varchar')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_CUSTOMER_VARCHAR_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_VARCHAR_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_VARCHAR_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_group')}`; -CREATE TABLE `{$installer->getTable('customer_group')}` ( - `customer_group_id` smallint(3) unsigned NOT NULL auto_increment, - `customer_group_code` varchar(32) NOT NULL default '', - `tax_class_id` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`customer_group_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Customer groups'; - -INSERT INTO `{$installer->getTable('customer_group')}` VALUES(0, 'NOT LOGGED IN', 3), (1, 'General', 3), (2, 'Wholesale', 3), (3, 'Retailer', 3); -"); -$installer->endSetup(); -$installer->installEntities(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-1.4.0.0.0.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-1.4.0.0.0.php deleted file mode 100644 index 12336532dd2..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-1.4.0.0.0.php +++ /dev/null @@ -1,621 +0,0 @@ -startSetup(); - -$installer->run(" --- DROP TABLE IF EXISTS `{$installer->getTable('customer_address_entity')}`; -CREATE TABLE `{$installer->getTable('customer_address_entity')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(10) unsigned default NULL, - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_CUSTOMER_ADDRESS_CUSTOMER_ID` (`parent_id`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_CUSTOMER_ID` FOREIGN KEY (`parent_id`) REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Customer Address Entities'; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_address_entity_datetime')}`; -CREATE TABLE `{$installer->getTable('customer_address_entity_datetime')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_DATETIME_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY` (`entity_id`), - KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_address_entity_decimal')}`; -CREATE TABLE `{$installer->getTable('customer_address_entity_decimal')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_DECIMAL_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY` (`entity_id`), - KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_address_entity_int')}`; -CREATE TABLE `{$installer->getTable('customer_address_entity_int')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_INT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_INT_ENTITY` (`entity_id`), - KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_INT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_address_entity_text')}`; -CREATE TABLE `{$installer->getTable('customer_address_entity_text')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_TEXT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_TEXT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_TEXT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_address_entity_varchar')}`; -CREATE TABLE `{$installer->getTable('customer_address_entity_varchar')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_ADDRESS_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY` (`entity_id`), - KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`), - CONSTRAINT `FK_CUSTOMER_ADDRESS_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_address_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_entity')}`; -CREATE TABLE `{$installer->getTable('customer_entity')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `website_id` smallint(5) unsigned default NULL, - `email` varchar(255) NOT NULL default '', - `group_id` smallint(3) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `store_id` smallint(5) unsigned default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_CUSTOMER_ENTITY_STORE` (`store_id`), - KEY `IDX_ENTITY_TYPE` (`entity_type_id`), - KEY `IDX_AUTH` (`email`,`website_id`), - KEY `FK_CUSTOMER_WEBSITE` (`website_id`), - CONSTRAINT `FK_CUSTOMER_ENTITY_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `{$installer->getTable('core_website')}` (`website_id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Customer Entityies'; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_entity_datetime')}`; -CREATE TABLE `{$installer->getTable('customer_entity_datetime')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`), - KEY `FK_CUSTOMER_DATETIME_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_DATETIME_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_DATETIME_ENTITY` (`entity_id`), - KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`), - CONSTRAINT `FK_CUSTOMER_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_DATETIME_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_DATETIME_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_entity_decimal')}`; -CREATE TABLE `{$installer->getTable('customer_entity_decimal')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`), - KEY `FK_CUSTOMER_DECIMAL_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_DECIMAL_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_DECIMAL_ENTITY` (`entity_id`), - KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`), - CONSTRAINT `FK_CUSTOMER_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_entity_int')}`; -CREATE TABLE `{$installer->getTable('customer_entity_int')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`), - KEY `FK_CUSTOMER_INT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_INT_ENTITY` (`entity_id`), - KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`), - CONSTRAINT `FK_CUSTOMER_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_INT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_entity_text')}`; -CREATE TABLE `{$installer->getTable('customer_entity_text')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`), - KEY `FK_CUSTOMER_TEXT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_TEXT_ENTITY` (`entity_id`), - CONSTRAINT `FK_CUSTOMER_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_TEXT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_entity_varchar')}`; -CREATE TABLE `{$installer->getTable('customer_entity_varchar')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`), - KEY `FK_CUSTOMER_VARCHAR_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_CUSTOMER_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_CUSTOMER_VARCHAR_ENTITY` (`entity_id`), - KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`), - CONSTRAINT `FK_CUSTOMER_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_VARCHAR_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('customer_group')}`; -CREATE TABLE `{$installer->getTable('customer_group')}` ( - `customer_group_id` smallint(3) unsigned NOT NULL auto_increment, - `customer_group_code` varchar(32) NOT NULL default '', - `tax_class_id` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`customer_group_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Customer groups'; - -INSERT INTO `{$installer->getTable('customer_group')}` VALUES(0, 'NOT LOGGED IN', 3), (1, 'General', 3), (2, 'Wholesale', 3), (3, 'Retailer', 3); - --- DROP TABLE IF EXISTS `{$installer->getTable('customer/eav_attribute')}`; -CREATE TABLE `{$installer->getTable('customer/eav_attribute')}` ( - `attribute_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, - `is_visible` tinyint(1) unsigned NOT NULL DEFAULT '1', - `is_visible_on_front` tinyint(1) unsigned NOT NULL DEFAULT '0', - `input_filter` varchar(255) NOT NULL, - `lines_to_divide_multiline` smallint(5) unsigned NOT NULL DEFAULT '0', - `min_text_length` int(11) unsigned NOT NULL DEFAULT '0', - `max_text_length` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`attribute_id`), - CONSTRAINT `FK_CUSTOMER_EAV_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav/attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); -$installer->endSetup(); -$installer->installEntities(); - -$setup = $installer->getConnection(); - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/prefix_show') - ->where('value!=?', '0'); -$showPrefix = (bool) Mage::helper('customer/address')->getConfig('prefix_show') - || $setup->fetchOne($select) > 0; - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/middlename_show') - ->where('value!=?', '0'); -$showMiddlename = (bool) Mage::helper('customer/address')->getConfig('middlename_show') - || $setup->fetchOne($select) > 0; - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/suffix_show') - ->where('value!=?', '0'); -$showSuffix = (bool) Mage::helper('customer/address')->getConfig('suffix_show') - || $setup->fetchOne($select) > 0; - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/dob_show') - ->where('value!=?', '0'); -$showDob = (bool) Mage::helper('customer/address')->getConfig('dob_show') - || $setup->fetchOne($select) > 0; - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/taxvat_show') - ->where('value!=?', '0'); -$showTaxVat = (bool) Mage::helper('customer/address')->getConfig('taxvat_show') - || $setup->fetchOne($select) > 0; - -/** - ***************************************************************************** - * customer/account/create/ - ***************************************************************************** - */ - -$setup->insert($installer->getTable('eav/form_type'), [ - 'code' => 'customer_account_create', - 'label' => 'customer_account_create', - 'is_system' => 1, - 'theme' => '', - 'store_id' => 0, -]); -$formTypeId = $setup->lastInsertId(); -$entityTypeId = $installer->getEntityTypeId('customer'); - -$setup->insert($installer->getTable('eav/form_type_entity'), [ - 'type_id' => $formTypeId, - 'entity_type_id' => $entityTypeId, -]); - -$setup->insert($installer->getTable('eav/form_fieldset'), [ - 'type_id' => $formTypeId, - 'code' => 'general', - 'sort_order' => 1, -]); -$fieldsetId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_fieldset_label'), [ - 'fieldset_id' => $fieldsetId, - 'store_id' => 0, - 'label' => 'Personal Information', -]); - -$elementSort = 0; -if ($showPrefix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'prefix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'firstname'), - 'sort_order' => $elementSort++, -]); -if ($showMiddlename) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'middlename'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'lastname'), - 'sort_order' => $elementSort++, -]); -if ($showSuffix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'suffix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'email'), - 'sort_order' => $elementSort++, -]); -if ($showDob) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'dob'), - 'sort_order' => $elementSort++, - ]); -} -if ($showTaxVat) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'taxvat'), - 'sort_order' => $elementSort++, - ]); -} - -/** - ***************************************************************************** - * customer/account/edit/ - ***************************************************************************** - */ - -$setup->insert($installer->getTable('eav/form_type'), [ - 'code' => 'customer_account_edit', - 'label' => 'customer_account_edit', - 'is_system' => 1, - 'theme' => '', - 'store_id' => 0, -]); -$formTypeId = $setup->lastInsertId(); -$entityTypeId = $installer->getEntityTypeId('customer'); - -$setup->insert($installer->getTable('eav/form_type_entity'), [ - 'type_id' => $formTypeId, - 'entity_type_id' => $entityTypeId, -]); - -$setup->insert($installer->getTable('eav/form_fieldset'), [ - 'type_id' => $formTypeId, - 'code' => 'general', - 'sort_order' => 1, -]); -$fieldsetId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_fieldset_label'), [ - 'fieldset_id' => $fieldsetId, - 'store_id' => 0, - 'label' => 'Account Information', -]); - -$elementSort = 0; -if ($showPrefix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'prefix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'firstname'), - 'sort_order' => $elementSort++, -]); -if ($showMiddlename) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'middlename'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'lastname'), - 'sort_order' => $elementSort++, -]); -if ($showSuffix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'suffix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'email'), - 'sort_order' => $elementSort++, -]); -if ($showDob) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'dob'), - 'sort_order' => $elementSort++, - ]); -} -if ($showTaxVat) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'taxvat'), - 'sort_order' => $elementSort++, - ]); -} - -/** - ***************************************************************************** - * customer/address/edit - ***************************************************************************** - */ - -$setup->insert($installer->getTable('eav/form_type'), [ - 'code' => 'customer_address_edit', - 'label' => 'customer_address_edit', - 'is_system' => 1, - 'theme' => '', - 'store_id' => 0, -]); -$formTypeId = $setup->lastInsertId(); -$entityTypeId = $installer->getEntityTypeId('customer_address'); - -$setup->insert($installer->getTable('eav/form_type_entity'), [ - 'type_id' => $formTypeId, - 'entity_type_id' => $entityTypeId, -]); - -$setup->insert($installer->getTable('eav/form_fieldset'), [ - 'type_id' => $formTypeId, - 'code' => 'contact', - 'sort_order' => 1, -]); -$fieldsetId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_fieldset_label'), [ - 'fieldset_id' => $fieldsetId, - 'store_id' => 0, - 'label' => 'Contact Information', -]); - -$elementSort = 0; -if ($showPrefix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'prefix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'firstname'), - 'sort_order' => $elementSort++, -]); -if ($showMiddlename) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'middlename'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'lastname'), - 'sort_order' => $elementSort++, -]); -if ($showSuffix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'suffix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'company'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'telephone'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'fax'), - 'sort_order' => $elementSort++, -]); - -$setup->insert($installer->getTable('eav/form_fieldset'), [ - 'type_id' => $formTypeId, - 'code' => 'address', - 'sort_order' => 2, -]); -$fieldsetId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_fieldset_label'), [ - 'fieldset_id' => $fieldsetId, - 'store_id' => 0, - 'label' => 'Address', -]); - -$elementSort = 0; -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'street'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'city'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'region'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'postcode'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'country_id'), - 'sort_order' => $elementSort++, -]); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.6.1-0.7.0.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.6.1-0.7.0.php deleted file mode 100644 index c606bd8189d..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.6.1-0.7.0.php +++ /dev/null @@ -1,19 +0,0 @@ -startSetup()->run(" -alter table {$this->getTable('customer_entity')} drop foreign key `FK_CUSTOMER_ENTITY_PARENT_ENTITY` ; -")->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index 93921bd75be..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,57 +0,0 @@ -startSetup(); - -$this->getConnection()->dropColumn($this->getTable('customer_address_entity'), 'store_id'); - -$installer->run(" -ALTER TABLE {$this->getTable('customer_entity')} - DROP INDEX `FK_CUSTOMER_ENTITY_STORE`; -ALTER TABLE {$this->getTable('customer_entity')} - CHANGE `store_id` `store_id` smallint(5) unsigned NULL DEFAULT '0'; -ALTER TABLE {$this->getTable('customer_entity')} - ADD CONSTRAINT `FK_CUSTOMER_ENTITY_STORE` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) - ON UPDATE CASCADE - ON DELETE SET NULL; -"); -$installer->run(" -ALTER TABLE {$this->getTable('customer_entity')} - DROP INDEX `FK_CUSTOMER_ENTITY_ENTITY_TYPE`, - ADD INDEX `IDX_ENTITY_TYPE` (`entity_type_id`); -"); -$installer->run(" -ALTER TABLE {$this->getTable('customer_entity')} - DROP INDEX `FK_CUSTOMER_ENTITY_PARENT_ENTITY`, - ADD INDEX `IDX_PARENT_ENTITY` (`parent_id`); -"); - -$this->getConnection()->dropColumn($this->getTable('customer_entity_varchar'), 'store_id'); -$this->getConnection()->dropColumn($this->getTable('customer_entity_text'), 'store_id'); -$this->getConnection()->dropColumn($this->getTable('customer_entity_int'), 'store_id'); -$this->getConnection()->dropColumn($this->getTable('customer_entity_decimal'), 'store_id'); -$this->getConnection()->dropColumn($this->getTable('customer_entity_datetime'), 'store_id'); - -$this->getConnection()->dropColumn($this->getTable('customer_address_entity_varchar'), 'store_id'); -$this->getConnection()->dropColumn($this->getTable('customer_address_entity_text'), 'store_id'); -$this->getConnection()->dropColumn($this->getTable('customer_address_entity_int'), 'store_id'); -$this->getConnection()->dropColumn($this->getTable('customer_address_entity_decimal'), 'store_id'); -$this->getConnection()->dropColumn($this->getTable('customer_address_entity_datetime'), 'store_id'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index fbf5d44af8e..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,56 +0,0 @@ -startSetup(); - -$this->getConnection()->dropColumn($this->getTable('customer_address_entity'), 'store_id'); - -$installer->run(" -ALTER TABLE {$this->getTable('customer_entity')} - ADD COLUMN `website_id` SMALLINT(5) UNSIGNED AFTER `attribute_set_id`, - ADD COLUMN `email` VARCHAR(255) NOT NULL AFTER `website_id`, - ADD COLUMN `group_id` SMALLINT(3) UNSIGNED NOT NULL AFTER `email`, - ADD INDEX IDX_AUTH(`email`, `website_id`), - ADD CONSTRAINT `FK_CUSTOMER_WEBSITE` FOREIGN KEY `FK_CUSTOMER_WEBSITE` (`website_id`) - REFERENCES {$this->getTable('core_website')} (`website_id`) ON DELETE SET NULL ON UPDATE CASCADE; -"); - -$emailAttributeId = $installer->getAttributeId('customer', 'email'); -$groupAttributeId = $installer->getAttributeId('customer', 'group_id'); - -$installer->run(" - UPDATE {$this->getTable('customer_entity')} customer, {$this->getTable('core_store')} store - SET customer.website_id=store.website_id - WHERE store.store_id=customer.store_id; - - UPDATE {$this->getTable('core_website')} SET code='admin', name='Admin' WHERE website_id=0; - - UPDATE {$this->getTable('customer_entity')} customer, {$this->getTable('customer_entity_varchar')} varchar_attribute - SET customer.email=varchar_attribute.value - WHERE varchar_attribute.entity_id=customer.entity_id - AND varchar_attribute.attribute_id={$emailAttributeId}; - - UPDATE {$this->getTable('customer_entity')} customer, {$this->getTable('customer_entity_int')} int_attribute - SET customer.group_id=int_attribute.value - WHERE int_attribute.entity_id=customer.entity_id - AND int_attribute.attribute_id={$groupAttributeId}; -"); - -$installer->getConnection()->dropColumn($this->getTable('customer_entity'), 'parent_id'); -$installer->installEntities(); -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.0-0.8.1.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.0-0.8.1.php deleted file mode 100644 index b3e20d66b3f..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.0-0.8.1.php +++ /dev/null @@ -1,17 +0,0 @@ -installEntities(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.10-0.8.11.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.10-0.8.11.php deleted file mode 100644 index 344719d08d7..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.10-0.8.11.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropKey($installer->getTable('customer_address_entity_text'), 'IDX_VALUE'); -$installer->getConnection()->dropKey($installer->getTable('customer_entity_text'), 'IDX_VALUE'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.11-0.8.12.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.11-0.8.12.php deleted file mode 100644 index 6c59e5f3f7d..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.11-0.8.12.php +++ /dev/null @@ -1,381 +0,0 @@ -startSetup(); - -$setup = $installer->getConnection(); - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/prefix_show') - ->where('value!=?', '0'); -$showPrefix = (bool) Mage::helper('customer/address')->getConfig('prefix_show') - || $setup->fetchOne($select) > 0; - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/middlename_show') - ->where('value!=?', '0'); -$showMiddlename = (bool) Mage::helper('customer/address')->getConfig('middlename_show') - || $setup->fetchOne($select) > 0; - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/suffix_show') - ->where('value!=?', '0'); -$showSuffix = (bool) Mage::helper('customer/address')->getConfig('suffix_show') - || $setup->fetchOne($select) > 0; - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/dob_show') - ->where('value!=?', '0'); -$showDob = (bool) Mage::helper('customer/address')->getConfig('dob_show') - || $setup->fetchOne($select) > 0; - -$select = $setup->select() - ->from($installer->getTable('core/config_data'), 'COUNT(*)') - ->where('path=?', 'customer/address/taxvat_show') - ->where('value!=?', '0'); -$showTaxVat = (bool) Mage::helper('customer/address')->getConfig('taxvat_show') - || $setup->fetchOne($select) > 0; - -/** - ***************************************************************************** - * customer/account/create/ - ***************************************************************************** - */ - -$setup->insert($installer->getTable('eav/form_type'), [ - 'code' => 'customer_account_create', - 'label' => 'customer_account_create', - 'is_system' => 1, - 'theme' => '', - 'store_id' => 0, -]); -$formTypeId = $setup->lastInsertId(); -$entityTypeId = $installer->getEntityTypeId('customer'); - -$setup->insert($installer->getTable('eav/form_type_entity'), [ - 'type_id' => $formTypeId, - 'entity_type_id' => $entityTypeId, -]); - -$setup->insert($installer->getTable('eav/form_fieldset'), [ - 'type_id' => $formTypeId, - 'code' => 'general', - 'sort_order' => 1, -]); -$fieldsetId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_fieldset_label'), [ - 'fieldset_id' => $fieldsetId, - 'store_id' => 0, - 'label' => 'Personal Information', -]); - -$elementSort = 0; -if ($showPrefix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'prefix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'firstname'), - 'sort_order' => $elementSort++, -]); -if ($showMiddlename) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'middlename'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'lastname'), - 'sort_order' => $elementSort++, -]); -if ($showSuffix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'suffix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'email'), - 'sort_order' => $elementSort++, -]); -if ($showDob) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'dob'), - 'sort_order' => $elementSort++, - ]); -} -if ($showTaxVat) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'taxvat'), - 'sort_order' => $elementSort++, - ]); -} - -/** - ***************************************************************************** - * customer/account/edit/ - ***************************************************************************** - */ - -$setup->insert($installer->getTable('eav/form_type'), [ - 'code' => 'customer_account_edit', - 'label' => 'customer_account_edit', - 'is_system' => 1, - 'theme' => '', - 'store_id' => 0, -]); -$formTypeId = $setup->lastInsertId(); -$entityTypeId = $installer->getEntityTypeId('customer'); - -$setup->insert($installer->getTable('eav/form_type_entity'), [ - 'type_id' => $formTypeId, - 'entity_type_id' => $entityTypeId, -]); - -$setup->insert($installer->getTable('eav/form_fieldset'), [ - 'type_id' => $formTypeId, - 'code' => 'general', - 'sort_order' => 1, -]); -$fieldsetId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_fieldset_label'), [ - 'fieldset_id' => $fieldsetId, - 'store_id' => 0, - 'label' => 'Account Information', -]); - -$elementSort = 0; -if ($showPrefix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'prefix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'firstname'), - 'sort_order' => $elementSort++, -]); -if ($showMiddlename) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'middlename'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'lastname'), - 'sort_order' => $elementSort++, -]); -if ($showSuffix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'suffix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'email'), - 'sort_order' => $elementSort++, -]); -if ($showDob) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'dob'), - 'sort_order' => $elementSort++, - ]); -} -if ($showTaxVat) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'taxvat'), - 'sort_order' => $elementSort++, - ]); -} - -/** - ***************************************************************************** - * customer/address/edit - ***************************************************************************** - */ - -$setup->insert($installer->getTable('eav/form_type'), [ - 'code' => 'customer_address_edit', - 'label' => 'customer_address_edit', - 'is_system' => 1, - 'theme' => '', - 'store_id' => 0, -]); -$formTypeId = $setup->lastInsertId(); -$entityTypeId = $installer->getEntityTypeId('customer_address'); - -$setup->insert($installer->getTable('eav/form_type_entity'), [ - 'type_id' => $formTypeId, - 'entity_type_id' => $entityTypeId, -]); - -$setup->insert($installer->getTable('eav/form_fieldset'), [ - 'type_id' => $formTypeId, - 'code' => 'contact', - 'sort_order' => 1, -]); -$fieldsetId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_fieldset_label'), [ - 'fieldset_id' => $fieldsetId, - 'store_id' => 0, - 'label' => 'Contact Information', -]); - -$elementSort = 0; -if ($showPrefix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'prefix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'firstname'), - 'sort_order' => $elementSort++, -]); -if ($showMiddlename) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'middlename'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'lastname'), - 'sort_order' => $elementSort++, -]); -if ($showSuffix) { - $setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'suffix'), - 'sort_order' => $elementSort++, - ]); -} -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'company'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'telephone'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'fax'), - 'sort_order' => $elementSort++, -]); - -$setup->insert($installer->getTable('eav/form_fieldset'), [ - 'type_id' => $formTypeId, - 'code' => 'address', - 'sort_order' => 2, -]); -$fieldsetId = $setup->lastInsertId(); - -$setup->insert($installer->getTable('eav/form_fieldset_label'), [ - 'fieldset_id' => $fieldsetId, - 'store_id' => 0, - 'label' => 'Address', -]); - -$elementSort = 0; -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'street'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'city'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'region'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'postcode'), - 'sort_order' => $elementSort++, -]); -$setup->insert($installer->getTable('eav/form_element'), [ - 'type_id' => $formTypeId, - 'fieldset_id' => $fieldsetId, - 'attribute_id' => $installer->getAttributeId($entityTypeId, 'country_id'), - 'sort_order' => $elementSort++, -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.12-1.4.0.0.0.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.12-1.4.0.0.0.php deleted file mode 100644 index 09920a6e9db..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.12-1.4.0.0.0.php +++ /dev/null @@ -1,68 +0,0 @@ -startSetup(); - -$installer->updateEntityType('customer', 'additional_attribute_table', 'customer/eav_attribute'); -$installer->updateEntityType('customer', 'entity_attribute_collection', 'customer/attribute_collection'); -$installer->updateEntityType('customer_address', 'additional_attribute_table', 'customer/eav_attribute'); -$installer->updateEntityType('customer_address', 'entity_attribute_collection', 'customer/address_attribute_collection'); -$installer->run(" -CREATE TABLE `{$installer->getTable('customer/eav_attribute')}` ( - `attribute_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, - `is_visible` tinyint(1) unsigned NOT NULL DEFAULT '1', - `is_visible_on_front` tinyint(1) unsigned NOT NULL DEFAULT '0', - `input_filter` varchar(255) NOT NULL, - `lines_to_divide_multiline` smallint(5) unsigned NOT NULL DEFAULT '0', - `min_text_length` int(11) unsigned NOT NULL DEFAULT '0', - `max_text_length` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`attribute_id`), - CONSTRAINT `FK_CUSTOMER_EAV_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav/attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); -$visibleAttributes = ['store_id', 'default_billing', 'default_shipping', 'confirmation']; -$stmt = $installer->getConnection()->select() - ->from($installer->getTable('eav/attribute'), ['attribute_id', 'attribute_code']) - ->where('entity_type_id = ?', $installer->getEntityTypeId('customer')) - ->orWhere('entity_type_id = ?', $installer->getEntityTypeId('customer_address')); -$result = $installer->getConnection()->fetchAll($stmt); - -$table = $installer->getTable('customer/eav_attribute'); -foreach ($result as $row) { - $_visible = true; - $_visibleOnFront = false; - $_inputFilter = ''; - $_linesToDivideMultiline = 0; - $_minLength = 0; - $_maxLength = 0; - if (in_array($row['attribute_code'], $visibleAttributes)) { - $_visible = false; - } - $attributes = [ - 'attribute_id' => $row['attribute_id'], - 'is_visible' => $_visible, - 'is_visible_on_front' => $_visibleOnFront, - 'input_filter' => $_inputFilter, - 'lines_to_divide_multiline' => $_linesToDivideMultiline, - 'min_text_length' => $_minLength, - 'max_text_length' => $_maxLength, - ]; - $installer->getConnection()->insert($table, $attributes); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.4-0.8.5.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.4-0.8.5.php deleted file mode 100644 index 4cba2c35c63..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.4-0.8.5.php +++ /dev/null @@ -1,21 +0,0 @@ -getAttribute('customer', 'birthdate', 'attribute_id')) { - $this->getConnection()->delete($this->getTable('eav_attribute'), 'attribute_id=' . $attrId); -} - -$this->installEntities(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.5-0.8.6.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.5-0.8.6.php deleted file mode 100644 index 9f4d2115847..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.5-0.8.6.php +++ /dev/null @@ -1,33 +0,0 @@ -startSetup(); - -$attributeId = $installer->getAttributeId('customer', 'email'); - -$installer->run(" - DELETE FROM {$this->getTable('customer_entity_varchar')} - WHERE attribute_id={$attributeId}; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.6-0.8.7.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.6-0.8.7.php deleted file mode 100644 index b848a158936..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.6-0.8.7.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup(); - -$installer->addAttribute('customer', 'taxvat', [ - 'label' => 'Tax/VAT number', - 'visible' => 1, - 'required' => 0, - 'position' => 1, -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.7-0.8.8.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.7-0.8.8.php deleted file mode 100644 index f6e2cdebf2f..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.7-0.8.8.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->addAttribute('customer', 'confirmation', [ - 'label' => 'Is confirmed', - 'visible' => false, - 'required' => false, -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.8-0.8.9.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.8-0.8.9.php deleted file mode 100644 index 1c419305ad0..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.8-0.8.9.php +++ /dev/null @@ -1,33 +0,0 @@ -startSetup(); - -$installer->getConnection()->addKey($installer->getTable('customer_address_entity_datetime'), 'IDX_VALUE', ['entity_id', 'attribute_id', 'value']); -$installer->getConnection()->addKey($installer->getTable('customer_address_entity_decimal'), 'IDX_VALUE', ['entity_id', 'attribute_id', 'value']); -$installer->getConnection()->addKey($installer->getTable('customer_address_entity_int'), 'IDX_VALUE', ['entity_id', 'attribute_id', 'value']); -$installer->getConnection()->addKey($installer->getTable('customer_address_entity_text'), 'IDX_VALUE', ['entity_id', 'attribute_id']); -$installer->getConnection()->addKey($installer->getTable('customer_address_entity_varchar'), 'IDX_VALUE', ['entity_id', 'attribute_id', 'value']); - -$installer->getConnection()->addKey($installer->getTable('customer_entity_datetime'), 'IDX_VALUE', ['entity_id', 'attribute_id', 'value']); -$installer->getConnection()->addKey($installer->getTable('customer_entity_decimal'), 'IDX_VALUE', ['entity_id', 'attribute_id', 'value']); -$installer->getConnection()->addKey($installer->getTable('customer_entity_int'), 'IDX_VALUE', ['entity_id', 'attribute_id', 'value']); -$installer->getConnection()->addKey($installer->getTable('customer_entity_text'), 'IDX_VALUE', ['entity_id', 'attribute_id']); -$installer->getConnection()->addKey($installer->getTable('customer_entity_varchar'), 'IDX_VALUE', ['entity_id', 'attribute_id', 'value']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.9-0.8.10.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.9-0.8.10.php deleted file mode 100644 index a4b6a3e55cb..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.9-0.8.10.php +++ /dev/null @@ -1,53 +0,0 @@ -getTable('customer/address_entity'); - -$types = ['datetime', 'decimal', 'int', 'text', 'varchar']; - -$tables = [$this->getTable('customer/entity'), - $this->getTable('customer/address_entity')]; - -foreach ($tables as $table) { - foreach ($types as $type) { - $tableName = $table . '_' . $type; - - $select = $installer->getConnection()->select() - ->from($tableName, [ - 'entity_id' => 'entity_id', - 'attribute_id' => 'attribute_id', - 'rows_count' => 'COUNT(*)']) - ->group(['entity_id', 'attribute_id']) - ->having('rows_count > 1'); - $query = $installer->getConnection()->query($select); - - while ($row = $query->fetch()) { - $sql = 'DELETE FROM `' . $tableName . '`' - . ' WHERE entity_id=? AND attribute_id=?' - . ' LIMIT ' . ($row['rows_count'] - 1); - $installer->getConnection()->query($sql, [ - $row['entity_id'], - $row['attribute_id'], - ]); - } - - $installer->getConnection()->addKey($tableName, 'IDX_ATTRIBUTE_VALUE', ['entity_id', 'attribute_id'], 'unique'); - } -} diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php deleted file mode 100644 index b9a2a9bfa3f..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php +++ /dev/null @@ -1,53 +0,0 @@ -startSetup(); - -$installer->addAttribute('customer', 'gender', [ - 'label' => 'Gender', - 'visible' => true, - 'required' => false, - 'type' => 'int', - 'input' => 'select', - 'source' => 'eav/entity_attribute_source_table', -]); - -$tableOptions = $installer->getTable('eav_attribute_option'); -$tableOptionValues = $installer->getTable('eav_attribute_option_value'); - -// add options for level of politeness -$attributeId = (int) $installer->getAttribute('customer', 'gender', 'attribute_id'); -foreach (['Male', 'Female'] as $sortOrder => $label) { - // add option - $data = [ - 'attribute_id' => $attributeId, - 'sort_order' => $sortOrder, - ]; - $installer->getConnection()->insert($tableOptions, $data); - - // add option label - $optionId = (int) $installer->getConnection()->lastInsertId($tableOptions, 'option_id'); - $data = [ - 'option_id' => $optionId, - 'store_id' => 0, - 'value' => $label, - ]; - $installer->getConnection()->insert($tableOptionValues, $data); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php deleted file mode 100644 index efdf5b8e5f3..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$this->updateAttribute('customer', 'default_billing', 'frontend_label', 'Default Billing Address'); -$this->updateAttribute('customer', 'default_shipping', 'frontend_label', 'Default Shipping Address'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php deleted file mode 100644 index 68f6321b0f2..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php +++ /dev/null @@ -1,26 +0,0 @@ -getConnection()->addColumn( - $installer->getTable('customer/eav_attribute'), - 'data_model', - 'varchar(255) default NULL', -); - -$installer->updateAttribute('customer_address', 'postcode', 'data_model', 'customer/attribute_data_postcode'); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php deleted file mode 100644 index ac02258ef86..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php +++ /dev/null @@ -1,45 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('customer_eav_attribute_website'), - 'FK_CUSTOMER_EAV_ATTRIBUTE_WEBSITE_ATTRIBUTE_EAV_ATTRIBUTE', -); -$installer->getConnection()->dropForeignKey( - $installer->getTable('customer_eav_attribute_website'), - 'FK_CUSTOMER_EAV_ATTRIBUTE_WEBSITE_WEBSITE_CORE_WEBSITE', -); - -$installer->getConnection()->addConstraint( - 'FK_CUST_EAV_ATTR_WEBST_ATTR_EAV_ATTR', - $installer->getTable('customer_eav_attribute_website'), - 'attribute_id', - $installer->getTable('eav_attribute'), - 'attribute_id', -); -$installer->getConnection()->addConstraint( - 'FK_CUST_EAV_ATTR_WEBST_WEBST_CORE_WEBST', - $installer->getTable('customer_eav_attribute_website'), - 'website_id', - $installer->getTable('core_website'), - 'website_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php deleted file mode 100644 index 911fa924c26..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php +++ /dev/null @@ -1,29 +0,0 @@ -startSetup(); - -$this->addAttribute('customer', 'created_at', [ - 'type' => 'static', - 'label' => 'Created At', - 'visible' => false, - 'required' => false, - 'input' => 'date', -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php deleted file mode 100644 index 08bbdaea726..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php +++ /dev/null @@ -1,20 +0,0 @@ -updateAttribute('customer_address', 'region_id', 'frontend_label', 'State/Province'); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php deleted file mode 100644 index e20342990ec..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->updateAttribute('customer', 'dob', 'backend_model', ''); -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php deleted file mode 100644 index ba63875a70c..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php +++ /dev/null @@ -1,20 +0,0 @@ -updateEntityType('customer_address', 'entity_model', 'customer/address'); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php deleted file mode 100644 index d0105355e38..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php +++ /dev/null @@ -1,61 +0,0 @@ -run(" -CREATE TABLE `{$installer->getTable('customer/form_attribute')}` ( - `form_code` char(32) NOT NULL, - `attribute_id` smallint UNSIGNED NOT NULL, - PRIMARY KEY(`form_code`, `attribute_id`), - KEY `IDX_CUSTOMER_FORM_ATTRIBUTE_ATTRIBUTE` (`attribute_id`), - CONSTRAINT `FK_CUSTOMER_FORM_ATTRIBUTE_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Customer attributes/forms relations'; -"); - -$installer->getConnection()->dropColumn($installer->getTable('customer/eav_attribute'), 'is_visible_on_front'); -$installer->getConnection()->changeColumn( - $installer->getTable('customer/eav_attribute'), - 'lines_to_divide_multiline', - 'multiline_count', - 'TINYINT UNSIGNED NOT NULL DEFAULT 1', -); -$installer->getConnection()->dropColumn($installer->getTable('customer/eav_attribute'), 'min_text_length'); -$installer->getConnection()->dropColumn($installer->getTable('customer/eav_attribute'), 'max_text_length'); -$installer->getConnection()->modifyColumn( - $installer->getTable('customer/eav_attribute'), - 'input_filter', - 'varchar(255) DEFAULT NULL', -); -$installer->getConnection()->addColumn( - $installer->getTable('customer/eav_attribute'), - 'validate_rules', - 'text DEFAULT NULL', -); -$installer->getConnection()->addColumn( - $installer->getTable('customer/eav_attribute'), - 'is_system', - 'TINYINT UNSIGNED NOT NULL DEFAULT 0', -); -$installer->getConnection()->addColumn( - $installer->getTable('customer/eav_attribute'), - 'sort_order', - 'INT UNSIGNED NOT NULL DEFAULT 0', -); - -$installer->updateEntityType('customer', 'attribute_model', 'customer/attribute'); -$installer->updateEntityType('customer_address', 'attribute_model', 'customer/attribute'); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php deleted file mode 100644 index 8ccf4329c1d..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php +++ /dev/null @@ -1,38 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$installer->getTable('customer/eav_attribute_website')}` ( - `attribute_id` smallint(5) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `is_visible` tinyint(1) unsigned DEFAULT NULL, - `is_required` tinyint(1) unsigned DEFAULT NULL, - `default_value` text, - `multiline_count` tinyint(3) unsigned DEFAULT NULL, - PRIMARY KEY (`attribute_id`, `website_id`), - KEY `IDX_WEBSITE` (`website_id`), - CONSTRAINT `FK_CUSTOMER_EAV_ATTRIBUTE_WEBSITE_ATTRIBUTE_EAV_ATTRIBUTE` FOREIGN KEY (`attribute_id`) - REFERENCES `{$installer->getTable('eav/attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CUSTOMER_EAV_ATTRIBUTE_WEBSITE_WEBSITE_CORE_WEBSITE` FOREIGN KEY (`website_id`) - REFERENCES `{$installer->getTable('core/website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php deleted file mode 100644 index 980d9c27aa7..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php +++ /dev/null @@ -1,21 +0,0 @@ -updateEntityType('customer', 'entity_attribute_collection', 'customer/attribute_collection'); -$installer->updateEntityType('customer_address', 'entity_attribute_collection', 'customer/address_attribute_collection'); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 742e176fdb1..00000000000 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,1912 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('customer/address_entity'), - 'FK_CUSTOMER_ADDRESS_CUSTOMER_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('customer/eav_attribute'), - 'FK_CUSTOMER_EAV_ATTRIBUTE_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('customer/eav_attribute_website'), - 'FK_CUST_EAV_ATTR_WEBST_ATTR_EAV_ATTR', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('customer/eav_attribute_website'), - 'FK_CUST_EAV_ATTR_WEBST_WEBST_CORE_WEBST', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('customer/entity'), - 'FK_CUSTOMER_ENTITY_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('customer/entity'), - 'FK_CUSTOMER_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('customer/form_attribute'), - 'FK_CUSTOMER_FORM_ATTRIBUTE_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_datetime'), - 'FK_CUSTOMER_ADDRESS_DATETIME_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_datetime'), - 'FK_CUSTOMER_ADDRESS_DATETIME_ENTITY', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_datetime'), - 'FK_CUSTOMER_ADDRESS_DATETIME_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_decimal'), - 'FK_CUSTOMER_ADDRESS_DECIMAL_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_decimal'), - 'FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_decimal'), - 'FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_int'), - 'FK_CUSTOMER_ADDRESS_INT_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_int'), - 'FK_CUSTOMER_ADDRESS_INT_ENTITY', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_int'), - 'FK_CUSTOMER_ADDRESS_INT_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_text'), - 'FK_CUSTOMER_ADDRESS_TEXT_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_text'), - 'FK_CUSTOMER_ADDRESS_TEXT_ENTITY', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_text'), - 'FK_CUSTOMER_ADDRESS_TEXT_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_varchar'), - 'FK_CUSTOMER_ADDRESS_VARCHAR_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_varchar'), - 'FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_address_entity_varchar'), - 'FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_datetime'), - 'FK_CUSTOMER_DATETIME_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_datetime'), - 'FK_CUSTOMER_DATETIME_ENTITY', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_datetime'), - 'FK_CUSTOMER_DATETIME_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_decimal'), - 'FK_CUSTOMER_DECIMAL_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_decimal'), - 'FK_CUSTOMER_DECIMAL_ENTITY', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_decimal'), - 'FK_CUSTOMER_DECIMAL_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_int'), - 'FK_CUSTOMER_INT_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_int'), - 'FK_CUSTOMER_INT_ENTITY', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_int'), - 'FK_CUSTOMER_INT_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_text'), - 'FK_CUSTOMER_TEXT_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_text'), - 'FK_CUSTOMER_TEXT_ENTITY', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_text'), - 'FK_CUSTOMER_TEXT_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_varchar'), - 'FK_CUSTOMER_VARCHAR_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_varchar'), - 'FK_CUSTOMER_VARCHAR_ENTITY', -); - -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('customer_entity_varchar'), - 'FK_CUSTOMER_VARCHAR_ENTITY_TYPE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('customer/address_entity'), - 'FK_CUSTOMER_ADDRESS_CUSTOMER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('customer/eav_attribute_website'), - 'IDX_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('customer/entity'), - 'FK_CUSTOMER_ENTITY_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('customer/entity'), - 'IDX_ENTITY_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('customer/entity'), - 'IDX_AUTH', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('customer/entity'), - 'FK_CUSTOMER_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('customer/form_attribute'), - 'IDX_CUSTOMER_FORM_ATTRIBUTE_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_datetime'), - 'IDX_ATTRIBUTE_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_datetime'), - 'FK_CUSTOMER_ADDRESS_DATETIME_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_datetime'), - 'FK_CUSTOMER_ADDRESS_DATETIME_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_datetime'), - 'FK_CUSTOMER_ADDRESS_DATETIME_ENTITY', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_datetime'), - 'IDX_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_decimal'), - 'IDX_ATTRIBUTE_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_decimal'), - 'FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_decimal'), - 'FK_CUSTOMER_ADDRESS_DECIMAL_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_decimal'), - 'FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_decimal'), - 'IDX_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_int'), - 'IDX_ATTRIBUTE_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_int'), - 'FK_CUSTOMER_ADDRESS_INT_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_int'), - 'FK_CUSTOMER_ADDRESS_INT_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_int'), - 'FK_CUSTOMER_ADDRESS_INT_ENTITY', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_int'), - 'IDX_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_text'), - 'IDX_ATTRIBUTE_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_text'), - 'FK_CUSTOMER_ADDRESS_TEXT_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_text'), - 'FK_CUSTOMER_ADDRESS_TEXT_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_text'), - 'FK_CUSTOMER_ADDRESS_TEXT_ENTITY', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_varchar'), - 'IDX_ATTRIBUTE_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_varchar'), - 'FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_varchar'), - 'FK_CUSTOMER_ADDRESS_VARCHAR_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_varchar'), - 'FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_address_entity_varchar'), - 'IDX_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_datetime'), - 'IDX_ATTRIBUTE_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_datetime'), - 'FK_CUSTOMER_DATETIME_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_datetime'), - 'FK_CUSTOMER_DATETIME_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_datetime'), - 'FK_CUSTOMER_DATETIME_ENTITY', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_datetime'), - 'IDX_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_decimal'), - 'IDX_ATTRIBUTE_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_decimal'), - 'FK_CUSTOMER_DECIMAL_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_decimal'), - 'FK_CUSTOMER_DECIMAL_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_decimal'), - 'FK_CUSTOMER_DECIMAL_ENTITY', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_decimal'), - 'IDX_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_int'), - 'IDX_ATTRIBUTE_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_int'), - 'FK_CUSTOMER_INT_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_int'), - 'FK_CUSTOMER_INT_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_int'), - 'FK_CUSTOMER_INT_ENTITY', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_int'), - 'IDX_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_text'), - 'IDX_ATTRIBUTE_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_text'), - 'FK_CUSTOMER_TEXT_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_text'), - 'FK_CUSTOMER_TEXT_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_text'), - 'FK_CUSTOMER_TEXT_ENTITY', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_varchar'), - 'IDX_ATTRIBUTE_VALUE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_varchar'), - 'FK_CUSTOMER_VARCHAR_ENTITY_TYPE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_varchar'), - 'FK_CUSTOMER_VARCHAR_ATTRIBUTE', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_varchar'), - 'FK_CUSTOMER_VARCHAR_ENTITY', -); - -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('customer_entity_varchar'), - 'IDX_VALUE', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('customer/entity') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_set_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Set Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Website Id', - ], - 'email' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Email', - ], - 'group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Group Id', - ], - 'increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Increment Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Updated At', - ], - 'is_active' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Is Active', - ], - ], - 'comment' => 'Customer Entity', - ], - $installer->getTable('customer/address_entity') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_set_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Set Id', - ], - 'increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Increment Id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Parent Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Updated At', - ], - 'is_active' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Is Active', - ], - ], - 'comment' => 'Customer Address Entity', - ], - $installer->getTable('customer/customer_group') => [ - 'columns' => [ - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Customer Group Id', - ], - 'customer_group_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'comment' => 'Customer Group Code', - ], - 'tax_class_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Tax Class Id', - ], - ], - 'comment' => 'Customer Group', - ], - $installer->getTable('customer/eav_attribute') => [ - 'columns' => [ - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Attribute Id', - ], - 'is_visible' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Is Visible', - ], - 'input_filter' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Input Filter', - ], - 'multiline_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Multiline Count', - ], - 'validate_rules' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Validate Rules', - ], - 'is_system' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is System', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - 'data_model' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Data Model', - ], - ], - 'comment' => 'Customer Eav Attribute', - ], - $installer->getTable('customer/eav_attribute_website') => [ - 'columns' => [ - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Attribute Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'is_visible' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Is Visible', - ], - 'is_required' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Is Required', - ], - 'default_value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Default Value', - ], - 'multiline_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Multiline Count', - ], - ], - 'comment' => 'Customer Eav Attribute Website', - ], - $installer->getTable('customer/form_attribute') => [ - 'columns' => [ - 'form_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Form Code', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Attribute Id', - ], - ], - 'comment' => 'Customer Form Attribute', - ], - $installer->getTable('customer_address_entity_datetime') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATETIME, - 'nullable' => false, - 'default' => '0000-00-00 00:00:00', - 'comment' => 'Value', - ], - ], - 'comment' => 'Customer Address Entity Datetime', - ], - $installer->getTable('customer_address_entity_decimal') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Value', - ], - ], - 'comment' => 'Customer Address Entity Decimal', - ], - $installer->getTable('customer_address_entity_int') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Value', - ], - ], - 'comment' => 'Customer Address Entity Int', - ], - $installer->getTable('customer_address_entity_text') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'nullable' => false, - 'comment' => 'Value', - ], - ], - 'comment' => 'Customer Address Entity Text', - ], - $installer->getTable('customer_address_entity_varchar') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Value', - ], - ], - 'comment' => 'Customer Address Entity Varchar', - ], - $installer->getTable('customer_entity_datetime') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATETIME, - 'nullable' => false, - 'default' => '0000-00-00 00:00:00', - 'comment' => 'Value', - ], - ], - 'comment' => 'Customer Entity Datetime', - ], - $installer->getTable('customer_entity_decimal') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Value', - ], - ], - 'comment' => 'Customer Entity Decimal', - ], - $installer->getTable('customer_entity_int') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Value', - ], - ], - 'comment' => 'Customer Entity Int', - ], - $installer->getTable('customer_entity_text') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'nullable' => false, - 'comment' => 'Value', - ], - ], - 'comment' => 'Customer Entity Text', - ], - $installer->getTable('customer_entity_varchar') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Value', - ], - ], - 'comment' => 'Customer Entity Varchar', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('customer/address_entity'), - $installer->getIdxName('customer/address_entity', ['parent_id']), - ['parent_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$installer->getConnection()->addIndex( - $installer->getTable('customer/eav_attribute_website'), - $installer->getIdxName('customer/eav_attribute_website', ['website_id']), - ['website_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$installer->getConnection()->addIndex( - $installer->getTable('customer/entity'), - $installer->getIdxName('customer/entity', ['store_id']), - ['store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$installer->getConnection()->addIndex( - $installer->getTable('customer/entity'), - $installer->getIdxName('customer/entity', ['entity_type_id']), - ['entity_type_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$installer->getConnection()->addIndex( - $installer->getTable('customer/entity'), - $installer->getIdxName('customer/entity', ['email', 'website_id']), - ['email', 'website_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$installer->getConnection()->addIndex( - $installer->getTable('customer/entity'), - $installer->getIdxName('customer/entity', ['website_id']), - ['website_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$installer->getConnection()->addIndex( - $installer->getTable('customer/form_attribute'), - $installer->getIdxName('customer/form_attribute', ['attribute_id']), - ['attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_datetime'), - $installer->getIdxName( - 'customer_address_entity_datetime', - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_datetime'), - $installer->getIdxName('customer_address_entity_datetime', ['entity_type_id']), - ['entity_type_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_datetime'), - $installer->getIdxName('customer_address_entity_datetime', ['attribute_id']), - ['attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_datetime'), - $installer->getIdxName('customer_address_entity_datetime', ['entity_id']), - ['entity_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_datetime'), - $installer->getIdxName('customer_address_entity_datetime', ['entity_id', 'attribute_id', 'value']), - ['entity_id', 'attribute_id', 'value'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_decimal'), - $installer->getIdxName( - 'customer_address_entity_decimal', - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_decimal'), - $installer->getIdxName('customer_address_entity_decimal', ['entity_type_id']), - ['entity_type_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_decimal'), - $installer->getIdxName('customer_address_entity_decimal', ['attribute_id']), - ['attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_decimal'), - $installer->getIdxName('customer_address_entity_decimal', ['entity_id']), - ['entity_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_decimal'), - $installer->getIdxName('customer_address_entity_decimal', ['entity_id', 'attribute_id', 'value']), - ['entity_id', 'attribute_id', 'value'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_int'), - $installer->getIdxName( - 'customer_address_entity_int', - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_int'), - $installer->getIdxName('customer_address_entity_int', ['entity_type_id']), - ['entity_type_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_int'), - $installer->getIdxName('customer_address_entity_int', ['attribute_id']), - ['attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_int'), - $installer->getIdxName('customer_address_entity_int', ['entity_id']), - ['entity_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_int'), - $installer->getIdxName('customer_address_entity_int', ['entity_id', 'attribute_id', 'value']), - ['entity_id', 'attribute_id', 'value'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_text'), - $installer->getIdxName( - 'customer_address_entity_text', - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_text'), - $installer->getIdxName('customer_address_entity_text', ['entity_type_id']), - ['entity_type_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_text'), - $installer->getIdxName('customer_address_entity_text', ['attribute_id']), - ['attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_text'), - $installer->getIdxName('customer_address_entity_text', ['entity_id']), - ['entity_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_varchar'), - $installer->getIdxName( - 'customer_address_entity_varchar', - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_varchar'), - $installer->getIdxName('customer_address_entity_varchar', ['entity_type_id']), - ['entity_type_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_varchar'), - $installer->getIdxName('customer_address_entity_varchar', ['attribute_id']), - ['attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_varchar'), - $installer->getIdxName('customer_address_entity_varchar', ['entity_id']), - ['entity_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_address_entity_varchar'), - $installer->getIdxName('customer_address_entity_varchar', ['entity_id', 'attribute_id', 'value']), - ['entity_id', 'attribute_id', 'value'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_datetime'), - $installer->getIdxName( - 'customer_entity_datetime', - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_datetime'), - $installer->getIdxName('customer_entity_datetime', ['entity_type_id']), - ['entity_type_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_datetime'), - $installer->getIdxName('customer_entity_datetime', ['attribute_id']), - ['attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_datetime'), - $installer->getIdxName('customer_entity_datetime', ['entity_id']), - ['entity_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_datetime'), - $installer->getIdxName('customer_entity_datetime', ['entity_id', 'attribute_id', 'value']), - ['entity_id', 'attribute_id', 'value'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_decimal'), - $installer->getIdxName( - 'customer_entity_decimal', - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_decimal'), - $installer->getIdxName('customer_entity_decimal', ['entity_type_id']), - ['entity_type_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_decimal'), - $installer->getIdxName('customer_entity_decimal', ['attribute_id']), - ['attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_decimal'), - $installer->getIdxName('customer_entity_decimal', ['entity_id']), - ['entity_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_decimal'), - $installer->getIdxName('customer_entity_decimal', ['entity_id', 'attribute_id', 'value']), - ['entity_id', 'attribute_id', 'value'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_int'), - $installer->getIdxName( - 'customer_entity_int', - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_int'), - $installer->getIdxName('customer_entity_int', ['entity_type_id']), - ['entity_type_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_int'), - $installer->getIdxName('customer_entity_int', ['attribute_id']), - ['attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_int'), - $installer->getIdxName('customer_entity_int', ['entity_id']), - ['entity_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_int'), - $installer->getIdxName('customer_entity_int', ['entity_id', 'attribute_id', 'value']), - ['entity_id', 'attribute_id', 'value'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_text'), - $installer->getIdxName( - 'customer_entity_text', - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_text'), - $installer->getIdxName('customer_entity_text', ['entity_type_id']), - ['entity_type_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_text'), - $installer->getIdxName('customer_entity_text', ['attribute_id']), - ['attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_text'), - $installer->getIdxName('customer_entity_text', ['entity_id']), - ['entity_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_varchar'), - $installer->getIdxName( - 'customer_entity_varchar', - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_varchar'), - $installer->getIdxName('customer_entity_varchar', ['entity_type_id']), - ['entity_type_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_varchar'), - $installer->getIdxName('customer_entity_varchar', ['attribute_id']), - ['attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_varchar'), - $installer->getIdxName('customer_entity_varchar', ['entity_id']), - ['entity_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -$connection = $installer->getConnection()->addIndex( - $installer->getTable('customer_entity_varchar'), - $installer->getIdxName('customer_entity_varchar', ['entity_id', 'attribute_id', 'value']), - ['entity_id', 'attribute_id', 'value'], - Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('customer/eav_attribute', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('customer/eav_attribute'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('customer/address_entity', 'parent_id', 'customer/entity', 'entity_id'), - $installer->getTable('customer/address_entity'), - 'parent_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('customer/eav_attribute_website', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('customer/eav_attribute_website'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('customer/eav_attribute_website', 'website_id', 'core/website', 'website_id'), - $installer->getTable('customer/eav_attribute_website'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('customer/entity', 'store_id', 'core/store', 'store_id'), - $installer->getTable('customer/entity'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('customer/entity', 'website_id', 'core/website', 'website_id'), - $installer->getTable('customer/entity'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('customer/form_attribute', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('customer/form_attribute'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_datetime', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('customer_address_entity_datetime'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_datetime', 'entity_id', 'customer_address_entity', 'entity_id'), - $installer->getTable('customer_address_entity_datetime'), - 'entity_id', - $installer->getTable('customer_address_entity'), - 'entity_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_datetime', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('customer_address_entity_datetime'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_decimal', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('customer_address_entity_decimal'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_decimal', 'entity_id', 'customer_address_entity', 'entity_id'), - $installer->getTable('customer_address_entity_decimal'), - 'entity_id', - $installer->getTable('customer_address_entity'), - 'entity_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_decimal', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('customer_address_entity_decimal'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_int', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('customer_address_entity_int'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_int', 'entity_id', 'customer_address_entity', 'entity_id'), - $installer->getTable('customer_address_entity_int'), - 'entity_id', - $installer->getTable('customer_address_entity'), - 'entity_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_int', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('customer_address_entity_int'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_text', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('customer_address_entity_text'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_text', 'entity_id', 'customer_address_entity', 'entity_id'), - $installer->getTable('customer_address_entity_text'), - 'entity_id', - $installer->getTable('customer_address_entity'), - 'entity_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_text', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('customer_address_entity_text'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_varchar', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('customer_address_entity_varchar'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_varchar', 'entity_id', 'customer_address_entity', 'entity_id'), - $installer->getTable('customer_address_entity_varchar'), - 'entity_id', - $installer->getTable('customer_address_entity'), - 'entity_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_address_entity_varchar', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('customer_address_entity_varchar'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_datetime', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('customer_entity_datetime'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_datetime', 'entity_id', 'customer/entity', 'entity_id'), - $installer->getTable('customer_entity_datetime'), - 'entity_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_datetime', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('customer_entity_datetime'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_decimal', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('customer_entity_decimal'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_decimal', 'entity_id', 'customer/entity', 'entity_id'), - $installer->getTable('customer_entity_decimal'), - 'entity_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_decimal', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('customer_entity_decimal'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_int', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('customer_entity_int'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_int', 'entity_id', 'customer/entity', 'entity_id'), - $installer->getTable('customer_entity_int'), - 'entity_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_int', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('customer_entity_int'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_text', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('customer_entity_text'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_text', 'entity_id', 'customer/entity', 'entity_id'), - $installer->getTable('customer_entity_text'), - 'entity_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_text', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('customer_entity_text'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_varchar', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('customer_entity_varchar'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_varchar', 'entity_id', 'customer/entity', 'entity_id'), - $installer->getTable('customer_entity_varchar'), - 'entity_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('customer_entity_varchar', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('customer_entity_varchar'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -/** - * Update customer address attributes - */ -$installer->updateAttribute( - 'customer_address', - 'region', - 'backend_model', - 'customer/entity_address_attribute_backend_region', -); - -$installer->updateAttribute( - 'customer_address', - 'street', - 'backend_model', - 'customer/entity_address_attribute_backend_street', -); - -$installer->updateAttribute( - 'customer_address', - 'region_id', - 'source_model', - 'customer/entity_address_attribute_source_region', -); - -$installer->updateAttribute( - 'customer_address', - 'country_id', - 'source_model', - 'customer/entity_address_attribute_source_country', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 58bcff1af22..00000000000 --- a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,48 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS `{$this->getTable('dataflow_session')}`; -CREATE TABLE `{$this->getTable('dataflow_session')}` ( - `session_id` int(11) NOT NULL auto_increment, - `user_id` int(11) NOT NULL, - `created_date` datetime default NULL, - `file` varchar(255) character set utf8 default NULL, - `type` varchar(32) character set utf8 default NULL, - `direction` varchar(32) character set utf8 default NULL, - `comment` varchar(255) character set utf8 default NULL, - PRIMARY KEY (`session_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$this->getTable('dataflow_import_data')}`; -CREATE TABLE `{$this->getTable('dataflow_import_data')}` ( - `import_id` int(11) NOT NULL auto_increment, - `session_id` int(11) default NULL, - `serial_number` int(11) NOT NULL default '0', - `value` text character set utf8, - `status` int(1) NOT NULL default '0', - PRIMARY KEY (`import_id`), - KEY `FK_dataflow_import_data` (`session_id`), - CONSTRAINT `FK_dataflow_import_data` FOREIGN KEY (`session_id`) REFERENCES `{$this->getTable('dataflow_session')}` (`session_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 6853f192f1a..00000000000 --- a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,57 +0,0 @@ -startSetup()->run(" - -drop table if exists {$this->getTable('dataflow_profile')}; -CREATE TABLE {$this->getTable('dataflow_profile')} ( - `profile_id` int(10) unsigned NOT NULL auto_increment, - `name` varchar(255) NOT NULL default '', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `actions_xml` text, - `gui_data` text, - `direction` enum('import','export') default NULL, - `entity_type` varchar(64) NOT NULL default '', - `store_id` smallint(5) unsigned NOT NULL default '0', - `data_transfer` enum('file', 'interactive'), - PRIMARY KEY (`profile_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -drop table if exists {$this->getTable('dataflow_profile_history')}; -CREATE TABLE {$this->getTable('dataflow_profile_history')} ( - `history_id` int(10) unsigned NOT NULL auto_increment, - `profile_id` int(10) unsigned NOT NULL default '0', - `action_code` varchar(64) default NULL, - `user_id` int(10) unsigned NOT NULL default '0', - `performed_at` datetime default NULL, - PRIMARY KEY (`history_id`), - KEY `FK_dataflow_profile_history` (`profile_id`), - CONSTRAINT `FK_dataflow_profile_history` FOREIGN KEY (`profile_id`) REFERENCES {$this->getTable('dataflow_profile')} (`profile_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -if ($this->tableExists($this->getTable('core_convert_profile'))) { - $this->run(" - insert into {$this->getTable('dataflow_profile')} select * from {$this->getTable('core_convert_profile')}; - insert into {$this->getTable('dataflow_profile_history')} select * from {$this->getTable('core_convert_history')}; - - drop table {$this->getTable('core_convert_profile')}; - drop table {$this->getTable('core_convert_history')}; - "); -} - -$this->endSetup(); diff --git a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index c132924cb30..00000000000 --- a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup()->run(" -INSERT INTO `{$this->getTable('dataflow_profile')}` (`profile_id`, `name`, `created_at`, `updated_at`, `actions_xml`, `gui_data`, `direction`, `entity_type`, `store_id`, `data_transfer`) VALUES -(NULL, 'Export All Products', NOW(), NOW(), '\r\n \r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n true\r\n\r\n\r\n\r\n file\r\n var/export\r\n \r\n\r\n\r\n', 'a:5:{s:4:\"file\";a:7:{s:4:\"type\";s:4:\"file\";s:8:\"filename\";s:23:\"export_all_products.csv\";s:4:\"path\";s:10:\"var/export\";s:4:\"host\";s:0:\"\";s:4:\"user\";s:0:\"\";s:8:\"password\";s:0:\"\";s:7:\"passive\";s:0:\"\";}s:5:\"parse\";a:5:{s:4:\"type\";s:3:\"csv\";s:12:\"single_sheet\";s:0:\"\";s:9:\"delimiter\";s:1:\",\";s:7:\"enclose\";s:1:\"\"\";s:10:\"fieldnames\";s:4:\"true\";}s:3:\"map\";a:3:{s:14:\"only_specified\";s:0:\"\";s:7:\"product\";a:2:{s:2:\"db\";a:0:{}s:4:\"file\";a:0:{}}s:8:\"customer\";a:2:{s:2:\"db\";a:0:{}s:4:\"file\";a:0:{}}}s:7:\"product\";a:1:{s:6:\"filter\";a:8:{s:4:\"name\";s:0:\"\";s:3:\"sku\";s:0:\"\";s:4:\"type\";s:1:\"0\";s:13:\"attribute_set\";s:0:\"\";s:5:\"price\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}s:3:\"qty\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}s:10:\"visibility\";s:1:\"0\";s:6:\"status\";s:1:\"0\";}}s:8:\"customer\";a:1:{s:6:\"filter\";a:10:{s:9:\"firstname\";s:0:\"\";s:8:\"lastname\";s:0:\"\";s:5:\"email\";s:0:\"\";s:5:\"group\";s:1:\"0\";s:10:\"adressType\";s:15:\"default_billing\";s:9:\"telephone\";s:0:\"\";s:8:\"postcode\";s:0:\"\";s:7:\"country\";s:0:\"\";s:6:\"region\";s:0:\"\";s:10:\"created_at\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}}}}', 'export', 'product', 0, 'file'), -(NULL, 'Export Product Stocks', NOW(), NOW(), '\r\n \r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n true\r\n\r\n\r\n\r\n \r\n \r\n true\r\n\r\n\r\n\r\n file\r\n var/export\r\n \r\n\r\n\r\n', 'a:5:{s:4:\"file\";a:7:{s:4:\"type\";s:4:\"file\";s:8:\"filename\";s:25:\"export_product_stocks.csv\";s:4:\"path\";s:10:\"var/export\";s:4:\"host\";s:0:\"\";s:4:\"user\";s:0:\"\";s:8:\"password\";s:0:\"\";s:7:\"passive\";s:0:\"\";}s:5:\"parse\";a:5:{s:4:\"type\";s:3:\"csv\";s:12:\"single_sheet\";s:0:\"\";s:9:\"delimiter\";s:1:\",\";s:7:\"enclose\";s:1:\"\"\";s:10:\"fieldnames\";s:4:\"true\";}s:3:\"map\";a:3:{s:14:\"only_specified\";s:4:\"true\";s:7:\"product\";a:2:{s:2:\"db\";a:4:{i:1;s:5:\"store\";i:2;s:3:\"sku\";i:3;s:3:\"qty\";i:4;s:11:\"is_in_stock\";}s:4:\"file\";a:4:{i:1;s:5:\"store\";i:2;s:3:\"sku\";i:3;s:3:\"qty\";i:4;s:11:\"is_in_stock\";}}s:8:\"customer\";a:2:{s:2:\"db\";a:0:{}s:4:\"file\";a:0:{}}}s:7:\"product\";a:1:{s:6:\"filter\";a:8:{s:4:\"name\";s:0:\"\";s:3:\"sku\";s:0:\"\";s:4:\"type\";s:1:\"0\";s:13:\"attribute_set\";s:0:\"\";s:5:\"price\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}s:3:\"qty\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}s:10:\"visibility\";s:1:\"0\";s:6:\"status\";s:1:\"0\";}}s:8:\"customer\";a:1:{s:6:\"filter\";a:10:{s:9:\"firstname\";s:0:\"\";s:8:\"lastname\";s:0:\"\";s:5:\"email\";s:0:\"\";s:5:\"group\";s:1:\"0\";s:10:\"adressType\";s:15:\"default_billing\";s:9:\"telephone\";s:0:\"\";s:8:\"postcode\";s:0:\"\";s:7:\"country\";s:0:\"\";s:6:\"region\";s:0:\"\";s:10:\"created_at\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}}}}', 'export', 'product', 0, 'file'), -(NULL, 'Import All Products', NOW(), NOW(), '\r\n \r\n \r\n true\r\n \r\n catalog/convert_adapter_product\r\n parse\r\n', 'a:5:{s:4:\"file\";a:7:{s:4:\"type\";s:4:\"file\";s:8:\"filename\";s:23:\"export_all_products.csv\";s:4:\"path\";s:10:\"var/export\";s:4:\"host\";s:0:\"\";s:4:\"user\";s:0:\"\";s:8:\"password\";s:0:\"\";s:7:\"passive\";s:0:\"\";}s:5:\"parse\";a:5:{s:4:\"type\";s:3:\"csv\";s:12:\"single_sheet\";s:0:\"\";s:9:\"delimiter\";s:1:\",\";s:7:\"enclose\";s:1:\"\"\";s:10:\"fieldnames\";s:4:\"true\";}s:3:\"map\";a:3:{s:14:\"only_specified\";s:0:\"\";s:7:\"product\";a:2:{s:2:\"db\";a:0:{}s:4:\"file\";a:0:{}}s:8:\"customer\";a:2:{s:2:\"db\";a:0:{}s:4:\"file\";a:0:{}}}s:7:\"product\";a:1:{s:6:\"filter\";a:8:{s:4:\"name\";s:0:\"\";s:3:\"sku\";s:0:\"\";s:4:\"type\";s:1:\"0\";s:13:\"attribute_set\";s:0:\"\";s:5:\"price\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}s:3:\"qty\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}s:10:\"visibility\";s:1:\"0\";s:6:\"status\";s:1:\"0\";}}s:8:\"customer\";a:1:{s:6:\"filter\";a:10:{s:9:\"firstname\";s:0:\"\";s:8:\"lastname\";s:0:\"\";s:5:\"email\";s:0:\"\";s:5:\"group\";s:1:\"0\";s:10:\"adressType\";s:15:\"default_billing\";s:9:\"telephone\";s:0:\"\";s:8:\"postcode\";s:0:\"\";s:7:\"country\";s:0:\"\";s:6:\"region\";s:0:\"\";s:10:\"created_at\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}}}}', 'import', 'product', 0, 'interactive'), -(NULL, 'Import Product Stocks', NOW(), NOW(), '\r\n \r\n \r\n true\r\n \r\n catalog/convert_adapter_product\r\n parse\r\n', 'a:5:{s:4:\"file\";a:7:{s:4:\"type\";s:4:\"file\";s:8:\"filename\";s:18:\"export_product.csv\";s:4:\"path\";s:10:\"var/export\";s:4:\"host\";s:0:\"\";s:4:\"user\";s:0:\"\";s:8:\"password\";s:0:\"\";s:7:\"passive\";s:0:\"\";}s:5:\"parse\";a:5:{s:4:\"type\";s:3:\"csv\";s:12:\"single_sheet\";s:0:\"\";s:9:\"delimiter\";s:1:\",\";s:7:\"enclose\";s:1:\"\"\";s:10:\"fieldnames\";s:4:\"true\";}s:3:\"map\";a:3:{s:14:\"only_specified\";s:0:\"\";s:7:\"product\";a:2:{s:2:\"db\";a:0:{}s:4:\"file\";a:0:{}}s:8:\"customer\";a:2:{s:2:\"db\";a:0:{}s:4:\"file\";a:0:{}}}s:7:\"product\";a:1:{s:6:\"filter\";a:8:{s:4:\"name\";s:0:\"\";s:3:\"sku\";s:0:\"\";s:4:\"type\";s:1:\"0\";s:13:\"attribute_set\";s:0:\"\";s:5:\"price\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}s:3:\"qty\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}s:10:\"visibility\";s:1:\"0\";s:6:\"status\";s:1:\"0\";}}s:8:\"customer\";a:1:{s:6:\"filter\";a:10:{s:9:\"firstname\";s:0:\"\";s:8:\"lastname\";s:0:\"\";s:5:\"email\";s:0:\"\";s:5:\"group\";s:1:\"0\";s:10:\"adressType\";s:15:\"default_billing\";s:9:\"telephone\";s:0:\"\";s:8:\"postcode\";s:0:\"\";s:7:\"country\";s:0:\"\";s:6:\"region\";s:0:\"\";s:10:\"created_at\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}}}}', 'import', 'product', 0, 'interactive'), -(NULL, 'Export Customers', NOW(), NOW(), '\r\n \r\n \r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n true\r\n\r\n\r\n\r\n file\r\n var/export\r\n \r\n\r\n\r\n', 'a:5:{s:4:\"file\";a:7:{s:4:\"type\";s:4:\"file\";s:8:\"filename\";s:20:\"export_customers.csv\";s:4:\"path\";s:10:\"var/export\";s:4:\"host\";s:0:\"\";s:4:\"user\";s:0:\"\";s:8:\"password\";s:0:\"\";s:7:\"passive\";s:0:\"\";}s:5:\"parse\";a:5:{s:4:\"type\";s:3:\"csv\";s:12:\"single_sheet\";s:0:\"\";s:9:\"delimiter\";s:1:\",\";s:7:\"enclose\";s:1:\"\"\";s:10:\"fieldnames\";s:4:\"true\";}s:3:\"map\";a:3:{s:14:\"only_specified\";s:0:\"\";s:7:\"product\";a:2:{s:2:\"db\";a:0:{}s:4:\"file\";a:0:{}}s:8:\"customer\";a:2:{s:2:\"db\";a:0:{}s:4:\"file\";a:0:{}}}s:7:\"product\";a:1:{s:6:\"filter\";a:8:{s:4:\"name\";s:0:\"\";s:3:\"sku\";s:0:\"\";s:4:\"type\";s:1:\"0\";s:13:\"attribute_set\";s:0:\"\";s:5:\"price\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}s:3:\"qty\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}s:10:\"visibility\";s:1:\"0\";s:6:\"status\";s:1:\"0\";}}s:8:\"customer\";a:1:{s:6:\"filter\";a:10:{s:9:\"firstname\";s:0:\"\";s:8:\"lastname\";s:0:\"\";s:5:\"email\";s:0:\"\";s:5:\"group\";s:1:\"0\";s:10:\"adressType\";s:15:\"default_billing\";s:9:\"telephone\";s:0:\"\";s:8:\"postcode\";s:0:\"\";s:7:\"country\";s:0:\"\";s:6:\"region\";s:0:\"\";s:10:\"created_at\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}}}}', 'export', 'customer', 0, 'file'), -(NULL, 'Import Customers', NOW(), NOW(), '\r\n \r\n \r\n true\r\n \r\n customer/convert_adapter_customer\r\n parse\r\n', 'a:5:{s:4:\"file\";a:7:{s:4:\"type\";s:4:\"file\";s:8:\"filename\";s:19:\"export_customer.csv\";s:4:\"path\";s:10:\"var/export\";s:4:\"host\";s:0:\"\";s:4:\"user\";s:0:\"\";s:8:\"password\";s:0:\"\";s:7:\"passive\";s:0:\"\";}s:5:\"parse\";a:5:{s:4:\"type\";s:3:\"csv\";s:12:\"single_sheet\";s:0:\"\";s:9:\"delimiter\";s:1:\",\";s:7:\"enclose\";s:1:\"\"\";s:10:\"fieldnames\";s:4:\"true\";}s:3:\"map\";a:3:{s:14:\"only_specified\";s:0:\"\";s:7:\"product\";a:2:{s:2:\"db\";a:0:{}s:4:\"file\";a:0:{}}s:8:\"customer\";a:2:{s:2:\"db\";a:0:{}s:4:\"file\";a:0:{}}}s:7:\"product\";a:1:{s:6:\"filter\";a:8:{s:4:\"name\";s:0:\"\";s:3:\"sku\";s:0:\"\";s:4:\"type\";s:1:\"0\";s:13:\"attribute_set\";s:0:\"\";s:5:\"price\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}s:3:\"qty\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}s:10:\"visibility\";s:1:\"0\";s:6:\"status\";s:1:\"0\";}}s:8:\"customer\";a:1:{s:6:\"filter\";a:10:{s:9:\"firstname\";s:0:\"\";s:8:\"lastname\";s:0:\"\";s:5:\"email\";s:0:\"\";s:5:\"group\";s:1:\"0\";s:10:\"adressType\";s:15:\"default_billing\";s:9:\"telephone\";s:0:\"\";s:8:\"postcode\";s:0:\"\";s:7:\"country\";s:0:\"\";s:6:\"region\";s:0:\"\";s:10:\"created_at\";a:2:{s:4:\"from\";s:0:\"\";s:2:\"to\";s:0:\"\";}}}}', 'import', 'customer', 0, 'interactive'); -"); - -$this->endSetup(); diff --git a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index 104e7e4b7ab..00000000000 --- a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,68 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS `{$installer->getTable('dataflow_batch_import')}`; --- DROP TABLE IF EXISTS `{$installer->getTable('dataflow_batch_export')}`; --- DROP TABLE IF EXISTS `{$installer->getTable('dataflow_batch')}`; - -CREATE TABLE `{$installer->getTable('dataflow_batch')}` ( - `batch_id` int(10) unsigned NOT NULL auto_increment, - `profile_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `adapter` varchar(128) default NULL, - `created_at` datetime default NULL, - PRIMARY KEY (`batch_id`), - KEY `FK_DATAFLOW_BATCH_PROFILE` (`profile_id`), - KEY `FK_DATAFLOW_BATCH_STORE` (`store_id`), - KEY `IDX_CREATED_AT` (`created_at`), - CONSTRAINT `FK_DATAFLOW_BATCH_PROFILE` FOREIGN KEY (`profile_id`) REFERENCES `{$installer->getTable('dataflow_profile')}` (`profile_id`) ON DELETE CASCADE, - CONSTRAINT `FK_DATAFLOW_BATCH_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('dataflow_batch_export')}` ( - `batch_export_id` bigint(20) unsigned NOT NULL auto_increment, - `batch_id` int(10) unsigned NOT NULL default '0', - `batch_data` longtext, - `status` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`batch_export_id`), - KEY `FK_DATAFLOW_BATCH_EXPORT_BATCH` (`batch_id`), - CONSTRAINT `FK_DATAFLOW_BATCH_EXPORT_BATCH` FOREIGN KEY (`batch_id`) REFERENCES `{$installer->getTable('dataflow_batch')}` (`batch_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - CREATE TABLE `{$installer->getTable('dataflow_batch_import')}` ( - `batch_import_id` bigint(20) unsigned NOT NULL auto_increment, - `batch_id` int(10) unsigned NOT NULL default '0', - `batch_data` longtext, - `status` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`batch_import_id`), - KEY `FK_DATAFLOW_BATCH_IMPORT_BATCH` (`batch_id`), - CONSTRAINT `FK_DATAFLOW_BATCH_IMPORT_BATCH` FOREIGN KEY (`batch_id`) REFERENCES `{$installer->getTable('dataflow_batch')}` (`batch_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.3-0.7.4.php deleted file mode 100644 index 198670fea7e..00000000000 --- a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($installer->getTable('dataflow_batch'), 'params', 'text default NULL AFTER adapter'); -$installer->endSetup(); diff --git a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index e28b3de90f1..00000000000 --- a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,478 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('dataflow/batch'), - 'FK_DATAFLOW_BATCH_PROFILE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('dataflow/batch'), - 'FK_DATAFLOW_BATCH_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('dataflow/batch_export'), - 'FK_DATAFLOW_BATCH_EXPORT_BATCH', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('dataflow/batch_import'), - 'FK_DATAFLOW_BATCH_IMPORT_BATCH', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('dataflow_import_data'), - 'FK_DATAFLOW_IMPORT_DATA', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('dataflow/profile_history'), - 'FK_DATAFLOW_PROFILE_HISTORY', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('dataflow/batch'), - 'FK_DATAFLOW_BATCH_PROFILE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('dataflow/batch'), - 'FK_DATAFLOW_BATCH_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('dataflow/batch'), - 'IDX_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('dataflow/batch_export'), - 'FK_DATAFLOW_BATCH_EXPORT_BATCH', -); -$installer->getConnection()->dropIndex( - $installer->getTable('dataflow/batch_import'), - 'FK_DATAFLOW_BATCH_IMPORT_BATCH', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('dataflow/import'), - 'FK_DATAFLOW_IMPORT_DATA', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('dataflow/profile_history'), - 'FK_DATAFLOW_PROFILE_HISTORY', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('dataflow/session') => [ - 'columns' => [ - 'session_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Session Id', - ], - 'user_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'User Id', - ], - 'created_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created Date', - ], - 'file' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'File', - ], - 'type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Type', - ], - 'direction' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Direction', - ], - 'comment' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Comment', - ], - ], - 'comment' => 'Dataflow Session', - ], - $installer->getTable('dataflow/import') => [ - 'columns' => [ - 'import_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Import Id', - ], - 'session_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Session Id', - ], - 'serial_number' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Serial Number', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Value', - ], - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Status', - ], - ], - 'comment' => 'Dataflow Import Data', - ], - $installer->getTable('dataflow/profile') => [ - 'columns' => [ - 'profile_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Profile Id', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Name', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Updated At', - ], - 'actions_xml' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Actions Xml', - ], - 'gui_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Gui Data', - ], - 'direction' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 6, - 'comment' => 'Direction', - ], - 'entity_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'comment' => 'Entity Type', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'data_transfer' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 11, - 'comment' => 'Data Transfer', - ], - ], - 'comment' => 'Dataflow Profile', - ], - $installer->getTable('dataflow/profile_history') => [ - 'columns' => [ - 'history_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'History Id', - ], - 'profile_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Profile Id', - ], - 'action_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'comment' => 'Action Code', - ], - 'user_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'User Id', - ], - 'performed_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Performed At', - ], - ], - 'comment' => 'Dataflow Profile History', - ], - $installer->getTable('dataflow/batch') => [ - 'columns' => [ - 'batch_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Batch Id', - ], - 'profile_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Profile ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'adapter' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 128, - 'comment' => 'Adapter', - ], - 'params' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Parameters', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - ], - 'comment' => 'Dataflow Batch', - ], - $installer->getTable('dataflow/batch_export') => [ - 'columns' => [ - 'batch_export_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Batch Export Id', - ], - 'batch_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Batch Id', - ], - 'batch_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '2G', - 'comment' => 'Batch Data', - ], - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Status', - ], - ], - 'comment' => 'Dataflow Batch Export', - ], - $installer->getTable('dataflow/batch_import') => [ - 'columns' => [ - 'batch_import_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Batch Import Id', - ], - 'batch_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Batch Id', - ], - 'batch_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '2G', - 'comment' => 'Batch Data', - ], - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Status', - ], - ], - 'comment' => 'Dataflow Batch Import', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('dataflow/batch'), - $installer->getIdxName('dataflow/batch', ['profile_id']), - ['profile_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('dataflow/batch'), - $installer->getIdxName('dataflow/batch', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('dataflow/batch'), - $installer->getIdxName('dataflow/batch', ['created_at']), - ['created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('dataflow/batch_export'), - $installer->getIdxName('dataflow/batch_export', ['batch_id']), - ['batch_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('dataflow/batch_import'), - $installer->getIdxName('dataflow/batch_import', ['batch_id']), - ['batch_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('dataflow/import'), - $installer->getIdxName('dataflow/import', ['session_id']), - ['session_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('dataflow/profile_history'), - $installer->getIdxName('dataflow/profile_history', ['profile_id']), - ['profile_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('dataflow/batch', 'profile_id', 'dataflow/profile', 'profile_id'), - $installer->getTable('dataflow/batch'), - 'profile_id', - $installer->getTable('dataflow/profile'), - 'profile_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, - Varien_Db_Ddl_Table::ACTION_NO_ACTION, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('dataflow/batch', 'store_id', 'core/store', 'store_id'), - $installer->getTable('dataflow/batch'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, - Varien_Db_Ddl_Table::ACTION_NO_ACTION, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('dataflow/batch_import', 'batch_id', 'dataflow/batch', 'batch_id'), - $installer->getTable('dataflow/batch_import'), - 'batch_id', - $installer->getTable('dataflow/batch'), - 'batch_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, - Varien_Db_Ddl_Table::ACTION_NO_ACTION, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('dataflow/batch_export', 'batch_id', 'dataflow/batch', 'batch_id'), - $installer->getTable('dataflow/batch_export'), - 'batch_id', - $installer->getTable('dataflow/batch'), - 'batch_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, - Varien_Db_Ddl_Table::ACTION_NO_ACTION, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('dataflow/import', 'session_id', 'dataflow/session', 'session_id'), - $installer->getTable('dataflow/import'), - 'session_id', - $installer->getTable('dataflow/session'), - 'session_id', - Varien_Db_Ddl_Table::ACTION_NO_ACTION, - Varien_Db_Ddl_Table::ACTION_NO_ACTION, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('dataflow/profile_history', 'profile_id', 'dataflow/profile', 'profile_id'), - $installer->getTable('dataflow/profile_history'), - 'profile_id', - $installer->getTable('dataflow/profile'), - 'profile_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.7.0.php deleted file mode 100644 index ad7dccc9e57..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,72 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('directory_country')}; -CREATE TABLE {$this->getTable('directory_country')} ( - `country_id` varchar(2) NOT NULL default '', - `iso2_code` varchar(2) NOT NULL default '', - `iso3_code` varchar(3) NOT NULL default '', - `address_template_plain` text, - `address_template_html` text, - PRIMARY KEY (`country_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Countries'; - -insert into {$this->getTable('directory_country')}(`country_id`,`iso2_code`,`iso3_code`,`address_template_plain`,`address_template_html`) values ('AD','AD','AND','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AE','AE','ARE','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AF','AF','AFG','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AG','AG','ATG','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AI','AI','AIA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AL','AL','ALB','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AM','AM','ARM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AN','AN','ANT','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AO','AO','AGO','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AQ','AQ','ATA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AR','AR','ARG','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AS','AS','ASM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AT','AT','AUT','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AU','AU','AUS','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AW','AW','ABW','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('AZ','AZ','AZE','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BA','BA','BIH','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BB','BB','BRB','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BD','BD','BGD','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BE','BE','BEL','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BF','BF','BFA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BG','BG','BGR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BH','BH','BHR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BI','BI','BDI','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BJ','BJ','BEN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BM','BM','BMU','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BN','BN','BRN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BO','BO','BOL','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BR','BR','BRA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BS','BS','BHS','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BT','BT','BTN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BV','BV','BVT','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BW','BW','BWA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BY','BY','BLR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('BZ','BZ','BLZ','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CA','CA','CAN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CC','CC','CCK','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CF','CF','CAF','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CG','CG','COG','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CH','CH','CHE','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CI','CI','CIV','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CK','CK','COK','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CL','CL','CHL','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CM','CM','CMR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CN','CN','CHN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CO','CO','COL','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CR','CR','CRI','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CU','CU','CUB','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CV','CV','CPV','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CX','CX','CXR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CY','CY','CYP','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('CZ','CZ','CZE','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('DE','DE','DEU','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('DJ','DJ','DJI','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('DK','DK','DNK','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('DM','DM','DMA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('DO','DO','DOM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('DZ','DZ','DZA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('EC','EC','ECU','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('EE','EE','EST','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('EG','EG','EGY','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('EH','EH','ESH','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('ER','ER','ERI','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('ES','ES','ESP','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('ET','ET','ETH','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('FI','FI','FIN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('FJ','FJ','FJI','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('FK','FK','FLK','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('FM','FM','FSM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('FO','FO','FRO','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('FR','FR','FRA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('FX','FX','FXX','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GA','GA','GAB','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GB','GB','GBR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GD','GD','GRD','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GE','GE','GEO','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GF','GF','GUF','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GH','GH','GHA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GI','GI','GIB','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GL','GL','GRL','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GM','GM','GMB','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GN','GN','GIN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GP','GP','GLP','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GQ','GQ','GNQ','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GR','GR','GRC','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GS','GS','SGS','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GT','GT','GTM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GU','GU','GUM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GW','GW','GNB','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('GY','GY','GUY','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('HK','HK','HKG','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('HM','HM','HMD','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('HN','HN','HND','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('HR','HR','HRV','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('HT','HT','HTI','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('HU','HU','HUN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('ID','ID','IDN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('IE','IE','IRL','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('IL','IL','ISR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('IN','IN','IND','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('IO','IO','IOT','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('IQ','IQ','IRQ','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('IR','IR','IRN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('IS','IS','ISL','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('IT','IT','ITA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('JM','JM','JAM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('JO','JO','JOR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('JP','JP','JPN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('KE','KE','KEN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('KG','KG','KGZ','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('KH','KH','KHM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('KI','KI','KIR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('KM','KM','COM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('KN','KN','KNA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('KP','KP','PRK','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('KR','KR','KOR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('KW','KW','KWT','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('KY','KY','CYM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('KZ','KZ','KAZ','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('LA','LA','LAO','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('LB','LB','LBN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('LC','LC','LCA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('LI','LI','LIE','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('LK','LK','LKA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('LR','LR','LBR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('LS','LS','LSO','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('LT','LT','LTU','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('LU','LU','LUX','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('LV','LV','LVA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('LY','LY','LBY','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MA','MA','MAR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MC','MC','MCO','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MD','MD','MDA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MG','MG','MDG','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MH','MH','MHL','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MK','MK','MKD','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('ML','ML','MLI','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MM','MM','MMR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MN','MN','MNG','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MO','MO','MAC','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MP','MP','MNP','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MQ','MQ','MTQ','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MR','MR','MRT','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MS','MS','MSR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MT','MT','MLT','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MU','MU','MUS','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MV','MV','MDV','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MW','MW','MWI','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MX','MX','MEX','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MY','MY','MYS','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('MZ','MZ','MOZ','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('NA','NA','NAM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('NC','NC','NCL','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('NE','NE','NER','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('NF','NF','NFK','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('NG','NG','NGA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('NI','NI','NIC','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('NL','NL','NLD','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('NO','NO','NOR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('NP','NP','NPL','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('NR','NR','NRU','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('NU','NU','NIU','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('NZ','NZ','NZL','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('OM','OM','OMN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('PA','PA','PAN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('PE','PE','PER','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('PF','PF','PYF','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('PG','PG','PNG','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('PH','PH','PHL','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('PK','PK','PAK','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('PL','PL','POL','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('PM','PM','SPM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('PN','PN','PCN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('PR','PR','PRI','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('PT','PT','PRT','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('PW','PW','PLW','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('PY','PY','PRY','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('QA','QA','QAT','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('RE','RE','REU','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('RO','RO','ROM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('RU','RU','RUS','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('RW','RW','RWA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SA','SA','SAU','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SB','SB','SLB','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SC','SC','SYC','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SD','SD','SDN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SE','SE','SWE','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SG','SG','SGP','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SH','SH','SHN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SI','SI','SVN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SJ','SJ','SJM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SK','SK','SVK','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SL','SL','SLE','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SM','SM','SMR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SN','SN','SEN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SO','SO','SOM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SR','SR','SUR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('ST','ST','STP','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SV','SV','SLV','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SY','SY','SYR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('SZ','SZ','SWZ','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TC','TC','TCA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TD','TD','TCD','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TF','TF','ATF','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TG','TG','TGO','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TH','TH','THA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TJ','TJ','TJK','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TK','TK','TKL','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TM','TM','TKM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TN','TN','TUN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TO','TO','TON','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TR','TR','TUR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TT','TT','TTO','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TV','TV','TUV','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TW','TW','TWN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('TZ','TZ','TZA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('UA','UA','UKR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('UG','UG','UGA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('UM','UM','UMI','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('US','US','USA','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('UY','UY','URY','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('UZ','UZ','UZB','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('VA','VA','VAT','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('VC','VC','VCT','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('VE','VE','VEN','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('VG','VG','VGB','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('VI','VI','VIR','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('VN','VN','VNM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('VU','VU','VUT','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('WF','WF','WLF','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('WS','WS','WSM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('YE','YE','YEM','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('YT','YT','MYT','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('ZA','ZA','ZAF','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('ZM','ZM','ZMB','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'),('ZW','ZW','ZWE','{{firstname}} {{lastname}}\n{{company}}\n{{street1}}\n{{street2}}\n{{city}}, {{region}} {{postcode}}','{{firstname}} {{lastname}}
\n{{company}}
\n{{street}}
\n{{city}}, {{region}} {{postcode}}
\nT: {{telephone}}'); - --- DROP TABLE IF EXISTS {$this->getTable('directory_country_region')}; -CREATE TABLE {$this->getTable('directory_country_region')} ( - `region_id` mediumint(8) unsigned NOT NULL auto_increment, - `country_id` varchar(4) NOT NULL default '0', - `code` varchar(32) NOT NULL default '', - `default_name` varchar(255) default NULL, - PRIMARY KEY (`region_id`), - KEY `FK_REGION_COUNTRY` (`country_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Country regions'; - -insert into `{$this->getTable('directory_country_region')}` (`region_id`,`country_id`,`code`,`default_name`) VALUES (1,'US','AL','Alabama'),(2,'US','AK','Alaska'),(3,'US','AS','American Samoa'),(4,'US','AZ','Arizona'),(5,'US','AR','Arkansas'),(6,'US','AF','Armed Forces Africa'),(7,'US','AA','Armed Forces Americas'),(8,'US','AC','Armed Forces Canada'),(9,'US','AE','Armed Forces Europe'),(10,'US','AM','Armed Forces Middle East'),(11,'US','AP','Armed Forces Pacific'),(12,'US','CA','California'),(13,'US','CO','Colorado'),(14,'US','CT','Connecticut'),(15,'US','DE','Delaware'),(16,'US','DC','District of Columbia'),(17,'US','FM','Federated States Of Micronesia'),(18,'US','FL','Florida'),(19,'US','GA','Georgia'),(20,'US','GU','Guam'),(21,'US','HI','Hawaii'),(22,'US','ID','Idaho'),(23,'US','IL','Illinois'),(24,'US','IN','Indiana'),(25,'US','IA','Iowa'),(26,'US','KS','Kansas'),(27,'US','KY','Kentucky'),(28,'US','LA','Louisiana'),(29,'US','ME','Maine'),(30,'US','MH','Marshall Islands'),(31,'US','MD','Maryland'),(32,'US','MA','Massachusetts'),(33,'US','MI','Michigan'),(34,'US','MN','Minnesota'),(35,'US','MS','Mississippi'),(36,'US','MO','Missouri'),(37,'US','MT','Montana'),(38,'US','NE','Nebraska'),(39,'US','NV','Nevada'),(40,'US','NH','New Hampshire'),(41,'US','NJ','New Jersey'),(42,'US','NM','New Mexico'),(43,'US','NY','New York'),(44,'US','NC','North Carolina'),(45,'US','ND','North Dakota'),(46,'US','MP','Northern Mariana Islands'),(47,'US','OH','Ohio'),(48,'US','OK','Oklahoma'),(49,'US','OR','Oregon'),(50,'US','PW','Palau'),(51,'US','PA','Pennsylvania'),(52,'US','PR','Puerto Rico'),(53,'US','RI','Rhode Island'),(54,'US','SC','South Carolina'),(55,'US','SD','South Dakota'),(56,'US','TN','Tennessee'),(57,'US','TX','Texas'),(58,'US','UT','Utah'),(59,'US','VT','Vermont'),(60,'US','VI','Virgin Islands'),(61,'US','VA','Virginia'),(62,'US','WA','Washington'),(63,'US','WV','West Virginia'),(64,'US','WI','Wisconsin'),(65,'US','WY','Wyoming'),(66,'CA','AB','Alberta'),(67,'CA','BC','British Columbia'),(68,'CA','MB','Manitoba'),(69,'CA','NF','Newfoundland'),(70,'CA','NB','New Brunswick'),(71,'CA','NS','Nova Scotia'),(72,'CA','NT','Northwest Territories'),(73,'CA','NU','Nunavut'),(74,'CA','ON','Ontario'),(75,'CA','PE','Prince Edward Island'),(76,'CA','QC','Quebec'),(77,'CA','SK','Saskatchewan'),(78,'CA','YT','Yukon Territory'),(79,'DE','NDS','Niedersachsen'),(80,'DE','BAW','Baden-Württemberg'),(81,'DE','BAY','Bayern'),(82,'DE','BER','Berlin'),(83,'DE','BRG','Brandenburg'),(84,'DE','BRE','Bremen'),(85,'DE','HAM','Hamburg'),(86,'DE','HES','Hessen'),(87,'DE','MEC','Mecklenburg-Vorpommern'),(88,'DE','NRW','Nordrhein-Westfalen'),(89,'DE','RHE','Rheinland-Pfalz'),(90,'DE','SAR','Saarland'),(91,'DE','SAS','Sachsen'),(92,'DE','SAC','Sachsen-Anhalt'),(93,'DE','SCN','Schleswig-Holstein'),(94,'DE','THE','Thüringen'),(95,'AT','WI','Wien'),(96,'AT','NO','Niederösterreich'),(97,'AT','OO','Oberösterreich'),(98,'AT','SB','Salzburg'),(99,'AT','KN','Kärnten'),(100,'AT','ST','Steiermark'),(101,'AT','TI','Tirol'),(102,'AT','BL','Burgenland'),(103,'AT','VB','Voralberg'),(104,'CH','AG','Aargau'),(105,'CH','AI','Appenzell Innerrhoden'),(106,'CH','AR','Appenzell Ausserrhoden'),(107,'CH','BE','Bern'),(108,'CH','BL','Basel-Landschaft'),(109,'CH','BS','Basel-Stadt'),(110,'CH','FR','Freiburg'),(111,'CH','GE','Genf'),(112,'CH','GL','Glarus'),(113,'CH','JU','Graubünden'),(114,'CH','JU','Jura'),(115,'CH','LU','Luzern'),(116,'CH','NE','Neuenburg'),(117,'CH','NW','Nidwalden'),(118,'CH','OW','Obwalden'),(119,'CH','SG','St. Gallen'),(120,'CH','SH','Schaffhausen'),(121,'CH','SO','Solothurn'),(122,'CH','SZ','Schwyz'),(123,'CH','TG','Thurgau'),(124,'CH','TI','Tessin'),(125,'CH','UR','Uri'),(126,'CH','VD','Waadt'),(127,'CH','VS','Wallis'),(128,'CH','ZG','Zug'),(129,'CH','ZH','Zürich'),(130,'ES','A Coruсa','A Coruña'),(131,'ES','Alava','Alava'),(132,'ES','Albacete','Albacete'),(133,'ES','Alicante','Alicante'),(134,'ES','Almeria','Almeria'),(135,'ES','Asturias','Asturias'),(136,'ES','Avila','Avila'),(137,'ES','Badajoz','Badajoz'),(138,'ES','Baleares','Baleares'),(139,'ES','Barcelona','Barcelona'),(140,'ES','Burgos','Burgos'),(141,'ES','Caceres','Caceres'),(142,'ES','Cadiz','Cadiz'),(143,'ES','Cantabria','Cantabria'),(144,'ES','Castellon','Castellon'),(145,'ES','Ceuta','Ceuta'),(146,'ES','Ciudad Real','Ciudad Real'),(147,'ES','Cordoba','Cordoba'),(148,'ES','Cuenca','Cuenca'),(149,'ES','Girona','Girona'),(150,'ES','Granada','Granada'),(151,'ES','Guadalajara','Guadalajara'),(152,'ES','Guipuzcoa','Guipuzcoa'),(153,'ES','Huelva','Huelva'),(154,'ES','Huesca','Huesca'),(155,'ES','Jaen','Jaen'),(156,'ES','La Rioja','La Rioja'),(157,'ES','Las Palmas','Las Palmas'),(158,'ES','Leon','Leon'),(159,'ES','Lleida','Lleida'),(160,'ES','Lugo','Lugo'),(161,'ES','Madrid','Madrid'),(162,'ES','Malaga','Malaga'),(163,'ES','Melilla','Melilla'),(164,'ES','Murcia','Murcia'),(165,'ES','Navarra','Navarra'),(166,'ES','Ourense','Ourense'),(167,'ES','Palencia','Palencia'),(168,'ES','Pontevedra','Pontevedra'),(169,'ES','Salamanca','Salamanca'),(170,'ES','Santa Cruz de Tenerife','Santa Cruz de Tenerife'),(171,'ES','Segovia','Segovia'),(172,'ES','Sevilla','Sevilla'),(173,'ES','Soria','Soria'),(174,'ES','Tarragona','Tarragona'),(175,'ES','Teruel','Teruel'),(176,'ES','Toledo','Toledo'),(177,'ES','Valencia','Valencia'),(178,'ES','Valladolid','Valladolid'),(179,'ES','Vizcaya','Vizcaya'),(180,'ES','Zamora','Zamora'),(181,'ES','Zaragoza','Zaragoza'); - --- DROP TABLE IF EXISTS {$this->getTable('directory_country_region_name')}; -CREATE TABLE {$this->getTable('directory_country_region_name')} ( - `locale` varchar(8) NOT NULL default '', - `region_id` mediumint(8) unsigned NOT NULL default '0', - `name` varchar(64) NOT NULL default '', - PRIMARY KEY (`locale`,`region_id`), - KEY `FK_DIRECTORY_REGION_NAME_REGION` (`region_id`), - CONSTRAINT `FK_DIRECTORY_REGION_NAME_REGION` FOREIGN KEY (`region_id`) REFERENCES {$this->getTable('directory_country_region')} (`region_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Regions names'; - -INSERT INTO `{$this->getTable('directory_country_region_name')}` VALUES ('en_US',1,'Alabama'),('en_US',2,'Alaska'),('en_US',3,'American Samoa'),('en_US',4,'Arizona'),('en_US',5,'Arkansas'),('en_US',6,'Armed Forces Africa'),('en_US',7,'Armed Forces Americas'),('en_US',8,'Armed Forces Canada'),('en_US',9,'Armed Forces Europe'),('en_US',10,'Armed Forces Middle East'),('en_US',11,'Armed Forces Pacific'),('en_US',12,'California'),('en_US',13,'Colorado'),('en_US',14,'Connecticut'),('en_US',15,'Delaware'),('en_US',16,'District of Columbia'),('en_US',17,'Federated States Of Micronesia'),('en_US',18,'Florida'),('en_US',19,'Georgia'),('en_US',20,'Guam'),('en_US',21,'Hawaii'),('en_US',22,'Idaho'),('en_US',23,'Illinois'),('en_US',24,'Indiana'),('en_US',25,'Iowa'),('en_US',26,'Kansas'),('en_US',27,'Kentucky'),('en_US',28,'Louisiana'),('en_US',29,'Maine'),('en_US',30,'Marshall Islands'),('en_US',31,'Maryland'),('en_US',32,'Massachusetts'),('en_US',33,'Michigan'),('en_US',34,'Minnesota'),('en_US',35,'Mississippi'),('en_US',36,'Missouri'),('en_US',37,'Montana'),('en_US',38,'Nebraska'),('en_US',39,'Nevada'),('en_US',40,'New Hampshire'),('en_US',41,'New Jersey'),('en_US',42,'New Mexico'),('en_US',43,'New York'),('en_US',44,'North Carolina'),('en_US',45,'North Dakota'),('en_US',46,'Northern Mariana Islands'),('en_US',47,'Ohio'),('en_US',48,'Oklahoma'),('en_US',49,'Oregon'),('en_US',50,'Palau'),('en_US',51,'Pennsylvania'),('en_US',52,'Puerto Rico'),('en_US',53,'Rhode Island'),('en_US',54,'South Carolina'),('en_US',55,'South Dakota'),('en_US',56,'Tennessee'),('en_US',57,'Texas'),('en_US',58,'Utah'),('en_US',59,'Vermont'),('en_US',60,'Virgin Islands'),('en_US',61,'Virginia'),('en_US',62,'Washington'),('en_US',63,'West Virginia'),('en_US',64,'Wisconsin'),('en_US',65,'Wyoming'),('en_US',66,'Alberta'),('en_US',67,'British Columbia'),('en_US',68,'Manitoba'),('en_US',69,'Newfoundland'),('en_US',70,'New Brunswick'),('en_US',71,'Nova Scotia'),('en_US',72,'Northwest Territories'),('en_US',73,'Nunavut'),('en_US',74,'Ontario'),('en_US',75,'Prince Edward Island'),('en_US',76,'Quebec'),('en_US',77,'Saskatchewan'),('en_US',78,'Yukon Territory'),('en_US',79,'Niedersachsen'),('en_US',80,'Baden-Württemberg'),('en_US',81,'Bayern'),('en_US',82,'Berlin'),('en_US',83,'Brandenburg'),('en_US',84,'Bremen'),('en_US',85,'Hamburg'),('en_US',86,'Hessen'),('en_US',87,'Mecklenburg-Vorpommern'),('en_US',88,'Nordrhein-Westfalen'),('en_US',89,'Rheinland-Pfalz'),('en_US',90,'Saarland'),('en_US',91,'Sachsen'),('en_US',92,'Sachsen-Anhalt'),('en_US',93,'Schleswig-Holstein'),('en_US',94,'Thüringen'),('en_US',95,'Wien'),('en_US',96,'Niederösterreich'),('en_US',97,'Oberösterreich'),('en_US',98,'Salzburg'),('en_US',99,'Kärnten'),('en_US',100,'Steiermark'),('en_US',101,'Tirol'),('en_US',102,'Burgenland'),('en_US',103,'Voralberg'),('en_US',104,'Aargau'),('en_US',105,'Appenzell Innerrhoden'),('en_US',106,'Appenzell Ausserrhoden'),('en_US',107,'Bern'),('en_US',108,'Basel-Landschaft'),('en_US',109,'Basel-Stadt'),('en_US',110,'Freiburg'),('en_US',111,'Genf'),('en_US',112,'Glarus'),('en_US',113,'Graubünden'),('en_US',114,'Jura'),('en_US',115,'Luzern'),('en_US',116,'Neuenburg'),('en_US',117,'Nidwalden'),('en_US',118,'Obwalden'),('en_US',119,'St. Gallen'),('en_US',120,'Schaffhausen'),('en_US',121,'Solothurn'),('en_US',122,'Schwyz'),('en_US',123,'Thurgau'),('en_US',124,'Tessin'),('en_US',125,'Uri'),('en_US',126,'Waadt'),('en_US',127,'Wallis'),('en_US',128,'Zug'),('en_US',129,'Zürich'),('en_US',130,'A Coruña'),('en_US',131,'Alava'),('en_US',132,'Albacete'),('en_US',133,'Alicante'),('en_US',134,'Almeria'),('en_US',135,'Asturias'),('en_US',136,'Avila'),('en_US',137,'Badajoz'),('en_US',138,'Baleares'),('en_US',139,'Barcelona'),('en_US',140,'Burgos'),('en_US',141,'Caceres'),('en_US',142,'Cadiz'),('en_US',143,'Cantabria'),('en_US',144,'Castellon'),('en_US',145,'Ceuta'),('en_US',146,'Ciudad Real'),('en_US',147,'Cordoba'),('en_US',148,'Cuenca'),('en_US',149,'Girona'),('en_US',150,'Granada'),('en_US',151,'Guadalajara'),('en_US',152,'Guipuzcoa'),('en_US',153,'Huelva'),('en_US',154,'Huesca'),('en_US',155,'Jaen'),('en_US',156,'La Rioja'),('en_US',157,'Las Palmas'),('en_US',158,'Leon'),('en_US',159,'Lleida'),('en_US',160,'Lugo'),('en_US',161,'Madrid'),('en_US',162,'Malaga'),('en_US',163,'Melilla'),('en_US',164,'Murcia'),('en_US',165,'Navarra'),('en_US',166,'Ourense'),('en_US',167,'Palencia'),('en_US',168,'Pontevedra'),('en_US',169,'Salamanca'),('en_US',170,'Santa Cruz de Tenerife'),('en_US',171,'Segovia'),('en_US',172,'Sevilla'),('en_US',173,'Soria'),('en_US',174,'Tarragona'),('en_US',175,'Teruel'),('en_US',176,'Toledo'),('en_US',177,'Valencia'),('en_US',178,'Valladolid'),('en_US',179,'Vizcaya'),('en_US',180,'Zamora'),('en_US',181,'Zaragoza'); - --- DROP TABLE IF EXISTS {$this->getTable('directory_currency_rate')}; -CREATE TABLE {$this->getTable('directory_currency_rate')} ( - `currency_from` char(3) NOT NULL default '', - `currency_to` char(3) NOT NULL default '', - `rate` decimal(24,12) NOT NULL default '0.0000', - PRIMARY KEY (`currency_from`,`currency_to`), - KEY `FK_CURRENCY_RATE_TO` (`currency_to`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -INSERT INTO {$this->getTable('directory_currency_rate')} (`currency_from`, `currency_to`, `rate`) VALUES ('EUR', 'EUR', 1.000000000000),('EUR', 'USD', 1.415000000000),('USD', 'EUR', 0.706700000000),('USD', 'USD', 1.000000000000); - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.8.0.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.8.0.php deleted file mode 100644 index 54ee4c61a28..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.8.0.php +++ /dev/null @@ -1,262 +0,0 @@ -startSetup(); - -$installer->run(" --- DROP TABLE IF EXISTS `{$installer->getTable('directory_country')}`; -CREATE TABLE `{$installer->getTable('directory_country')}` ( - `country_id` varchar(2) NOT NULL default '', - `iso2_code` varchar(2) NOT NULL default '', - `iso3_code` varchar(3) NOT NULL default '', - PRIMARY KEY (`country_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Countries'; - -INSERT INTO `{$installer->getTable('directory_country')}` VALUES -('AD', 'AD', 'AND'),('AE', 'AE', 'ARE'),('AF', 'AF', 'AFG'),('AG', 'AG', 'ATG'), -('AI', 'AI', 'AIA'),('AL', 'AL', 'ALB'),('AM', 'AM', 'ARM'),('AN', 'AN', 'ANT'), -('AO', 'AO', 'AGO'),('AQ', 'AQ', 'ATA'),('AR', 'AR', 'ARG'),('AS', 'AS', 'ASM'), -('AT', 'AT', 'AUT'),('AU', 'AU', 'AUS'),('AW', 'AW', 'ABW'),('AZ', 'AZ', 'AZE'), -('BA', 'BA', 'BIH'),('BB', 'BB', 'BRB'),('BD', 'BD', 'BGD'),('BE', 'BE', 'BEL'), -('BF', 'BF', 'BFA'),('BG', 'BG', 'BGR'),('BH', 'BH', 'BHR'),('BI', 'BI', 'BDI'), -('BJ', 'BJ', 'BEN'),('BM', 'BM', 'BMU'),('BN', 'BN', 'BRN'),('BO', 'BO', 'BOL'), -('BR', 'BR', 'BRA'),('BS', 'BS', 'BHS'),('BT', 'BT', 'BTN'),('BV', 'BV', 'BVT'), -('BW', 'BW', 'BWA'),('BY', 'BY', 'BLR'),('BZ', 'BZ', 'BLZ'),('CA', 'CA', 'CAN'), -('CC', 'CC', 'CCK'),('CF', 'CF', 'CAF'),('CG', 'CG', 'COG'),('CH', 'CH', 'CHE'), -('CI', 'CI', 'CIV'),('CK', 'CK', 'COK'),('CL', 'CL', 'CHL'),('CM', 'CM', 'CMR'), -('CN', 'CN', 'CHN'),('CO', 'CO', 'COL'),('CR', 'CR', 'CRI'),('CU', 'CU', 'CUB'), -('CV', 'CV', 'CPV'),('CX', 'CX', 'CXR'),('CY', 'CY', 'CYP'),('CZ', 'CZ', 'CZE'), -('DE', 'DE', 'DEU'),('DJ', 'DJ', 'DJI'),('DK', 'DK', 'DNK'),('DM', 'DM', 'DMA'), -('DO', 'DO', 'DOM'),('DZ', 'DZ', 'DZA'),('EC', 'EC', 'ECU'),('EE', 'EE', 'EST'), -('EG', 'EG', 'EGY'),('EH', 'EH', 'ESH'),('ER', 'ER', 'ERI'),('ES', 'ES', 'ESP'), -('ET', 'ET', 'ETH'),('FI', 'FI', 'FIN'),('FJ', 'FJ', 'FJI'),('FK', 'FK', 'FLK'), -('FM', 'FM', 'FSM'),('FO', 'FO', 'FRO'),('FR', 'FR', 'FRA'),('FX', 'FX', 'FXX'), -('GA', 'GA', 'GAB'),('GB', 'GB', 'GBR'),('GD', 'GD', 'GRD'),('GE', 'GE', 'GEO'), -('GF', 'GF', 'GUF'),('GH', 'GH', 'GHA'),('GI', 'GI', 'GIB'),('GL', 'GL', 'GRL'), -('GM', 'GM', 'GMB'),('GN', 'GN', 'GIN'),('GP', 'GP', 'GLP'),('GQ', 'GQ', 'GNQ'), -('GR', 'GR', 'GRC'),('GS', 'GS', 'SGS'),('GT', 'GT', 'GTM'),('GU', 'GU', 'GUM'), -('GW', 'GW', 'GNB'),('GY', 'GY', 'GUY'),('HK', 'HK', 'HKG'),('HM', 'HM', 'HMD'), -('HN', 'HN', 'HND'),('HR', 'HR', 'HRV'),('HT', 'HT', 'HTI'),('HU', 'HU', 'HUN'), -('ID', 'ID', 'IDN'),('IE', 'IE', 'IRL'),('IL', 'IL', 'ISR'),('IN', 'IN', 'IND'), -('IO', 'IO', 'IOT'),('IQ', 'IQ', 'IRQ'),('IR', 'IR', 'IRN'),('IS', 'IS', 'ISL'), -('IT', 'IT', 'ITA'),('JM', 'JM', 'JAM'),('JO', 'JO', 'JOR'),('JP', 'JP', 'JPN'), -('KE', 'KE', 'KEN'),('KG', 'KG', 'KGZ'),('KH', 'KH', 'KHM'),('KI', 'KI', 'KIR'), -('KM', 'KM', 'COM'),('KN', 'KN', 'KNA'),('KP', 'KP', 'PRK'),('KR', 'KR', 'KOR'), -('KW', 'KW', 'KWT'),('KY', 'KY', 'CYM'),('KZ', 'KZ', 'KAZ'),('LA', 'LA', 'LAO'), -('LB', 'LB', 'LBN'),('LC', 'LC', 'LCA'),('LI', 'LI', 'LIE'),('LK', 'LK', 'LKA'), -('LR', 'LR', 'LBR'),('LS', 'LS', 'LSO'),('LT', 'LT', 'LTU'),('LU', 'LU', 'LUX'), -('LV', 'LV', 'LVA'),('LY', 'LY', 'LBY'),('MA', 'MA', 'MAR'),('MC', 'MC', 'MCO'), -('MD', 'MD', 'MDA'),('MG', 'MG', 'MDG'),('MH', 'MH', 'MHL'),('MK', 'MK', 'MKD'), -('ML', 'ML', 'MLI'),('MM', 'MM', 'MMR'),('MN', 'MN', 'MNG'),('MO', 'MO', 'MAC'), -('MP', 'MP', 'MNP'),('MQ', 'MQ', 'MTQ'),('MR', 'MR', 'MRT'),('MS', 'MS', 'MSR'), -('MT', 'MT', 'MLT'),('MU', 'MU', 'MUS'),('MV', 'MV', 'MDV'),('MW', 'MW', 'MWI'), -('MX', 'MX', 'MEX'),('MY', 'MY', 'MYS'),('MZ', 'MZ', 'MOZ'),('NA', 'NA', 'NAM'), -('NC', 'NC', 'NCL'),('NE', 'NE', 'NER'),('NF', 'NF', 'NFK'),('NG', 'NG', 'NGA'), -('NI', 'NI', 'NIC'),('NL', 'NL', 'NLD'),('NO', 'NO', 'NOR'),('NP', 'NP', 'NPL'), -('NR', 'NR', 'NRU'),('NU', 'NU', 'NIU'),('NZ', 'NZ', 'NZL'),('OM', 'OM', 'OMN'), -('PA', 'PA', 'PAN'),('PE', 'PE', 'PER'),('PF', 'PF', 'PYF'),('PG', 'PG', 'PNG'), -('PH', 'PH', 'PHL'),('PK', 'PK', 'PAK'),('PL', 'PL', 'POL'),('PM', 'PM', 'SPM'), -('PN', 'PN', 'PCN'),('PR', 'PR', 'PRI'),('PT', 'PT', 'PRT'),('PW', 'PW', 'PLW'), -('PY', 'PY', 'PRY'),('QA', 'QA', 'QAT'),('RE', 'RE', 'REU'),('RO', 'RO', 'ROM'), -('RU', 'RU', 'RUS'),('RW', 'RW', 'RWA'),('SA', 'SA', 'SAU'),('SB', 'SB', 'SLB'), -('SC', 'SC', 'SYC'),('SD', 'SD', 'SDN'),('SE', 'SE', 'SWE'),('SG', 'SG', 'SGP'), -('SH', 'SH', 'SHN'),('SI', 'SI', 'SVN'),('SJ', 'SJ', 'SJM'),('SK', 'SK', 'SVK'), -('SL', 'SL', 'SLE'),('SM', 'SM', 'SMR'),('SN', 'SN', 'SEN'),('SO', 'SO', 'SOM'), -('SR', 'SR', 'SUR'),('ST', 'ST', 'STP'),('SV', 'SV', 'SLV'),('SY', 'SY', 'SYR'), -('SZ', 'SZ', 'SWZ'),('TC', 'TC', 'TCA'),('TD', 'TD', 'TCD'),('TF', 'TF', 'ATF'), -('TG', 'TG', 'TGO'),('TH', 'TH', 'THA'),('TJ', 'TJ', 'TJK'),('TK', 'TK', 'TKL'), -('TM', 'TM', 'TKM'),('TN', 'TN', 'TUN'),('TO', 'TO', 'TON'),('TR', 'TR', 'TUR'), -('TT', 'TT', 'TTO'),('TV', 'TV', 'TUV'),('TW', 'TW', 'TWN'),('TZ', 'TZ', 'TZA'), -('UA', 'UA', 'UKR'),('UG', 'UG', 'UGA'),('UM', 'UM', 'UMI'),('US', 'US', 'USA'), -('UY', 'UY', 'URY'),('UZ', 'UZ', 'UZB'),('VA', 'VA', 'VAT'),('VC', 'VC', 'VCT'), -('VE', 'VE', 'VEN'),('VG', 'VG', 'VGB'),('VI', 'VI', 'VIR'),('VN', 'VN', 'VNM'), -('VU', 'VU', 'VUT'),('WF', 'WF', 'WLF'),('WS', 'WS', 'WSM'),('YE', 'YE', 'YEM'), -('YT', 'YT', 'MYT'),('ZA', 'ZA', 'ZAF'),('ZM', 'ZM', 'ZMB'),('ZW', 'ZW', 'ZWE'); - --- DROP TABLE IF EXISTS `{$installer->getTable('directory_country_format')}`; -CREATE TABLE `{$installer->getTable('directory_country_format')}` ( - `country_format_id` int(10) unsigned NOT NULL auto_increment, - `country_id` varchar(2) NOT NULL default '', - `type` varchar(30) NOT NULL default '', - `format` text NOT NULL, - PRIMARY KEY (`country_format_id`), - UNIQUE KEY `country_type` (`country_id`,`type`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Countries format'; - --- DROP TABLE IF EXISTS `{$installer->getTable('directory_country_region')}`; -CREATE TABLE `{$installer->getTable('directory_country_region')}` ( - `region_id` mediumint(8) unsigned NOT NULL auto_increment, - `country_id` varchar(4) NOT NULL default '0', - `code` varchar(32) NOT NULL default '', - `default_name` varchar(255) default NULL, - PRIMARY KEY (`region_id`), - KEY `FK_REGION_COUNTRY` (`country_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Country regions'; - -INSERT INTO `{$installer->getTable('directory_country_region')}` VALUES -(1, 'US', 'AL', 'Alabama'),(2, 'US', 'AK', 'Alaska'),(3, 'US', 'AS', 'American Samoa'), -(4, 'US', 'AZ', 'Arizona'),(5, 'US', 'AR', 'Arkansas'),(6, 'US', 'AF', 'Armed Forces Africa'), -(7, 'US', 'AA', 'Armed Forces Americas'),(8, 'US', 'AC', 'Armed Forces Canada'),(9, 'US', 'AE', 'Armed Forces Europe'), -(10, 'US', 'AM', 'Armed Forces Middle East'),(11, 'US', 'AP', 'Armed Forces Pacific'), -(12, 'US', 'CA', 'California'),(13, 'US', 'CO', 'Colorado'),(14, 'US', 'CT', 'Connecticut'), -(15, 'US', 'DE', 'Delaware'),(16, 'US', 'DC', 'District of Columbia'),(17, 'US', 'FM', 'Federated States Of Micronesia'), -(18, 'US', 'FL', 'Florida'),(19, 'US', 'GA', 'Georgia'),(20, 'US', 'GU', 'Guam'), -(21, 'US', 'HI', 'Hawaii'),(22, 'US', 'ID', 'Idaho'),(23, 'US', 'IL', 'Illinois'), -(24, 'US', 'IN', 'Indiana'),(25, 'US', 'IA', 'Iowa'),(26, 'US', 'KS', 'Kansas'), -(27, 'US', 'KY', 'Kentucky'),(28, 'US', 'LA', 'Louisiana'),(29, 'US', 'ME', 'Maine'), -(30, 'US', 'MH', 'Marshall Islands'),(31, 'US', 'MD', 'Maryland'),(32, 'US', 'MA', 'Massachusetts'), -(33, 'US', 'MI', 'Michigan'),(34, 'US', 'MN', 'Minnesota'),(35, 'US', 'MS', 'Mississippi'), -(36, 'US', 'MO', 'Missouri'),(37, 'US', 'MT', 'Montana'),(38, 'US', 'NE', 'Nebraska'), -(39, 'US', 'NV', 'Nevada'),(40, 'US', 'NH', 'New Hampshire'),(41, 'US', 'NJ', 'New Jersey'), -(42, 'US', 'NM', 'New Mexico'),(43, 'US', 'NY', 'New York'),(44, 'US', 'NC', 'North Carolina'), -(45, 'US', 'ND', 'North Dakota'),(46, 'US', 'MP', 'Northern Mariana Islands'),(47, 'US', 'OH', 'Ohio'), -(48, 'US', 'OK', 'Oklahoma'),(49, 'US', 'OR', 'Oregon'),(50, 'US', 'PW', 'Palau'), -(51, 'US', 'PA', 'Pennsylvania'),(52, 'US', 'PR', 'Puerto Rico'),(53, 'US', 'RI', 'Rhode Island'), -(54, 'US', 'SC', 'South Carolina'),(55, 'US', 'SD', 'South Dakota'),(56, 'US', 'TN', 'Tennessee'), -(57, 'US', 'TX', 'Texas'),(58, 'US', 'UT', 'Utah'),(59, 'US', 'VT', 'Vermont'), -(60, 'US', 'VI', 'Virgin Islands'),(61, 'US', 'VA', 'Virginia'),(62, 'US', 'WA', 'Washington'), -(63, 'US', 'WV', 'West Virginia'),(64, 'US', 'WI', 'Wisconsin'),(65, 'US', 'WY', 'Wyoming'), -(66, 'CA', 'AB', 'Alberta'),(67, 'CA', 'BC', 'British Columbia'),(68, 'CA', 'MB', 'Manitoba'), -(69, 'CA', 'NF', 'Newfoundland'),(70, 'CA', 'NB', 'New Brunswick'),(71, 'CA', 'NS', 'Nova Scotia'), -(72, 'CA', 'NT', 'Northwest Territories'),(73, 'CA', 'NU', 'Nunavut'),(74, 'CA', 'ON', 'Ontario'), -(75, 'CA', 'PE', 'Prince Edward Island'),(76, 'CA', 'QC', 'Quebec'),(77, 'CA', 'SK', 'Saskatchewan'), -(78, 'CA', 'YT', 'Yukon Territory'),(79, 'DE', 'NDS', 'Niedersachsen'),(80, 'DE', 'BAW', 'Baden-Württemberg'), -(81, 'DE', 'BAY', 'Bayern'),(82, 'DE', 'BER', 'Berlin'),(83, 'DE', 'BRG', 'Brandenburg'), -(84, 'DE', 'BRE', 'Bremen'),(85, 'DE', 'HAM', 'Hamburg'),(86, 'DE', 'HES', 'Hessen'), -(87, 'DE', 'MEC', 'Mecklenburg-Vorpommern'),(88, 'DE', 'NRW', 'Nordrhein-Westfalen'),(89, 'DE', 'RHE', 'Rheinland-Pfalz'), -(90, 'DE', 'SAR', 'Saarland'),(91, 'DE', 'SAS', 'Sachsen'),(92, 'DE', 'SAC', 'Sachsen-Anhalt'), -(93, 'DE', 'SCN', 'Schleswig-Holstein'),(94, 'DE', 'THE', 'Thüringen'),(95, 'AT', 'WI', 'Wien'), -(96, 'AT', 'NO', 'Niederösterreich'),(97, 'AT', 'OO', 'Oberösterreich'),(98, 'AT', 'SB', 'Salzburg'), -(99, 'AT', 'KN', 'Kärnten'),(100, 'AT', 'ST', 'Steiermark'),(101, 'AT', 'TI', 'Tirol'), -(102, 'AT', 'BL', 'Burgenland'),(103, 'AT', 'VB', 'Voralberg'),(104, 'CH', 'AG', 'Aargau'), -(105, 'CH', 'AI', 'Appenzell Innerrhoden'),(106, 'CH', 'AR', 'Appenzell Ausserrhoden'),(107, 'CH', 'BE', 'Bern'), -(108, 'CH', 'BL', 'Basel-Landschaft'),(109, 'CH', 'BS', 'Basel-Stadt'),(110, 'CH', 'FR', 'Freiburg'), -(111, 'CH', 'GE', 'Genf'),(112, 'CH', 'GL', 'Glarus'),(113, 'CH', 'JU', 'Graubünden'), -(114, 'CH', 'JU', 'Jura'),(115, 'CH', 'LU', 'Luzern'),(116, 'CH', 'NE', 'Neuenburg'), -(117, 'CH', 'NW', 'Nidwalden'),(118, 'CH', 'OW', 'Obwalden'),(119, 'CH', 'SG', 'St. Gallen'), -(120, 'CH', 'SH', 'Schaffhausen'),(121, 'CH', 'SO', 'Solothurn'),(122, 'CH', 'SZ', 'Schwyz'), -(123, 'CH', 'TG', 'Thurgau'),(124, 'CH', 'TI', 'Tessin'),(125, 'CH', 'UR', 'Uri'), -(126, 'CH', 'VD', 'Waadt'),(127, 'CH', 'VS', 'Wallis'),(128, 'CH', 'ZG', 'Zug'), -(129, 'CH', 'ZH', 'Zürich'),(130, 'ES', 'A Coruсa', 'A Coruña'),(131, 'ES', 'Alava', 'Alava'), -(132, 'ES', 'Albacete', 'Albacete'),(133, 'ES', 'Alicante', 'Alicante'),(134, 'ES', 'Almeria', 'Almeria'), -(135, 'ES', 'Asturias', 'Asturias'),(136, 'ES', 'Avila', 'Avila'),(137, 'ES', 'Badajoz', 'Badajoz'), -(138, 'ES', 'Baleares', 'Baleares'),(139, 'ES', 'Barcelona', 'Barcelona'), -(140, 'ES', 'Burgos', 'Burgos'),(141, 'ES', 'Caceres', 'Caceres'),(142, 'ES', 'Cadiz', 'Cadiz'), -(143, 'ES', 'Cantabria', 'Cantabria'),(144, 'ES', 'Castellon', 'Castellon'),(145, 'ES', 'Ceuta', 'Ceuta'), -(146, 'ES', 'Ciudad Real', 'Ciudad Real'),(147, 'ES', 'Cordoba', 'Cordoba'),(148, 'ES', 'Cuenca', 'Cuenca'), -(149, 'ES', 'Girona', 'Girona'),(150, 'ES', 'Granada', 'Granada'),(151, 'ES', 'Guadalajara', 'Guadalajara'), -(152, 'ES', 'Guipuzcoa', 'Guipuzcoa'),(153, 'ES', 'Huelva', 'Huelva'),(154, 'ES', 'Huesca', 'Huesca'), -(155, 'ES', 'Jaen', 'Jaen'),(156, 'ES', 'La Rioja', 'La Rioja'),(157, 'ES', 'Las Palmas', 'Las Palmas'), -(158, 'ES', 'Leon', 'Leon'),(159, 'ES', 'Lleida', 'Lleida'),(160, 'ES', 'Lugo', 'Lugo'), -(161, 'ES', 'Madrid', 'Madrid'),(162, 'ES', 'Malaga', 'Malaga'),(163, 'ES', 'Melilla', 'Melilla'), -(164, 'ES', 'Murcia', 'Murcia'),(165, 'ES', 'Navarra', 'Navarra'),(166, 'ES', 'Ourense', 'Ourense'), -(167, 'ES', 'Palencia', 'Palencia'),(168, 'ES', 'Pontevedra', 'Pontevedra'),(169, 'ES', 'Salamanca', 'Salamanca'), -(170, 'ES', 'Santa Cruz de Tenerife', 'Santa Cruz de Tenerife'),(171, 'ES', 'Segovia', 'Segovia'),(172, 'ES', 'Sevilla', 'Sevilla'), -(173, 'ES', 'Soria', 'Soria'),(174, 'ES', 'Tarragona', 'Tarragona'),(175, 'ES', 'Teruel', 'Teruel'), -(176, 'ES', 'Toledo', 'Toledo'),(177, 'ES', 'Valencia', 'Valencia'),(178, 'ES', 'Valladolid', 'Valladolid'), -(179, 'ES', 'Vizcaya', 'Vizcaya'),(180, 'ES', 'Zamora', 'Zamora'),(181, 'ES', 'Zaragoza', 'Zaragoza'); - --- DROP TABLE IF EXISTS `{$installer->getTable('directory_country_region_name')}`; -CREATE TABLE `{$installer->getTable('directory_country_region_name')}` ( - `locale` varchar(8) NOT NULL default '', - `region_id` mediumint(8) unsigned NOT NULL default '0', - `name` varchar(64) NOT NULL default '', - PRIMARY KEY (`locale`,`region_id`), - KEY `FK_DIRECTORY_REGION_NAME_REGION` (`region_id`), - CONSTRAINT `FK_DIRECTORY_REGION_NAME_REGION` FOREIGN KEY (`region_id`) REFERENCES {$installer->getTable('directory_country_region')} (`region_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Regions names'; - -INSERT INTO `{$installer->getTable('directory_country_region_name')}` VALUES -('en_US', 1, 'Alabama'),('en_US', 2, 'Alaska'),('en_US', 3, 'American Samoa'), -('en_US', 4, 'Arizona'),('en_US', 5, 'Arkansas'),('en_US', 6, 'Armed Forces Africa'), -('en_US', 7, 'Armed Forces Americas'), -('en_US', 8, 'Armed Forces Canada'),('en_US', 9, 'Armed Forces Europe'), -('en_US', 10, 'Armed Forces Middle East'), -('en_US', 11, 'Armed Forces Pacific'),('en_US', 12, 'California'), -('en_US', 13, 'Colorado'),('en_US', 14, 'Connecticut'),('en_US', 15, 'Delaware'), -('en_US', 16, 'District of Columbia'),('en_US', 17, 'Federated States Of Micronesia'),('en_US', 18, 'Florida'), -('en_US', 19, 'Georgia'),('en_US', 20, 'Guam'),('en_US', 21, 'Hawaii'), -('en_US', 22, 'Idaho'),('en_US', 23, 'Illinois'),('en_US', 24, 'Indiana'), -('en_US', 25, 'Iowa'),('en_US', 26, 'Kansas'),('en_US', 27, 'Kentucky'), -('en_US', 28, 'Louisiana'),('en_US', 29, 'Maine'),('en_US', 30, 'Marshall Islands'), -('en_US', 31, 'Maryland'),('en_US', 32, 'Massachusetts'),('en_US', 33, 'Michigan'), -('en_US', 34, 'Minnesota'),('en_US', 35, 'Mississippi'),('en_US', 36, 'Missouri'), -('en_US', 37, 'Montana'),('en_US', 38, 'Nebraska'),('en_US', 39, 'Nevada'), -('en_US', 40, 'New Hampshire'),('en_US', 41, 'New Jersey'),('en_US', 42, 'New Mexico'), -('en_US', 43, 'New York'),('en_US', 44, 'North Carolina'),('en_US', 45, 'North Dakota'), -('en_US', 46, 'Northern Mariana Islands'),('en_US', 47, 'Ohio'),('en_US', 48, 'Oklahoma'), -('en_US', 49, 'Oregon'),('en_US', 50, 'Palau'),('en_US', 51, 'Pennsylvania'), -('en_US', 52, 'Puerto Rico'),('en_US', 53, 'Rhode Island'),('en_US', 54, 'South Carolina'), -('en_US', 55, 'South Dakota'),('en_US', 56, 'Tennessee'),('en_US', 57, 'Texas'), -('en_US', 58, 'Utah'),('en_US', 59, 'Vermont'),('en_US', 60, 'Virgin Islands'), -('en_US', 61, 'Virginia'),('en_US', 62, 'Washington'),('en_US', 63, 'West Virginia'), -('en_US', 64, 'Wisconsin'),('en_US', 65, 'Wyoming'),('en_US', 66, 'Alberta'), -('en_US', 67, 'British Columbia'),('en_US', 68, 'Manitoba'),('en_US', 69, 'Newfoundland'), -('en_US', 70, 'New Brunswick'),('en_US', 71, 'Nova Scotia'),('en_US', 72, 'Northwest Territories'), -('en_US', 73, 'Nunavut'),('en_US', 74, 'Ontario'),('en_US', 75, 'Prince Edward Island'), -('en_US', 76, 'Quebec'),('en_US', 77, 'Saskatchewan'),('en_US', 78, 'Yukon Territory'), -('en_US', 79, 'Niedersachsen'),('en_US', 80, 'Baden-Württemberg'),('en_US', 81, 'Bayern'), -('en_US', 82, 'Berlin'),('en_US', 83, 'Brandenburg'),('en_US', 84, 'Bremen'), -('en_US', 85, 'Hamburg'),('en_US', 86, 'Hessen'),('en_US', 87, 'Mecklenburg-Vorpommern'), -('en_US', 88, 'Nordrhein-Westfalen'),('en_US', 89, 'Rheinland-Pfalz'),('en_US', 90, 'Saarland'), -('en_US', 91, 'Sachsen'),('en_US', 92, 'Sachsen-Anhalt'),('en_US', 93, 'Schleswig-Holstein'), -('en_US', 94, 'Thüringen'),('en_US', 95, 'Wien'),('en_US', 96, 'Niederösterreich'), -('en_US', 97, 'Oberösterreich'),('en_US', 98, 'Salzburg'),('en_US', 99, 'Kärnten'), -('en_US', 100, 'Steiermark'),('en_US', 101, 'Tirol'),('en_US', 102, 'Burgenland'), -('en_US', 103, 'Voralberg'),('en_US', 104, 'Aargau'),('en_US', 105, 'Appenzell Innerrhoden'), -('en_US', 106, 'Appenzell Ausserrhoden'),('en_US', 107, 'Bern'),('en_US', 108, 'Basel-Landschaft'), -('en_US', 109, 'Basel-Stadt'),('en_US', 110, 'Freiburg'),('en_US', 111, 'Genf'), -('en_US', 112, 'Glarus'),('en_US', 113, 'Graubünden'),('en_US', 114, 'Jura'), -('en_US', 115, 'Luzern'),('en_US', 116, 'Neuenburg'),('en_US', 117, 'Nidwalden'), -('en_US', 118, 'Obwalden'),('en_US', 119, 'St. Gallen'),('en_US', 120, 'Schaffhausen'), -('en_US', 121, 'Solothurn'),('en_US', 122, 'Schwyz'),('en_US', 123, 'Thurgau'), -('en_US', 124, 'Tessin'),('en_US', 125, 'Uri'),('en_US', 126, 'Waadt'), -('en_US', 127, 'Wallis'),('en_US', 128, 'Zug'),('en_US', 129, 'Zürich'), -('en_US', 130, 'A Coruña'),('en_US', 131, 'Alava'),('en_US', 132, 'Albacete'), -('en_US', 133, 'Alicante'),('en_US', 134, 'Almeria'),('en_US', 135, 'Asturias'), -('en_US', 136, 'Avila'),('en_US', 137, 'Badajoz'),('en_US', 138, 'Baleares'), -('en_US', 139, 'Barcelona'),('en_US', 140, 'Burgos'),('en_US', 141, 'Caceres'), -('en_US', 142, 'Cadiz'),('en_US', 143, 'Cantabria'),('en_US', 144, 'Castellon'), -('en_US', 145, 'Ceuta'),('en_US', 146, 'Ciudad Real'),('en_US', 147, 'Cordoba'), -('en_US', 148, 'Cuenca'),('en_US', 149, 'Girona'),('en_US', 150, 'Granada'), -('en_US', 151, 'Guadalajara'),('en_US', 152, 'Guipuzcoa'),('en_US', 153, 'Huelva'), -('en_US', 154, 'Huesca'),('en_US', 155, 'Jaen'),('en_US', 156, 'La Rioja'), -('en_US', 157, 'Las Palmas'),('en_US', 158, 'Leon'),('en_US', 159, 'Lleida'), -('en_US', 160, 'Lugo'),('en_US', 161, 'Madrid'),('en_US', 162, 'Malaga'), -('en_US', 163, 'Melilla'),('en_US', 164, 'Murcia'),('en_US', 165, 'Navarra'), -('en_US', 166, 'Ourense'),('en_US', 167, 'Palencia'),('en_US', 168, 'Pontevedra'), -('en_US', 169, 'Salamanca'),('en_US', 170, 'Santa Cruz de Tenerife'),('en_US', 171, 'Segovia'), -('en_US', 172, 'Sevilla'),('en_US', 173, 'Soria'),('en_US', 174, 'Tarragona'), -('en_US', 175, 'Teruel'),('en_US', 176, 'Toledo'),('en_US', 177, 'Valencia'), -('en_US', 178, 'Valladolid'),('en_US', 179, 'Vizcaya'),('en_US', 180, 'Zamora'), -('en_US', 181, 'Zaragoza'); - --- DROP TABLE IF EXISTS `{$installer->getTable('directory_currency_rate')}`; -CREATE TABLE `{$installer->getTable('directory_currency_rate')}` ( - `currency_from` char(3) NOT NULL default '', - `currency_to` char(3) NOT NULL default '', - `rate` decimal(24,12) NOT NULL default '0.000000000000', - PRIMARY KEY (`currency_from`,`currency_to`), - KEY `FK_CURRENCY_RATE_TO` (`currency_to`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -INSERT INTO `{$installer->getTable('directory_currency_rate')}` VALUES -('EUR', 'EUR', 1.000000000000),('EUR', 'USD', 1.415000000000), -('USD', 'EUR', 0.706700000000),('USD', 'USD', 1.000000000000); -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index d09ddf7fd4a..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup() - ->run(" -DROP TABLE IF EXISTS {$this->getTable('directory_country_format')}; -CREATE TABLE {$this->getTable('directory_country_format')} ( - `country_format_id` int(10) unsigned NOT NULL auto_increment, - `country_id` char(2) NOT NULL default '', - `type` varchar(30) NOT NULL default '', - `format` text NOT NULL, - PRIMARY KEY (`country_format_id`), - UNIQUE KEY `country_type` (`country_id`,`type`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Countries format'; - -ALTER TABLE {$this->getTable('directory_country')}, - DROP COLUMN `address_template_plain`, DROP COLUMN `address_template_html`; -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index 035de015bbd..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,29 +0,0 @@ -startSetup() - ->run(" -INSERT INTO {$this->getTable('core_email_template')} (`template_code`, `template_text`, `template_type`, -`template_subject`, `template_sender_name`, `template_sender_email`, `added_at`, `modified_at`) VALUES -('Currency Update Warnings', 'Currency update warnings:\r\n\r\n\r\n{{var warnings}}', 1, -'Currency Update Warnings', NULL, NULL, '2008-01-30 14:10:31', '2008-01-30 16:02:47'); - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.0-0.8.1.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.0-0.8.1.php deleted file mode 100644 index 854f46b51ef..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.0-0.8.1.php +++ /dev/null @@ -1,58 +0,0 @@ -startSetup(); - -$installer->run(" -INSERT INTO `{$installer->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) -VALUES -('FR', '01', 'Ain'),('FR', '02', 'Aisne'),('FR', '03', 'Allier'), -('FR', '04', 'Alpes-de-Haute-Provence'),('FR', '05', 'Hautes-Alpes'),('FR', '06', 'Alpes-Maritimes'), -('FR', '07', 'Ardèche'),('FR', '08', 'Ardennes'),('FR', '09', 'Ariège'), -('FR', '10', 'Aube'),('FR', '11', 'Aude'),('FR', '12', 'Aveyron'), -('FR', '13', 'Bouches-du-Rhône'),('FR', '14', 'Calvados'),('FR', '15', 'Cantal'), -('FR', '16', 'Charente'),('FR', '17', 'Charente-Maritime'),('FR', '18', 'Cher'), -('FR', '19', 'Corrèze'),('FR', '2A', 'Corse-du-Sud'),('FR', '2B', 'Haute-Corse'), -('FR', '21', 'Côte-d\\'Or'),('FR', '22', 'Côtes-d\\'Armor'),('FR', '23', 'Creuse'), -('FR', '24', 'Dordogne'),('FR', '25', 'Doubs'),('FR', '26', 'Drôme'), -('FR', '27', 'Eure'),('FR', '28', 'Eure-et-Loir'),('FR', '29', 'Finistère'), -('FR', '30', 'Gard'),('FR', '31', 'Haute-Garonne'),('FR', '32', 'Gers'), -('FR', '33', 'Gironde'),('FR', '34', 'Hérault'),('FR', '35', 'Ille-et-Vilaine'), -('FR', '36', 'Indre'),('FR', '37', 'Indre-et-Loire'),('FR', '38', 'Isère'), -('FR', '39', 'Jura'),('FR', '40', 'Landes'),('FR', '41', 'Loir-et-Cher'), -('FR', '42', 'Loire'),('FR', '43', 'Haute-Loire'),('FR', '44', 'Loire-Atlantique'), -('FR', '45', 'Loiret'),('FR', '46', 'Lot'),('FR', '47', 'Lot-et-Garonne'), -('FR', '48', 'Lozère'),('FR', '49', 'Maine-et-Loire'),('FR', '50', 'Manche'), -('FR', '51', 'Marne'),('FR', '52', 'Haute-Marne'),('FR', '53', 'Mayenne'), -('FR', '54', 'Meurthe-et-Moselle'),('FR', '55', 'Meuse'),('FR', '56', 'Morbihan'), -('FR', '57', 'Moselle'),('FR', '58', 'Nièvre'),('FR', '59', 'Nord'), -('FR', '60', 'Oise'),('FR', '61', 'Orne'),('FR', '62', 'Pas-de-Calais'), -('FR', '63', 'Puy-de-Dôme'),('FR', '64', 'Pyrénées-Atlantiques'),('FR', '65', 'Hautes-Pyrénées'), -('FR', '66', 'Pyrénées-Orientales'),('FR', '67', 'Bas-Rhin'),('FR', '68', 'Haut-Rhin'), -('FR', '69', 'Rhône'),('FR', '70', 'Haute-Saône'),('FR', '71', 'Saône-et-Loire'), -('FR', '72', 'Sarthe'),('FR', '73', 'Savoie'),('FR', '74', 'Haute-Savoie'), -('FR', '75', 'Paris'),('FR', '76', 'Seine-Maritime'),('FR', '77', 'Seine-et-Marne'), -('FR', '78', 'Yvelines'),('FR', '79', 'Deux-Sèvres'),('FR', '80', 'Somme'), -('FR', '81', 'Tarn'),('FR', '82', 'Tarn-et-Garonne'),('FR', '83', 'Var'), -('FR', '84', 'Vaucluse'),('FR', '85', 'Vendée'),('FR', '86', 'Vienne'), -('FR', '87', 'Haute-Vienne'),('FR', '88', 'Vosges'),('FR', '89', 'Yonne'), -('FR', '90', 'Territoire-de-Belfort'),('FR', '91', 'Essonne'),('FR', '92', 'Hauts-de-Seine'), -('FR', '93', 'Seine-Saint-Denis'),('FR', '94', 'Val-de-Marne'),('FR', '95', 'Val-d\\'Oise'); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.1-0.8.2.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.1-0.8.2.php deleted file mode 100644 index a52d309cd25..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.1-0.8.2.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); - -$installer->run(" -REPLACE INTO `{$installer->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) -SELECT 'en_US', `region_id`, `default_name` FROM `{$installer->getTable('directory_country_region')}` WHERE `country_id` = 'FR'; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.10-0.8.11.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.10-0.8.11.php deleted file mode 100644 index e60fa85b608..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.10-0.8.11.php +++ /dev/null @@ -1,208 +0,0 @@ -getConnection(); - -$regionTable = $installer->getTable('directory/country_region'); - -$regionsToIns = [ - //After reform of 2010 January - ['FI', 'Lappi', 'Lappi'], - ['FI', 'Pohjois-Pohjanmaa', 'Pohjois-Pohjanmaa'], - ['FI', 'Kainuu', 'Kainuu'], - ['FI', 'Pohjois-Karjala', 'Pohjois-Karjala'], - ['FI', 'Pohjois-Savo', 'Pohjois-Savo'], - ['FI', 'Etelä-Savo', 'Etelä-Savo'], - ['FI', 'Etelä-Pohjanmaa', 'Etelä-Pohjanmaa'], - ['FI', 'Pohjanmaa', 'Pohjanmaa'], - ['FI', 'Pirkanmaa', 'Pirkanmaa'], - ['FI', 'Satakunta', 'Satakunta'], - ['FI', 'Keski-Pohjanmaa', 'Keski-Pohjanmaa'], - ['FI', 'Keski-Suomi', 'Keski-Suomi'], - ['FI', 'Varsinais-Suomi', 'Varsinais-Suomi'], - ['FI', 'Etelä-Karjala', 'Etelä-Karjala'], - ['FI', 'Päijät-Häme', 'Päijät-Häme'], - ['FI', 'Kanta-Häme', 'Kanta-Häme'], - ['FI', 'Uusimaa', 'Uusimaa'], - ['FI', 'Itä-Uusimaa', 'Itä-Uusimaa'], - ['FI', 'Kymenlaakso', 'Kymenlaakso'], - ['FI', 'Ahvenanmaa', 'Ahvenanmaa'], - - //ISO-3166-2:EE - ['EE', 'EE-37', 'Harjumaa'], - ['EE', 'EE-39', 'Hiiumaa'], - ['EE', 'EE-44', 'Ida-Virumaa'], - ['EE', 'EE-49', 'Jõgevamaa'], - ['EE', 'EE-51', 'Järvamaa'], - ['EE', 'EE-57', 'Läänemaa'], - ['EE', 'EE-59', 'Lääne-Virumaa'], - ['EE', 'EE-65', 'Põlvamaa'], - ['EE', 'EE-67', 'Pärnumaa'], - ['EE', 'EE-70', 'Raplamaa'], - ['EE', 'EE-74', 'Saaremaa'], - ['EE', 'EE-78', 'Tartumaa'], - ['EE', 'EE-82', 'Valgamaa'], - ['EE', 'EE-84', 'Viljandimaa'], - ['EE', 'EE-86', 'Võrumaa'], - - //After reform of 2009 July - ['LV', 'LV-DGV', 'Daugavpils'],//now become good - ['LV', 'LV-JEL', 'Jelgava'], - ['LV', 'Jēkabpils', 'Jēkabpils'], - ['LV', 'LV-JUR', 'Jūrmala'], - ['LV', 'LV-LPX', 'Liepāja'], - ['LV', 'LV-LE', 'Liepājas novads'], - ['LV', 'LV-REZ', 'Rēzekne'], - ['LV', 'LV-RIX', 'Rīga'], - ['LV', 'LV-RI', 'Rīgas novads'], - ['LV', 'Valmiera', 'Valmiera'], - ['LV', 'LV-VEN', 'Ventspils'], - ['LV', 'Aglonas novads', 'Aglonas novads'], - ['LV', 'LV-AI', 'Aizkraukles novads'], - ['LV', 'Aizputes novads', 'Aizputes novads'], - ['LV', 'Aknīstes novads', 'Aknīstes novads'], - ['LV', 'Alojas novads', 'Alojas novads'], - ['LV', 'Alsungas novads', 'Alsungas novads'], - ['LV', 'LV-AL', 'Alūksnes novads'], - ['LV', 'Amatas novads', 'Amatas novads'], - ['LV', 'Apes novads', 'Apes novads'], - ['LV', 'Auces novads', 'Auces novads'], - ['LV', 'Babītes novads', 'Babītes novads'], - ['LV', 'Baldones novads', 'Baldones novads'], - ['LV', 'Baltinavas novads', 'Baltinavas novads'], - ['LV', 'LV-BL', 'Balvu novads'], - ['LV', 'LV-BU', 'Bauskas novads'], - ['LV', 'Beverīnas novads', 'Beverīnas novads'], - ['LV', 'Brocēnu novads', 'Brocēnu novads'], - ['LV', 'Burtnieku novads', 'Burtnieku novads'], - ['LV', 'Carnikavas novads', 'Carnikavas novads'], - ['LV', 'Cesvaines novads', 'Cesvaines novads'], - ['LV', 'Ciblas novads', 'Ciblas novads'], - ['LV', 'LV-CE', 'Cēsu novads'], - ['LV', 'Dagdas novads', 'Dagdas novads'], - ['LV', 'LV-DA', 'Daugavpils novads'], - ['LV', 'LV-DO', 'Dobeles novads'], - ['LV', 'Dundagas novads', 'Dundagas novads'], - ['LV', 'Durbes novads', 'Durbes novads'], - ['LV', 'Engures novads', 'Engures novads'], - ['LV', 'Garkalnes novads', 'Garkalnes novads'], - ['LV', 'Grobiņas novads', 'Grobiņas novads'], - ['LV', 'LV-GU', 'Gulbenes novads'], - ['LV', 'Iecavas novads', 'Iecavas novads'], - ['LV', 'Ikšķiles novads', 'Ikšķiles novads'], - ['LV', 'Ilūkstes novads', 'Ilūkstes novads'], - ['LV', 'Inčukalna novads', 'Inčukalna novads'], - ['LV', 'Jaunjelgavas novads', 'Jaunjelgavas novads'], - ['LV', 'Jaunpiebalgas novads', 'Jaunpiebalgas novads'], - ['LV', 'Jaunpils novads', 'Jaunpils novads'], - ['LV', 'LV-JL', 'Jelgavas novads'], - ['LV', 'LV-JK', 'Jēkabpils novads'], - ['LV', 'Kandavas novads', 'Kandavas novads'], - ['LV', 'Kokneses novads', 'Kokneses novads'], - ['LV', 'Krimuldas novads', 'Krimuldas novads'], - ['LV', 'Krustpils novads', 'Krustpils novads'], - ['LV', 'LV-KR', 'Krāslavas novads'], - ['LV', 'LV-KU', 'Kuldīgas novads'], - ['LV', 'Kārsavas novads', 'Kārsavas novads'], - ['LV', 'Lielvārdes novads', 'Lielvārdes novads'], - ['LV', 'LV-LM', 'Limbažu novads'], - ['LV', 'Lubānas novads', 'Lubānas novads'], - ['LV', 'LV-LU', 'Ludzas novads'], - ['LV', 'Līgatnes novads', 'Līgatnes novads'], - ['LV', 'Līvānu novads', 'Līvānu novads'], - ['LV', 'LV-MA', 'Madonas novads'], - ['LV', 'Mazsalacas novads', 'Mazsalacas novads'], - ['LV', 'Mālpils novads', 'Mālpils novads'], - ['LV', 'Mārupes novads', 'Mārupes novads'], - ['LV', 'Naukšēnu novads', 'Naukšēnu novads'], - ['LV', 'Neretas novads', 'Neretas novads'], - ['LV', 'Nīcas novads', 'Nīcas novads'], - ['LV', 'LV-OG', 'Ogres novads'], - ['LV', 'Olaines novads', 'Olaines novads'], - ['LV', 'Ozolnieku novads', 'Ozolnieku novads'], - ['LV', 'LV-PR', 'Preiļu novads'], - ['LV', 'Priekules novads', 'Priekules novads'], - ['LV', 'Priekuļu novads', 'Priekuļu novads'], - ['LV', 'Pārgaujas novads', 'Pārgaujas novads'], - ['LV', 'Pāvilostas novads', 'Pāvilostas novads'], - ['LV', 'Pļaviņu novads', 'Pļaviņu novads'], - ['LV', 'Raunas novads', 'Raunas novads'], - ['LV', 'Riebiņu novads', 'Riebiņu novads'], - ['LV', 'Rojas novads', 'Rojas novads'], - ['LV', 'Ropažu novads', 'Ropažu novads'], - ['LV', 'Rucavas novads', 'Rucavas novads'], - ['LV', 'Rugāju novads', 'Rugāju novads'], - ['LV', 'Rundāles novads', 'Rundāles novads'], - ['LV', 'LV-RE', 'Rēzeknes novads'], - ['LV', 'Rūjienas novads', 'Rūjienas novads'], - ['LV', 'Salacgrīvas novads', 'Salacgrīvas novads'], - ['LV', 'Salas novads', 'Salas novads'], - ['LV', 'Salaspils novads', 'Salaspils novads'], - ['LV', 'LV-SA', 'Saldus novads'], - ['LV', 'Saulkrastu novads', 'Saulkrastu novads'], - ['LV', 'Siguldas novads', 'Siguldas novads'], - ['LV', 'Skrundas novads', 'Skrundas novads'], - ['LV', 'Skrīveru novads', 'Skrīveru novads'], - ['LV', 'Smiltenes novads', 'Smiltenes novads'], - ['LV', 'Stopiņu novads', 'Stopiņu novads'], - ['LV', 'Strenču novads', 'Strenču novads'], - ['LV', 'Sējas novads', 'Sējas novads'], - ['LV', 'LV-TA', 'Talsu novads'], - ['LV', 'LV-TU', 'Tukuma novads'], - ['LV', 'Tērvetes novads', 'Tērvetes novads'], - ['LV', 'Vaiņodes novads', 'Vaiņodes novads'], - ['LV', 'LV-VK', 'Valkas novads'], - ['LV', 'LV-VM', 'Valmieras novads'], - ['LV', 'Varakļānu novads', 'Varakļānu novads'], - ['LV', 'Vecpiebalgas novads', 'Vecpiebalgas novads'], - ['LV', 'Vecumnieku novads', 'Vecumnieku novads'], - ['LV', 'LV-VE', 'Ventspils novads'], - ['LV', 'Viesītes novads', 'Viesītes novads'], - ['LV', 'Viļakas novads', 'Viļakas novads'], - ['LV', 'Viļānu novads', 'Viļānu novads'], - ['LV', 'Vārkavas novads', 'Vārkavas novads'], - ['LV', 'Zilupes novads', 'Zilupes novads'], - ['LV', 'Ādažu novads', 'Ādažu novads'], - ['LV', 'Ērgļu novads', 'Ērgļu novads'], - ['LV', 'Ķeguma novads', 'Ķeguma novads'], - ['LV', 'Ķekavas novads', 'Ķekavas novads'], - - //ISO-3166-2:LT - ['LT', 'LT-AL', 'Alytaus Apskritis'], - ['LT', 'LT-KU', 'Kauno Apskritis'], - ['LT', 'LT-KL', 'Klaipėdos Apskritis'], - ['LT', 'LT-MR', 'Marijampolės Apskritis'], - ['LT', 'LT-PN', 'Panevėžio Apskritis'], - ['LT', 'LT-SA', 'Šiaulių Apskritis'], - ['LT', 'LT-TA', 'Tauragės Apskritis'], - ['LT', 'LT-TE', 'Telšių Apskritis'], - ['LT', 'LT-UT', 'Utenos Apskritis'], - ['LT', 'LT-VL', 'Vilniaus Apskritis'], -]; - -foreach ($regionsToIns as $row) { - if (!($connection->fetchOne("SELECT 1 FROM `{$regionTable}` WHERE `country_id` = :country_id && `code` = :code", ['country_id' => $row[0], 'code' => $row[1]]))) { - $connection->insert($regionTable, [ - 'country_id' => $row[0], - 'code' => $row[1], - 'default_name' => $row[2], - ]); - } -} diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.2-0.8.3.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.2-0.8.3.php deleted file mode 100644 index 5dfb07f4888..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.2-0.8.3.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); - -$installer->run(" -INSERT INTO `{$installer->getTable('directory_country')}` (`country_id`, `iso2_code`, `iso3_code`) VALUES -('AX', 'AX', 'ALA'),('CD', 'CD', 'COD'),('CS', 'CS', 'SCG'),('PS', 'PS', 'PSE'); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.3-0.8.4.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.3-0.8.4.php deleted file mode 100644 index 52b8700276a..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.3-0.8.4.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->run(" -INSERT INTO `{$installer->getTable('directory_country')}` (`country_id`, `iso2_code`, `iso3_code`) VALUES -('GG', 'GG', 'GGY'),('IM', 'IM', 'IMN'),('JE', 'JE', 'JEY'),('ME', 'ME', 'MNE'), -('BL', 'BL', 'BLM'),('MF', 'MF', 'MAF'),('RS', 'RS', 'SRB'),('TL', 'TL', 'TLS'); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.4-0.8.5.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.4-0.8.5.php deleted file mode 100644 index d33184fc8cb..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.4-0.8.5.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->run(" - UPDATE {$installer->getTable('directory/country_region')} - SET code = 'GR' - WHERE region_id = 113 -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.5-0.8.6.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.5-0.8.6.php deleted file mode 100644 index 14c19b1c3ec..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.5-0.8.6.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->run(" - UPDATE {$installer->getTable('directory/country')} - SET iso3_code = 'ROU' - WHERE country_id = 'RO' -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.6-0.8.7.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.6-0.8.7.php deleted file mode 100644 index 6fe1fa7ff26..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.6-0.8.7.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -// Delete non-existent and unofficial iso-3166-1 codes -$installer->run(" - DELETE FROM {$installer->getTable('directory/country')} - WHERE country_id IN('FX','CS') -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.7-0.8.8.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.7-0.8.8.php deleted file mode 100644 index 6f71d54775e..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.7-0.8.8.php +++ /dev/null @@ -1,35 +0,0 @@ -startSetup(); - -//Entries for 'Newfoundland' should be corrected because of the province changed its name and code - -$installer->run(" - UPDATE {$installer->getTable('directory/country_region')} - SET code = 'NL', default_name = 'Newfoundland and Labrador' - WHERE region_id = 69 -"); - -$installer->run(" - UPDATE {$installer->getTable('directory/country_region_name')} - SET `name` = 'Newfoundland and Labrador' - WHERE `region_id` = 69 AND `name` = 'Newfoundland' -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.8-0.8.9.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.8-0.8.9.php deleted file mode 100644 index 42bba6cfa9e..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.8-0.8.9.php +++ /dev/null @@ -1,49 +0,0 @@ -getConnection(); - -$regionTable = $installer->getTable('directory/country_region'); -$regionsToIns = [ - ['RO', 'AB', 'Alba'], ['RO', 'AR', 'Arad'], ['RO', 'AG', 'Argeş'], - ['RO', 'BC', 'Bacău'], ['RO', 'BH', 'Bihor'], ['RO', 'BN', 'Bistriţa-Năsăud'], - ['RO', 'BT', 'Botoşani'], ['RO', 'BV', 'Braşov'], ['RO', 'BR', 'Brăila'], - ['RO', 'B', 'Bucureşti'], ['RO', 'BZ', 'Buzău'], ['RO', 'CS', 'Caraş-Severin'], - ['RO', 'CL', 'Călăraşi'], ['RO', 'CJ', 'Cluj'], ['RO', 'CT', 'Constanţa'], - ['RO', 'CV', 'Covasna'], ['RO', 'DB', 'Dâmboviţa'], ['RO', 'DJ', 'Dolj'], - ['RO', 'GL', 'Galaţi'], ['RO', 'GR', 'Giurgiu'], ['RO', 'GJ', 'Gorj'], - ['RO', 'HR', 'Harghita'], ['RO', 'HD', 'Hunedoara'], ['RO', 'IL', 'Ialomiţa'], - ['RO', 'IS', 'Iaşi'], ['RO', 'IF', 'Ilfov'], ['RO', 'MM', 'Maramureş'], - ['RO', 'MH', 'Mehedinţi'], ['RO', 'MS', 'Mureş'], ['RO', 'NT', 'Neamţ'], - ['RO', 'OT', 'Olt'], ['RO', 'PH', 'Prahova'], ['RO', 'SM', 'Satu-Mare'], - ['RO', 'SJ', 'Sălaj'], ['RO', 'SB', 'Sibiu'], ['RO', 'SV', 'Suceava'], - ['RO', 'TR', 'Teleorman'], ['RO', 'TM', 'Timiş'], ['RO', 'TL', 'Tulcea'], - ['RO', 'VS', 'Vaslui'], ['RO', 'VL', 'Vâlcea'], ['RO', 'VN', 'Vrancea'], -]; - -foreach ($regionsToIns as $row) { - if (!($connection->fetchOne("SELECT 1 FROM `{$regionTable}` WHERE `country_id` = :country_id && `code` = :code", ['country_id' => $row[0], 'code' => $row[1]]))) { - $connection->insert($regionTable, [ - 'country_id' => $row[0], - 'code' => $row[1], - 'default_name' => $row[2], - ]); - } -} diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.9-0.8.10.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.9-0.8.10.php deleted file mode 100644 index 08356c36bc5..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.9-0.8.10.php +++ /dev/null @@ -1,53 +0,0 @@ -getConnection(); - -$regionTable = $installer->getTable('directory/country_region'); -$regNameTable = $installer->getTable('directory/country_region_name'); - -$regionsToIns = [ - ['RO', 'AB', 'Alba'], ['RO', 'AR', 'Arad'], ['RO', 'AG', 'Argeş'], - ['RO', 'BC', 'Bacău'], ['RO', 'BH', 'Bihor'], ['RO', 'BN', 'Bistriţa-Năsăud'], - ['RO', 'BT', 'Botoşani'], ['RO', 'BV', 'Braşov'], ['RO', 'BR', 'Brăila'], - ['RO', 'B', 'Bucureşti'], ['RO', 'BZ', 'Buzău'], ['RO', 'CS', 'Caraş-Severin'], - ['RO', 'CL', 'Călăraşi'], ['RO', 'CJ', 'Cluj'], ['RO', 'CT', 'Constanţa'], - ['RO', 'CV', 'Covasna'], ['RO', 'DB', 'Dâmboviţa'], ['RO', 'DJ', 'Dolj'], - ['RO', 'GL', 'Galaţi'], ['RO', 'GR', 'Giurgiu'], ['RO', 'GJ', 'Gorj'], - ['RO', 'HR', 'Harghita'], ['RO', 'HD', 'Hunedoara'], ['RO', 'IL', 'Ialomiţa'], - ['RO', 'IS', 'Iaşi'], ['RO', 'IF', 'Ilfov'], ['RO', 'MM', 'Maramureş'], - ['RO', 'MH', 'Mehedinţi'], ['RO', 'MS', 'Mureş'], ['RO', 'NT', 'Neamţ'], - ['RO', 'OT', 'Olt'], ['RO', 'PH', 'Prahova'], ['RO', 'SM', 'Satu-Mare'], - ['RO', 'SJ', 'Sălaj'], ['RO', 'SB', 'Sibiu'], ['RO', 'SV', 'Suceava'], - ['RO', 'TR', 'Teleorman'], ['RO', 'TM', 'Timiş'], ['RO', 'TL', 'Tulcea'], - ['RO', 'VS', 'Vaslui'], ['RO', 'VL', 'Vâlcea'], ['RO', 'VN', 'Vrancea'], -]; - -foreach ($regionsToIns as $row) { - $regionId = $connection->fetchOne("SELECT `region_id` FROM `{$regionTable}` WHERE `country_id` = :country_id && `code` = :code", ['country_id' => $row[0], 'code' => $row[1]]); - - if (!$connection->fetchOne("SELECT 1 FROM `{$regNameTable}` WHERE `region_id` = {$regionId}")) { - $connection->insert($regNameTable, [ - 'locale' => 'en_US', - 'region_id' => $regionId, - 'name' => $row[2], - ]); - } -} diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index b3b63add013..00000000000 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,242 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('directory/country_region_name'), - 'FK_DIRECTORY_REGION_NAME_REGION', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('directory/country_format'), - 'COUNTRY_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('directory/country_region'), - 'FK_REGION_COUNTRY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('directory/country_region_name'), - 'FK_DIRECTORY_REGION_NAME_REGION', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('directory/currency_rate'), - 'FK_CURRENCY_RATE_TO', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('directory/country') => [ - 'columns' => [ - 'country_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 2, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Country Id in ISO-2', - ], - 'iso2_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 2, - 'nullable' => false, - 'comment' => 'Country ISO-2 format', - ], - 'iso3_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'nullable' => false, - 'comment' => 'Country ISO-3', - ], - ], - 'comment' => 'Directory Country', - ], - $installer->getTable('directory/country_format') => [ - 'columns' => [ - 'country_format_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Country Format Id', - ], - 'country_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 2, - 'nullable' => false, - 'comment' => 'Country Id in ISO-2', - ], - 'type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 30, - 'nullable' => false, - 'comment' => 'Country Format Type', - ], - 'format' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'nullable' => false, - 'comment' => 'Country Format', - ], - ], - 'comment' => 'Directory Country Format', - ], - $installer->getTable('directory/country_region') => [ - 'columns' => [ - 'region_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Region Id', - ], - 'country_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 4, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Country Id in ISO-2', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'comment' => 'Region code', - ], - 'default_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Region Name', - ], - ], - 'comment' => 'Directory Country Region', - ], - $installer->getTable('directory/country_region_name') => [ - 'columns' => [ - 'locale' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 8, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Locale', - ], - 'region_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Region Id', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Region Name', - ], - ], - 'comment' => 'Directory Country Region Name', - ], - $installer->getTable('directory/currency_rate') => [ - 'columns' => [ - 'currency_from' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Currency Code Convert From', - ], - 'currency_to' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Currency Code Convert To', - ], - 'rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 12, - 'precision' => 24, - 'nullable' => false, - 'default' => '0.000000000000', - 'comment' => 'Currency Conversion Rate', - ], - ], - 'comment' => 'Directory Currency Rate', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('directory/country_format'), - $installer->getIdxName( - 'directory/country_format', - ['country_id', 'type'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['country_id', 'type'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('directory/country_region'), - $installer->getIdxName('directory/country_region', ['country_id']), - ['country_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('directory/country_region_name'), - $installer->getIdxName('directory/country_region_name', ['region_id']), - ['region_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('directory/currency_rate'), - $installer->getIdxName('directory/currency_rate', ['currency_to']), - ['currency_to'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('directory/country_region_name', 'region_id', 'directory/country_region', 'region_id'), - $installer->getTable('directory/country_region_name'), - 'region_id', - $installer->getTable('directory/country_region'), - 'region_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-0.1.0.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-0.1.0.php deleted file mode 100644 index e2374dc735b..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-0.1.0.php +++ /dev/null @@ -1,42 +0,0 @@ -startSetup(); - -$fieldList = [ - 'price', - 'special_price', - 'special_from_date', - 'special_to_date', - 'minimal_price', - 'cost', - 'tier_price', - 'weight', - 'tax_class_id', -]; - -// make these attributes applicable to downloadable products -foreach ($fieldList as $field) { - $applyTo = explode(',', $installer->getAttribute(Mage_Catalog_Model_Product::ENTITY, $field, 'apply_to')); - if (!in_array('downloadable', $applyTo)) { - $applyTo[] = 'downloadable'; - $installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, $field, 'apply_to', implode(',', $applyTo)); - } -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-1.4.0.0.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-1.4.0.0.php deleted file mode 100644 index 19b01256b09..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-1.4.0.0.php +++ /dev/null @@ -1,250 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$installer->getTable('downloadable_link')}` ( - `link_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `product_id` int(10) unsigned NOT NULL DEFAULT '0', - `sort_order` int(10) unsigned NOT NULL DEFAULT '0', - `number_of_downloads` int(10) unsigned DEFAULT NULL, - `is_shareable` smallint(1) unsigned NOT NULL DEFAULT '0', - `link_url` varchar(255) NOT NULL DEFAULT '', - `link_file` varchar(255) NOT NULL DEFAULT '', - `link_type` varchar(20) NOT NULL DEFAULT '', - `sample_url` varchar(255) NOT NULL DEFAULT '', - `sample_file` varchar(255) NOT NULL DEFAULT '', - `sample_type` varchar(20) NOT NULL DEFAULT '', - PRIMARY KEY (`link_id`), - KEY `DOWNLODABLE_LINK_PRODUCT` (`product_id`), - KEY `DOWNLODABLE_LINK_PRODUCT_SORT_ORDER` (`product_id`,`sort_order`), - CONSTRAINT `FK_DOWNLODABLE_LINK_PRODUCT` FOREIGN KEY (`product_id`) - REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('downloadable_link_price')}` ( - `price_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `link_id` int(10) unsigned NOT NULL DEFAULT '0', - `website_id` smallint(5) unsigned NOT NULL DEFAULT '0', - `price` decimal(12,4) NOT NULL DEFAULT '0.0000', - PRIMARY KEY (`price_id`), - KEY `DOWNLOADABLE_LINK_PRICE_LINK` (`link_id`), - KEY `DOWNLOADABLE_LINK_PRICE_WEBSITE` (`website_id`), - CONSTRAINT `FK_DOWNLOADABLE_LINK_PRICE_WEBSITE` FOREIGN KEY (`website_id`) - REFERENCES `{$installer->getTable('core_website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_DOWNLOADABLE_LINK_PRICE_LINK` FOREIGN KEY (`link_id`) - REFERENCES `{$installer->getTable('downloadable_link')}` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('downloadable_link_purchased')}` ( - `purchased_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `order_id` int(10) unsigned NOT NULL DEFAULT '0', - `order_increment_id` varchar(50) NOT NULL DEFAULT '', - `order_item_id` int(10) unsigned NOT NULL DEFAULT '0', - `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `customer_id` int(10) unsigned NOT NULL DEFAULT '0', - `product_name` varchar(255) NOT NULL DEFAULT '', - `product_sku` varchar(255) NOT NULL DEFAULT '', - `link_section_title` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`purchased_id`), - KEY `DOWNLOADABLE_ORDER_ID` (`order_id`), - KEY `DOWNLOADABLE_CUSTOMER_ID` (`customer_id`), - KEY `KEY_DOWNLOADABLE_ORDER_ITEM_ID` (`order_item_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('downloadable_link_purchased_item')}` ( - `item_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `purchased_id` int(10) unsigned NOT NULL DEFAULT '0', - `order_item_id` int(10) unsigned NOT NULL DEFAULT '0', - `product_id` int(10) unsigned DEFAULT '0', - `link_hash` varchar(255) NOT NULL DEFAULT '', - `number_of_downloads_bought` int(10) unsigned NOT NULL DEFAULT '0', - `number_of_downloads_used` int(10) unsigned NOT NULL DEFAULT '0', - `link_id` int(20) unsigned NOT NULL DEFAULT '0', - `link_title` varchar(255) NOT NULL DEFAULT '', - `is_shareable` smallint(1) unsigned NOT NULL DEFAULT '0', - `link_url` varchar(255) NOT NULL DEFAULT '', - `link_file` varchar(255) NOT NULL DEFAULT '', - `link_type` varchar(255) NOT NULL DEFAULT '', - `status` varchar(50) NOT NULL DEFAULT '', - `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - PRIMARY KEY (`item_id`), - KEY `DOWNLOADABLE_LINK_PURCHASED_ID` (`purchased_id`), - KEY `DOWNLOADABLE_ORDER_ITEM_ID` (`order_item_id`), - KEY `DOWNLOADALBE_LINK_HASH` (`link_hash`), - CONSTRAINT `FK_DOWNLOADABLE_LINK_PURCHASED_ID` FOREIGN KEY (`purchased_id`) - REFERENCES `{$installer->getTable('downloadable_link_purchased')}` (`purchased_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('downloadable_link_title')}` ( - `title_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `link_id` int(10) unsigned NOT NULL DEFAULT '0', - `store_id` smallint(5) unsigned NOT NULL DEFAULT '0', - `title` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`title_id`), - UNIQUE KEY `UNQ_LINK_TITLE_STORE` (`link_id`,`store_id`), - KEY `DOWNLOADABLE_LINK_TITLE_LINK` (`link_id`), - KEY `DOWNLOADABLE_LINK_TITLE_STORE` (`store_id`), - CONSTRAINT `FK_DOWNLOADABLE_LINK_TITLE_LINK` FOREIGN KEY (`link_id`) - REFERENCES `{$installer->getTable('downloadable_link')}` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_DOWNLOADABLE_LINK_TITLE_STORE` FOREIGN KEY (`store_id`) - REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('downloadable_sample')}` ( - `sample_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `product_id` int(10) unsigned NOT NULL DEFAULT '0', - `sample_url` varchar(255) NOT NULL DEFAULT '', - `sample_file` varchar(255) NOT NULL DEFAULT '', - `sample_type` varchar(20) NOT NULL DEFAULT '', - `sort_order` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`sample_id`), - KEY `DOWNLODABLE_SAMPLE_PRODUCT` (`product_id`), - CONSTRAINT `FK_DOWNLODABLE_SAMPLE_PRODUCT` FOREIGN KEY (`product_id`) - REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('downloadable_sample_title')}` ( - `title_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `sample_id` int(10) unsigned NOT NULL DEFAULT '0', - `store_id` smallint(5) unsigned NOT NULL DEFAULT '0', - `title` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`title_id`), - UNIQUE KEY `UNQ_SAMPLE_TITLE_STORE` (`sample_id`,`store_id`), - KEY `DOWNLOADABLE_SAMPLE_TITLE_SAMPLE` (`sample_id`), - KEY `DOWNLOADABLE_SAMPLE_TITLE_STORE` (`store_id`), - CONSTRAINT `FK_DOWNLOADABLE_SAMPLE_TITLE_SAMPLE` FOREIGN KEY (`sample_id`) - REFERENCES `{$installer->getTable('downloadable_sample')}` (`sample_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_DOWNLOADABLE_SAMPLE_TITLE_STORE` FOREIGN KEY (`store_id`) - REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$fieldList = [ - 'price', - 'special_price', - 'special_from_date', - 'special_to_date', - 'minimal_price', - 'cost', - 'tier_price', - 'tax_class_id', -]; - -// make these attributes applicable to downloadable products -foreach ($fieldList as $field) { - $applyTo = explode(',', $installer->getAttribute('catalog_product', $field, 'apply_to')); - if (!in_array('downloadable', $applyTo)) { - $applyTo[] = 'downloadable'; - $installer->updateAttribute('catalog_product', $field, 'apply_to', implode(',', $applyTo)); - } -} - -$installer->addAttribute('catalog_product', 'links_purchased_separately', [ - 'type' => 'int', - 'backend' => '', - 'frontend' => '', - 'label' => 'Links can be purchased separately', - 'input' => '', - 'class' => '', - 'source' => '', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, - 'visible' => false, - 'required' => true, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'downloadable', - 'is_configurable' => false, -]); - -$installer->addAttribute('catalog_product', 'samples_title', [ - 'type' => 'varchar', - 'backend' => '', - 'frontend' => '', - 'label' => 'Samples title', - 'input' => '', - 'class' => '', - 'source' => '', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, - 'visible' => false, - 'required' => true, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'downloadable', - 'is_configurable' => false, -]); - -$installer->addAttribute('catalog_product', 'links_title', [ - 'type' => 'varchar', - 'backend' => '', - 'frontend' => '', - 'label' => 'Links title', - 'input' => '', - 'class' => '', - 'source' => '', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, - 'visible' => false, - 'required' => true, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'downloadable', - 'is_configurable' => false, -]); - -$installer->addAttribute('catalog_product', 'links_exist', [ - 'type' => 'int', - 'backend' => '', - 'frontend' => '', - 'label' => '', - 'input' => '', - 'class' => '', - 'source' => '', - 'global' => true, - 'visible' => false, - 'required' => false, - 'user_defined' => false, - 'default' => '0', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'downloadable', - 'is_configurable' => false, - 'used_in_product_listing' => 1, -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.0-0.1.1.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.0-0.1.1.php deleted file mode 100644 index dc0fee2c543..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.0-0.1.1.php +++ /dev/null @@ -1,44 +0,0 @@ -startSetup(); - -// make attribute 'weight' not applicable to downloadable products -$applyTo = explode(',', $installer->getAttribute('catalog_product', 'weight', 'apply_to')); -if (in_array('downloadable', $applyTo)) { - $newApplyTo = []; - foreach ($applyTo as $key => $value) { - if ($value != 'downloadable') { - $newApplyTo[] = $value; - } - } - $installer->updateAttribute('catalog_product', 'weight', 'apply_to', implode(',', $newApplyTo)); -} else { - $installer->updateAttribute('catalog_product', 'weight', 'apply_to', implode(',', $applyTo)); -} - -// remove 'weight' values for downloadable products if there were any created -$attributeId = $installer->getAttributeId('catalog_product', 'weight'); -$installer->run(" - DELETE FROM {$installer->getTable('catalog_product_entity_decimal')} - WHERE (entity_id in ( - SELECT entity_id FROM {$installer->getTable('catalog/product')} WHERE type_id = 'downloadable' - )) and attribute_id = {$attributeId} -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.1-0.1.2.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.1-0.1.2.php deleted file mode 100644 index a8eb44e4994..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.1-0.1.2.php +++ /dev/null @@ -1,147 +0,0 @@ -startSetup(); - -/** @var Varien_Db_Adapter_Pdo_Mysql $conn */ -$conn = $installer->getConnection(); - -$installer->run(" -CREATE TABLE `{$installer->getTable('downloadable/sample')}` ( - `sample_id` int(10) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - `sample_file` varchar(255) NOT NULL default '', - `sort_order` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`sample_id`), - KEY `DOWNLODABLE_SAMPLE_PRODUCT` (`product_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$conn->addConstraint( - 'FK_DOWNLODABLE_SAMPLE_PRODUCT', - $installer->getTable('downloadable/sample'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->run(" -CREATE TABLE `{$installer->getTable('downloadable/sample_title')}` ( - `title_id` int(10) unsigned NOT NULL auto_increment, - `sample_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `title` varchar(255) NOT NULL default '', - PRIMARY KEY (`title_id`), - KEY `DOWNLOADABLE_SAMPLE_TITLE_SAMPLE` (`sample_id`), - KEY `DOWNLOADABLE_SAMPLE_TITLE_STORE` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$conn->addConstraint( - 'FK_DOWNLOADABLE_SAMPLE_TITLE_SAMPLE', - $installer->getTable('downloadable/sample_title'), - 'sample_id', - $installer->getTable('downloadable/sample'), - 'sample_id', -); -$conn->addConstraint( - 'FK_DOWNLOADABLE_SAMPLE_TITLE_STORE', - $installer->getTable('downloadable/sample_title'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->run(" -CREATE TABLE `{$installer->getTable('downloadable/link')}` ( - `link_id` int(10) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - `sort_order` int(10) unsigned NOT NULL default '0', - `number_of_downloads` int(10) unsigned, - `is_shareable` smallint(1) unsigned NOT NULL default '0', - `link_file` varchar(255) NOT NULL default '', - `sample_file` varchar(255) NOT NULL default '', - PRIMARY KEY (`link_id`), - KEY `DOWNLODABLE_LINK_PRODUCT` (`product_id`), - KEY `DOWNLODABLE_LINK_PRODUCT_SORT_ORDER` (`product_id` , `sort_order`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$conn->addConstraint( - 'FK_DOWNLODABLE_LINK_PRODUCT', - $installer->getTable('downloadable/link'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->run(" -CREATE TABLE `{$installer->getTable('downloadable/link_title')}` ( - `title_id` int(10) unsigned NOT NULL auto_increment, - `link_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `title` varchar(255) NOT NULL default '', - PRIMARY KEY (`title_id`), - KEY `DOWNLOADABLE_LINK_TITLE_LINK` (`link_id`), - KEY `DOWNLOADABLE_LINK_TITLE_STORE` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$conn->addConstraint( - 'FK_DOWNLOADABLE_LINK_TITLE_LINK', - $installer->getTable('downloadable/link_title'), - 'link_id', - $installer->getTable('downloadable/link'), - 'link_id', -); -$conn->addConstraint( - 'FK_DOWNLOADABLE_LINK_TITLE_STORE', - $installer->getTable('downloadable/link_title'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->run(" -CREATE TABLE `{$installer->getTable('downloadable/link_price')}` ( - `price_id` int(10) unsigned NOT NULL auto_increment, - `link_id` int(10) unsigned NOT NULL default '0', - `website_id` smallint(5) unsigned NOT NULL default '0', - `price` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`price_id`), - KEY `DOWNLOADABLE_LINK_PRICE_LINK` (`link_id`), - KEY `DOWNLOADABLE_LINK_PRICE_WEBSITE` (`website_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$conn->addConstraint( - 'FK_DOWNLOADABLE_LINK_PRICE_LINK', - $installer->getTable('downloadable/link_price'), - 'link_id', - $installer->getTable('downloadable/link'), - 'link_id', -); -$conn->addConstraint( - 'FK_DOWNLOADABLE_LINK_PRICE_WEBSITE', - $installer->getTable('downloadable/link_price'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.10-0.1.11.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.10-0.1.11.php deleted file mode 100644 index a42ff504b2b..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.10-0.1.11.php +++ /dev/null @@ -1,86 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('downloadable/sample'), 'sample_type', "varchar(20) NOT NULL default '' AFTER `sample_file`"); -$installer->getConnection()->addColumn($installer->getTable('downloadable/link'), 'link_type', "varchar(20) NOT NULL default '' AFTER `link_file`"); -$installer->getConnection()->addColumn($installer->getTable('downloadable/link'), 'sample_type', "varchar(20) NOT NULL default '' AFTER `sample_file`"); - -$conn->dropForeignKey($installer->getTable('downloadable/link_purchased'), 'FK_DOWNLOADABLE_ORDER_ITEM_ID'); -$conn->dropKey($installer->getTable('downloadable/link_purchased'), 'DOWNLOADABLE_ORDER_ITEM_ID'); - -$installer->run(" -CREATE TABLE `{$installer->getTable('downloadable/link_purchased_item')}`( - `item_id` int(10) unsigned NOT NULL auto_increment, - `purchased_id` int(10) unsigned NOT NULL default '0', - `order_item_id` int(10) unsigned NOT NULL default '0', - `number_of_downloads_bought` int(10) unsigned NOT NULL default '0', - `number_of_downloads_used` int(10) unsigned NOT NULL default '0', - `link_id` int(20) unsigned NOT NULL default '0', - `link_title` varchar(255) NOT NULL default '', - `is_shareable` smallint(1) unsigned NOT NULL default '0', - `link_url` varchar(255) NOT NULL default '', - `link_file` varchar(255) NOT NULL default '', - `link_type` varchar(255) NOT NULL default '', - `status` varchar(50) NOT NULL default '', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`item_id`), - KEY `DOWNLOADABLE_LINK_PURCHASED_ID` (`purchased_id`), - KEY `DOWNLOADABLE_ORDER_ITEM_ID` (`order_item_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$conn->addConstraint( - 'FK_DOWNLOADABLE_LINK_PURCHASED_ID', - $installer->getTable('downloadable/link_purchased_item'), - 'purchased_id', - $installer->getTable('downloadable/link_purchased'), - 'purchased_id', -); -$conn->addConstraint( - 'FK_DOWNLOADABLE_ORDER_ITEM_ID', - $installer->getTable('downloadable/link_purchased_item'), - 'order_item_id', - $installer->getTable('sales/order_item'), - 'item_id', -); - -$installer->run(" - INSERT INTO `{$installer->getTable('downloadable/link_purchased_item')}` - (`purchased_id`, `order_item_id`, `number_of_downloads_bought`, `number_of_downloads_used`, `link_id`, `link_title`, `is_shareable`, `link_url`, `link_file`, `status`, `created_at`, `updated_at`) - SELECT - `purchased_id`, `order_item_id`, `number_of_downloads_bought`, `number_of_downloads_used`, `link_id`, `link_title`, `is_shareable`, `link_url`, `link_file`, `status`, `created_at`, `updated_at` - FROM `{$installer->getTable('downloadable/link_purchased')}` - -"); - -$conn->dropColumn($installer->getTable('downloadable/link_purchased'), 'order_item_id'); -$conn->dropColumn($installer->getTable('downloadable/link_purchased'), 'number_of_downloads_bought'); -$conn->dropColumn($installer->getTable('downloadable/link_purchased'), 'number_of_downloads_used'); -$conn->dropColumn($installer->getTable('downloadable/link_purchased'), 'link_id'); -$conn->dropColumn($installer->getTable('downloadable/link_purchased'), 'link_title'); -$conn->dropColumn($installer->getTable('downloadable/link_purchased'), 'is_shareable'); -$conn->dropColumn($installer->getTable('downloadable/link_purchased'), 'link_url'); -$conn->dropColumn($installer->getTable('downloadable/link_purchased'), 'link_file'); -$conn->dropColumn($installer->getTable('downloadable/link_purchased'), 'status'); - -$installer->getConnection()->addColumn($installer->getTable('downloadable/link_purchased'), 'link_section_title', "varchar(255) NOT NULL default '' AFTER `product_sku`"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.11-0.1.12.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.11-0.1.12.php deleted file mode 100644 index 311982612e2..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.11-0.1.12.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($installer->getTable('downloadable/link_purchased_item'), 'product_id', "int(10) unsigned default '0' AFTER `order_item_id`"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.12-0.1.13.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.12-0.1.13.php deleted file mode 100644 index 42a3d096b50..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.12-0.1.13.php +++ /dev/null @@ -1,42 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('downloadable/link_purchased_item'), 'link_hash', "varchar(255) NOT NULL default '' AFTER `product_id`"); - -$installer->getConnection()->addKey($installer->getTable('downloadable/link_purchased_item'), 'DOWNLOADALBE_LINK_HASH', 'link_hash'); - -$select = $installer->getConnection()->select() - ->from($installer->getTable('downloadable/link_purchased_item'), [ - 'item_id', - 'purchased_id', - 'order_item_id', - 'product_id', - ]); -$result = $installer->getConnection()->fetchAll($select); - -foreach ($result as $row) { - $installer->getConnection()->update( - $installer->getTable('downloadable/link_purchased_item'), - ['link_hash' => strtr(base64_encode(microtime() . $row['purchased_id'] . $row['order_item_id'] . $row['product_id']), '+/=', '-_,')], - $installer->getConnection()->quoteInto('item_id = ?', $row['item_id']), - ); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.13-0.1.14.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.13-0.1.14.php deleted file mode 100644 index 886b8c92887..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.13-0.1.14.php +++ /dev/null @@ -1,48 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('downloadable/link_purchased'), 'order_item_id', "int(10) unsigned NOT NULL default '0' AFTER `order_increment_id`"); - -$conn->addKey($installer->getTable('downloadable/link_purchased'), 'KEY_DOWNLOADABLE_ORDER_ITEM_ID', 'order_item_id'); - -$conn->addConstraint( - 'FK_DOWNLOADABLE_PURCHASED_ORDER_ITEM_ID', - $installer->getTable('downloadable/link_purchased'), - 'order_item_id', - $installer->getTable('sales/order_item'), - 'item_id', -); - -$select = $installer->getConnection()->select() - ->from($installer->getTable('downloadable/link_purchased_item'), [ - 'purchased_id', - 'order_item_id', - ]); -$result = $installer->getConnection()->fetchAll($select); - -foreach ($result as $row) { - $installer->getConnection()->update( - $installer->getTable('downloadable/link_purchased'), - ['order_item_id' => $row['order_item_id']], - $installer->getConnection()->quoteInto('purchased_id = ?', $row['purchased_id']), - ); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.14-0.1.15.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.14-0.1.15.php deleted file mode 100644 index 5667fb66a3c..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.14-0.1.15.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -$installer->getConnection()->addKey( - $installer->getTable('downloadable/link_title'), - 'UNQ_LINK_TITLE_STORE', - ['link_id', 'store_id'], - 'unique', -); -$installer->getConnection()->addKey( - $installer->getTable('downloadable/sample_title'), - 'UNQ_SAMPLE_TITLE_STORE', - ['sample_id', 'store_id'], - 'unique', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.15-0.1.16.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.15-0.1.16.php deleted file mode 100644 index c8a20061950..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.15-0.1.16.php +++ /dev/null @@ -1,59 +0,0 @@ -startSetup(); - -$installer->addAttribute('catalog_product', 'links_exist', [ - 'type' => 'int', - 'backend' => '', - 'frontend' => '', - 'label' => '', - 'input' => '', - 'class' => '', - 'source' => '', - 'global' => true, - 'visible' => false, - 'required' => false, - 'user_defined' => false, - 'default' => '0', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'downloadable', - 'is_configurable' => false, - 'used_in_product_listing' => 1, -]); - -$newAttributeId = $installer->getAttributeId('catalog_product', 'links_exist'); -$entityTypeId = $installer->getEntityTypeId('catalog_product'); -$newAttributeTable = $installer->getAttributeTable($entityTypeId, 'links_exist'); - -$defaultValue = 1; -$installer->run(" -INSERT INTO `{$newAttributeTable}` - (entity_id, entity_type_id, attribute_id, value) - SELECT distinct product_id, - '{$entityTypeId}' AS entity_type_id, - '{$newAttributeId}' AS attribute_id, - '{$defaultValue}' AS value - FROM `{$installer->getTable('downloadable/link')}` -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.2-0.1.3.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.2-0.1.3.php deleted file mode 100644 index eb329ba4575..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.2-0.1.3.php +++ /dev/null @@ -1,43 +0,0 @@ -startSetup(); - -$installer->addAttribute('catalog_product', 'links_purchased_separately', [ - 'type' => 'int', - 'backend' => '', - 'frontend' => '', - 'label' => 'Links can be purchased separately', - 'input' => '', - 'class' => '', - 'source' => '', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, - 'visible' => false, - 'required' => true, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'downloadable', - 'is_configurable' => false, -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.3-0.1.4.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.3-0.1.4.php deleted file mode 100644 index dffa6df74dc..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.3-0.1.4.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($installer->getTable('downloadable/sample'), 'sample_url', "varchar(255) NOT NULL default '' AFTER `product_id`"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.4-0.1.5.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.4-0.1.5.php deleted file mode 100644 index e5b1a3a5b0b..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.4-0.1.5.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($installer->getTable('downloadable/link'), 'link_url', "varchar(255) NOT NULL default '' AFTER `is_shareable`"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.5-0.1.6.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.5-0.1.6.php deleted file mode 100644 index fb4a97eb230..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.5-0.1.6.php +++ /dev/null @@ -1,56 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$installer->getTable('downloadable/link_purchased')}` ( - `purchased_id` int(10) unsigned NOT NULL auto_increment, - `order_item_id` int(10) unsigned NOT NULL default '0', - `order_id` int(10) unsigned NOT NULL default '0', - `number_of_downloads_bought` int(10) unsigned NOT NULL default '0', - `number_of_downloads_used` int(10) unsigned NOT NULL default '0', - `link_id` int(20) unsigned NOT NULL default '0', - `link_title` varchar(255) NOT NULL default '', - `link_url` varchar(255) NOT NULL default '', - `link_file` varchar(255) NOT NULL default '', - `status` varchar(50) NOT NULL default '', - `product_name` varchar(255) NOT NULL default '', - `product_sku` varchar(255) NOT NULL default '', - PRIMARY KEY (`purchased_id`), - KEY `DOWNLOADABLE_ORDER_ITEM_ID` (`order_item_id`), - KEY `DOWNLOADABLE_ORDER_ID` (`order_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$conn->addConstraint( - 'FK_DOWNLOADABLE_ORDER_ITEM_ID', - $installer->getTable('downloadable/link_purchased'), - 'order_item_id', - $installer->getTable('sales/order_item'), - 'item_id', -); -$conn->addConstraint( - 'FK_DOWNLOADABLE_ORDER_ID', - $installer->getTable('downloadable/link_purchased'), - 'order_id', - $installer->getTable('sales/order'), - 'entity_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.6-0.1.7.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.6-0.1.7.php deleted file mode 100644 index 96c9e1b5c1b..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.6-0.1.7.php +++ /dev/null @@ -1,196 +0,0 @@ -startSetup(); - -$installer->run(" - DROP TABLE IF EXISTS `{$installer->getTable('downloadable/link')}`; - DROP TABLE IF EXISTS `{$installer->getTable('downloadable/link_price')}`; - DROP TABLE IF EXISTS `{$installer->getTable('downloadable/link_purchased')}`; - DROP TABLE IF EXISTS `{$installer->getTable('downloadable/link_title')}`; - DROP TABLE IF EXISTS `{$installer->getTable('downloadable/sample')}`; - DROP TABLE IF EXISTS `{$installer->getTable('downloadable/sample_title')}`; -"); - -$installer->run(" -CREATE TABLE `{$installer->getTable('downloadable/link')}`( - `link_id` int(10) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - `sort_order` int(10) unsigned NOT NULL default '0', - `number_of_downloads` int(10) unsigned default NULL, - `is_shareable` smallint(1) unsigned NOT NULL default '0', - `link_url` varchar(255) NOT NULL default '', - `link_file` varchar(255) NOT NULL default '', - `sample_file` varchar(255) NOT NULL default '', - PRIMARY KEY (`link_id`), - KEY `DOWNLODABLE_LINK_PRODUCT` (`product_id`), - KEY `DOWNLODABLE_LINK_PRODUCT_SORT_ORDER` (`product_id`,`sort_order`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$conn->addConstraint( - 'FK_DOWNLODABLE_LINK_PRODUCT', - $installer->getTable('downloadable/link'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->run(" -CREATE TABLE `{$installer->getTable('downloadable/link_price')}`( - `price_id` int(10) unsigned NOT NULL auto_increment, - `link_id` int(10) unsigned NOT NULL default '0', - `website_id` smallint(5) unsigned NOT NULL default '0', - `price` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`price_id`), - KEY `DOWNLOADABLE_LINK_PRICE_LINK` (`link_id`), - KEY `DOWNLOADABLE_LINK_PRICE_WEBSITE` (`website_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$conn->addConstraint( - 'FK_DOWNLOADABLE_LINK_PRICE_LINK', - $installer->getTable('downloadable/link_price'), - 'link_id', - $installer->getTable('downloadable/link'), - 'link_id', -); -$conn->addConstraint( - 'FK_DOWNLOADABLE_LINK_PRICE_WEBSITE', - $installer->getTable('downloadable/link_price'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->run(" -CREATE TABLE `{$installer->getTable('downloadable/link_purchased')}`( - `purchased_id` int(10) unsigned NOT NULL auto_increment, - `order_item_id` int(10) unsigned NOT NULL default '0', - `order_id` int(10) unsigned NOT NULL default '0', - `order_increment_id` varchar(50) NOT NULL default '', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `customer_id` int(10) unsigned NOT NULL default '0', - `number_of_downloads_bought` int(10) unsigned NOT NULL default '0', - `number_of_downloads_used` int(10) unsigned NOT NULL default '0', - `link_id` int(20) unsigned NOT NULL default '0', - `link_title` varchar(255) NOT NULL default '', - `link_url` varchar(255) NOT NULL default '', - `link_file` varchar(255) NOT NULL default '', - `status` varchar(50) NOT NULL default '', - `product_name` varchar(255) NOT NULL default '', - `product_sku` varchar(255) NOT NULL default '', - PRIMARY KEY (`purchased_id`), - KEY `DOWNLOADABLE_ORDER_ITEM_ID` (`order_item_id`), - KEY `DOWNLOADABLE_ORDER_ID` (`order_id`), - KEY `DOWNLOADABLE_CUSTOMER_ID` (`customer_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$conn->addConstraint( - 'FK_DOWNLOADABLE_ORDER_ID', - $installer->getTable('downloadable/link_purchased'), - 'order_id', - $installer->getTable('sales/order'), - 'entity_id', -); -$conn->addConstraint( - 'FK_DOWNLOADABLE_ORDER_ITEM_ID', - $installer->getTable('downloadable/link_purchased'), - 'order_item_id', - $installer->getTable('sales/order_item'), - 'item_id', -); - -$installer->run(" -CREATE TABLE `{$installer->getTable('downloadable/link_title')}`( - `title_id` int(10) unsigned NOT NULL auto_increment, - `link_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `title` varchar(255) NOT NULL default '', - PRIMARY KEY (`title_id`), - KEY `DOWNLOADABLE_LINK_TITLE_LINK` (`link_id`), - KEY `DOWNLOADABLE_LINK_TITLE_STORE` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$conn->addConstraint( - 'FK_DOWNLOADABLE_LINK_TITLE_LINK', - $installer->getTable('downloadable/link_title'), - 'link_id', - $installer->getTable('downloadable/link'), - 'link_id', -); -$conn->addConstraint( - 'FK_DOWNLOADABLE_LINK_TITLE_STORE', - $installer->getTable('downloadable/link_title'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->run(" -CREATE TABLE `{$installer->getTable('downloadable/sample')}`( - `sample_id` int(10) unsigned NOT NULL auto_increment, - `product_id` int(10) unsigned NOT NULL default '0', - `sample_url` varchar(255) NOT NULL default '', - `sample_file` varchar(255) NOT NULL default '', - `sort_order` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`sample_id`), - KEY `DOWNLODABLE_SAMPLE_PRODUCT` (`product_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$conn->addConstraint( - 'FK_DOWNLODABLE_SAMPLE_PRODUCT', - $installer->getTable('downloadable/sample'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->run(" -CREATE TABLE `{$installer->getTable('downloadable/sample_title')}`( - `title_id` int(10) unsigned NOT NULL auto_increment, - `sample_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `title` varchar(255) NOT NULL default '', - PRIMARY KEY (`title_id`), - KEY `DOWNLOADABLE_SAMPLE_TITLE_SAMPLE` (`sample_id`), - KEY `DOWNLOADABLE_SAMPLE_TITLE_STORE` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$conn->addConstraint( - 'FK_DOWNLOADABLE_SAMPLE_TITLE_SAMPLE', - $installer->getTable('downloadable/sample_title'), - 'sample_id', - $installer->getTable('downloadable/sample'), - 'sample_id', -); - -$conn->addConstraint( - 'FK_DOWNLOADABLE_SAMPLE_TITLE_STORE', - $installer->getTable('downloadable/sample_title'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.7-0.1.8.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.7-0.1.8.php deleted file mode 100644 index 543b1156292..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.7-0.1.8.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($installer->getTable('downloadable/link_purchased'), 'is_shareable', "smallint(1) unsigned NOT NULL default '0' AFTER `link_title`"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.8-0.1.9.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.8-0.1.9.php deleted file mode 100644 index cb119d06b3c..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.8-0.1.9.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($installer->getTable('downloadable/link'), 'sample_url', "varchar(255) NOT NULL default '' AFTER `link_file`"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.9-0.1.10.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.9-0.1.10.php deleted file mode 100644 index 2a7c415c10b..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.9-0.1.10.php +++ /dev/null @@ -1,65 +0,0 @@ -startSetup(); - -$installer->addAttribute('catalog_product', 'samples_title', [ - 'type' => 'varchar', - 'backend' => '', - 'frontend' => '', - 'label' => 'Samples title', - 'input' => '', - 'class' => '', - 'source' => '', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, - 'visible' => false, - 'required' => true, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'downloadable', - 'is_configurable' => false, -]); - -$installer->addAttribute('catalog_product', 'links_title', [ - 'type' => 'varchar', - 'backend' => '', - 'frontend' => '', - 'label' => 'Links title', - 'input' => '', - 'class' => '', - 'source' => '', - 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, - 'visible' => false, - 'required' => true, - 'user_defined' => false, - 'default' => '', - 'searchable' => false, - 'filterable' => false, - 'comparable' => false, - 'visible_on_front' => false, - 'unique' => false, - 'apply_to' => 'downloadable', - 'is_configurable' => false, -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.3.9-1.4.0.0.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.3.9-1.4.0.0.php deleted file mode 100644 index ceaf7455f2b..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.3.9-1.4.0.0.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -// Remove sales foreign keys -$installer->getConnection()->dropForeignKey( - $installer->getTable('downloadable_link_purchased'), - 'FK_DOWNLOADABLE_ORDER_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('downloadable_link_purchased'), - 'FK_DOWNLOADABLE_PURCHASED_ORDER_ITEM_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('downloadable_link_purchased_item'), - 'FK_DOWNLOADABLE_ORDER_ITEM_ID', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php deleted file mode 100644 index a1f3b577263..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php +++ /dev/null @@ -1,44 +0,0 @@ -startSetup(); - -$installer->run(" -DROP TABLE IF EXISTS `{$installer->getTable('catalog/product_index_price')}_downloadable_idx`; - -CREATE TABLE `{$installer->getTable('downloadable/product_price_indexer_idx')}` ( - `entity_id` int(10) unsigned NOT NULL, - `customer_group_id` smallint(5) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `min_price` decimal(12,4) default NULL, - `max_price` decimal(12,4) default NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('downloadable/product_price_indexer_tmp')}` ( - `entity_id` int(10) unsigned NOT NULL, - `customer_group_id` smallint(5) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `min_price` decimal(12,4) default NULL, - `max_price` decimal(12,4) default NULL, - PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php deleted file mode 100644 index 13d7bc7e851..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php +++ /dev/null @@ -1,20 +0,0 @@ -updateAttribute('catalog_product', 'links_purchased_separately', 'used_in_product_listing', 1); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php deleted file mode 100644 index 4ef13edca00..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php +++ /dev/null @@ -1,94 +0,0 @@ -getConnection(); - -$adapter->modifyColumn( - $installer->getTable('downloadable/link_purchased'), - 'order_id', - "INT(10) UNSIGNED NULL DEFAULT '0'", -); - -$adapter->modifyColumn( - $installer->getTable('downloadable/link_purchased_item'), - 'order_item_id', - "INT(10) UNSIGNED NULL DEFAULT '0'", -); - -/** - * Update order_id/order_item_id to NULL which contained invalid values - */ -$adapter->beginTransaction(); -//update downloadable purchased data -$select = $adapter->select() - ->from(['d' => $installer->getTable('downloadable/link_purchased')], ['purchased_id', 'purchased_id']) - ->joinLeft( - ['o' => $installer->getTable('sales/order')], - 'd.order_id = o.entity_id', - [], - ) - ->where('o.entity_id IS NULL') - ->where('d.order_id IS NOT NULL') -; -$ids = $adapter->fetchPairs($select); -if ($ids) { - $adapter->update( - $installer->getTable('downloadable/link_purchased'), - ['order_id' => new Zend_Db_Expr('(NULL)')], - $adapter->quoteInto('purchased_id IN (?)', $ids), - ); -} -//update downloadable purchased items data -$select = $adapter->select() - ->from(['d' => $installer->getTable('downloadable/link_purchased_item')], ['item_id', 'item_id']) - ->joinLeft( - ['o' => $installer->getTable('sales/order_item')], - 'd.order_item_id = o.item_id', - [], - ) - ->where('o.item_id IS NULL') - ->where('d.order_item_id IS NOT NULL') -; -$ids = $adapter->fetchPairs($select); -if ($ids) { - $adapter->update( - $installer->getTable('downloadable/link_purchased_item'), - ['order_item_id' => new Zend_Db_Expr('(NULL)')], - $adapter->quoteInto('item_id IN (?)', $ids), - ); -} -$adapter->commit(); - -//add foreign keys -$adapter->addConstraint( - 'FK_DOWNLOADABLE_LINK_ORDER_ID', - $installer->getTable('downloadable/link_purchased'), - 'order_id', - $installer->getTable('sales/order'), - 'entity_id', - 'set null', -); -$adapter->addConstraint( - 'FK_DOWNLOADABLE_LINK_ORDER_ITEM_ID', - $installer->getTable('downloadable/link_purchased_item'), - 'order_item_id', - $installer->getTable('sales/order_item'), - 'item_id', - 'set null', -); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index d6927473efa..00000000000 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,853 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('downloadable/link'), - 'FK_DOWNLODABLE_LINK_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('downloadable/link_price'), - 'FK_DOWNLOADABLE_LINK_PRICE_LINK', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('downloadable/link_price'), - 'FK_DOWNLOADABLE_LINK_PRICE_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('downloadable/link_purchased'), - 'FK_DOWNLOADABLE_LINK_ORDER_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('downloadable/link_purchased_item'), - 'FK_DOWNLOADABLE_LINK_PURCHASED_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('downloadable/link_purchased_item'), - 'FK_DOWNLOADABLE_LINK_ORDER_ITEM_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('downloadable/link_title'), - 'FK_DOWNLOADABLE_LINK_TITLE_LINK', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('downloadable/link_title'), - 'FK_DOWNLOADABLE_LINK_TITLE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('downloadable/sample'), - 'FK_DOWNLODABLE_SAMPLE_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('downloadable_sample_title'), - 'FK_DOWNLOADABLE_SAMPLE_TITLE_SAMPLE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('downloadable_sample_title'), - 'FK_DOWNLOADABLE_SAMPLE_TITLE_STORE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/link'), - 'DOWNLODABLE_LINK_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/link'), - 'DOWNLODABLE_LINK_PRODUCT_SORT_ORDER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/link_price'), - 'DOWNLOADABLE_LINK_PRICE_LINK', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/link_price'), - 'DOWNLOADABLE_LINK_PRICE_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/link_purchased'), - 'DOWNLOADABLE_ORDER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/link_purchased'), - 'DOWNLOADABLE_CUSTOMER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/link_purchased'), - 'KEY_DOWNLOADABLE_ORDER_ITEM_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/link_purchased_item'), - 'DOWNLOADABLE_LINK_PURCHASED_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/link_purchased_item'), - 'DOWNLOADABLE_ORDER_ITEM_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/link_purchased_item'), - 'DOWNLOADALBE_LINK_HASH', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/link_title'), - 'UNQ_LINK_TITLE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/link_title'), - 'DOWNLOADABLE_LINK_TITLE_LINK', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/link_title'), - 'DOWNLOADABLE_LINK_TITLE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/sample'), - 'DOWNLODABLE_SAMPLE_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/sample_title'), - 'UNQ_SAMPLE_TITLE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/sample_title'), - 'DOWNLOADABLE_SAMPLE_TITLE_SAMPLE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('downloadable/sample_title'), - 'DOWNLOADABLE_SAMPLE_TITLE_STORE', -); - -/** - * Change columns - */ - -$tables = [ - $installer->getTable('downloadable/link') => [ - 'columns' => [ - 'link_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Link ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort order', - ], - 'number_of_downloads' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Number of downloads', - ], - 'is_shareable' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Shareable flag', - ], - 'link_url' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Link Url', - ], - 'link_file' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Link File', - ], - 'link_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 20, - 'comment' => 'Link Type', - ], - 'sample_url' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Sample Url', - ], - 'sample_file' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Sample File', - ], - 'sample_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 20, - 'comment' => 'Sample Type', - ], - ], - 'comment' => 'Downloadable Link Table', - ], - $installer->getTable('downloadable/link_title') => [ - 'columns' => [ - 'title_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Title ID', - ], - 'link_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Link ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'title' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Title', - ], - ], - 'comment' => 'Link Title Table', - ], - $installer->getTable('downloadable/link_price') => [ - 'columns' => [ - 'price_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Price ID', - ], - 'link_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Link ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Website ID', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Price', - ], - ], - 'comment' => 'Downloadable Link Price Table', - ], - $installer->getTable('downloadable/sample') => [ - 'columns' => [ - 'sample_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Sample ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'sample_url' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Sample URL', - ], - 'sample_file' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Sample file', - ], - 'sample_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 20, - 'comment' => 'Sample Type', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - ], - 'comment' => 'Downloadable Sample Table', - ], - $installer->getTable('downloadable/sample_title') => [ - 'columns' => [ - 'title_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Title ID', - ], - 'sample_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sample ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store ID', - ], - 'title' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Title', - ], - ], - 'comment' => 'Downloadable Sample Title Table', - ], - $installer->getTable('downloadable/link_purchased') => [ - 'columns' => [ - 'purchased_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Purchased ID', - ], - 'order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Order ID', - ], - 'order_increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Order Increment ID', - ], - 'order_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Order Item ID', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Date of creation', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Date of modification', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Customer ID', - ], - 'product_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Product name', - ], - 'product_sku' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Product sku', - ], - 'link_section_title' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Link_section_title', - ], - ], - 'comment' => 'Downloadable Link Purchased Table', - ], - $installer->getTable('downloadable/link_purchased_item') => [ - 'columns' => [ - 'item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Item ID', - ], - 'purchased_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Purchased ID', - ], - 'order_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Order Item ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'link_hash' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Link hash', - ], - 'number_of_downloads_bought' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Number of downloads bought', - ], - 'number_of_downloads_used' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Number of downloads used', - ], - 'link_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Link ID', - ], - 'link_title' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Link Title', - ], - 'is_shareable' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Shareable Flag', - ], - 'link_url' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Link Url', - ], - 'link_file' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Link File', - ], - 'link_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Link Type', - ], - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Status', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Creation Time', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Update Time', - ], - ], - 'comment' => 'Downloadable Link Purchased Item Table', - ], - $installer->getTable('downloadable/product_price_indexer_idx') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website ID', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Minimum price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Maximum price', - ], - ], - 'comment' => 'Indexer Table for price of downloadable products', - ], - $installer->getTable('downloadable/product_price_indexer_tmp') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity ID', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Customer Group ID', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website ID', - ], - 'min_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Minimum price', - ], - 'max_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Maximum price', - ], - ], - 'comment' => 'Temporary Indexer Table for price of downloadable products', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/link'), - $installer->getIdxName('downloadable/link', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/link'), - $installer->getIdxName('downloadable/link', ['product_id', 'sort_order']), - ['product_id', 'sort_order'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/link_price'), - $installer->getIdxName('downloadable/link_price', ['link_id']), - ['link_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/link_price'), - $installer->getIdxName('downloadable/link_price', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/link_purchased'), - $installer->getIdxName('downloadable/link_purchased', ['order_id']), - ['order_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/link_purchased'), - $installer->getIdxName('downloadable/link_purchased', ['order_item_id']), - ['order_item_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/link_purchased'), - $installer->getIdxName('downloadable/link_purchased', ['customer_id']), - ['customer_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/link_purchased_item'), - $installer->getIdxName('downloadable/link_purchased_item', ['link_hash']), - ['link_hash'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/link_purchased_item'), - $installer->getIdxName('downloadable/link_purchased_item', ['order_item_id']), - ['order_item_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/link_purchased_item'), - $installer->getIdxName('downloadable/link_purchased_item', ['purchased_id']), - ['purchased_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/link_title'), - $installer->getIdxName( - 'downloadable/link_title', - ['link_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['link_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/link_title'), - $installer->getIdxName('downloadable/link_title', ['link_id']), - ['link_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/link_title'), - $installer->getIdxName('downloadable/link_title', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/sample'), - $installer->getIdxName('downloadable/sample', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/sample_title'), - $installer->getIdxName( - 'downloadable/sample_title', - ['sample_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['sample_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/sample_title'), - $installer->getIdxName('downloadable/sample_title', ['sample_id']), - ['sample_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('downloadable/sample_title'), - $installer->getIdxName('downloadable/sample_title', ['store_id']), - ['store_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('downloadable/link', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('downloadable/link'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('downloadable/link_price', 'link_id', 'downloadable/link', 'link_id'), - $installer->getTable('downloadable/link_price'), - 'link_id', - $installer->getTable('downloadable/link'), - 'link_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('downloadable/link_price', 'website_id', 'core/website', 'website_id'), - $installer->getTable('downloadable/link_price'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('downloadable/link_purchased', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('downloadable/link_purchased'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('downloadable/link_purchased', 'order_id', 'sales/order', 'entity_id'), - $installer->getTable('downloadable/link_purchased'), - 'order_id', - $installer->getTable('sales/order'), - 'entity_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'downloadable/link_purchased_item', - 'purchased_id', - 'downloadable/link_purchased', - 'purchased_id', - ), - $installer->getTable('downloadable/link_purchased_item'), - 'purchased_id', - $installer->getTable('downloadable/link_purchased'), - 'purchased_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('downloadable/link_purchased_item', 'order_item_id', 'sales/order_item', 'item_id'), - $installer->getTable('downloadable/link_purchased_item'), - 'order_item_id', - $installer->getTable('sales/order_item'), - 'item_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('downloadable/link_title', 'link_id', 'downloadable/link', 'link_id'), - $installer->getTable('downloadable/link_title'), - 'link_id', - $installer->getTable('downloadable/link'), - 'link_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('downloadable/link_title', 'store_id', 'core/store', 'store_id'), - $installer->getTable('downloadable/link_title'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('downloadable/sample', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('downloadable/sample'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('downloadable/sample_title', 'sample_id', 'downloadable/sample', 'sample_id'), - $installer->getTable('downloadable/sample_title'), - 'sample_id', - $installer->getTable('downloadable/sample'), - 'sample_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('downloadable/sample_title', 'store_id', 'core/store', 'store_id'), - $installer->getTable('downloadable/sample_title'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 284a59a1a80..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,275 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('eav_attribute')}; -CREATE TABLE {$this->getTable('eav_attribute')} ( - `attribute_id` smallint(5) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_code` varchar(255) NOT NULL default '', - `attribute_model` varchar(255) default NULL, - `backend_model` varchar(255) default NULL, - `backend_type` enum('static','datetime','decimal','int','text','varchar') NOT NULL default 'static', - `backend_table` varchar(255) default NULL, - `frontend_model` varchar(255) default NULL, - `frontend_input` varchar(50) default NULL, - `frontend_input_renderer` varchar(255) default NULL, - `frontend_label` varchar(255) default NULL, - `frontend_class` varchar(255) default NULL, - `source_model` varchar(255) default NULL, - `is_global` tinyint(1) unsigned NOT NULL default '1', - `is_visible` tinyint(1) unsigned NOT NULL default '1', - `is_required` tinyint(1) unsigned NOT NULL default '0', - `is_user_defined` tinyint(1) unsigned NOT NULL default '0', - `default_value` text, - `is_searchable` tinyint(1) unsigned NOT NULL default '0', - `is_filterable` tinyint(1) unsigned NOT NULL default '0', - `is_comparable` tinyint(1) unsigned NOT NULL default '0', - `is_visible_on_front` tinyint(1) unsigned NOT NULL default '0', - `is_unique` tinyint(1) unsigned NOT NULL default '0', - `apply_to` tinyint(3) unsigned NOT NULL default '0', - `is_used_for_price_rules` tinyint(1) unsigned NOT NULL default '0', - `is_filterable_in_search` tinyint(1) unsigned NOT NULL default '0', - `use_in_super_product` tinyint(1) unsigned NOT NULL default '1', - `used_in_product_listing` tinyint(1) unsigned NOT NULL default '0', - `used_for_sort_by` tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (`attribute_id`), - UNIQUE KEY `entity_type_id` (`entity_type_id`,`attribute_code`), - KEY `IDX_USED_FOR_SORT_BY` (`entity_type_id`,`used_for_sort_by`), - KEY `IDX_USED_IN_PRODUCT_LISTING` (`entity_type_id`,`used_in_product_listing`), - CONSTRAINT `FK_eav_attribute` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('eav_attribute_group')}; -CREATE TABLE {$this->getTable('eav_attribute_group')} ( - `attribute_group_id` smallint(5) unsigned NOT NULL auto_increment, - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `attribute_group_name` varchar(255) character set latin1 NOT NULL default '', - `sort_order` smallint(6) NOT NULL default '0', - PRIMARY KEY (`attribute_group_id`), - UNIQUE KEY `attribute_set_id` (`attribute_set_id`,`attribute_group_name`), - KEY `attribute_set_id_2` (`attribute_set_id`,`sort_order`), - CONSTRAINT `FK_eav_attribute_group` FOREIGN KEY (`attribute_set_id`) REFERENCES `{$this->getTable('eav_attribute_set')}` (`attribute_set_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('eav_attribute_option')}; -CREATE TABLE {$this->getTable('eav_attribute_option')} ( - `option_id` int(10) unsigned NOT NULL auto_increment, - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `sort_order` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`option_id`), - KEY `FK_ATTRIBUTE_OPTION_ATTRIBUTE` (`attribute_id`), - CONSTRAINT `FK_ATTRIBUTE_OPTION_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Attributes option (for source model)'; - --- DROP TABLE IF EXISTS {$this->getTable('eav_attribute_option_value')}; -CREATE TABLE {$this->getTable('eav_attribute_option_value')} ( - `value_id` int(10) unsigned NOT NULL auto_increment, - `option_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_ATTRIBUTE_OPTION_VALUE_OPTION` (`option_id`), - KEY `FK_ATTRIBUTE_OPTION_VALUE_STORE` (`store_id`), - CONSTRAINT `FK_ATTRIBUTE_OPTION_VALUE_OPTION` FOREIGN KEY (`option_id`) REFERENCES `{$this->getTable('eav_attribute_option')}` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_ATTRIBUTE_OPTION_VALUE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Attribute option values per store'; - --- DROP TABLE IF EXISTS {$this->getTable('eav_attribute_set')}; -CREATE TABLE {$this->getTable('eav_attribute_set')} ( - `attribute_set_id` smallint(5) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_set_name` varchar(255) character set utf8 collate utf8_swedish_ci NOT NULL default '', - `sort_order` smallint(6) NOT NULL default '0', - PRIMARY KEY (`attribute_set_id`), - UNIQUE KEY `entity_type_id` (`entity_type_id`,`attribute_set_name`), - KEY `entity_type_id_2` (`entity_type_id`,`sort_order`), - CONSTRAINT `FK_eav_attribute_set` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('eav_entity')}; -CREATE TABLE {$this->getTable('eav_entity')} ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(11) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_ENTITY_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_ENTITY_STORE` (`store_id`), - CONSTRAINT `FK_eav_entity` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_eav_entity_store` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Entityies'; - --- DROP TABLE IF EXISTS {$this->getTable('eav_entity_attribute')}; -CREATE TABLE {$this->getTable('eav_entity_attribute')} ( - `entity_attribute_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `attribute_group_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `sort_order` smallint(6) NOT NULL default '0', - PRIMARY KEY (`entity_attribute_id`), - UNIQUE KEY `attribute_set_id_2` (`attribute_set_id`,`attribute_id`), - UNIQUE KEY `attribute_group_id` (`attribute_group_id`,`attribute_id`), - KEY `attribute_set_id_3` (`attribute_set_id`,`sort_order`), - KEY `FK_EAV_ENTITY_ATTRIVUTE_ATTRIBUTE` (`attribute_id`), - CONSTRAINT `FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_ENTITY_ATTRIBUTE_GROUP` FOREIGN KEY (`attribute_group_id`) REFERENCES `{$this->getTable('eav_attribute_group')}` (`attribute_group_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('eav_entity_datetime')}; -CREATE TABLE {$this->getTable('eav_entity_datetime')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_ATTRIBUTE_DATETIME_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_ATTRIBUTE_DATETIME_ATTRIBUTE` (`attribute_id`), - KEY `FK_ATTRIBUTE_DATETIME_STORE` (`store_id`), - KEY `FK_ATTRIBUTE_DATETIME_ENTITY` (`entity_id`), - KEY `value_by_attribute` (`attribute_id`,`value`), - KEY `value_by_entity_type` (`entity_type_id`,`value`), - CONSTRAINT `FK_EAV_ENTITY_DATETIME_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('eav_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_ENTITY_DATETIME_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_ENTITY_DATETIME_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Datetime values of attributes'; - --- DROP TABLE IF EXISTS {$this->getTable('eav_entity_decimal')}; -CREATE TABLE {$this->getTable('eav_entity_decimal')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_ATTRIBUTE_DECIMAL_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_ATTRIBUTE_DECIMAL_ATTRIBUTE` (`attribute_id`), - KEY `FK_ATTRIBUTE_DECIMAL_STORE` (`store_id`), - KEY `FK_ATTRIBUTE_DECIMAL_ENTITY` (`entity_id`), - KEY `value_by_attribute` (`attribute_id`,`value`), - KEY `value_by_entity_type` (`entity_type_id`,`value`), - CONSTRAINT `FK_EAV_ENTITY_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('eav_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_ENTITY_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_ENTITY_DECIMAL_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Decimal values of attributes'; - --- DROP TABLE IF EXISTS {$this->getTable('eav_entity_int')}; -CREATE TABLE {$this->getTable('eav_entity_int')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_ATTRIBUTE_INT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_ATTRIBUTE_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_ATTRIBUTE_INT_STORE` (`store_id`), - KEY `FK_ATTRIBUTE_INT_ENTITY` (`entity_id`), - KEY `value_by_attribute` (`attribute_id`,`value`), - KEY `value_by_entity_type` (`entity_type_id`,`value`), - CONSTRAINT `FK_EAV_ENTITY_INT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('eav_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_ENTITY_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_ENTITY_INT_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Integer values of attributes'; - --- DROP TABLE IF EXISTS {$this->getTable('eav_entity_store')}; -CREATE TABLE {$this->getTable('eav_entity_store')} ( - `entity_store_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `increment_prefix` varchar(20) NOT NULL default '', - `increment_last_id` varchar(50) NOT NULL default '', - PRIMARY KEY (`entity_store_id`), - KEY `FK_eav_entity_store_entity_type` (`entity_type_id`), - KEY `FK_eav_entity_store_store` (`store_id`), - CONSTRAINT `FK_eav_entity_store_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_eav_entity_store_store` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('eav_entity_text')}; -CREATE TABLE {$this->getTable('eav_entity_text')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_ATTRIBUTE_TEXT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_ATTRIBUTE_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_ATTRIBUTE_TEXT_STORE` (`store_id`), - KEY `FK_ATTRIBUTE_TEXT_ENTITY` (`entity_id`), - CONSTRAINT `FK_EAV_ENTITY_TEXT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('eav_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_ENTITY_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_ENTITY_TEXT_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Text values of attributes'; - --- DROP TABLE IF EXISTS {$this->getTable('eav_entity_type')}; -CREATE TABLE {$this->getTable('eav_entity_type')} ( - `entity_type_id` smallint(5) unsigned NOT NULL auto_increment, - `entity_type_code` varchar(50) NOT NULL default '', - `entity_table` varchar(255) NOT NULL default '', - `value_table_prefix` varchar(255) NOT NULL default '', - `entity_id_field` varchar(255) NOT NULL default '', - `is_data_sharing` tinyint(4) unsigned NOT NULL default '1', - `data_sharing_key` varchar(100) default 'default', - `default_attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_model` varchar(255) NOT NULL default '', - `increment_per_store` tinyint(1) unsigned NOT NULL default '0', - `increment_pad_length` tinyint(8) unsigned NOT NULL default '8', - `increment_pad_char` char(1) NOT NULL default '0', - PRIMARY KEY (`entity_type_id`), - KEY `entity_name` (`entity_type_code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('eav_entity_varchar')}; -CREATE TABLE {$this->getTable('eav_entity_varchar')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_ATTRIBUTE_VARCHAR_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_ATTRIBUTE_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_ATTRIBUTE_VARCHAR_STORE` (`store_id`), - KEY `FK_ATTRIBUTE_VARCHAR_ENTITY` (`entity_id`), - KEY `value_by_attribute` (`attribute_id`,`value`), - KEY `value_by_entity_type` (`entity_type_id`,`value`), - CONSTRAINT `FK_EAV_ENTITY_VARCHAR_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('eav_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_ENTITY_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_ENTITY_VARCHAR_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Varchar values of attributes'; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index e0a76b91646..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropColumn($this->getTable('eav_attribute'), 'attribute_name'); -$installer->getConnection()->dropColumn($this->getTable('eav_attribute'), 'apply_to'); -$installer->run(" - ALTER TABLE {$this->getTable('eav_attribute')} ADD COLUMN `is_configurable` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index fef2988ff71..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($installer->getTable('eav_attribute'), 'apply_to', 'VARCHAR(255) NOT NULL'); -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php deleted file mode 100644 index 6864f6632dc..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php +++ /dev/null @@ -1,31 +0,0 @@ -startSetup(); - -$table = $installer->getTable('eav/attribute'); -$installer->getConnection()->addColumn( - $table, - 'is_filterable_in_search', - "TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'", -); -$installer->run(" - UPDATE `{$table}` SET is_filterable_in_search=(is_filterable!=0) -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.11-0.7.12.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.11-0.7.12.php deleted file mode 100644 index 261a39ab634..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.11-0.7.12.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($installer->getTable('eav_attribute'), 'is_html_allowed_on_front', "tinyint(1) unsigned not null default '0' after `is_visible_on_front`"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.12-0.7.13.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.12-0.7.13.php deleted file mode 100644 index 4e36cc782c4..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.12-0.7.13.php +++ /dev/null @@ -1,32 +0,0 @@ -startSetup(); - -$installer->getConnection()->addConstraint( - 'FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE', - $installer->getTable('eav/entity_attribute'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', - 'CASCADE', - 'CASCADE', - true, -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.13-0.7.14.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.13-0.7.14.php deleted file mode 100644 index 3a89365dadd..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.13-0.7.14.php +++ /dev/null @@ -1,38 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('eav/entity_type'), 'additional_attribute_table', 'varchar(255) NOT NULL DEFAULT \'\''); -$installer->getConnection()->addColumn($installer->getTable('eav/entity_type'), 'entity_attribute_collection', 'varchar(255) NOT NULL DEFAULT \'\''); -$installer->run(" - CREATE TABLE `{$installer->getTable('eav/attribute_label')}` ( - `attribute_label_id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0', - `store_id` smallint(5) unsigned NOT NULL DEFAULT '0', - `value` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`attribute_label_id`), - KEY `IDX_ATTRIBUTE_LABEL_ATTRIBUTE` (`attribute_id`), - KEY `IDX_ATTRIBUTE_LABEL_STORE` (`store_id`), - KEY `IDX_ATTRIBUTE_LABEL_ATTRIBUTE_STORE` (`attribute_id`, `store_id`), - CONSTRAINT `FK_ATTRIBUTE_LABEL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav/attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_ATTRIBUTE_LABEL_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.14-0.7.15.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.14-0.7.15.php deleted file mode 100644 index 3388ec10a62..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.14-0.7.15.php +++ /dev/null @@ -1,85 +0,0 @@ -startSetup(); - -$installer->run(" - -CREATE TABLE `{$installer->getTable('eav/form_type')}` ( - `type_id` smallint(5) unsigned NOT NULL auto_increment, - `code` char(64) NOT NULL, - `label` varchar(255) NOT NULL, - `is_system` tinyint(1) unsigned NOT NULL default '0', - `theme` varchar(64) NOT NULL default '', - `store_id` smallint(5) unsigned NOT NULL, - PRIMARY KEY (`type_id`), - UNIQUE KEY `UNQ_FORM_TYPE_CODE` (`code`, `theme`, `store_id`), - KEY `IDX_STORE` (`store_id`), - CONSTRAINT `FK_EAV_FORM_TYPE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('eav/form_type_entity')}` ( - `type_id` smallint(5) unsigned NOT NULL, - `entity_type_id` smallint(5) unsigned NOT NULL, - PRIMARY KEY (`type_id`,`entity_type_id`), - KEY `IDX_EAV_ENTITY_TYPE` (`entity_type_id`), - CONSTRAINT `FK_EAV_FORM_TYPE_ENTITY_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav/entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_FORM_TYPE_ENTITY_FORM_TYPE` FOREIGN KEY (`type_id`) REFERENCES `{$installer->getTable('eav/form_type')}` (`type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('eav/form_fieldset')}` ( - `fieldset_id` smallint(5) unsigned NOT NULL auto_increment, - `type_id` smallint(5) unsigned NOT NULL, - `code` char(64) NOT NULL, - `sort_order` int(11) NOT NULL default '0', - PRIMARY KEY (`fieldset_id`), - UNIQUE KEY `UNQ_FORM_FIELDSET_CODE` (`type_id`,`code`), - KEY `IDX_FORM_TYPE` (`type_id`), - CONSTRAINT `FK_EAV_FORM_FIELDSET_FORM_TYPE` FOREIGN KEY (`type_id`) REFERENCES `{$installer->getTable('eav/form_type')}` (`type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('eav/form_fieldset_label')}` ( - `fieldset_id` smallint(5) unsigned NOT NULL, - `store_id` smallint(5) unsigned NOT NULL, - `label` varchar(255) NOT NULL, - PRIMARY KEY (`fieldset_id`, `store_id`), - KEY `IDX_FORM_FIELDSET` (`fieldset_id`), - KEY `IDX_STORE` (`store_id`), - CONSTRAINT `FK_EAV_FORM_FIELDSET_LABEL_FORM_FIELDSET` FOREIGN KEY (`fieldset_id`) REFERENCES `{$installer->getTable('eav/form_fieldset')}` (`fieldset_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_FORM_FIELDSET_LABEL_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('eav_form_element')}` ( - `element_id` int(10) unsigned NOT NULL auto_increment, - `type_id` smallint(5) unsigned NOT NULL, - `fieldset_id` smallint(5) unsigned default NULL, - `attribute_id` smallint(5) unsigned NOT NULL, - `sort_order` int(11) NOT NULL default '0', - PRIMARY KEY (`element_id`), - KEY `IDX_FORM_TYPE` (`type_id`), - UNIQUE KEY `UNQ_FORM_ATTRIBUTE` (`type_id`,`attribute_id`), - KEY `IDX_FORM_FIELDSET` (`fieldset_id`), - KEY `IDX_FORM_ATTRIBUTE` (`attribute_id`), - CONSTRAINT `FK_EAV_FORM_ELEMENT_FORM_TYPE` FOREIGN KEY (`type_id`) REFERENCES `{$installer->getTable('eav/form_type')}` (`type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_FORM_ELEMENT_FORM_FIELDSET` FOREIGN KEY (`fieldset_id`) REFERENCES `{$installer->getTable('eav/form_fieldset')}` (`fieldset_id`) ON DELETE SET NULL ON UPDATE CASCADE, - CONSTRAINT `FK_EAV_FORM_ELEMENT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav/attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.15-0.7.16.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.15-0.7.16.php deleted file mode 100644 index 34b40c30cc6..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.15-0.7.16.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$conn = $installer->getConnection(); -foreach (['datetime', 'decimal', 'int', 'text', 'varchar'] as $type) { - $tableName = $installer->getTable('eav_entity_' . $type); - $conn->addKey($tableName, 'UNQ_ATTRIBUTE_VALUE', ['entity_id','attribute_id','store_id'], 'unique'); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index 48e9f7e5d7e..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('eav_entity_type'), 'entity_model', 'VARCHAR(255) NOT NULL after entity_type_code'); -$installer->getConnection()->addColumn($installer->getTable('eav_entity_type'), 'attribute_model', 'VARCHAR(255) NOT NULL after entity_model'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.3-0.7.4.php deleted file mode 100644 index 25ec9b4a697..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($installer->getTable('eav_attribute'), 'position', 'INT(11) NOT NULL'); -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index 8521ae31b5b..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($installer->getTable('eav_attribute'), 'note', 'VARCHAR( 255 ) NOT NULL'); -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.5-0.7.6.php deleted file mode 100644 index c257ea96a83..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('eav_attribute_group'), 'default_id', 'SMALLINT( 5 ) NOT NULL'); -$installer->installDefaultGroupIds(); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.6-0.7.7.php deleted file mode 100644 index 58adead9728..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$installer->getTable('eav_attribute_group')} - CHANGE `default_id` `default_id` smallint unsigned NULL default '0'; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php deleted file mode 100644 index fb265b2cfd0..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('eav/attribute'), 'is_visible_in_advanced_search', "TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0'"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.8-0.7.9.php deleted file mode 100644 index 2f7fc196acb..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$installer->getTable('eav_attribute_group')} - CHANGE `attribute_group_name` `attribute_group_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default ''; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php deleted file mode 100644 index ebb616f2b23..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($installer->getTable('eav/attribute'), 'is_used_for_price_rules', "TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 412e40af3a3..00000000000 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,2222 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/attribute'), - 'FK_EAV_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/attribute_group'), - 'FK_EAV_ATTRIBUTE_GROUP', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/attribute_label'), - 'FK_ATTRIBUTE_LABEL_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/attribute_label'), - 'FK_ATTRIBUTE_LABEL_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/attribute_option'), - 'FK_ATTRIBUTE_OPTION_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/attribute_option_value'), - 'FK_ATTRIBUTE_OPTION_VALUE_OPTION', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/attribute_option_value'), - 'FK_ATTRIBUTE_OPTION_VALUE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/attribute_set'), - 'FK_EAV_ATTRIBUTE_SET', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/entity'), - 'FK_EAV_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/entity'), - 'FK_EAV_ENTITY_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/entity_attribute'), - 'FK_EAV_ENTITY_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/entity_attribute'), - 'FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/entity_attribute'), - 'FK_EAV_ENTITY_ATTRIBUTE_GROUP', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/entity_attribute'), - 'FK_EAV_ENTITY_ATTRIVUTE_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/entity_attribute'), - 'FK_EAV_ENTITY_ATTRIVUTE_GROUP', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/entity_store'), - 'FK_EAV_ENTITY_STORE_ENTITY_TYPE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/entity_store'), - 'FK_EAV_ENTITY_STORE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/form_element'), - 'FK_EAV_FORM_ELEMENT_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/form_element'), - 'FK_EAV_FORM_ELEMENT_FORM_FIELDSET', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/form_element'), - 'FK_EAV_FORM_ELEMENT_FORM_TYPE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/form_fieldset_label'), - 'FK_EAV_FORM_FIELDSET_LABEL_FORM_FIELDSET', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/form_fieldset_label'), - 'FK_EAV_FORM_FIELDSET_LABEL_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/form_type'), - 'FK_EAV_FORM_TYPE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/form_type_entity'), - 'FK_EAV_FORM_TYPE_ENTITY_ENTITY_TYPE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/form_type_entity'), - 'FK_EAV_FORM_TYPE_ENTITY_FORM_TYPE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('eav/form_fieldset'), - 'FK_EAV_FORM_FIELDSET_FORM_TYPE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - 'FK_EAV_ENTITY_DATETIME_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - 'FK_EAV_ENTITY_DATETIME_ENTITY_TYPE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - 'FK_EAV_ENTITY_DATETIME_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - 'FK_EAV_ENTITY_DECIMAL_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - 'FK_EAV_ENTITY_DECIMAL_ENTITY_TYPE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - 'FK_EAV_ENTITY_DECIMAL_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'int']), - 'FK_EAV_ENTITY_INT_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'int']), - 'FK_EAV_ENTITY_INT_ENTITY_TYPE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'int']), - 'FK_EAV_ENTITY_INT_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'text']), - 'FK_EAV_ENTITY_TEXT_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'text']), - 'FK_EAV_ENTITY_TEXT_ENTITY_TYPE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'text']), - 'FK_EAV_ENTITY_TEXT_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - 'FK_EAV_ENTITY_VARCHAR_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - 'FK_EAV_ENTITY_VARCHAR_ENTITY_TYPE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - 'FK_EAV_ENTITY_VARCHAR_STORE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('eav/attribute'), - 'ENTITY_TYPE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/attribute_group'), - 'ATTRIBUTE_SET_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/attribute_group'), - 'ATTRIBUTE_SET_ID_2', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/attribute_label'), - 'IDX_ATTRIBUTE_LABEL_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/attribute_label'), - 'IDX_ATTRIBUTE_LABEL_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/attribute_label'), - 'IDX_ATTRIBUTE_LABEL_ATTRIBUTE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/attribute_option'), - 'FK_ATTRIBUTE_OPTION_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/attribute_option_value'), - 'FK_ATTRIBUTE_OPTION_VALUE_OPTION', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/attribute_option_value'), - 'FK_ATTRIBUTE_OPTION_VALUE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/attribute_set'), - 'ENTITY_TYPE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/attribute_set'), - 'ENTITY_TYPE_ID_2', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/entity'), - 'FK_ENTITY_ENTITY_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/entity'), - 'FK_ENTITY_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/entity_attribute'), - 'ATTRIBUTE_SET_ID_2', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/entity_attribute'), - 'ATTRIBUTE_GROUP_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/entity_attribute'), - 'ATTRIBUTE_SET_ID_3', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/entity_attribute'), - 'FK_EAV_ENTITY_ATTRIVUTE_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/entity_store'), - 'FK_EAV_ENTITY_STORE_ENTITY_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/entity_store'), - 'FK_EAV_ENTITY_STORE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/entity_type'), - 'ENTITY_NAME', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/form_element'), - 'UNQ_FORM_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/form_element'), - 'IDX_FORM_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/form_element'), - 'IDX_FORM_FIELDSET', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/form_element'), - 'IDX_FORM_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/form_fieldset'), - 'UNQ_FORM_FIELDSET_CODE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/form_fieldset'), - 'IDX_FORM_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/form_fieldset_label'), - 'IDX_FORM_FIELDSET', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/form_fieldset_label'), - 'IDX_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/form_type'), - 'UNQ_FORM_TYPE_CODE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/form_type'), - 'IDX_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('eav/form_type_entity'), - 'IDX_EAV_ENTITY_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - 'UNQ_ATTRIBUTE_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - 'FK_ATTRIBUTE_DATETIME_ENTITY_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - 'FK_ATTRIBUTE_DATETIME_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - 'FK_ATTRIBUTE_DATETIME_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - 'FK_ATTRIBUTE_DATETIME_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - 'VALUE_BY_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - 'VALUE_BY_ENTITY_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - 'UNQ_ATTRIBUTE_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - 'FK_ATTRIBUTE_DECIMAL_ENTITY_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - 'FK_ATTRIBUTE_DECIMAL_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - 'FK_ATTRIBUTE_DECIMAL_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - 'FK_ATTRIBUTE_DECIMAL_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - 'VALUE_BY_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - 'VALUE_BY_ENTITY_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'int']), - 'UNQ_ATTRIBUTE_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'int']), - 'FK_ATTRIBUTE_INT_ENTITY_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'int']), - 'FK_ATTRIBUTE_INT_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'int']), - 'FK_ATTRIBUTE_INT_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'int']), - 'FK_ATTRIBUTE_INT_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'int']), - 'VALUE_BY_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'int']), - 'VALUE_BY_ENTITY_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'text']), - 'UNQ_ATTRIBUTE_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'text']), - 'FK_ATTRIBUTE_TEXT_ENTITY_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'text']), - 'FK_ATTRIBUTE_TEXT_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'text']), - 'FK_ATTRIBUTE_TEXT_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'text']), - 'FK_ATTRIBUTE_TEXT_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - 'UNQ_ATTRIBUTE_VALUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - 'FK_ATTRIBUTE_VARCHAR_ENTITY_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - 'FK_ATTRIBUTE_VARCHAR_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - 'FK_ATTRIBUTE_VARCHAR_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - 'FK_ATTRIBUTE_VARCHAR_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - 'VALUE_BY_ATTRIBUTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - 'VALUE_BY_ENTITY_TYPE', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('eav/entity') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_set_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Set Id', - ], - 'increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'nullable' => false, - 'comment' => 'Increment Id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Parent Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Updated At', - ], - 'is_active' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Defines Is Entity Active', - ], - ], - 'comment' => 'Eav Entity', - ], - $installer->getTable('eav/entity_type') => [ - 'columns' => [ - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Type Id', - ], - 'entity_type_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'nullable' => false, - 'comment' => 'Entity Type Code', - ], - 'entity_model' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Entity Model', - ], - 'attribute_model' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Attribute Model', - ], - 'entity_table' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Entity Table', - ], - 'value_table_prefix' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Value Table Prefix', - ], - 'entity_id_field' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Entity Id Field', - ], - 'is_data_sharing' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Defines Is Data Sharing', - ], - 'data_sharing_key' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 100, - 'default' => 'default', - 'comment' => 'Data Sharing Key', - ], - 'default_attribute_set_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Default Attribute Set Id', - ], - 'increment_model' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => true, - 'default' => '', - 'comment' => 'Increment Model', - ], - 'increment_per_store' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Increment Per Store', - ], - 'increment_pad_length' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '8', - 'comment' => 'Increment Pad Length', - ], - 'increment_pad_char' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 1, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Increment Pad Char', - ], - 'additional_attribute_table' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => true, - 'default' => '', - 'comment' => 'Additional Attribute Table', - ], - 'entity_attribute_collection' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => true, - 'default' => '', - 'comment' => 'Entity Attribute Collection', - ], - ], - 'comment' => 'Eav Entity Type', - ], - $installer->getTable('eav/entity_store') => [ - 'columns' => [ - 'entity_store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Store Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'increment_prefix' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 20, - 'comment' => 'Increment Prefix', - ], - 'increment_last_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Last Incremented Id', - ], - ], - 'comment' => 'Eav Entity Store', - ], - $installer->getTable('eav/entity_attribute') => [ - 'columns' => [ - 'entity_attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Attribute Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_set_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Set Id', - ], - 'attribute_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Group Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Id', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - ], - 'comment' => 'Eav Entity Attributes', - ], - $installer->getTable('eav/attribute') => [ - 'columns' => [ - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Attribute Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Attribute Code', - ], - 'attribute_model' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Attribute Model', - ], - 'backend_model' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Backend Model', - ], - 'backend_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 8, - 'nullable' => false, - 'default' => 'static', - 'comment' => 'Backend Type', - ], - 'backend_table' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Backend Table', - ], - 'frontend_model' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Frontend Model', - ], - 'frontend_input' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Frontend Input', - ], - 'frontend_label' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Frontend Label', - ], - 'frontend_class' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Frontend Class', - ], - 'source_model' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Source Model', - ], - 'is_required' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Defines Is Required', - ], - 'is_user_defined' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Defines Is User Defined', - ], - 'default_value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Default Value', - ], - 'is_unique' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Defines Is Unique', - ], - 'note' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Note', - ], - ], - 'comment' => 'Eav Attribute', - ], - $installer->getTable('eav/attribute_set') => [ - 'columns' => [ - 'attribute_set_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Attribute Set Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - 'attribute_set_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Attribute Set Name', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - ], - 'comment' => 'Eav Attribute Set', - ], - $installer->getTable('eav/attribute_group') => [ - 'columns' => [ - 'attribute_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Attribute Group Id', - ], - 'attribute_set_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Set Id', - ], - 'attribute_group_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Attribute Group Name', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - 'default_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Default Id', - ], - ], - 'comment' => 'Eav Attribute Group', - ], - $installer->getTable('eav/attribute_option') => [ - 'columns' => [ - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Option Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Id', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - ], - 'comment' => 'Eav Attribute Option', - ], - $installer->getTable('eav/attribute_option_value') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Option Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Value', - ], - ], - 'comment' => 'Eav Attribute Option Value', - ], - $installer->getTable('eav/attribute_label') => [ - 'columns' => [ - 'attribute_label_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Attribute Label Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Value', - ], - ], - 'comment' => 'Eav Attribute Label', - ], - $installer->getTable('eav/form_type') => [ - 'columns' => [ - 'type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Type Id', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'nullable' => false, - 'comment' => 'Code', - ], - 'label' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Label', - ], - 'is_system' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is System', - ], - 'theme' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'comment' => 'Theme', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Id', - ], - ], - 'comment' => 'Eav Form Type', - ], - $installer->getTable('eav/form_type_entity') => [ - 'columns' => [ - 'type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Type Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Entity Type Id', - ], - ], - 'comment' => 'Eav Form Type Entity', - ], - $installer->getTable('eav/form_fieldset') => [ - 'columns' => [ - 'fieldset_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Fieldset Id', - ], - 'type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Type Id', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'nullable' => false, - 'comment' => 'Code', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - ], - 'comment' => 'Eav Form Fieldset', - ], - $installer->getTable('eav/form_fieldset_label') => [ - 'columns' => [ - 'fieldset_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Fieldset Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'label' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Label', - ], - ], - 'comment' => 'Eav Form Fieldset Label', - ], - $installer->getTable('eav/form_element') => [ - 'columns' => [ - 'element_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Element Id', - ], - 'type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Type Id', - ], - 'fieldset_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Fieldset Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Id', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - ], - 'comment' => 'Eav Form Element', - ] - , - $installer->getTable(['eav/entity_value_prefix', 'datetime']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATETIME, - 'nullable' => false, - 'default' => '0000-00-00 00:00:00', - 'comment' => 'Attribute Value', - ], - ], - 'comment' => 'Eav Entity Value Prefix', - ], - $installer->getTable(['eav/entity_value_prefix', 'decimal']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Attribute Value', - ], - ], - 'comment' => 'Eav Entity Value Prefix', - ], - $installer->getTable(['eav/entity_value_prefix', 'int']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Attribute Value', - ], - ], - 'comment' => 'Eav Entity Value Prefix', - ], - $installer->getTable(['eav/entity_value_prefix', 'text']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'nullable' => false, - 'comment' => 'Attribute Value', - ], - ], - 'comment' => 'Eav Entity Value Prefix', - ], - $installer->getTable(['eav/entity_value_prefix', 'varchar']) => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Attribute Value', - ], - ], - 'comment' => 'Eav Entity Value Prefix', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('eav/attribute'), - $installer->getIdxName( - 'eav/attribute', - ['entity_type_id', 'attribute_code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_type_id', 'attribute_code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/attribute'), - $installer->getIdxName('eav/attribute', ['entity_type_id']), - ['entity_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/attribute_group'), - $installer->getIdxName( - 'eav/attribute_group', - ['attribute_set_id', 'attribute_group_name'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['attribute_set_id', 'attribute_group_name'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/attribute_group'), - $installer->getIdxName('eav/attribute_group', ['attribute_set_id', 'sort_order']), - ['attribute_set_id', 'sort_order'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/attribute_label'), - $installer->getIdxName('eav/attribute_label', ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/attribute_label'), - $installer->getIdxName('eav/attribute_label', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/attribute_label'), - $installer->getIdxName('eav/attribute_label', ['attribute_id', 'store_id']), - ['attribute_id', 'store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/attribute_option'), - $installer->getIdxName('eav/attribute_option', ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/attribute_option_value'), - $installer->getIdxName('eav/attribute_option_value', ['option_id']), - ['option_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/attribute_option_value'), - $installer->getIdxName('eav/attribute_option_value', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/attribute_set'), - $installer->getIdxName( - 'eav/attribute_set', - ['entity_type_id', 'attribute_set_name'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_type_id', 'attribute_set_name'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/attribute_set'), - $installer->getIdxName('eav/attribute_set', ['entity_type_id', 'sort_order']), - ['entity_type_id', 'sort_order'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/entity'), - $installer->getIdxName('eav/entity', ['entity_type_id']), - ['entity_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/entity'), - $installer->getIdxName('eav/entity', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/entity_attribute'), - $installer->getIdxName( - 'eav/entity_attribute', - ['attribute_set_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['attribute_set_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/entity_attribute'), - $installer->getIdxName( - 'eav/entity_attribute', - ['attribute_group_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['attribute_group_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/entity_attribute'), - $installer->getIdxName('eav/entity_attribute', ['attribute_set_id', 'sort_order']), - ['attribute_set_id', 'sort_order'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/entity_attribute'), - $installer->getIdxName('eav/entity_attribute', ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/entity_store'), - $installer->getIdxName('eav/entity_store', ['entity_type_id']), - ['entity_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/entity_store'), - $installer->getIdxName('eav/entity_store', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/entity_type'), - $installer->getIdxName('eav/entity_type', ['entity_type_code']), - ['entity_type_code'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/form_element'), - $installer->getIdxName( - 'eav/form_element', - ['type_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['type_id', 'attribute_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/form_element'), - $installer->getIdxName('eav/form_element', ['type_id']), - ['type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/form_element'), - $installer->getIdxName('eav/form_element', ['fieldset_id']), - ['fieldset_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/form_element'), - $installer->getIdxName('eav/form_element', ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/form_fieldset'), - $installer->getIdxName( - 'eav/form_fieldset', - ['type_id', 'code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['type_id', 'code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/form_fieldset'), - $installer->getIdxName('eav/form_fieldset', ['type_id']), - ['type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/form_fieldset_label'), - $installer->getIdxName('eav/form_fieldset_label', ['fieldset_id']), - ['fieldset_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/form_fieldset_label'), - $installer->getIdxName('eav/form_fieldset_label', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/form_type'), - $installer->getIdxName( - 'eav/form_type', - ['code', 'theme', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['code', 'theme', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/form_type'), - $installer->getIdxName('eav/form_type', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('eav/form_type_entity'), - $installer->getIdxName('eav/form_type_entity', ['entity_type_id']), - ['entity_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - $installer->getIdxName( - ['eav/entity_value_prefix', 'datetime'], - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - $installer->getIdxName(['eav/entity_value_prefix', 'datetime'], ['entity_type_id']), - ['entity_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - $installer->getIdxName(['eav/entity_value_prefix', 'datetime'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - $installer->getIdxName(['eav/entity_value_prefix', 'datetime'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - $installer->getIdxName(['eav/entity_value_prefix', 'datetime'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - $installer->getIdxName(['eav/entity_value_prefix', 'datetime'], ['attribute_id', 'value']), - ['attribute_id', 'value'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - $installer->getIdxName(['eav/entity_value_prefix', 'datetime'], ['entity_type_id', 'value']), - ['entity_type_id', 'value'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - $installer->getIdxName( - ['eav/entity_value_prefix', 'decimal'], - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - $installer->getIdxName(['eav/entity_value_prefix', 'decimal'], ['entity_type_id']), - ['entity_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - $installer->getIdxName(['eav/entity_value_prefix', 'decimal'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - $installer->getIdxName(['eav/entity_value_prefix', 'decimal'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - $installer->getIdxName(['eav/entity_value_prefix', 'decimal'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - $installer->getIdxName(['eav/entity_value_prefix', 'decimal'], ['attribute_id', 'value']), - ['attribute_id', 'value'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - $installer->getIdxName(['eav/entity_value_prefix', 'decimal'], ['entity_type_id', 'value']), - ['entity_type_id', 'value'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'int']), - $installer->getIdxName( - ['eav/entity_value_prefix', 'int'], - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'int']), - $installer->getIdxName(['eav/entity_value_prefix', 'int'], ['entity_type_id']), - ['entity_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'int']), - $installer->getIdxName(['eav/entity_value_prefix', 'int'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'int']), - $installer->getIdxName(['eav/entity_value_prefix', 'int'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'int']), - $installer->getIdxName(['eav/entity_value_prefix', 'int'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'int']), - $installer->getIdxName(['eav/entity_value_prefix', 'int'], ['attribute_id', 'value']), - ['attribute_id', 'value'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'int']), - $installer->getIdxName(['eav/entity_value_prefix', 'int'], ['entity_type_id', 'value']), - ['entity_type_id', 'value'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'text']), - $installer->getIdxName( - ['eav/entity_value_prefix', 'text'], - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'text']), - $installer->getIdxName(['eav/entity_value_prefix', 'text'], ['entity_type_id']), - ['entity_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'text']), - $installer->getIdxName(['eav/entity_value_prefix', 'text'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'text']), - $installer->getIdxName(['eav/entity_value_prefix', 'text'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'text']), - $installer->getIdxName(['eav/entity_value_prefix', 'text'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - $installer->getIdxName( - ['eav/entity_value_prefix', 'varchar'], - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_id', 'attribute_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - $installer->getIdxName(['eav/entity_value_prefix', 'varchar'], ['entity_type_id']), - ['entity_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - $installer->getIdxName(['eav/entity_value_prefix', 'varchar'], ['attribute_id']), - ['attribute_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - $installer->getIdxName(['eav/entity_value_prefix', 'varchar'], ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - $installer->getIdxName(['eav/entity_value_prefix', 'varchar'], ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - $installer->getIdxName(['eav/entity_value_prefix', 'varchar'], ['attribute_id', 'value']), - ['attribute_id', 'value'], -); - -$installer->getConnection()->addIndex( - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - $installer->getIdxName(['eav/entity_value_prefix', 'varchar'], ['entity_type_id', 'value']), - ['entity_type_id', 'value'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/attribute', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('eav/attribute'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/attribute_group', 'attribute_set_id', 'eav/attribute_set', 'attribute_set_id'), - $installer->getTable('eav/attribute_group'), - 'attribute_set_id', - $installer->getTable('eav/attribute_set'), - 'attribute_set_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/attribute_label', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('eav/attribute_label'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/attribute_label', 'store_id', 'core/store', 'store_id'), - $installer->getTable('eav/attribute_label'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/attribute_option', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('eav/attribute_option'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/attribute_option_value', 'option_id', 'eav/attribute_option', 'option_id'), - $installer->getTable('eav/attribute_option_value'), - 'option_id', - $installer->getTable('eav/attribute_option'), - 'option_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/attribute_option_value', 'store_id', 'core/store', 'store_id'), - $installer->getTable('eav/attribute_option_value'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/attribute_set', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('eav/attribute_set'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/entity', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('eav/entity'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/entity', 'store_id', 'core/store', 'store_id'), - $installer->getTable('eav/entity'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/entity_attribute', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('eav/entity_attribute'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/entity_attribute', 'attribute_group_id', 'eav/attribute_group', 'attribute_group_id'), - $installer->getTable('eav/entity_attribute'), - 'attribute_group_id', - $installer->getTable('eav/attribute_group'), - 'attribute_group_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/entity_store', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('eav/entity_store'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/entity_store', 'store_id', 'core/store', 'store_id'), - $installer->getTable('eav/entity_store'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/form_element', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('eav/form_element'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/form_element', 'fieldset_id', 'eav/form_fieldset', 'fieldset_id'), - $installer->getTable('eav/form_element'), - 'fieldset_id', - $installer->getTable('eav/form_fieldset'), - 'fieldset_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/form_element', 'type_id', 'eav/form_type', 'type_id'), - $installer->getTable('eav/form_element'), - 'type_id', - $installer->getTable('eav/form_type'), - 'type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/form_fieldset', 'type_id', 'eav/form_type', 'type_id'), - $installer->getTable('eav/form_fieldset'), - 'type_id', - $installer->getTable('eav/form_type'), - 'type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/form_fieldset_label', 'fieldset_id', 'eav/form_fieldset', 'fieldset_id'), - $installer->getTable('eav/form_fieldset_label'), - 'fieldset_id', - $installer->getTable('eav/form_fieldset'), - 'fieldset_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/form_fieldset_label', 'store_id', 'core/store', 'store_id'), - $installer->getTable('eav/form_fieldset_label'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/form_type', 'store_id', 'core/store', 'store_id'), - $installer->getTable('eav/form_type'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/form_type_entity', 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable('eav/form_type_entity'), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('eav/form_type_entity', 'type_id', 'eav/form_type', 'type_id'), - $installer->getTable('eav/form_type_entity'), - 'type_id', - $installer->getTable('eav/form_type'), - 'type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'datetime'], 'entity_id', 'eav/entity', 'entity_id'), - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - 'entity_id', - $installer->getTable('eav/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'datetime'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'datetime'], 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable(['eav/entity_value_prefix', 'datetime']), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'decimal'], 'entity_id', 'eav/entity', 'entity_id'), - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - 'entity_id', - $installer->getTable('eav/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'decimal'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'decimal'], 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable(['eav/entity_value_prefix', 'decimal']), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'int'], 'entity_id', 'eav/entity', 'entity_id'), - $installer->getTable(['eav/entity_value_prefix', 'int']), - 'entity_id', - $installer->getTable('eav/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'int'], 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable(['eav/entity_value_prefix', 'int']), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'int'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['eav/entity_value_prefix', 'int']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'text'], 'entity_id', 'eav/entity', 'entity_id'), - $installer->getTable(['eav/entity_value_prefix', 'text']), - 'entity_id', - $installer->getTable('eav/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'text'], 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable(['eav/entity_value_prefix', 'text']), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'text'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['eav/entity_value_prefix', 'text']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'varchar'], 'entity_id', 'eav/entity', 'entity_id'), - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - 'entity_id', - $installer->getTable('eav/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'varchar'], 'store_id', 'core/store', 'store_id'), - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName(['eav/entity_value_prefix', 'varchar'], 'entity_type_id', 'eav/entity_type', 'entity_type_id'), - $installer->getTable(['eav/entity_value_prefix', 'varchar']), - 'entity_type_id', - $installer->getTable('eav/entity_type'), - 'entity_type_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-install-0.7.0.php deleted file mode 100644 index d2318f71ec1..00000000000 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,57 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('gift_message')}; -CREATE TABLE {$this->getTable('gift_message')} ( - `gift_message_id` int(7) unsigned NOT NULL auto_increment, - `customer_id` int(7) unsigned NOT NULL default '0', - `sender` varchar(255) NOT NULL default '', - `recipient` varchar(255) NOT NULL default '', - `message` text NOT NULL, - PRIMARY KEY (`gift_message_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); - -$installer->addAttribute('quote', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]); -$installer->addAttribute('quote_address', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]); -$installer->addAttribute('quote_item', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]); -$installer->addAttribute('quote_address_item', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]); -$installer->addAttribute('order', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]); -$installer->addAttribute('order_item', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]); -$installer->addAttribute('order_item', 'gift_message_available', ['type' => 'int', 'visible' => false, 'required' => false]); -$installer->addAttribute('catalog_product', 'gift_message_available', [ - 'backend' => 'giftmessage/entity_attribute_backend_boolean_config', - 'frontend' => '', - 'label' => 'Allow Gift Message', - 'input' => 'select', - 'class' => '', - 'source' => 'giftmessage/entity_attribute_source_boolean_config', - 'global' => true, - 'visible' => true, - 'required' => false, - 'user_defined' => false, - 'default' => '2', - 'visible_on_front' => false, -]); diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.1.3-0.7.0.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.1.3-0.7.0.php deleted file mode 100644 index 438ab5cea67..00000000000 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.1.3-0.7.0.php +++ /dev/null @@ -1,41 +0,0 @@ -startSetup() - ->addAttribute('quote', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]) - ->addAttribute('quote_address', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]) - ->addAttribute('quote_item', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]) - ->addAttribute('quote_address_item', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]) - ->addAttribute('order', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]) - ->addAttribute('order_item', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]) - ->addAttribute('order_item', 'gift_message_available', ['type' => 'int', 'visible' => false, 'required' => false]) - ->addAttribute('catalog_product', 'gift_message_available', [ - 'backend' => 'giftmessage/entity_attribute_backend_boolean_config', - 'frontend' => '', - 'label' => 'Allow Gift Message', - 'input' => 'select', - 'class' => '', - 'source' => 'giftmessage/entity_attribute_source_boolean_config', - 'global' => true, - 'visible' => true, - 'required' => false, - 'user_defined' => false, - 'default' => '2', - 'visible_on_front' => false, - ]) - ->removeAttribute('catalog_product', 'gift_message_aviable') - ->setConfigData('sales/gift_messages/allow', 1) - ->endSetup(); diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index cb3209742ed..00000000000 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,20 +0,0 @@ -updateAttribute('catalog_product', 'gift_message_available', 'is_configurable', 0); diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index c6685f770e9..00000000000 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,26 +0,0 @@ -addAttribute('quote', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]); -$installer->addAttribute('quote_address', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]); -$installer->addAttribute('quote_item', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]); -$installer->addAttribute('quote_address_item', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]); -$installer->addAttribute('order', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]); -$installer->addAttribute('order_item', 'gift_message_id', ['type' => 'int', 'visible' => false, 'required' => false]); -$installer->addAttribute('order_item', 'gift_message_available', ['type' => 'int', 'visible' => false, 'required' => false]); diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index 3e3b2e9abf2..00000000000 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,46 +0,0 @@ - 'sales/gift_options/allow_order', - 'sales/gift_messages/allow_items' => 'sales/gift_options/allow_items', -]; - -foreach ($pathesForReplace as $from => $to) { - $installer->run(sprintf( - "UPDATE `%s` SET `path` = '%s' WHERE `path` = '%s'", - $this->getTable('core/config_data'), - $to, - $from, - )); -} - -/* - * Create new attribute group and move gift_message_available attribute to this group - */ -$entityTypeId = $installer->getEntityTypeId('catalog_product'); -$attributeId = $installer->getAttributeId('catalog_product', 'gift_message_available'); - -$attributeSets = $installer->_conn->fetchAll('select * from ' . $this->getTable('eav/attribute_set') . ' where entity_type_id=?', $entityTypeId); -foreach ($attributeSets as $attributeSet) { - $setId = $attributeSet['attribute_set_id']; - $installer->addAttributeGroup($entityTypeId, $setId, 'Gift Options'); - $groupId = $installer->getAttributeGroupId($entityTypeId, $setId, 'Gift Options'); - $installer->addAttributeToGroup($entityTypeId, $setId, $groupId, $attributeId); -} diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.3-0.7.4.php deleted file mode 100644 index db331e4ea35..00000000000 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ /dev/null @@ -1,62 +0,0 @@ -updateAttribute( - 'catalog_product', - 'gift_message_available', - 'source_model', - 'eav/entity_attribute_source_boolean', -); - -$installer->updateAttribute( - 'catalog_product', - 'gift_message_available', - 'backend_model', - 'catalog/product_attribute_backend_boolean', -); - -$installer->updateAttribute( - 'catalog_product', - 'gift_message_available', - 'frontend_input_renderer', - 'adminhtml/catalog_product_helper_form_config', -); - -$installer->updateAttribute( - 'catalog_product', - 'gift_message_available', - 'default_value', - '', -); - -/* - * Update previously saved data for 'gift_message_available' attribute - */ -$entityTypeId = $installer->getEntityTypeId('catalog_product'); -$attributeId = $installer->getAttributeId($entityTypeId, 'gift_message_available'); - -$installer->getConnection()->update( - $installer->getTable('catalog_product_entity_varchar'), - ['value' => ''], - [ - 'entity_type_id =?' => $entityTypeId, - 'attribute_id =?' => $attributeId, - 'value =?' => '2', - ], -); diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index 1df41dd079d..00000000000 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,20 +0,0 @@ -updateAttribute('catalog_product', 'gift_message_available', 'apply_to', ''); diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.5-0.7.6.php deleted file mode 100644 index 68fb274c381..00000000000 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ /dev/null @@ -1,25 +0,0 @@ -updateAttribute( - 'catalog_product', - 'gift_message_available', - 'frontend_input_renderer', - 'giftmessage/adminhtml_product_helper_form_config', -); diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 14cbf7df6b4..00000000000 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,115 +0,0 @@ -startSetup(); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('giftmessage/message') => [ - 'columns' => [ - 'gift_message_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'GiftMessage Id', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Customer id', - ], - 'sender' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Sender', - ], - 'recipient' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Recipient', - ], - 'message' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'comment' => 'Message', - ], - ], - 'comment' => 'Gift Message', - ], - $installer->getTable('sales/quote') => [ - 'columns' => [ - 'gift_message_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Gift Message Id', - ], - ], - ], - $installer->getTable('sales/quote_address') => [ - 'columns' => [ - 'gift_message_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Gift Message Id', - ], - ], - ], - $installer->getTable('sales/quote_item') => [ - 'columns' => [ - 'gift_message_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Gift Message Id', - ], - ], - ], - $installer->getTable('sales/quote_address_item') => [ - 'columns' => [ - 'gift_message_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Gift Message Id', - ], - ], - ], - $installer->getTable('sales/order') => [ - 'columns' => [ - 'gift_message_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Gift Message Id', - ], - ], - ], - $installer->getTable('sales/order_item') => [ - 'columns' => [ - 'gift_message_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Gift Message Id', - ], - 'gift_message_available' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Gift Message Available', - ], - ], - ], -]; - -$installer->getConnection()->modifyTables($tables); - -$installer->endSetup(); diff --git a/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-install-0.1.0.php b/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-install-0.1.0.php deleted file mode 100644 index 7a518e5b293..00000000000 --- a/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-install-0.1.0.php +++ /dev/null @@ -1,84 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE IF NOT EXISTS `{$installer->getTable('importexport_importdata')}` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `entity` VARCHAR(50) NOT NULL, - `behavior` SET('" . Mage_ImportExport_Model_Import::BEHAVIOR_APPEND . "','" - . Mage_ImportExport_Model_Import::BEHAVIOR_REPLACE . "','" . - Mage_ImportExport_Model_Import::BEHAVIOR_DELETE . "') NOT NULL DEFAULT '" . - Mage_ImportExport_Model_Import::BEHAVIOR_APPEND . "', - `data` MEDIUMTEXT NOT NULL DEFAULT '', - PRIMARY KEY (`id`) -) -COLLATE='utf8_general_ci' -ENGINE=MyISAM -ROW_FORMAT=DEFAULT -", ); - -// add unique key for parent-child pairs which makes easier configurable products import -$installer->getConnection()->addKey( - $installer->getTable('catalog/product_super_link'), - 'UNQ_product_id_parent_id', - ['product_id', 'parent_id'], - 'unique', -); - -// add unique key for product-attribute pairs -$installer->getConnection()->addKey( - $installer->getTable('catalog/product_super_attribute'), - 'UNQ_product_id_attribute_id', - ['product_id', 'attribute_id'], - 'unique', -); - -// add unique key for product-value-website -$installer->getConnection()->addKey( - $installer->getTable('catalog/product_super_attribute_pricing'), - 'UNQ_product_super_attribute_id_value_index_website_id', - ['product_super_attribute_id', 'value_index', 'website_id'], - 'unique', -); - -$installer->getConnection()->addConstraint( - 'FK_INT_PRODUCT_LINK', - $installer->getTable('catalog/product_link_attribute_int'), - 'link_id', - $installer->getTable('catalog/product_link'), - 'link_id', -); - -$installer->getConnection()->addConstraint( - 'FK_INT_PRODUCT_LINK_ATTRIBUTE', - $installer->getTable('catalog/product_link_attribute_int'), - 'product_link_attribute_id', - $installer->getTable('catalog/product_link_attribute'), - 'product_link_attribute_id', -); - -$installer->getConnection()->addKey( - $installer->getTable('catalog/product_link_attribute_int'), - 'UNQ_product_link_attribute_id_link_id', - ['product_link_attribute_id', 'link_id'], - 'unique', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Index/sql/index_setup/mysql4-install-1.4.0.0.php b/app/code/core/Mage/Index/sql/index_setup/mysql4-install-1.4.0.0.php deleted file mode 100644 index 560ed4ceee1..00000000000 --- a/app/code/core/Mage/Index/sql/index_setup/mysql4-install-1.4.0.0.php +++ /dev/null @@ -1,55 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$this->getTable('index/event')}` ( - `event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `type` varchar(64) NOT NULL, - `entity` varchar(64) NOT NULL, - `entity_pk` bigint(20) DEFAULT NULL, - `created_at` datetime NOT NULL, - `old_data` mediumtext, - `new_data` mediumtext, - PRIMARY KEY (`event_id`), - UNIQUE KEY `IDX_UNIQUE_EVENT` (`type`,`entity`,`entity_pk`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$this->getTable('index/process')}` ( - `process_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `indexer_code` varchar(32) NOT NULL, - `status` enum('pending','working') NOT NULL DEFAULT 'pending', - `started_at` datetime DEFAULT NULL, - `ended_at` datetime DEFAULT NULL, - PRIMARY KEY (`process_id`), - UNIQUE KEY `IDX_CODE` (`indexer_code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$this->getTable('index/process_event')}` ( - `process_id` int(10) unsigned NOT NULL, - `event_id` bigint(20) unsigned NOT NULL, - `status` enum('new','working','done','error') NOT NULL DEFAULT 'new', - PRIMARY KEY (`process_id`,`event_id`), - KEY `FK_INDEX_EVNT_PROCESS` (`event_id`), - CONSTRAINT `FK_INDEX_EVNT_PROCESS` FOREIGN KEY (`event_id`) REFERENCES `{$this->getTable('index/event')}` (`event_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_INDEX_PROCESS_EVENT` FOREIGN KEY (`process_id`) REFERENCES `{$this->getTable('index/process')}` (`process_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php b/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php deleted file mode 100644 index d65cb1de2cc..00000000000 --- a/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php +++ /dev/null @@ -1,24 +0,0 @@ -getConnection()->addColumn( - $this->getTable('index/process'), - 'mode', - "enum('real_time','manual') DEFAULT 'real_time' NOT NULL after `ended_at`", -); diff --git a/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php b/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php deleted file mode 100644 index 25f435c0414..00000000000 --- a/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php +++ /dev/null @@ -1,25 +0,0 @@ -getConnection()->changeColumn( - $this->getTable('index/process'), - 'status', - 'status', - "enum('pending','working','require_reindex') DEFAULT 'pending' NOT NULL", -); diff --git a/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index de714177b82..00000000000 --- a/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,221 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('index_process_event'), - 'FK_INDEX_EVNT_PROCESS', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('index/process_event'), - 'FK_INDEX_PROCESS_EVENT', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('index/event'), - 'IDX_UNIQUE_EVENT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('index/process'), - 'IDX_CODE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('index/process_event'), - 'FK_INDEX_EVNT_PROCESS', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('index/event') => [ - 'columns' => [ - 'event_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Event Id', - ], - 'type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'nullable' => false, - 'comment' => 'Type', - ], - 'entity' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'nullable' => false, - 'comment' => 'Entity', - ], - 'entity_pk' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'comment' => 'Entity Primary Key', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Creation Time', - ], - 'old_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '2M', - 'comment' => 'Old Data', - ], - 'new_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '2M', - 'comment' => 'New Data', - ], - ], - 'comment' => 'Index Event', - ], - $installer->getTable('index/process') => [ - 'columns' => [ - 'process_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Process Id', - ], - 'indexer_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'comment' => 'Indexer Code', - ], - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 15, - 'nullable' => false, - 'default' => 'pending', - 'comment' => 'Status', - ], - 'started_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Started At', - ], - 'ended_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Ended At', - ], - 'mode' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 9, - 'nullable' => false, - 'default' => 'real_time', - 'comment' => 'Mode', - ], - ], - 'comment' => 'Index Process', - ], - $installer->getTable('index/process_event') => [ - 'columns' => [ - 'process_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Process Id', - ], - 'event_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Event Id', - ], - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 7, - 'nullable' => false, - 'default' => 'new', - 'comment' => 'Status', - ], - ], - 'comment' => 'Index Process Event', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('index/event'), - $installer->getIdxName( - 'index/event', - ['type', 'entity', 'entity_pk'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['type', 'entity', 'entity_pk'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('index/process'), - $installer->getIdxName( - 'index/process', - ['indexer_code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['indexer_code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('index/process_event'), - $installer->getIdxName('index/process_event', ['event_id']), - ['event_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('index/process_event', 'event_id', 'index/event', 'event_id'), - $installer->getTable('index/process_event'), - 'event_id', - $installer->getTable('index/event'), - 'event_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('index/process_event', 'process_id', 'index/process', 'process_id'), - $installer->getTable('index/process_event'), - 'process_id', - $installer->getTable('index/process'), - 'process_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-install-0.7.0.php deleted file mode 100644 index def342a0bc8..00000000000 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,104 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('log_customer')}; -CREATE TABLE {$this->getTable('log_customer')} ( - `log_id` int(10) unsigned NOT NULL auto_increment, - `visitor_id` bigint(20) unsigned default NULL, - `customer_id` int(11) NOT NULL default '0', - `login_at` datetime NOT NULL default '0000-00-00 00:00:00', - `logout_at` datetime default NULL, - PRIMARY KEY (`log_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Customers log information'; - --- DROP TABLE IF EXISTS {$this->getTable('log_quote')}; -CREATE TABLE {$this->getTable('log_quote')} ( - `quote_id` int(10) unsigned NOT NULL default '0', - `visitor_id` bigint(20) unsigned default NULL, - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `deleted_at` datetime default NULL, - PRIMARY KEY (`quote_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Quote log data'; - --- DROP TABLE IF EXISTS {$this->getTable('log_summary')}; -CREATE TABLE {$this->getTable('log_summary')} ( - `summary_id` bigint(20) unsigned NOT NULL auto_increment, - `type_id` smallint(5) unsigned default NULL, - `visitor_count` int(11) NOT NULL default '0', - `customer_count` int(11) NOT NULL default '0', - `add_date` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`summary_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Summary log information'; - --- DROP TABLE IF EXISTS {$this->getTable('log_summary_type')}; -CREATE TABLE {$this->getTable('log_summary_type')} ( - `type_id` smallint(5) unsigned NOT NULL auto_increment, - `type_code` varchar(64) NOT NULL default '', - `period` smallint(5) unsigned NOT NULL default '0', - `period_type` enum('MINUTE','HOUR','DAY','WEEK','MONTH') NOT NULL default 'MINUTE', - PRIMARY KEY (`type_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Type of summary information'; - -insert into {$this->getTable('log_summary_type')} (`type_id`,`type_code`,`period`,`period_type`) values - (1,'hour',1,'HOUR'),(2,'day',1,'DAY') -/* ,(3,'week',1,'WEEK'),(4,'month',1,'MONTH') */; - --- DROP TABLE IF EXISTS {$this->getTable('log_url')}; -CREATE TABLE {$this->getTable('log_url')} ( - `url_id` bigint(20) unsigned NOT NULL default '0', - `visitor_id` bigint(20) unsigned default NULL, - `visit_time` datetime NOT NULL default '0000-00-00 00:00:00' -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='URL visiting history'; - --- DROP TABLE IF EXISTS {$this->getTable('log_url_info')}; -CREATE TABLE {$this->getTable('log_url_info')} ( - `url_id` bigint(20) unsigned NOT NULL auto_increment, - `url` varchar(255) NOT NULL default '', - `referer` varchar(255) default NULL, - PRIMARY KEY (`url_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Detale information about url visit'; - --- DROP TABLE IF EXISTS {$this->getTable('log_visitor')}; -CREATE TABLE {$this->getTable('log_visitor')} ( - `visitor_id` bigint(20) unsigned NOT NULL auto_increment, - `session_id` char(64) NOT NULL default '', - `first_visit_at` datetime default NULL, - `last_visit_at` datetime NOT NULL default '0000-00-00 00:00:00', - `last_url_id` bigint(20) unsigned NOT NULL default '0', - PRIMARY KEY (`visitor_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='System visitors log'; - --- DROP TABLE IF EXISTS {$this->getTable('log_visitor_info')}; -CREATE TABLE {$this->getTable('log_visitor_info')} ( - `visitor_id` bigint(20) unsigned NOT NULL default '0', - `http_referer` varchar(255) default NULL, - `http_user_agent` varchar(255) default NULL, - `http_accept_charset` varchar(255) default NULL, - `http_accept_language` varchar(255) default NULL, - `server_addr` bigint(20) default NULL, - `remote_addr` bigint(20) default NULL, - PRIMARY KEY (`visitor_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Additional information by visitor'; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 29102886eec..00000000000 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,21 +0,0 @@ -run(" -ALTER TABLE {$this->getTable('log_summary')} ADD `store_id` SMALLINT( 5 ) UNSIGNED NOT NULL AFTER `summary_id` ; -ALTER TABLE {$this->getTable('log_customer')} ADD `store_id` SMALLINT( 5 ) UNSIGNED NOT NULL ; -ALTER TABLE {$this->getTable('log_visitor')} ADD `store_id` SMALLINT( 5 ) UNSIGNED NOT NULL ; -"); diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index f7b2dd07119..00000000000 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,23 +0,0 @@ -run(" -truncate table `{$this->getTable('log_quote')}`; -truncate table `{$this->getTable('log_url')}`; -truncate table `{$this->getTable('log_url_info')}`; -truncate table `{$this->getTable('log_visitor')}`; -truncate table `{$this->getTable('log_visitor_info')}`; -"); diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.3-0.7.4.php deleted file mode 100644 index 2a0bf56d9db..00000000000 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ /dev/null @@ -1,25 +0,0 @@ -startSetup(); - -$installer->getConnection()->addKey($installer->getTable('log/customer'), 'IDX_VISITOR', 'visitor_id'); -$installer->getConnection()->addKey($installer->getTable('log/url_table'), 'PRIMARY', 'url_id', 'primary'); -$installer->getConnection()->addKey($installer->getTable('log/url_table'), 'IDX_VISITOR', 'visitor_id'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index c970a37ddcc..00000000000 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$installer->getTable('log_visitor_online')}` ( - `visitor_id` bigint(20) unsigned NOT NULL auto_increment, - `visitor_type` char(1) NOT NULL, - `remote_addr` int(11) NOT NULL, - `first_visit_at` datetime default NULL, - `last_visit_at` datetime default NULL, - `customer_id` int(10) unsigned default NULL, - `last_url` varchar(255) default NULL, - PRIMARY KEY (`visitor_id`), - KEY `IDX_VISITOR_TYPE` (`visitor_type`), - KEY `IDX_VISIT_TIME` (`first_visit_at`,`last_visit_at`), - KEY `IDX_CUSTOMER` (`customer_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.5-0.7.6.php deleted file mode 100644 index 4e8f039336b..00000000000 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->modifyColumn($installer->getTable('log/visitor_online'), 'remote_addr', 'bigint(20) NOT NULL'); -$installer->endSetup(); diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.6-0.7.7.php deleted file mode 100644 index 8696781faa0..00000000000 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ /dev/null @@ -1,32 +0,0 @@ -startSetup(); - -$installer->run(" - ALTER TABLE `{$installer->getTable('log/customer')}` ENGINE INNODB; - ALTER TABLE `{$installer->getTable('log/quote_table')}` ENGINE INNODB; - ALTER TABLE `{$installer->getTable('log/summary_table')}` ENGINE INNODB; - ALTER TABLE `{$installer->getTable('log/summary_type_table')}` ENGINE INNODB; - ALTER TABLE `{$installer->getTable('log/url_table')}` ENGINE INNODB; - ALTER TABLE `{$installer->getTable('log/url_info_table')}` ENGINE INNODB; - ALTER TABLE `{$installer->getTable('log/visitor')}` ENGINE INNODB; - ALTER TABLE `{$installer->getTable('log/visitor_info')}` ENGINE INNODB; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index b11d6320d2c..00000000000 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,402 +0,0 @@ -startSetup(); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('log/customer'), - 'IDX_VISITOR', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('log_visitor_online'), - 'IDX_VISITOR_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('log_visitor_online'), - 'IDX_VISIT_TIME', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('log_visitor_online'), - 'IDX_CUSTOMER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('log_url'), - 'IDX_VISITOR', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('log/customer') => [ - 'columns' => [ - 'log_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Log ID', - ], - 'visitor_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'unsigned' => true, - 'comment' => 'Visitor ID', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Customer ID', - ], - 'login_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Login Time', - ], - 'logout_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Logout Time', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - ], - 'comment' => 'Log Customers Table', - ], - $installer->getTable('log/visitor') => [ - 'columns' => [ - 'visitor_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Visitor ID', - ], - 'session_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'nullable' => false, - 'comment' => 'Session ID', - ], - 'first_visit_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'First Visit Time', - ], - 'last_visit_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Last Visit Time', - ], - 'last_url_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Last URL ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - ], - 'comment' => 'Log Visitors Table', - ], - $installer->getTable('log/visitor_info') => [ - 'columns' => [ - 'visitor_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Visitor ID', - ], - 'http_referer' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'HTTP Referrer', - ], - 'http_user_agent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'HTTP User-Agent', - ], - 'http_accept_charset' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'HTTP Accept-Charset', - ], - 'http_accept_language' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'HTTP Accept-Language', - ], - 'server_addr' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'comment' => 'Server Address', - ], - 'remote_addr' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'comment' => 'Remote Address', - ], - ], - 'comment' => 'Log Visitor Info Table', - ], - $installer->getTable('log/url_table') => [ - 'columns' => [ - 'url_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'URL ID', - ], - 'visitor_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'unsigned' => true, - 'comment' => 'Visitor ID', - ], - 'visit_time' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Visit Time', - ], - ], - 'comment' => 'Log URL Table', - ], - $installer->getTable('log/url_info_table') => [ - 'columns' => [ - 'url_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'URL ID', - ], - 'url' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => true, - 'default' => null, - 'comment' => 'URL', - ], - 'referer' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Referrer', - ], - ], - 'comment' => 'Log URL Info Table', - ], - $installer->getTable('log/summary_table') => [ - 'columns' => [ - 'summary_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Summary ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store ID', - ], - 'type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Type ID', - ], - 'visitor_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Visitor Count', - ], - 'customer_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Customer Count', - ], - 'add_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Date', - ], - ], - 'comment' => 'Log Summary Table', - ], - $installer->getTable('log/summary_type_table') => [ - 'columns' => [ - 'type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Type ID', - ], - 'type_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'nullable' => false, - 'comment' => 'Type Code', - ], - 'period' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Period', - ], - 'period_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 6, - 'nullable' => false, - 'default' => 'MINUTE', - 'comment' => 'Period Type', - ], - ], - 'comment' => 'Log Summary Types Table', - ], - $installer->getTable('log/quote_table') => [ - 'columns' => [ - 'quote_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Quote ID', - ], - 'visitor_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'unsigned' => true, - 'comment' => 'Visitor ID', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Creation Time', - ], - 'deleted_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Deletion Time', - ], - ], - 'comment' => 'Log Quotes Table', - ], - $installer->getTable('log/visitor_online') => [ - 'columns' => [ - 'visitor_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Visitor ID', - ], - 'visitor_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 1, - 'nullable' => false, - 'comment' => 'Visitor Type', - ], - 'remote_addr' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'nullable' => false, - 'comment' => 'Remote Address', - ], - 'first_visit_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'First Visit Time', - ], - 'last_visit_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Last Visit Time', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Customer ID', - ], - 'last_url' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Last URL', - ], - ], - 'comment' => 'Log Visitor Online Table', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('log/customer'), - $installer->getIdxName('log/customer', ['visitor_id']), - ['visitor_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('log/url_table'), - $installer->getIdxName('log/url_table', ['visitor_id']), - ['visitor_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('log/visitor_online'), - $installer->getIdxName('log/visitor_online', ['visitor_type']), - ['visitor_type'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('log/visitor_online'), - $installer->getIdxName('log/visitor_online', ['first_visit_at', 'last_visit_at']), - ['first_visit_at', 'last_visit_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('log/visitor_online'), - $installer->getIdxName('log/visitor_online', ['customer_id']), - ['customer_id'], -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.7.0.php deleted file mode 100644 index c272bd2490d..00000000000 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,130 +0,0 @@ -startSetup(); - -$installer->run(" - -/*Table structure for table `newsletter_problem` */ - --- DROP TABLE IF EXISTS {$this->getTable('newsletter_problem')}; -CREATE TABLE {$this->getTable('newsletter_problem')} ( - `problem_id` int(7) unsigned NOT NULL auto_increment, - `subscriber_id` int(7) unsigned default NULL, - `queue_id` int(7) unsigned NOT NULL default '0', - `problem_error_code` int(3) unsigned default '0', - `problem_error_text` varchar(200) default NULL, - PRIMARY KEY (`problem_id`), - KEY `FK_PROBLEM_SUBSCRIBER` (`subscriber_id`), - KEY `FK_PROBLEM_QUEUE` (`queue_id`), - CONSTRAINT `FK_PROBLEM_QUEUE` FOREIGN KEY (`queue_id`) REFERENCES {$this->getTable('newsletter_queue')} (`queue_id`), - CONSTRAINT `FK_PROBLEM_SUBSCRIBER` FOREIGN KEY (`subscriber_id`) REFERENCES {$this->getTable('newsletter_subscriber')} (`subscriber_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter problems'; - -/*Data for the table `newsletter_problem` */ - -/*Table structure for table `newsletter_queue` */ - --- DROP TABLE IF EXISTS {$this->getTable('newsletter_queue')}; -CREATE TABLE {$this->getTable('newsletter_queue')} ( - `queue_id` int(7) unsigned NOT NULL auto_increment, - `template_id` int(7) unsigned NOT NULL default '0', - `queue_status` int(3) unsigned NOT NULL default '0', - `queue_start_at` datetime default NULL, - `queue_finish_at` datetime default NULL, - PRIMARY KEY (`queue_id`), - KEY `FK_QUEUE_TEMPLATE` (`template_id`), - CONSTRAINT `FK_QUEUE_TEMPLATE` FOREIGN KEY (`template_id`) REFERENCES {$this->getTable('newsletter_template')} (`template_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter queue'; - -/*Data for the table `newsletter_queue` */ - -/*Table structure for table `newsletter_queue_link` */ - --- DROP TABLE IF EXISTS {$this->getTable('newsletter_queue_link')}; -CREATE TABLE {$this->getTable('newsletter_queue_link')} ( - `queue_link_id` int(9) unsigned NOT NULL auto_increment, - `queue_id` int(7) unsigned NOT NULL default '0', - `subscriber_id` int(7) unsigned NOT NULL default '0', - `letter_sent_at` datetime default NULL, - PRIMARY KEY (`queue_link_id`), - KEY `FK_QUEUE_LINK_SUBSCRIBER` (`subscriber_id`), - KEY `FK_QUEUE_LINK_QUEUE` (`queue_id`), - CONSTRAINT `FK_QUEUE_LINK_QUEUE` FOREIGN KEY (`queue_id`) REFERENCES {$this->getTable('newsletter_queue')} (`queue_id`) ON DELETE CASCADE, - CONSTRAINT `FK_QUEUE_LINK_SUBSCRIBER` FOREIGN KEY (`subscriber_id`) REFERENCES {$this->getTable('newsletter_subscriber')} (`subscriber_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter queue to subscriber link'; - -/*Data for the table `newsletter_queue_link` */ - -/*Table structure for table `newsletter_queue_store_link` */ - --- DROP TABLE IF EXISTS {$this->getTable('newsletter_queue_store_link')}; -CREATE TABLE {$this->getTable('newsletter_queue_store_link')} ( - `queue_id` int(7) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`queue_id`,`store_id`), - CONSTRAINT `FK_LINK_QUEUE` FOREIGN KEY (`queue_id`) REFERENCES {$this->getTable('newsletter_queue')} (`queue_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `newsletter_queue_store_link` */ - -/*Table structure for table `newsletter_subscriber` */ - --- DROP TABLE IF EXISTS {$this->getTable('newsletter_subscriber')}; -CREATE TABLE {$this->getTable('newsletter_subscriber')} ( - `subscriber_id` int(7) unsigned NOT NULL auto_increment, - `store_id` int(3) unsigned default '0', - `change_status_at` datetime default NULL, - `customer_id` int(11) unsigned NOT NULL default '0', - `subscriber_email` varchar(150) character set latin1 collate latin1_general_ci NOT NULL default '', - `subscriber_status` int(3) NOT NULL default '0', - `subscriber_confirm_code` varchar(32) default 'NULL', - PRIMARY KEY (`subscriber_id`), - KEY `FK_SUBSCRIBER_STORE` (`store_id`), - KEY `FK_SUBSCRIBER_CUSTOMER` (`customer_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter subscribers'; - -/*Data for the table `newsletter_subscriber` */ - -/*Table structure for table `newsletter_template` */ - --- DROP TABLE IF EXISTS {$this->getTable('newsletter_template')}; -CREATE TABLE {$this->getTable('newsletter_template')} ( - `template_id` int(7) unsigned NOT NULL auto_increment, - `template_code` varchar(150) default NULL, - `template_text` text, - `template_text_preprocessed` text, - `template_type` int(3) unsigned default NULL, - `template_subject` varchar(200) default NULL, - `template_sender_name` varchar(200) default NULL, - `template_sender_email` varchar(200) character set latin1 collate latin1_general_ci default NULL, - `template_actual` tinyint(1) unsigned default '1', - `added_at` datetime default NULL, - `modified_at` datetime default NULL, - PRIMARY KEY (`template_id`), - KEY `template_actual` (`template_actual`), - KEY `added_at` (`added_at`), - KEY `modified_at` (`modified_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter templates'; - -/*Data for the table `newsletter_template` */ - -insert into {$this->getTable('newsletter_template')}(`template_id`,`template_code`,`template_text`,`template_text_preprocessed`,`template_type`,`template_subject`,`template_sender_name`,`template_sender_email`,`template_actual`,`added_at`,`modified_at`) values (1,'Great Newsletter','This is a GREAT

Newsletter','This is a GREAT

Newsletter',2,'Greatness','Magento','david@varien.com',0,'2007-08-29 17:30:31','2007-08-29 17:30:31'),(2,'Great Newsletter','This is a GREAT

Newsletter','This is a GREAT

Newsletter',2,'Greatness','Magento','david@varien.com',0,'2007-08-29 17:30:31','2007-08-29 17:30:31'),(3,'Great Newsletter','This is a GREAT

Newsletter',NULL,2,'Greatness','Magento','david@varien.com',1,'2007-08-29 17:30:31','2007-08-29 17:30:31'); - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.8.0.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.8.0.php deleted file mode 100644 index d86bc3b9e5d..00000000000 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.8.0.php +++ /dev/null @@ -1,105 +0,0 @@ -startSetup(); - -$installer->run(" --- DROP TABLE IF EXISTS `{$installer->getTable('newsletter_problem')}`; -CREATE TABLE `{$installer->getTable('newsletter_problem')}` ( - `problem_id` int(7) unsigned NOT NULL auto_increment, - `subscriber_id` int(7) unsigned default NULL, - `queue_id` int(7) unsigned NOT NULL default '0', - `problem_error_code` int(3) unsigned default '0', - `problem_error_text` varchar(200) default NULL, - PRIMARY KEY (`problem_id`), - KEY `FK_PROBLEM_SUBSCRIBER` (`subscriber_id`), - KEY `FK_PROBLEM_QUEUE` (`queue_id`), - CONSTRAINT `FK_PROBLEM_QUEUE` FOREIGN KEY (`queue_id`) REFERENCES `{$installer->getTable('newsletter_queue')}` (`queue_id`), - CONSTRAINT `FK_PROBLEM_SUBSCRIBER` FOREIGN KEY (`subscriber_id`) REFERENCES `{$installer->getTable('newsletter_subscriber')}` (`subscriber_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter problems'; - --- DROP TABLE IF EXISTS `{$installer->getTable('newsletter_queue')}`; -CREATE TABLE `{$installer->getTable('newsletter_queue')}` ( - `queue_id` int(7) unsigned NOT NULL auto_increment, - `template_id` int(7) unsigned NOT NULL default '0', - `queue_status` int(3) unsigned NOT NULL default '0', - `queue_start_at` datetime default NULL, - `queue_finish_at` datetime default NULL, - PRIMARY KEY (`queue_id`), - KEY `FK_QUEUE_TEMPLATE` (`template_id`), - CONSTRAINT `FK_QUEUE_TEMPLATE` FOREIGN KEY (`template_id`) REFERENCES `{$installer->getTable('newsletter_template')}` (`template_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter queue'; - --- DROP TABLE IF EXISTS `{$installer->getTable('newsletter_queue_link')}`; -CREATE TABLE `{$installer->getTable('newsletter_queue_link')}` ( - `queue_link_id` int(9) unsigned NOT NULL auto_increment, - `queue_id` int(7) unsigned NOT NULL default '0', - `subscriber_id` int(7) unsigned NOT NULL default '0', - `letter_sent_at` datetime default NULL, - PRIMARY KEY (`queue_link_id`), - KEY `FK_QUEUE_LINK_SUBSCRIBER` (`subscriber_id`), - KEY `FK_QUEUE_LINK_QUEUE` (`queue_id`), - CONSTRAINT `FK_QUEUE_LINK_QUEUE` FOREIGN KEY (`queue_id`) REFERENCES `{$installer->getTable('newsletter_queue')}` (`queue_id`) ON DELETE CASCADE, - CONSTRAINT `FK_QUEUE_LINK_SUBSCRIBER` FOREIGN KEY (`subscriber_id`) REFERENCES `{$installer->getTable('newsletter_subscriber')}` (`subscriber_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter queue to subscriber link'; - --- DROP TABLE IF EXISTS `{$installer->getTable('newsletter_queue_store_link')}`; -CREATE TABLE `{$installer->getTable('newsletter_queue_store_link')}` ( - `queue_id` int(7) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`queue_id`,`store_id`), - KEY `FK_NEWSLETTER_QUEUE_STORE_LINK_STORE` (`store_id`), - CONSTRAINT `FK_NEWSLETTER_QUEUE_STORE_LINK_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_LINK_QUEUE` FOREIGN KEY (`queue_id`) REFERENCES `{$installer->getTable('newsletter_queue')}` (`queue_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('newsletter_subscriber')}`; -CREATE TABLE `{$installer->getTable('newsletter_subscriber')}` ( - `subscriber_id` int(7) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned default '0', - `change_status_at` datetime default NULL, - `customer_id` int(11) unsigned NOT NULL default '0', - `subscriber_email` varchar(150) character set latin1 collate latin1_general_ci NOT NULL default '', - `subscriber_status` int(3) NOT NULL default '0', - `subscriber_confirm_code` varchar(32) default 'NULL', - PRIMARY KEY (`subscriber_id`), - KEY `FK_SUBSCRIBER_CUSTOMER` (`customer_id`), - KEY `FK_NEWSLETTER_SUBSCRIBER_STORE` (`store_id`), - CONSTRAINT `FK_NEWSLETTER_SUBSCRIBER_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter subscribers'; - --- DROP TABLE IF EXISTS `{$installer->getTable('newsletter_template')}`; -CREATE TABLE `{$installer->getTable('newsletter_template')}` ( - `template_id` int(7) unsigned NOT NULL auto_increment, - `template_code` varchar(150) default NULL, - `template_text` text, - `template_text_preprocessed` text, - `template_type` int(3) unsigned default NULL, - `template_subject` varchar(200) default NULL, - `template_sender_name` varchar(200) default NULL, - `template_sender_email` varchar(200) character set latin1 collate latin1_general_ci default NULL, - `template_actual` tinyint(1) unsigned default '1', - `added_at` datetime default NULL, - `modified_at` datetime default NULL, - PRIMARY KEY (`template_id`), - KEY `template_actual` (`template_actual`), - KEY `added_at` (`added_at`), - KEY `modified_at` (`modified_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter templates'; -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 9cc5e73d563..00000000000 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,39 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('newsletter_queue_store_link')} - ADD CONSTRAINT `FK_NEWSLETTER_QUEUE_STORE_LINK_STORE` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) - ON DELETE CASCADE - ON UPDATE CASCADE; -"); -$installer->run(" -ALTER TABLE {$this->getTable('newsletter_subscriber')} - DROP INDEX `FK_SUBSCRIBER_STORE`; -ALTER TABLE {$this->getTable('newsletter_subscriber')} - CHANGE `store_id` `store_id` smallint(5) unsigned NULL DEFAULT '0'; -ALTER TABLE {$this->getTable('newsletter_subscriber')} - ADD CONSTRAINT `FK_NEWSLETTER_SUBSCRIBER_STORE` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) - ON UPDATE CASCADE - ON DELETE SET NULL; -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.0-0.8.1.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.0-0.8.1.php deleted file mode 100644 index 298387c5ead..00000000000 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.0-0.8.1.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$table = $installer->getTable('newsletter_queue_link'); -$installer->getConnection()->addKey($table, 'IDX_NEWSLETTER_QUEUE_LINK_SEND_AT', ['queue_id', 'letter_sent_at']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php deleted file mode 100644 index 7effcde50ff..00000000000 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('newsletter_template'), - 'template_styles', - 'text AFTER `template_text_preprocessed`', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php deleted file mode 100644 index b28f58b9c0d..00000000000 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php +++ /dev/null @@ -1,81 +0,0 @@ -getTable('newsletter_queue'); -$templateTable = $installer->getTable('newsletter_template'); -$conn = $installer->getConnection(); - -$conn->addColumn($queueTable, 'newsletter_type', 'int(3) default NULL AFTER `template_id`'); -$conn->addColumn($queueTable, 'newsletter_text', 'text AFTER `newsletter_type`'); -$conn->addColumn($queueTable, 'newsletter_styles', 'text AFTER `newsletter_text`'); -$conn->addColumn($queueTable, 'newsletter_subject', 'varchar(200) default NULL AFTER `newsletter_styles`'); -$conn->addColumn($queueTable, 'newsletter_sender_name', 'varchar(200) default NULL AFTER `newsletter_subject`'); -$conn->addColumn( - $queueTable, - 'newsletter_sender_email', - 'varchar(200) character set latin1 collate latin1_general_ci default NULL AFTER `newsletter_sender_name`', -); - -$conn->modifyColumn($templateTable, 'template_text_preprocessed', "text comment 'deprecated since 1.4.0.1'"); - -$conn->beginTransaction(); - -try { - $select = $conn->select() - ->from(['main_table' => $queueTable], ['main_table.queue_id', 'main_table.template_id']) - ->joinLeft( - $templateTable, - "$templateTable.template_id = main_table.template_id", - [ - 'template_type', - 'template_text', - 'template_styles', - 'template_subject', - 'template_sender_name', - 'template_sender_email', - ], - ); - $rows = $conn->fetchAll($select); - - if ($rows) { - foreach ($rows as $row) { - $whereBind = $conn - ->quoteInto('queue_id=?', $row['queue_id']); - - $conn - ->update( - $queueTable, - [ - 'newsletter_type' => $row['template_type'], - 'newsletter_text' => $row['template_text'], - 'newsletter_styles' => $row['template_styles'], - 'newsletter_subject' => $row['template_subject'], - 'newsletter_sender_name' => $row['template_sender_name'], - 'newsletter_sender_email' => $row['template_sender_email'], - ], - $whereBind, - ); - } - } - - $conn->commit(); -} catch (Exception $e) { - $conn->rollBack(); - throw $e; -} diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 32e9e934512..00000000000 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,545 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('newsletter/problem'), - 'FK_PROBLEM_QUEUE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('newsletter/problem'), - 'FK_PROBLEM_SUBSCRIBER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('newsletter/queue'), - 'FK_QUEUE_TEMPLATE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('newsletter/queue_link'), - 'FK_QUEUE_LINK_SUBSCRIBER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('newsletter/subscriber'), - 'FK_NEWSLETTER_SUBSCRIBER_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('newsletter/queue_store_link'), - 'FK_LINK_QUEUE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('newsletter/queue_store_link'), - 'FK_NEWSLETTER_QUEUE_STORE_LINK_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('newsletter/queue_link'), - 'FK_QUEUE_LINK_QUEUE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('newsletter/problem'), - 'FK_PROBLEM_SUBSCRIBER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('newsletter/problem'), - 'FK_PROBLEM_QUEUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('newsletter/queue'), - 'FK_QUEUE_TEMPLATE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('newsletter/queue_link'), - 'FK_QUEUE_LINK_SUBSCRIBER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('newsletter/queue_link'), - 'FK_QUEUE_LINK_QUEUE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('newsletter/queue_link'), - 'IDX_NEWSLETTER_QUEUE_LINK_SEND_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('newsletter/queue_store_link'), - 'FK_NEWSLETTER_QUEUE_STORE_LINK_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('newsletter/subscriber'), - 'FK_SUBSCRIBER_CUSTOMER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('newsletter/subscriber'), - 'FK_NEWSLETTER_SUBSCRIBER_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('newsletter/template'), - 'TEMPLATE_ACTUAL', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('newsletter/template'), - 'ADDED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('newsletter/template'), - 'MODIFIED_AT', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('newsletter/subscriber') => [ - 'columns' => [ - 'subscriber_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Subscriber Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'change_status_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Change Status At', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Customer Id', - ], - 'subscriber_email' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 150, - 'nullable' => false, - 'comment' => 'Subscriber Email', - ], - 'subscriber_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Subscriber Status', - ], - 'subscriber_confirm_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'default' => 'NULL', - 'comment' => 'Subscriber Confirm Code', - ], - ], - 'comment' => 'Newsletter Subscriber', - ], - $installer->getTable('newsletter/queue') => [ - 'columns' => [ - 'queue_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Queue Id', - ], - 'template_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Template Id', - ], - 'newsletter_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Newsletter Type', - ], - 'newsletter_text' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Newsletter Text', - ], - 'newsletter_styles' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Newsletter Styles', - ], - 'newsletter_subject' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 200, - 'comment' => 'Newsletter Subject', - ], - 'newsletter_sender_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 200, - 'comment' => 'Newsletter Sender Name', - ], - 'newsletter_sender_email' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 200, - 'comment' => 'Newsletter Sender Email', - ], - 'queue_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Queue Status', - ], - 'queue_start_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Queue Start At', - ], - 'queue_finish_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Queue Finish At', - ], - ], - 'comment' => 'Newsletter Queue', - ], - $installer->getTable('newsletter_queue_link') => [ - 'columns' => [ - 'queue_link_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Queue Link Id', - ], - 'queue_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Queue Id', - ], - 'subscriber_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Subscriber Id', - ], - 'letter_sent_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Letter Sent At', - ], - ], - 'comment' => 'Newsletter Queue Link', - ], - $installer->getTable('newsletter_queue_store_link') => [ - 'columns' => [ - 'queue_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Queue Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store Id', - ], - ], - 'comment' => 'Newsletter Queue Store Link', - ], - $installer->getTable('newsletter/template') => [ - 'columns' => [ - 'template_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Template Id', - ], - 'template_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 150, - 'comment' => 'Template Code', - ], - 'template_text' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Template Text', - ], - 'template_text_preprocessed' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Template Text Preprocessed', - ], - 'template_styles' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Template Styles', - ], - 'template_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Template Type', - ], - 'template_subject' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 200, - 'comment' => 'Template Subject', - ], - 'template_sender_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 200, - 'comment' => 'Template Sender Name', - ], - 'template_sender_email' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 200, - 'comment' => 'Template Sender Email', - ], - 'template_actual' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '1', - 'comment' => 'Template Actual', - ], - 'added_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Added At', - ], - 'modified_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Modified At', - ], - ], - 'comment' => 'Newsletter Template', - ], - $installer->getTable('newsletter/problem') => [ - 'columns' => [ - 'problem_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Problem Id', - ], - 'subscriber_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Subscriber Id', - ], - 'queue_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Queue Id', - ], - 'problem_error_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Problem Error Code', - ], - 'problem_error_text' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 200, - 'comment' => 'Problem Error Text', - ], - ], - 'comment' => 'Newsletter Problems', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('newsletter/problem'), - $installer->getIdxName('newsletter/problem', ['subscriber_id']), - ['subscriber_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('newsletter/problem'), - $installer->getIdxName('newsletter/problem', ['queue_id']), - ['queue_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('newsletter/queue'), - $installer->getIdxName('newsletter/queue', ['template_id']), - ['template_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('newsletter/queue_link'), - $installer->getIdxName('newsletter/queue_link', ['subscriber_id']), - ['subscriber_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('newsletter/queue_link'), - $installer->getIdxName('newsletter/queue_link', ['queue_id']), - ['queue_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('newsletter/queue_link'), - $installer->getIdxName('newsletter/queue_link', ['queue_id', 'letter_sent_at']), - ['queue_id', 'letter_sent_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('newsletter/queue_store_link'), - $installer->getIdxName('newsletter/queue_store_link', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('newsletter/subscriber'), - $installer->getIdxName('newsletter/subscriber', ['customer_id']), - ['customer_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('newsletter/subscriber'), - $installer->getIdxName('newsletter/subscriber', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('newsletter/template'), - $installer->getIdxName('newsletter/template', ['template_actual']), - ['template_actual'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('newsletter/template'), - $installer->getIdxName('newsletter/template', ['added_at']), - ['added_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('newsletter/template'), - $installer->getIdxName('newsletter/template', ['modified_at']), - ['modified_at'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('newsletter/subscriber', 'store_id', 'core/store', 'store_id'), - $installer->getTable('newsletter/subscriber'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('newsletter/problem', 'queue_id', 'newsletter/queue', 'queue_id'), - $installer->getTable('newsletter/problem'), - 'queue_id', - $installer->getTable('newsletter/queue'), - 'queue_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('newsletter/problem', 'subscriber_id', 'newsletter/subscriber', 'subscriber_id'), - $installer->getTable('newsletter/problem'), - 'subscriber_id', - $installer->getTable('newsletter/subscriber'), - 'subscriber_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('newsletter/queue', 'template_id', 'newsletter/template', 'template_id'), - $installer->getTable('newsletter/queue'), - 'template_id', - $installer->getTable('newsletter/template'), - 'template_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('newsletter/queue_link', 'queue_id', 'newsletter/queue', 'queue_id'), - $installer->getTable('newsletter/queue_link'), - 'queue_id', - $installer->getTable('newsletter/queue'), - 'queue_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('newsletter/queue_link', 'subscriber_id', 'newsletter/subscriber', 'subscriber_id'), - $installer->getTable('newsletter/queue_link'), - 'subscriber_id', - $installer->getTable('newsletter/subscriber'), - 'subscriber_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('newsletter/queue_store_link', 'queue_id', 'newsletter/queue', 'queue_id'), - $installer->getTable('newsletter/queue_store_link'), - 'queue_id', - $installer->getTable('newsletter/queue'), - 'queue_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('newsletter/queue_store_link', 'store_id', 'core/store', 'store_id'), - $installer->getTable('newsletter/queue_store_link'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-data-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-data-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index a00e0b13831..00000000000 --- a/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-data-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,138 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); -$connection->beginTransaction(); - -try { - $paymentMethodCode = 'authorizenet'; - $transactionTable = $installer->getTable('sales/payment_transaction'); - $paymentTable = $installer->getTable('sales/order_payment'); - - /** - * Update payments - */ - $payments = $connection->fetchAll( - $connection->select() - ->from($paymentTable) - ->joinLeft( - $transactionTable, - "$transactionTable.txn_id = $paymentTable.last_trans_id", - [ - 'last_transaction_id' => 'transaction_id', - 'last_transaction_type' => 'txn_type', - 'last_transaction_is_closed' => 'is_closed', - ], - ) - ->where('method=?', $paymentMethodCode), - ); - - $paymentsIds = []; - $transactionsShouldBeOpened = []; - foreach ($payments as $payment) { - $paymentId = $payment['entity_id']; - $card = [ - 'last_trans_id' => $payment['last_trans_id'], - 'cc_type' => $payment['cc_type'], - 'cc_owner' => $payment['cc_owner'], - 'cc_last4' => $payment['cc_last4'], - 'cc_exp_month' => $payment['cc_exp_month'], - 'cc_exp_year' => $payment['cc_exp_year'], - 'cc_ss_issue' => $payment['cc_ss_issue'], - 'cc_ss_start_month' => $payment['cc_ss_start_month'], - 'cc_ss_start_year' => $payment['cc_ss_start_year'], - 'requested_amount' => $payment['base_amount_ordered'], - 'processed_amount' => $payment['base_amount_ordered'], - 'captured_amount' => $payment['base_amount_paid_online'], - 'refunded_amount' => $payment['base_amount_refunded_online'], - ]; - $additionalInformation = unserialize($payment['additional_information'], ['allowed_classes' => false]); - if (isset($additionalInformation['authorize_cards'])) { - continue; - } - $additionalInformation['authorize_cards'] = [ - (string) md5(microtime(1)) => $card, - ]; - $additionalInformation = serialize($additionalInformation); - - $bind = [ - 'additional_information' => $additionalInformation, - 'last_trans_id' => null, - 'cc_type' => null, - 'cc_owner' => null, - 'cc_last4' => null, - 'cc_exp_month' => null, - 'cc_exp_year' => null, - 'cc_ss_issue' => null, - 'cc_ss_start_month' => null, - 'cc_ss_start_year' => null, - ]; - $where = $this->getConnection()->quoteInto('entity_id=?', $paymentId); - $this->getConnection()->update($paymentTable, $bind, $where); - - /** - * Collect information for update last transactions of updated payments - */ - $paymentsIds[] = $paymentId; - if (($payment['last_transaction_type'] == 'authorization' || $payment['last_transaction_type'] == 'capture') - && $payment['last_transaction_is_closed'] == '1' - ) { - $transactionsShouldBeOpened[] = $payment['last_transaction_id']; - } - } - - /** - * Update transactions - */ - $transactions = $installer->getConnection()->fetchAll( - $installer->getConnection()->select() - ->from( - $transactionTable, - ['transaction_id', 'txn_id', 'txn_type', 'is_closed', 'additional_information'], - ) - ->where('payment_id IN (?)', $paymentsIds), - ); - foreach ($transactions as $transaction) { - $transactionId = $transaction['transaction_id']; - - $parts = explode('-', $transaction['txn_id']); - $realTransactionId = array_shift($parts); - $additionalInformation = unserialize($transaction['additional_information'], ['allowed_classes' => false]); - $additionalInformation['real_transaction_id'] = $realTransactionId; - $additionalInformation = serialize($additionalInformation); - - $isClosed = $transaction['is_closed']; - if (in_array($transactionId, $transactionsShouldBeOpened)) { - $isClosed = '0'; - } - - $bind = [ - 'additional_information' => $additionalInformation, - 'is_closed' => $isClosed, - ]; - $where = $this->getConnection()->quoteInto('transaction_id=?', $transactionId); - $this->getConnection()->update($transactionTable, $bind, $where); - } - - $installer->endSetup(); - $connection->commit(); -} catch (Exception $e) { - $connection->rollBack(); - throw $e; -} diff --git a/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 7ed2eb89119..00000000000 --- a/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE if exists {$this->getTable('paygate_authorizenet_debug')}; -CREATE TABLE {$this->getTable('paygate_authorizenet_debug')} ( - `debug_id` int(10) unsigned NOT NULL auto_increment, - `request_body` text, - `response_body` text, - `request_serialized` text, - `result_serialized` text, - `request_dump` text, - `result_dump` text, - PRIMARY KEY (`debug_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 782cb293cdd..00000000000 --- a/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -// replace transaction URLs - see http://integrationwizard.x.com/sdkupdate/step3.php -foreach ([ - 'pilot-payflowpro.verisign.com' => 'pilot-payflowpro.paypal.com', - 'test-payflow.verisign.com' => 'pilot-payflowpro.paypal.com', - 'payflow.verisign.com' => 'payflowpro.paypal.com', -] as $from => $to -) { - $installer->run(" - UPDATE {$installer->getTable('core/config_data')} SET `value` = REPLACE(`value`, '{$from}', '{$to}') - WHERE `path` = 'payment/verisign/url' - "); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Paypal/data/paypal_setup/data-upgrade-1.6.0.2-1.6.0.3.php b/app/code/core/Mage/Paypal/data/paypal_setup/data-upgrade-1.6.0.2-1.6.0.3.php deleted file mode 100644 index d351dd37464..00000000000 --- a/app/code/core/Mage/Paypal/data/paypal_setup/data-upgrade-1.6.0.2-1.6.0.3.php +++ /dev/null @@ -1,30 +0,0 @@ -getConnection(); -$installer->startSetup(); -$data = [ - ['paypal_reversed', 'PayPal Reversed'], - ['paypal_canceled_reversal', 'PayPal Canceled Reversal'], -]; -$connection = $installer->getConnection()->insertArray( - $installer->getTable('sales/order_status'), - ['status', 'label'], - $data, -); -$installer->endSetup(); diff --git a/app/code/core/Mage/Paypal/data/paypal_setup/data-upgrade-1.6.0.4-1.6.0.5.php b/app/code/core/Mage/Paypal/data/paypal_setup/data-upgrade-1.6.0.4-1.6.0.5.php deleted file mode 100644 index 14d9eb9ee0c..00000000000 --- a/app/code/core/Mage/Paypal/data/paypal_setup/data-upgrade-1.6.0.4-1.6.0.5.php +++ /dev/null @@ -1,21 +0,0 @@ -saveConfig($ecSkipOrderReviewStepFlagPath, '0'); diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 5badf4dbfdd..00000000000 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,39 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS `{$this->getTable('paypal_api_debug')}`; -CREATE TABLE `{$this->getTable('paypal_api_debug')}` ( - `debug_id` int(10) unsigned NOT NULL auto_increment, - `debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `request_body` text, - `response_body` text, - PRIMARY KEY (`debug_id`), - KEY `debug_at` (`debug_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); - -$installer->addAttribute('quote_payment', 'paypal_payer_id', []); -$installer->addAttribute('quote_payment', 'paypal_payer_status', []); -$installer->addAttribute('quote_payment', 'paypal_correlation_id', []); diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-1.4.0.0.php b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-1.4.0.0.php deleted file mode 100644 index 400bfd7c592..00000000000 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-1.4.0.0.php +++ /dev/null @@ -1,36 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$this->getTable('paypal_api_debug')}` ( - `debug_id` int(10) unsigned NOT NULL auto_increment, - `debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `request_body` text, - `response_body` text, - PRIMARY KEY (`debug_id`), - KEY `debug_at` (`debug_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - -$installer->addAttribute('quote_payment', 'paypal_payer_id', []); -$installer->addAttribute('quote_payment', 'paypal_payer_status', []); -$installer->addAttribute('quote_payment', 'paypal_correlation_id', []); -$installer->addAttribute('order', 'paypal_ipn_customer_notified', ['type' => 'int', 'visible' => false, 'default' => 0]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index 619b3ef77f3..00000000000 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->addAttribute('order', 'paypal_ipn_customer_notified', ['type' => 'int', 'visible' => false, 'default' => 0]); -$installer->endSetup(); diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index 4c713669b46..00000000000 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -$installer->addAttribute('order_payment', 'cc_secure_verify', []); - -// move paypal style settings to new paths -foreach ([ - 'paypal/wpp/page_style' => 'paypal/style/page_style', - 'paypal/wps/logo_url' => 'paypal/style/logo_url', -] as $from => $to -) { - $installer->run(" - UPDATE {$installer->getTable('core/config_data')} SET `path` = '{$to}' - WHERE `path` = '{$from}' - "); -} -$installer->endSetup(); diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php deleted file mode 100644 index ea521100807..00000000000 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php +++ /dev/null @@ -1,60 +0,0 @@ -startSetup(); - -$installer->run(" - -CREATE TABLE `{$installer->getTable('paypal_settlement_report')}` ( - `report_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `report_date` date NOT NULL, - `account_id` varchar(64) NOT NULL, - `filename` varchar(24) NOT NULL, - `last_modified` datetime NOT NULL, - PRIMARY KEY (`report_id`), - UNIQUE KEY `UNQ_REPORT_DATE_ACCOUNT` (`report_date`,`account_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('paypal_settlement_report_row')}` ( - `row_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `report_id` int(10) unsigned NOT NULL, - `transaction_id` varchar(19) NOT NULL, - `invoice_id` varchar(127) DEFAULT NULL, - `paypal_reference_id` varchar(19) NOT NULL, - `paypal_reference_id_type` enum('ODR','TXN','SUB','PAP','') NOT NULL, - `transaction_event_code` char(5) NOT NULL DEFAULT '', - `transaction_initiation_date` datetime DEFAULT NULL, - `transaction_completion_date` datetime DEFAULT NULL, - `transaction_debit_or_credit` enum('CR','DR') NOT NULL DEFAULT 'CR', - `gross_transaction_amount` decimal(20,6) NOT NULL DEFAULT '0.000000', - `gross_transaction_currency` char(3) NOT NULL DEFAULT '', - `fee_debit_or_credit` enum('CR','DR') NOT NULL, - `fee_amount` decimal(20,6) NOT NULL DEFAULT '0.000000', - `fee_currency` char(3) NOT NULL, - `custom_field` varchar(255) DEFAULT NULL, - `consumer_id` varchar(127) NOT NULL DEFAULT '', - PRIMARY KEY (`row_id`), - KEY `IDX_REPORT_ID` (`report_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `{$installer->getTable('paypal_settlement_report_row')}` - ADD CONSTRAINT `FK_PAYPAL_SETTLEMENT_ROW_REPORT` FOREIGN KEY (`report_id`) REFERENCES `{$installer->getTable('paypal_settlement_report')}` (`report_id`) ON DELETE CASCADE ON UPDATE CASCADE; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php deleted file mode 100644 index 4ae25093973..00000000000 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php +++ /dev/null @@ -1,37 +0,0 @@ -run(" -CREATE TABLE `{$installer->getTable('paypal/cert')}` ( - `cert_id` SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT, - `website_id` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0', - `content` MEDIUMBLOB NOT NULL, - `updated_at` datetime default NULL, - PRIMARY KEY (`cert_id`), - KEY `IDX_PAYPAL_CERT_WEBSITE` (`website_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->getConnection()->addConstraint( - 'FK_PAYPAL_CERT_WEBSITE', - $this->getTable('paypal/cert'), - 'website_id', - $this->getTable('core/website'), - 'website_id', -); diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index c36772e3664..00000000000 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,293 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('paypal/cert'), - 'FK_PAYPAL_CERT_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('paypal/settlement_report_row'), - 'FK_PAYPAL_SETTLEMENT_ROW_REPORT', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('paypal/cert'), - 'IDX_PAYPAL_CERT_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('paypal/settlement_report'), - 'UNQ_REPORT_DATE_ACCOUNT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('paypal/settlement_report_row'), - 'IDX_REPORT_ID', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('paypal/settlement_report') => [ - 'columns' => [ - 'report_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Report Id', - ], - 'report_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Report Date', - ], - 'account_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'comment' => 'Account Id', - ], - 'filename' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 24, - 'comment' => 'Filename', - ], - 'last_modified' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Last Modified', - ], - ], - 'comment' => 'Paypal Settlement Report Table', - ], - $installer->getTable('paypal/settlement_report_row') => [ - 'columns' => [ - 'row_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Row Id', - ], - 'report_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Report Id', - ], - 'transaction_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 19, - 'comment' => 'Transaction Id', - ], - 'invoice_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 127, - 'comment' => 'Invoice Id', - ], - 'paypal_reference_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 19, - 'comment' => 'Paypal Reference Id', - ], - 'paypal_reference_id_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Paypal Reference Id Type', - ], - 'transaction_event_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 5, - 'comment' => 'Transaction Event Code', - ], - 'transaction_initiation_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Transaction Initiation Date', - ], - 'transaction_completion_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Transaction Completion Date', - ], - 'transaction_debit_or_credit' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 2, - 'nullable' => false, - 'default' => 'CR', - 'comment' => 'Transaction Debit Or Credit', - ], - 'gross_transaction_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 6, - 'precision' => 20, - 'nullable' => false, - 'default' => '0.000000', - 'comment' => 'Gross Transaction Amount', - ], - 'gross_transaction_currency' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'default' => '', - 'comment' => 'Gross Transaction Currency', - ], - 'fee_debit_or_credit' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 2, - 'comment' => 'Fee Debit Or Credit', - ], - 'fee_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 6, - 'precision' => 20, - 'nullable' => false, - 'default' => '0.000000', - 'comment' => 'Fee Amount', - ], - 'fee_currency' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Fee Currency', - ], - 'custom_field' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Custom Field', - ], - 'consumer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 127, - 'comment' => 'Consumer Id', - ], - ], - 'comment' => 'Paypal Settlement Report Row Table', - ], - $installer->getTable('paypal/cert') => [ - 'columns' => [ - 'cert_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Cert Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Website Id', - ], - 'content' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Content', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Updated At', - ], - ], - 'comment' => 'Paypal Certificate Table', - ], - $installer->getTable('sales/quote_payment') => [ - 'columns' => [ - 'paypal_payer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Paypal Payer Id', - ], - 'paypal_payer_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Paypal Payer Status', - ], - 'paypal_correlation_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Paypal Correlation Id', - ], - ], - ], - $installer->getTable('sales/order') => [ - 'columns' => [ - 'paypal_ipn_customer_notified' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Paypal Ipn Customer Notified', - ], - ], - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('paypal/cert'), - $installer->getIdxName('paypal/cert', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('paypal/settlement_report'), - $installer->getIdxName( - 'paypal/settlement_report', - ['report_date', 'account_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['report_date', 'account_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('paypal/settlement_report_row'), - $installer->getIdxName('paypal/settlement_report_row', ['report_id']), - ['report_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('paypal/settlement_report_row', 'report_id', 'paypal/settlement_report', 'report_id'), - $installer->getTable('paypal/settlement_report_row'), - 'report_id', - $installer->getTable('paypal/settlement_report'), - 'report_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('paypal/cert', 'website_id', 'core/website', 'website_id'), - $installer->getTable('paypal/cert'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/mysql4-install-0.7.0.php deleted file mode 100644 index f0cff80cb52..00000000000 --- a/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,36 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('paypaluk_api_debug')}; - -CREATE TABLE {$this->getTable('paypaluk_api_debug')} ( - `debug_id` int(10) unsigned NOT NULL auto_increment, - `debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `request_body` text, - `response_body` text, - PRIMARY KEY (`debug_id`), - KEY `debug_at` (`debug_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-install-0.7.0.php deleted file mode 100644 index b1a8943a3b6..00000000000 --- a/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,79 +0,0 @@ -startSetup(); - -$installer->run(" --- DROP TABLE IF EXISTS `{$installer->getTable('product_alert_price')}`; -CREATE TABLE IF NOT EXISTS `{$installer->getTable('product_alert_price')}` ( - `alert_price_id` int(10) unsigned NOT NULL auto_increment, - `customer_id` int(10) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `price` decimal(12,4) NOT NULL default '0', - `website_id` smallint(5) unsigned NOT NULL default '0', - `add_date` datetime NOT NULL default '0000-00-00 00:00:00', - `last_send_date` datetime default NULL, - `send_count` smallint(5) unsigned NOT NULL default '0', - `status` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`alert_price_id`), - CONSTRAINT `FK_PRODUCT_ALERT_PRICE_CUSTOMER` - FOREIGN KEY (`customer_id`) - REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) - ON DELETE CASCADE - ON UPDATE CASCADE, - CONSTRAINT `FK_PRODUCT_ALERT_PRICE_PRODUCT` - FOREIGN KEY (`product_id`) - REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) - ON DELETE CASCADE - ON UPDATE CASCADE, - CONSTRAINT `FK_PRODUCT_ALERT_PRICE_WEBSITE` - FOREIGN KEY (`website_id`) - REFERENCES `{$installer->getTable('core_website')}` (`website_id`) - ON DELETE CASCADE - ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('product_alert_stock')}`; -CREATE TABLE `{$installer->getTable('product_alert_stock')}` ( - `alert_stock_id` int(10) unsigned NOT NULL auto_increment, - `customer_id` int(10) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `website_id` smallint(5) unsigned NOT NULL default '0', - `add_date` datetime NOT NULL default '0000-00-00 00:00:00', - `send_date` datetime default NULL, - `send_count` smallint(5) unsigned NOT NULL default '0', - `status` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`alert_stock_id`), - CONSTRAINT `FK_PRODUCT_ALERT_STOCK_CUSTOMER` - FOREIGN KEY (`customer_id`) - REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) - ON DELETE CASCADE - ON UPDATE CASCADE, - CONSTRAINT `FK_PRODUCT_ALERT_STOCK_PRODUCT` - FOREIGN KEY (`product_id`) - REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) - ON DELETE CASCADE - ON UPDATE CASCADE, - CONSTRAINT `FK_PRODUCT_ALERT_STOCK_WEBSITE` - FOREIGN KEY (`website_id`) - REFERENCES `{$installer->getTable('core_website')}` (`website_id`) - ON DELETE CASCADE - ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index 621f394e99f..00000000000 --- a/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,56 +0,0 @@ -startSetup(); - -// fix for sample data 1.2.0 -$installer->getConnection()->changeTableEngine($installer->getTable('productalert/stock'), 'INNODB'); -$installer->getConnection()->dropKey($installer->getTable('productalert/stock'), 'FK_PRODUCT_ALERT_PRICE_CUSTOMER'); -$installer->getConnection()->dropKey($installer->getTable('productalert/stock'), 'FK_PRODUCT_ALERT_PRICE_PRODUCT'); -$installer->getConnection()->dropKey($installer->getTable('productalert/stock'), 'FK_PRODUCT_ALERT_PRICE_WEBSITE'); -$installer->getConnection()->addConstraint( - 'FK_PRODUCT_ALERT_STOCK_CUSTOMER', - $installer->getTable('productalert/stock'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', - 'CASCADE', - 'CASCADE', - true, -); -$installer->getConnection()->addConstraint( - 'FK_PRODUCT_ALERT_STOCK_PRODUCT', - $installer->getTable('productalert/stock'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', - 'CASCADE', - 'CASCADE', - true, -); -$installer->getConnection()->addConstraint( - 'FK_PRODUCT_ALERT_STOCK_WEBSITE', - $installer->getTable('productalert/stock'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', - 'CASCADE', - 'CASCADE', - true, -); -$installer->endSetup(); diff --git a/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index f9673f0a46e..00000000000 --- a/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,307 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('productalert/price'), - 'FK_PRODUCT_ALERT_PRICE_CUSTOMER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('productalert/price'), - 'FK_PRODUCT_ALERT_PRICE_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('productalert/price'), - 'FK_PRODUCT_ALERT_PRICE_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('productalert/stock'), - 'FK_PRODUCT_ALERT_STOCK_CUSTOMER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('productalert/stock'), - 'FK_PRODUCT_ALERT_STOCK_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('productalert/stock'), - 'FK_PRODUCT_ALERT_STOCK_WEBSITE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('productalert/price'), - 'FK_PRODUCT_ALERT_PRICE_CUSTOMER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('productalert/price'), - 'FK_PRODUCT_ALERT_PRICE_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('productalert/price'), - 'FK_PRODUCT_ALERT_PRICE_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('productalert/stock'), - 'FK_PRODUCT_ALERT_STOCK_CUSTOMER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('productalert/stock'), - 'FK_PRODUCT_ALERT_STOCK_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('productalert/stock'), - 'FK_PRODUCT_ALERT_STOCK_WEBSITE', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('productalert/price') => [ - 'columns' => [ - 'alert_price_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Product alert price id', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Customer id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product id', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Price amount', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Website id', - ], - 'add_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Product alert add date', - ], - 'last_send_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Product alert last send date', - ], - 'send_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product alert send count', - ], - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product alert status', - ], - ], - 'comment' => 'Product Alert Price', - ], - $installer->getTable('productalert/stock') => [ - 'columns' => [ - 'alert_stock_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Product alert stock id', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Customer id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Website id', - ], - 'add_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Product alert add date', - ], - 'send_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Product alert send date', - ], - 'send_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Send Count', - ], - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product alert status', - ], - ], - 'comment' => 'Product Alert Stock', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('productalert/price'), - $installer->getIdxName('productalert/price', ['customer_id']), - ['customer_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('productalert/price'), - $installer->getIdxName('productalert/price', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('productalert/price'), - $installer->getIdxName('productalert/price', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('productalert/stock'), - $installer->getIdxName('productalert/stock', ['customer_id']), - ['customer_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('productalert/stock'), - $installer->getIdxName('productalert/stock', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('productalert/stock'), - $installer->getIdxName('productalert/stock', ['website_id']), - ['website_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('productalert/price', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('productalert/price'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('productalert/price', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('productalert/price'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('productalert/price', 'website_id', 'core/website', 'website_id'), - $installer->getTable('productalert/price'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('productalert/stock', 'website_id', 'core/website', 'website_id'), - $installer->getTable('productalert/stock'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('productalert/stock', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('productalert/stock'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('productalert/stock', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('productalert/stock'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Rating/sql/rating_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 9fcde24b8c7..00000000000 --- a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,111 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('rating')}; -CREATE TABLE {$this->getTable('rating')} ( - `rating_id` smallint(6) unsigned NOT NULL auto_increment, - `entity_id` smallint(6) unsigned NOT NULL default '0', - `rating_code` varchar(64) NOT NULL default '', - `position` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`rating_id`), - UNIQUE KEY `IDX_CODE` (`rating_code`), - KEY `FK_RATING_ENTITY` (`entity_id`), - CONSTRAINT `FK_RATING_ENTITY_KEY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('rating_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ratings'; - -insert into {$this->getTable('rating')}(`rating_id`,`entity_id`,`rating_code`,`position`) values (1,1,'Quality',0),(2,1,'Value',0),(3,1,'Price',0); - --- DROP TABLE IF EXISTS {$this->getTable('rating_entity')}; -CREATE TABLE {$this->getTable('rating_entity')} ( - `entity_id` smallint(6) unsigned NOT NULL auto_increment, - `entity_code` varchar(64) NOT NULL default '', - PRIMARY KEY (`entity_id`), - UNIQUE KEY `IDX_CODE` (`entity_code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rating entities'; - -insert into {$this->getTable('rating_entity')}(`entity_id`,`entity_code`) values (1,'product'),(2,'product_review'),(3,'review'); - --- DROP TABLE IF EXISTS {$this->getTable('rating_option')}; -CREATE TABLE {$this->getTable('rating_option')} ( - `option_id` int(10) unsigned NOT NULL auto_increment, - `rating_id` smallint(6) unsigned NOT NULL default '0', - `code` varchar(32) NOT NULL default '', - `value` tinyint(3) unsigned NOT NULL default '0', - `position` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`option_id`), - KEY `FK_RATING_OPTION_RATING` (`rating_id`), - CONSTRAINT `FK_RATING_OPTION_RATING` FOREIGN KEY (`rating_id`) REFERENCES {$this->getTable('rating')} (`rating_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rating options'; - -insert into {$this->getTable('rating_option')}(`option_id`,`rating_id`,`code`,`value`,`position`) values (1,1,'1',1,1),(2,1,'2',2,2),(3,1,'3',3,3),(4,1,'4',4,4),(5,1,'5',5,5),(6,2,'1',1,1),(7,2,'2',2,2),(8,2,'3',3,3),(9,2,'4',4,4),(10,2,'5',5,5),(11,3,'1',1,1),(12,3,'2',2,2),(13,3,'3',3,3),(14,3,'4',4,4),(15,3,'5',5,5); - --- DROP TABLE IF EXISTS {$this->getTable('rating_option_vote')}; -CREATE TABLE {$this->getTable('rating_option_vote')} ( - `vote_id` bigint(20) unsigned NOT NULL auto_increment, - `option_id` int(10) unsigned NOT NULL default '0', - `remote_ip` varchar(16) NOT NULL default '', - `remote_ip_long` int(11) NOT NULL default '0', - `customer_id` int(11) unsigned default '0', - `entity_pk_value` bigint(20) unsigned NOT NULL default '0', - `rating_id` smallint(6) unsigned NOT NULL default '0', - `review_id` bigint(20) unsigned default NULL, - `percent` tinyint(3) NOT NULL default '0', - `value` tinyint (3) NOT NULL default '0', - PRIMARY KEY (`vote_id`), - KEY `FK_RATING_OPTION_VALUE_OPTION` (`option_id`), - CONSTRAINT `FK_RATING_OPTION_VALUE_OPTION` FOREIGN KEY (`option_id`) REFERENCES {$this->getTable('rating_option')} (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rating option values'; - --- DROP TABLE IF EXISTS {$this->getTable('rating_option_vote_aggregated')}; -CREATE TABLE {$this->getTable('rating_option_vote_aggregated')} ( - `primary_id` int(11) NOT NULL auto_increment, - `rating_id` smallint(6) unsigned NOT NULL default '0', - `entity_pk_value` bigint(20) unsigned NOT NULL default '0', - `vote_count` int(10) unsigned NOT NULL default '0', - `vote_value_sum` int(10) unsigned NOT NULL default '0', - `percent` tinyint(3) NOT NULL default '0', - `store_id` smallint (5) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`primary_id`), - KEY `FK_RATING_OPTION_VALUE_AGGREGATE` (`rating_id`), - CONSTRAINT `FK_RATING_OPTION_VALUE_AGGREGATE` FOREIGN KEY (`rating_id`) REFERENCES {$this->getTable('rating')} (`rating_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('rating_store')}; -CREATE TABLE {$this->getTable('rating_store')} ( - `rating_id` smallint(6) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`rating_id`,`store_id`), - CONSTRAINT `FK_RATING_STORE_RATING` FOREIGN KEY (`rating_id`) REFERENCES {$this->getTable('rating')} (`rating_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('rating_title')}; -CREATE TABLE {$this->getTable('rating_title')} ( - `rating_id` smallint(6) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`rating_id`,`store_id`), - CONSTRAINT `FK_RATING_TITLE` FOREIGN KEY (`rating_id`) REFERENCES {$this->getTable('rating')} (`rating_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 7db68f67b80..00000000000 --- a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,42 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('rating_option_vote_aggregated')} - ADD CONSTRAINT `FK_RATING_OPTION_VOTE_AGGREGATED_STORE` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) - ON UPDATE CASCADE - ON DELETE CASCADE; -"); -$installer->run(" -ALTER TABLE {$this->getTable('rating_store')} - ADD CONSTRAINT `FK_RATING_STORE_STORE` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) - ON UPDATE CASCADE - ON DELETE CASCADE; -"); -$installer->run(" -ALTER TABLE {$this->getTable('rating_title')} - ADD CONSTRAINT `FK_RATING_TITLE_STORE` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) - ON UPDATE CASCADE - ON DELETE CASCADE; -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index fb7163cab97..00000000000 --- a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('rating_title')} - DROP FOREIGN KEY `FK_RATING_TITLE`; -"); - -$installer->run(" -ALTER TABLE {$this->getTable('rating_title')} - ADD CONSTRAINT `FK_RATING_TITLE` FOREIGN KEY (`rating_id`) - REFERENCES {$this->getTable('rating')} (`rating_id`) - ON UPDATE CASCADE - ON DELETE CASCADE; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 156dcbafa83..00000000000 --- a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,554 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('rating/rating'), - 'FK_RATING_ENTITY_KEY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('rating/rating_option'), - 'FK_RATING_OPTION_RATING', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('rating/rating_option_vote'), - 'FK_RATING_OPTION_REVIEW_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('rating/rating_option_vote'), - 'FK_RATING_OPTION_VALUE_OPTION', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('rating/rating_vote_aggregated'), - 'FK_RATING_OPTION_VALUE_AGGREGATE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('rating/rating_vote_aggregated'), - 'FK_RATING_OPTION_VOTE_AGGREGATED_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('rating/rating_store'), - 'FK_RATING_STORE_RATING', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('rating/rating_store'), - 'FK_RATING_STORE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('rating/rating_title'), - 'FK_RATING_TITLE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('rating/rating_title'), - 'FK_RATING_TITLE_STORE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('rating/rating'), - 'IDX_CODE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('rating/rating'), - 'FK_RATING_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('rating/rating_entity'), - 'IDX_CODE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('rating/rating_option'), - 'FK_RATING_OPTION_RATING', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('rating/rating_option_vote'), - 'FK_RATING_OPTION_VALUE_OPTION', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('rating/rating_option_vote'), - 'FK_RATING_OPTION_REVIEW_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('rating/rating_vote_aggregated'), - 'FK_RATING_OPTION_VALUE_AGGREGATE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('rating/rating_vote_aggregated'), - 'FK_RATING_OPTION_VOTE_AGGREGATED_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('rating/rating_store'), - 'FK_RATING_STORE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('rating/rating_title'), - 'FK_RATING_TITLE_STORE', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('rating/rating') => [ - 'columns' => [ - 'rating_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Rating Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Id', - ], - 'rating_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'nullable' => false, - 'comment' => 'Rating Code', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Rating Position On Frontend', - ], - ], - 'comment' => 'Ratings', - ], - $installer->getTable('rating/rating_store') => [ - 'columns' => [ - 'rating_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Rating id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store id', - ], - ], - 'comment' => 'Rating Store', - ], - $installer->getTable('rating/rating_title') => [ - 'columns' => [ - 'rating_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Rating Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Rating Label', - ], - ], - 'comment' => 'Rating Title', - ], - $installer->getTable('rating/rating_entity') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'entity_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'nullable' => false, - 'comment' => 'Entity Code', - ], - ], - 'comment' => 'Rating entities', - ], - $installer->getTable('rating/rating_option') => [ - 'columns' => [ - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Rating Option Id', - ], - 'rating_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Rating Id', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'comment' => 'Rating Option Code', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Rating Option Value', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Ration option position on frontend', - ], - ], - 'comment' => 'Rating options', - ], - $installer->getTable('rating/rating_option_vote') => [ - 'columns' => [ - 'vote_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Vote id', - ], - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Vote option id', - ], - 'remote_ip' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 16, - 'nullable' => false, - 'comment' => 'Customer IP', - ], - 'remote_ip_long' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Customer IP converted to long integer format', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Customer Id', - ], - 'entity_pk_value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product id', - ], - 'rating_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Rating id', - ], - 'review_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'unsigned' => true, - 'comment' => 'Review id', - ], - 'percent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Percent amount', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Vote option value', - ], - ], - 'comment' => 'Rating option values', - ], - $installer->getTable('rating/rating_vote_aggregated') => [ - 'columns' => [ - 'primary_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Vote aggregation id', - ], - 'rating_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Rating id', - ], - 'entity_pk_value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product id', - ], - 'vote_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Vote dty', - ], - 'vote_value_sum' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'General vote sum', - ], - 'percent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Vote percent', - ], - 'percent_approved' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'default' => '0', - 'comment' => 'Vote percent approved by admin', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store Id', - ], - ], - 'comment' => 'Rating vote aggregated', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('rating/rating'), - $installer->getIdxName( - 'rating/rating', - ['rating_code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['rating_code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('rating/rating'), - $installer->getIdxName('rating/rating', ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('rating/rating_entity'), - $installer->getIdxName( - 'rating/rating_entity', - ['entity_code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['entity_code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('rating/rating_option'), - $installer->getIdxName('rating/rating_option', ['rating_id']), - ['rating_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('rating/rating_option_vote'), - $installer->getIdxName('rating/rating_option_vote', ['option_id']), - ['option_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('rating/rating_vote_aggregated'), - $installer->getIdxName('rating/rating_vote_aggregated', ['rating_id']), - ['rating_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('rating/rating_vote_aggregated'), - $installer->getIdxName('rating/rating_vote_aggregated', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('rating/rating_store'), - $installer->getIdxName('rating/rating_store', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('rating/rating_title'), - $installer->getIdxName('rating/rating_title', ['store_id']), - ['store_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('rating/rating', 'entity_id', 'rating/rating_entity', 'entity_id'), - $installer->getTable('rating/rating'), - 'entity_id', - $installer->getTable('rating/rating_entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('rating/rating_option', 'rating_id', 'rating/rating', 'rating_id'), - $installer->getTable('rating/rating_option'), - 'rating_id', - $installer->getTable('rating/rating'), - 'rating_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('rating/rating_option_vote', 'review_id', 'review/review', 'review_id'), - $installer->getTable('rating/rating_option_vote'), - 'review_id', - $installer->getTable('review/review'), - 'review_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('rating/rating_option_vote', 'option_id', 'rating/rating_option', 'option_id'), - $installer->getTable('rating/rating_option_vote'), - 'option_id', - $installer->getTable('rating/rating_option'), - 'option_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('rating/rating_vote_aggregated', 'rating_id', 'rating/rating', 'rating_id'), - $installer->getTable('rating/rating_vote_aggregated'), - 'rating_id', - $installer->getTable('rating/rating'), - 'rating_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('rating/rating_vote_aggregated', 'store_id', 'core/store', 'store_id'), - $installer->getTable('rating/rating_vote_aggregated'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('rating/rating_store', 'store_id', 'core/store', 'store_id'), - $installer->getTable('rating/rating_store'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('rating/rating_store', 'rating_id', 'rating/rating', 'rating_id'), - $installer->getTable('rating/rating_store'), - 'rating_id', - $installer->getTable('rating/rating'), - 'rating_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, - Varien_Db_Ddl_Table::ACTION_NO_ACTION, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('rating/rating_title', 'rating_id', 'rating/rating', 'rating_id'), - $installer->getTable('rating/rating_title'), - 'rating_id', - $installer->getTable('rating/rating'), - 'rating_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('rating/rating_title', 'store_id', 'core/store', 'store_id'), - $installer->getTable('rating/rating_title'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-0.7.1.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-0.7.1.php deleted file mode 100644 index 0d53cb0f08e..00000000000 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-0.7.1.php +++ /dev/null @@ -1,54 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('report_event_types')}; -CREATE TABLE {$this->getTable('report_event_types')} ( - `event_type_id` smallint(6) unsigned NOT NULL auto_increment, - `event_name` varchar(32) NOT NULL, - PRIMARY KEY (`event_type_id`), - KEY `event_type_id` (`event_type_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -INSERT INTO {$this->getTable('report_event_types')} VALUES -(1, 'catalog_product_view'), -(2, 'sendfriend_product'), -(3, 'catalog_product_compare_add_product'), -(4, 'checkout_cart_add_product'), -(5, 'wishlist_add_product'), -(6, 'wishlist_share'); - --- DROP TABLE IF EXISTS {$this->getTable('report_event')}; -CREATE TABLE {$this->getTable('report_event')} ( - `event_id` bigint(20) unsigned NOT NULL auto_increment, - `logged_at` datetime NOT NULL default '0000-00-00 00:00:00', - `event_type_id` smallint(6) unsigned NOT NULL default '0', - `object_id` int(10) unsigned NOT NULL default '0', - `subject_id` int(10) unsigned NOT NULL default '0', - `store_id` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`event_id`), - KEY `subject_id` (`subject_id`), - KEY `object_id` (`object_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.5.0.0.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.5.0.0.php deleted file mode 100644 index 17726b71e28..00000000000 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.5.0.0.php +++ /dev/null @@ -1,71 +0,0 @@ -getConnection()->addIndex( - $installer->getTable('reports/viewed_product_index'), - $installer->getIdxName( - 'reports/viewed_product_index', - ['visitor_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['visitor_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ); - $installer->getConnection()->addIndex( - $installer->getTable('reports/viewed_product_index'), - $installer->getIdxName( - 'reports/viewed_product_index', - ['customer_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['customer_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ); - - /** - * Unique indexes for reports/compared_product_index - */ - $installer->getConnection()->addIndex( - $installer->getTable('reports/compared_product_index'), - $installer->getIdxName( - 'reports/compared_product_index', - ['visitor_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['visitor_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ); - $installer->getConnection()->addIndex( - $installer->getTable('reports/compared_product_index'), - $installer->getIdxName( - 'reports/compared_product_index', - ['customer_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['customer_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ); -} diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index d7eeb824b67..00000000000 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,54 +0,0 @@ -startSetup(); - -$installer->run(" - -DROP TABLE IF EXISTS {$this->getTable('report_event_types')}; -CREATE TABLE {$this->getTable('report_event_types')} ( - `event_type_id` smallint(6) unsigned NOT NULL auto_increment, - `event_name` varchar(32) NOT NULL, - PRIMARY KEY (`event_type_id`), - KEY `event_type_id` (`event_type_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -INSERT INTO {$this->getTable('report_event_types')} VALUES -(1, 'catalog_product_view'), -(2, 'sendfriend_product'), -(3, 'catalog_product_compare_add_product'), -(4, 'checkout_cart_add_product'), -(5, 'wishlist_add_product'), -(6, 'wishlist_share'); - -DROP TABLE IF EXISTS {$this->getTable('report_event')}; -CREATE TABLE {$this->getTable('report_event')} ( - `event_id` bigint(20) unsigned NOT NULL auto_increment, - `logged_at` datetime NOT NULL default '0000-00-00 00:00:00', - `event_type_id` smallint(6) unsigned NOT NULL default '0', - `object_id` int(10) unsigned NOT NULL default '0', - `subject_id` int(10) unsigned NOT NULL default '0', - `store_id` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`event_id`), - KEY `subject_id` (`subject_id`), - KEY `object_id` (`object_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index b4a390e844c..00000000000 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,33 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('report_event_types')} DROP INDEX `event_type_id`; -ALTER TABLE {$this->getTable('report_event_types')} CHANGE `event_name` `event_name` varchar(64) NOT NULL; -UPDATE {$this->getTable('report_event_types')} SET `event_name`='catalog_product_compare_add_product' WHERE `event_type_id`=3; -ALTER TABLE {$this->getTable('report_event')} ADD `sybtype` tinyint(3) unsigned NOT NULL default '0' AFTER `subject_id`; -ALTER TABLE {$this->getTable('report_event')} ADD INDEX (`event_type_id`); -ALTER TABLE {$this->getTable('report_event')} ADD INDEX (`sybtype`); -ALTER TABLE {$this->getTable('report_event')} ADD INDEX (`store_id`); -ALTER TABLE {$this->getTable('report_event_types')} ADD `customer_login` TINYINT UNSIGNED NOT NULL DEFAULT '0'; -UPDATE {$this->getTable('report_event_types')} SET `customer_login`=1; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index f5b4726cd07..00000000000 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,33 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('report_event')} CHANGE `sybtype` `subtype` tinyint(3) unsigned NOT NULL default '0' AFTER `subject_id`; -ALTER TABLE {$this->getTable('report_event')} DROP INDEX `sybtype`, ADD INDEX (`subtype`); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.3-0.7.4.php deleted file mode 100644 index 9169842f941..00000000000 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ /dev/null @@ -1,49 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('report_event')} - DROP INDEX `event_type_id`, - ADD INDEX `IDX_EVENT_TYPE` (`event_type_id`); -ALTER TABLE {$this->getTable('report_event')} - ADD CONSTRAINT `FK_REPORT_EVENT_TYPE` FOREIGN KEY (`event_type_id`) - REFERENCES {$this->getTable('report_event_types')} (`event_type_id`) - ON UPDATE CASCADE - ON DELETE CASCADE; -ALTER TABLE {$this->getTable('report_event')} - DROP INDEX `subject_id`, - ADD INDEX `IDX_SUBJECT` (`subject_id`); -ALTER TABLE {$this->getTable('report_event')} - DROP INDEX `object_id`, - ADD INDEX `IDX_OBJECT` (`object_id`); -ALTER TABLE {$this->getTable('report_event')} - DROP INDEX `subtype`, - ADD INDEX `IDX_SUBTYPE` (`subtype`); -ALTER TABLE {$this->getTable('report_event')} - DROP INDEX `store_id`; -ALTER TABLE {$this->getTable('report_event')} - CHANGE `store_id` `store_id` smallint(5) unsigned NOT NULL; -ALTER TABLE {$this->getTable('report_event')} - ADD CONSTRAINT `FK_REPORT_EVENT_STORE` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) - ON UPDATE CASCADE - ON DELETE CASCADE; -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index 0b35434858d..00000000000 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,32 +0,0 @@ -startSetup(); - -$installer->run(" -UPDATE {$installer->getTable('cms_page')} SET `layout_update_xml` = CONCAT(IFNULL(layout_update_xml, ''), '') WHERE `identifier`='home'; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.5-0.7.7.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.5-0.7.7.php deleted file mode 100644 index dbc12b9482e..00000000000 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.5-0.7.7.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$oldLayout = $installer->getConnection()->fetchOne("SELECT layout_update_xml FROM {$installer->getTable('cms_page')} WHERE `identifier`='home' LIMIT 1"); -$newLayout = str_replace([ - '', - '', - '', -], [ - 'bundlebundle/catalog_product_price', - 'bundlebundle/catalog_product_price', - 'bundlebundle/catalog_product_price', -], $oldLayout); - -$installer->run(sprintf( - "UPDATE {$installer->getTable('cms_page')} SET `layout_update_xml` = %s WHERE `identifier`='home';", - $installer->getConnection()->quote($newLayout), -)); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.7-0.7.8.php deleted file mode 100644 index f3b3961347c..00000000000 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ /dev/null @@ -1,61 +0,0 @@ -startSetup(); - -$installer->run(" - -CREATE TABLE `{$installer->getTable('reports/viewed_product_index')}` ( - `index_id` bigint(20) unsigned NOT NULL auto_increment, - `visitor_id` int(10) unsigned NOT NULL, - `customer_id` int(10) unsigned default NULL, - `product_id` int(10) unsigned NOT NULL, - `store_id` smallint(5) unsigned default NULL, - `added_at` datetime NOT NULL, - PRIMARY KEY (`index_id`), - UNIQUE KEY `UNQ_BY_VISITOR` (`visitor_id`,`product_id`), - UNIQUE KEY `UNQ_BY_CUSTOMER` (`customer_id`,`product_id`), - KEY `IDX_STORE` (`store_id`), - KEY `IDX_SORT_ADDED_AT` (`added_at`), - KEY `product_id` (`product_id`), - CONSTRAINT `FK_REPORT_VIEWED_PRODUCT_INDEX_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE, - CONSTRAINT `FK_REPORT_VIEWED_PRODUCT_INDEX_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `{$installer->getTable('customer/entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_REPORT_VIEWED_PRODUCT_INDEX_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog/product')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('reports/compared_product_index')}` ( - `index_id` bigint(20) unsigned NOT NULL auto_increment, - `visitor_id` int(10) unsigned NOT NULL, - `customer_id` int(10) unsigned default NULL, - `product_id` int(10) unsigned NOT NULL, - `store_id` smallint(5) unsigned default NULL, - `added_at` datetime NOT NULL, - PRIMARY KEY (`index_id`), - UNIQUE KEY `UNQ_BY_VISITOR` (`visitor_id`,`product_id`), - UNIQUE KEY `UNQ_BY_CUSTOMER` (`customer_id`,`product_id`), - KEY `IDX_STORE` (`store_id`), - KEY `IDX_SORT_ADDED_AT` (`added_at`), - KEY `product_id` (`product_id`), - CONSTRAINT `FK_REPORT_COMPARED_PRODUCT_INDEX_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE, - CONSTRAINT `FK_REPORT_COMPARED_PRODUCT_INDEX_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `{$installer->getTable('customer/entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_REPORT_COMPARED_PRODUCT_INDEX_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog/product')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.8-0.7.9.php deleted file mode 100644 index f9abbdb5755..00000000000 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->run("ALTER TABLE {$this->getTable('report_viewed_product_index')} CHANGE `visitor_id` `visitor_id` INT( 10 ) UNSIGNED NULL "); -$installer->endSetup(); diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.9-0.7.10.php deleted file mode 100644 index b0e23b98fe9..00000000000 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->getConnection()->modifyColumn( - $installer->getTable('reports/compared_product_index'), - 'visitor_id', - 'INT(10) UNSIGNED NULL', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index bb3d4430666..00000000000 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,489 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ - -$installer->getConnection()->dropForeignKey( - $installer->getTable('reports/compared_product_index'), - 'FK_REPORT_COMPARED_PRODUCT_INDEX_CUSTOMER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('reports/compared_product_index'), - 'FK_REPORT_COMPARED_PRODUCT_INDEX_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('reports/compared_product_index'), - 'FK_REPORT_COMPARED_PRODUCT_INDEX_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('reports/event'), - 'FK_REPORT_EVENT_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('reports/event'), - 'FK_REPORT_EVENT_TYPE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('reports/viewed_product_index'), - 'FK_REPORT_VIEWED_PRODUCT_INDEX_CUSTOMER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('reports/viewed_product_index'), - 'FK_REPORT_VIEWED_PRODUCT_INDEX_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('reports/viewed_product_index'), - 'FK_REPORT_VIEWED_PRODUCT_INDEX_STORE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('reports/compared_product_index'), - 'UNQ_BY_VISITOR', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('reports/compared_product_index'), - 'UNQ_BY_CUSTOMER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('reports/compared_product_index'), - 'IDX_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('reports/compared_product_index'), - 'IDX_SORT_ADDED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('reports/compared_product_index'), - 'PRODUCT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('reports/event'), - 'IDX_EVENT_TYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('reports/event'), - 'IDX_SUBJECT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('reports/event'), - 'IDX_OBJECT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('reports/event'), - 'IDX_SUBTYPE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('reports/event'), - 'FK_REPORT_EVENT_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('reports/viewed_product_index'), - 'UNQ_BY_VISITOR', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('reports/viewed_product_index'), - 'UNQ_BY_CUSTOMER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('reports/viewed_product_index'), - 'IDX_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('reports/viewed_product_index'), - 'IDX_SORT_ADDED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('reports/viewed_product_index'), - 'PRODUCT_ID', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('reports/event') => [ - 'columns' => [ - 'event_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Event Id', - ], - 'logged_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Logged At', - ], - 'event_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Event Type Id', - ], - 'object_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Object Id', - ], - 'subject_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Subject Id', - ], - 'subtype' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Subtype', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store Id', - ], - ], - 'comment' => 'Reports Event Table', - ], - $installer->getTable('reports/event_type') => [ - 'columns' => [ - 'event_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Event Type Id', - ], - 'event_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'nullable' => false, - 'comment' => 'Event Name', - ], - 'customer_login' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Customer Login', - ], - ], - 'comment' => 'Reports Event Type Table', - ], - $installer->getTable('reports/compared_product_index') => [ - 'columns' => [ - 'index_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Index Id', - ], - 'visitor_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Visitor Id', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Customer Id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Product Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'added_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Added At', - ], - ], - 'comment' => 'Reports Compared Product Index Table', - ], - $installer->getTable('reports/viewed_product_index') => [ - 'columns' => [ - 'index_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Index Id', - ], - 'visitor_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Visitor Id', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Customer Id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Product Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'added_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Added At', - ], - ], - 'comment' => 'Reports Viewed Product Index Table', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('reports/compared_product_index'), - $installer->getIdxName( - 'reports/compared_product_index', - ['visitor_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['visitor_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('reports/compared_product_index'), - $installer->getIdxName( - 'reports/compared_product_index', - ['customer_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['customer_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('reports/compared_product_index'), - $installer->getIdxName('reports/compared_product_index', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('reports/compared_product_index'), - $installer->getIdxName('reports/compared_product_index', ['added_at']), - ['added_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('reports/compared_product_index'), - $installer->getIdxName('reports/compared_product_index', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('reports/event'), - $installer->getIdxName('reports/event', ['event_type_id']), - ['event_type_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('reports/event'), - $installer->getIdxName('reports/event', ['subject_id']), - ['subject_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('reports/event'), - $installer->getIdxName('reports/event', ['object_id']), - ['object_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('reports/event'), - $installer->getIdxName('reports/event', ['subtype']), - ['subtype'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('reports/event'), - $installer->getIdxName('reports/event', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('reports/viewed_product_index'), - $installer->getIdxName( - 'reports/viewed_product_index', - ['visitor_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['visitor_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('reports/viewed_product_index'), - $installer->getIdxName( - 'reports/viewed_product_index', - ['customer_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['customer_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('reports/viewed_product_index'), - $installer->getIdxName('reports/viewed_product_index', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('reports/viewed_product_index'), - $installer->getIdxName('reports/viewed_product_index', ['added_at']), - ['added_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('reports/viewed_product_index'), - $installer->getIdxName('reports/viewed_product_index', ['product_id']), - ['product_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('reports/compared_product_index', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('reports/compared_product_index'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('reports/compared_product_index', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('reports/compared_product_index'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('reports/compared_product_index', 'store_id', 'core/store', 'store_id'), - $installer->getTable('reports/compared_product_index'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('reports/event', 'store_id', 'core/store', 'store_id'), - $installer->getTable('reports/event'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('reports/event', 'event_type_id', 'reports/event_type', 'event_type_id'), - $installer->getTable('reports/event'), - 'event_type_id', - $installer->getTable('reports/event_type'), - 'event_type_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('reports/viewed_product_index', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('reports/viewed_product_index'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('reports/viewed_product_index', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('reports/viewed_product_index'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('reports/viewed_product_index', 'store_id', 'core/store', 'store_id'), - $installer->getTable('reports/viewed_product_index'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-install-0.7.0.php deleted file mode 100644 index a5cbc0bd91e..00000000000 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,92 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('review')}; -CREATE TABLE {$this->getTable('review')} ( - `review_id` bigint(20) unsigned NOT NULL auto_increment, - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `entity_id` smallint(5) unsigned NOT NULL default '0', - `entity_pk_value` int(10) unsigned NOT NULL default '0', - `status_id` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`review_id`), - KEY `FK_REVIEW_ENTITY` (`entity_id`), - KEY `FK_REVIEW_STATUS` (`status_id`), - KEY `FK_REVIEW_PARENT_PRODUCT` (`entity_pk_value`), - CONSTRAINT `FK_REVIEW_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('review_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_REVIEW_PARENT_PRODUCT` FOREIGN KEY (`entity_pk_value`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_REVIEW_STATUS` FOREIGN KEY (`status_id`) REFERENCES {$this->getTable('review_status')} (`status_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Review base information'; - --- DROP TABLE IF EXISTS {$this->getTable('review_detail')}; -CREATE TABLE {$this->getTable('review_detail')} ( - `detail_id` bigint(20) unsigned NOT NULL auto_increment, - `review_id` bigint(20) unsigned NOT NULL default '0', - `store_id` smallint(6) unsigned NOT NULL default '0', - `title` varchar(255) NOT NULL default '', - `detail` text NOT NULL, - `nickname` varchar(128) NOT NULL default '', - `customer_id` int(10) unsigned default NULL, - PRIMARY KEY (`detail_id`), - KEY `FK_REVIEW_DETAIL_REVIEW` (`review_id`), - CONSTRAINT `FK_REVIEW_DETAIL_REVIEW` FOREIGN KEY (`review_id`) REFERENCES {$this->getTable('review')} (`review_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Review detail information'; - --- DROP TABLE IF EXISTS {$this->getTable('review_entity')}; -CREATE TABLE {$this->getTable('review_entity')} ( - `entity_id` smallint(5) unsigned NOT NULL auto_increment, - `entity_code` varchar(32) NOT NULL default '', - PRIMARY KEY (`entity_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Review entities'; - -insert into {$this->getTable('review_entity')}(`entity_id`,`entity_code`) values (1,'product'),(2,'customer'),(3,'category'); - --- DROP TABLE IF EXISTS {$this->getTable('review_entity_summary')}; -CREATE TABLE {$this->getTable('review_entity_summary')} ( - `primary_id` bigint(20) NOT NULL auto_increment, - `entity_pk_value` bigint(20) NOT NULL default '0', - `entity_type` tinyint(4) NOT NULL default '0', - `reviews_count` smallint(6) NOT NULL default '0', - `rating_summary` tinyint(4) NOT NULL default '0', - `store_id` smallint (5) unsigned NOT NULL default '0', - PRIMARY KEY (`primary_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('review_status')}; -CREATE TABLE {$this->getTable('review_status')} ( - `status_id` tinyint(3) unsigned NOT NULL auto_increment, - `status_code` varchar(32) NOT NULL default '', - PRIMARY KEY (`status_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Review statuses'; - -insert into {$this->getTable('review_status')}(`status_id`,`status_code`) values (1,'Approved'),(2,'Pending'),(3,'Not Approved'); - --- DROP TABLE IF EXISTS `{$this->getTable('review_store')}`; -CREATE TABLE `{$this->getTable('review_store')}` ( - `review_id` bigint(20) unsigned NOT NULL, - `store_id` smallint(5) unsigned NOT NULL, - PRIMARY KEY (`review_id`,`store_id`), - CONSTRAINT `FK_REVIEW_STORE_REVIEW` FOREIGN KEY (`review_id`) REFERENCES `{$this->getTable('review')}` (`review_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 26324d58e71..00000000000 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,44 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('review_detail')} - CHANGE `store_id` `store_id` smallint(5) unsigned NULL DEFAULT '0'; -ALTER TABLE {$this->getTable('review_detail')} - ADD CONSTRAINT `FK_REVIEW_DETAIL_STORE` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) - ON UPDATE CASCADE - ON DELETE SET NULL; -"); -$installer->run(" -ALTER TABLE {$this->getTable('review_entity_summary')} - ADD CONSTRAINT `FK_REVIEW_ENTITY_SUMMARY_STORE` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) - ON UPDATE CASCADE - ON DELETE CASCADE; -"); -$installer->run(" -ALTER TABLE {$this->getTable('review_store')} - ADD CONSTRAINT `FK_REVIEW_STORE_STORE` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) - ON UPDATE CASCADE - ON DELETE CASCADE; -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index 0f4d5b63d18..00000000000 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$voteTable = $this->getTable('rating_option_vote'); -$reviewTable = $this->getTable('review'); - -$this->run(" -DELETE FROM `{$voteTable}` WHERE `review_id` NOT IN (SELECT review_id FROM `{$reviewTable}`); -"); - -$this->run(" -ALTER TABLE `{$voteTable}` -ADD CONSTRAINT `FK_RATING_OPTION_REVIEW_ID` FOREIGN KEY (`review_id`) REFERENCES `{$reviewTable}` (`review_id`) -ON DELETE CASCADE ON UPDATE CASCADE; -"); - -$this->endSetup(); diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index aa2313fc272..00000000000 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,51 +0,0 @@ -startSetup(); - -// add average approved percent -$this->run(" -ALTER TABLE `{$this->getTable('rating_option_vote_aggregated')}` -ADD COLUMN `percent_approved` tinyint(3) NULL DEFAULT 0 AFTER `percent`; -"); - -try { - // re-aggregate existing reviews - $resource = Mage::getResourceSingleton('review/review'); - // count quantity and aggregate packs per 100 items - $total = $this->getConnection()->select()->from($this->getTable('review'), 'count(*)'); - $total = (int) $this->getConnection()->fetchOne($total); - for ($i = 0; $i < $total; $i += 100) { - $select = $this->getConnection()->select() - ->from($this->getTable('review'), ['review_id', 'entity_pk_value']) - ->limit(100, $i) - ; - $rows = $this->getConnection()->fetchAll($select); - foreach ($rows as $row) { - $resource->reAggregateReview($row['review_id'], $row['entity_pk_value']); - } - } -} catch (Exception $e) { - $this->run("ALTER TABLE `{$this->getTable('rating_option_vote_aggregated')}` DROP COLUMN `percent_approved`;"); - throw $e; -} - -$this->endSetup(); diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.3-0.7.4.php deleted file mode 100644 index adcd2abcf45..00000000000 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ /dev/null @@ -1,32 +0,0 @@ -startSetup(); - -$installer->getConnection()->addConstraint( - 'FK_REVIEW_STORE_REVIEW', - $installer->getTable('review/review_store'), - 'review_id', - $installer->getTable('review/review'), - 'review_id', - 'CASCADE', - 'CASCADE', - true, -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index fb3d9cf23bc..00000000000 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$tableReviewDetail = $installer->getTable('review/review_detail'); -$tableCustomer = $installer->getTable('customer_entity'); - -$installer->run("UPDATE {$tableReviewDetail} SET customer_id=NULL WHERE customer_id NOT IN (SELECT entity_id FROM {$tableCustomer})"); - -$installer->getConnection()->addConstraint( - 'FK_REVIEW_DETAIL_CUSTOMER', - $tableReviewDetail, - 'customer_id', - $tableCustomer, - 'entity_id', - 'SET NULL', - 'CASCADE', - true, -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.5-0.7.6.php deleted file mode 100644 index 4415aafe59b..00000000000 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->dropForeignKey($this->getTable('review'), 'FK_REVIEW_PARENT_PRODUCT'); -$installer->endSetup(); diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 0d465086e2f..00000000000 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,432 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('review/review'), - 'FK_REVIEW_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('review/review'), - 'FK_REVIEW_STATUS', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('review/review_detail'), - 'FK_REVIEW_DETAIL_CUSTOMER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('review/review_detail'), - 'FK_REVIEW_DETAIL_REVIEW', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('review/review_detail'), - 'FK_REVIEW_DETAIL_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('review/review_aggregate'), - 'FK_REVIEW_ENTITY_SUMMARY_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('review/review_store'), - 'FK_REVIEW_STORE_REVIEW', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('review/review_store'), - 'FK_REVIEW_STORE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('review/review_store'), - 'REVIEW_STORE_IBFK_1', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('review/review'), - 'FK_REVIEW_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('review/review'), - 'FK_REVIEW_STATUS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('review/review'), - 'FK_REVIEW_PARENT_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('review/review_detail'), - 'FK_REVIEW_DETAIL_REVIEW', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('review/review_detail'), - 'FK_REVIEW_DETAIL_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('review/review_detail'), - 'FK_REVIEW_DETAIL_CUSTOMER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('review/review_store'), - 'FK_REVIEW_STORE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('review/review_aggregate'), - 'FK_REVIEW_ENTITY_SUMMARY_STORE', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('review/review') => [ - 'columns' => [ - 'review_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Review id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Review create date', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity id', - ], - 'entity_pk_value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product id', - ], - 'status_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Status code', - ], - ], - 'comment' => 'Review base information', - ], - $installer->getTable('review/review_detail') => [ - 'columns' => [ - 'detail_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Review detail id', - ], - 'review_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Review id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Store id', - ], - 'title' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Title', - ], - 'detail' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'nullable' => false, - 'comment' => 'Detail description', - ], - 'nickname' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 128, - 'nullable' => false, - 'comment' => 'User nickname', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Customer Id', - ], - ], - 'comment' => 'Review detail information', - ], - $installer->getTable('review/review_status') => [ - 'columns' => [ - 'status_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Status id', - ], - 'status_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'comment' => 'Status code', - ], - ], - 'comment' => 'Review statuses', - ], - $installer->getTable('review/review_entity') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Review entity id', - ], - 'entity_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'comment' => 'Review entity code', - ], - ], - 'comment' => 'Review entities', - ], - $installer->getTable('review/review_aggregate') => [ - 'columns' => [ - 'primary_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Summary review entity id', - ], - 'entity_pk_value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product id', - ], - 'entity_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity type id', - ], - 'reviews_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Qty of reviews', - ], - 'rating_summary' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Summarized rating', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store id', - ], - ], - 'comment' => 'Review aggregates', - ], - $installer->getTable('review/review_store') => [ - 'columns' => [ - 'review_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Review Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store Id', - ], - ], - 'comment' => 'Review Store', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('review/review'), - $installer->getIdxName('review/review', ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('review/review'), - $installer->getIdxName('review/review', ['status_id']), - ['status_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('review/review'), - $installer->getIdxName('review/review', ['entity_pk_value']), - ['entity_pk_value'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('review/review_detail'), - $installer->getIdxName('review/review_detail', ['review_id']), - ['review_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('review/review_detail'), - $installer->getIdxName('review/review_detail', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('review/review_detail'), - $installer->getIdxName('review/review_detail', ['customer_id']), - ['customer_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('review/review_aggregate'), - $installer->getIdxName('review/review_aggregate', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('review/review_store'), - $installer->getIdxName('review/review_store', ['store_id']), - ['store_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('review/review', 'entity_id', 'review/review_entity', 'entity_id'), - $installer->getTable('review/review'), - 'entity_id', - $installer->getTable('review/review_entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('review/review', 'status_id', 'review/review_status', 'status_id'), - $installer->getTable('review/review'), - 'status_id', - $installer->getTable('review/review_status'), - 'status_id', - Varien_Db_Ddl_Table::ACTION_NO_ACTION, - Varien_Db_Ddl_Table::ACTION_NO_ACTION, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('review/review_detail', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('review/review_detail'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('review/review_detail', 'review_id', 'review/review', 'review_id'), - $installer->getTable('review/review_detail'), - 'review_id', - $installer->getTable('review/review'), - 'review_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('review/review_detail', 'store_id', 'core/store', 'store_id'), - $installer->getTable('review/review_detail'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('review/review_aggregate', 'store_id', 'core/store', 'store_id'), - $installer->getTable('review/review_aggregate'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('review/review_store', 'review_id', 'review/review', 'review_id'), - $installer->getTable('review/review_store'), - 'review_id', - $installer->getTable('review/review'), - 'review_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('review/review_store', 'store_id', 'core/store', 'store_id'), - $installer->getTable('review/review_store'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.7.0.php deleted file mode 100644 index c8f854ff1e4..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,725 +0,0 @@ -startSetup(); - -$installer->run(" - -/*Table structure for table `sales_counter` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_counter')}; -CREATE TABLE {$this->getTable('sales_counter')} ( - `counter_id` int(10) unsigned NOT NULL auto_increment, - `store_id` int(10) unsigned NOT NULL default '0', - `counter_type` varchar(50) NOT NULL default '', - `counter_value` varchar(50) NOT NULL default '', - PRIMARY KEY (`counter_id`), - UNIQUE KEY `store_id` (`store_id`,`counter_type`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_counter` */ - -/*Table structure for table `sales_discount_coupon` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_discount_coupon')}; - -CREATE TABLE {$this->getTable('sales_discount_coupon')} ( - `coupon_id` int(10) unsigned NOT NULL auto_increment, - `coupon_code` varchar(50) NOT NULL default '', - `discount_percent` decimal(10,4) NOT NULL default '0.0000', - `discount_fixed` decimal(10,4) NOT NULL default '0.0000', - `is_active` tinyint(1) NOT NULL default '1', - `from_date` datetime NOT NULL default '0000-00-00 00:00:00', - `to_date` datetime NOT NULL default '0000-00-00 00:00:00', - `min_subtotal` decimal(12,4) NOT NULL default '0.0000', - `limit_products` text NOT NULL, - `limit_categories` text NOT NULL, - `limit_attributes` text NOT NULL, - PRIMARY KEY (`coupon_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_discount_coupon` */ - -insert into {$this->getTable('sales_discount_coupon')}(`coupon_id`,`coupon_code`,`discount_percent`,`discount_fixed`, - `is_active`,`from_date`,`to_date`,`min_subtotal`,`limit_products`,`limit_categories`,`limit_attributes`) -values (1,'test',10.0000,0.0000,1,'0000-00-00 00:00:00','0000-00-00 00:00:00',0.0000,'','',''); - -/*Table structure for table `sales_invoice_entity` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_invoice_entity')}; - -CREATE TABLE {$this->getTable('sales_invoice_entity')} ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_sales_invoice_entity_type` (`entity_type_id`), - KEY `FK_sales_invoice_entity_store` (`store_id`), - CONSTRAINT `FK_sales_invoice_entity_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_invoice_entity` */ - -/*Table structure for table `sales_invoice_entity_datetime` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_invoice_entity_datetime')}; -CREATE TABLE {$this->getTable('sales_invoice_entity_datetime')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_sales_invoice_entity_datetime_entity_type` (`entity_type_id`), - KEY `FK_sales_invoice_entity_datetime_attribute` (`attribute_id`), - KEY `FK_sales_invoice_entity_datetime_store` (`store_id`), - KEY `FK_sales_invoice_entity_datetime` (`entity_id`), - CONSTRAINT `FK_sales_invoice_entity_datetime` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_invoice_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_datetime_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_datetime_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_datetime_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_invoice_entity_datetime` */ - -/*Table structure for table `sales_invoice_entity_decimal` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_invoice_entity_decimal')}; - -CREATE TABLE {$this->getTable('sales_invoice_entity_decimal')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_sales_invoice_entity_decimal_entity_type` (`entity_type_id`), - KEY `FK_sales_invoice_entity_decimal_attribute` (`attribute_id`), - KEY `FK_sales_invoice_entity_decimal_store` (`store_id`), - KEY `FK_sales_invoice_entity_decimal` (`entity_id`), - CONSTRAINT `FK_sales_invoice_entity_decimal` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_invoice_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_decimal_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_decimal_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_decimal_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_invoice_entity_decimal` */ - -/*Table structure for table `sales_invoice_entity_int` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_invoice_entity_int')}; - -CREATE TABLE {$this->getTable('sales_invoice_entity_int')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_sales_invoice_entity_int_entity_type` (`entity_type_id`), - KEY `FK_sales_invoice_entity_int_attribute` (`attribute_id`), - KEY `FK_sales_invoice_entity_int_store` (`store_id`), - KEY `FK_sales_invoice_entity_int` (`entity_id`), - CONSTRAINT `FK_sales_invoice_entity_int` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_invoice_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_int_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_int_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_int_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_invoice_entity_int` */ - -/*Table structure for table `sales_invoice_entity_text` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_invoice_entity_text')}; -CREATE TABLE {$this->getTable('sales_invoice_entity_text')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_sales_invoice_entity_text_entity_type` (`entity_type_id`), - KEY `FK_sales_invoice_entity_text_attribute` (`attribute_id`), - KEY `FK_sales_invoice_entity_text_store` (`store_id`), - KEY `FK_sales_invoice_entity_text` (`entity_id`), - CONSTRAINT `FK_sales_invoice_entity_text` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_invoice_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_text_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_text_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_text_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_invoice_entity_text` */ - -/*Table structure for table `sales_invoice_entity_varchar` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_invoice_entity_varchar')}; -CREATE TABLE {$this->getTable('sales_invoice_entity_varchar')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_sales_invoice_entity_varchar_entity_type` (`entity_type_id`), - KEY `FK_sales_invoice_entity_varchar_attribute` (`attribute_id`), - KEY `FK_sales_invoice_entity_varchar_store` (`store_id`), - KEY `FK_sales_invoice_entity_varchar` (`entity_id`), - CONSTRAINT `FK_sales_invoice_entity_varchar` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_invoice_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_varchar_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_varchar_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_invoice_entity_varchar_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_invoice_entity_varchar` */ - -/*Table structure for table `sales_order_entity` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_order_entity')}; -CREATE TABLE {$this->getTable('sales_order_entity')} ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_sales_order_entity_type` (`entity_type_id`), - KEY `FK_sales_order_entity_store` (`store_id`), - CONSTRAINT `FK_sales_order_entity_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - -/*Data for the table `sales_order_entity` */ - -/*Table structure for table `sales_order_entity_datetime` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_order_entity_datetime')}; -CREATE TABLE {$this->getTable('sales_order_entity_datetime')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_entity_datetime_entity_type` (`entity_type_id`), - KEY `FK_sales_order_entity_datetime_attribute` (`attribute_id`), - KEY `FK_sales_order_entity_datetime_store` (`store_id`), - KEY `FK_sales_order_entity_datetime` (`entity_id`), - CONSTRAINT `FK_sales_order_entity_datetime` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_order_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_datetime_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_datetime_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_datetime_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_order_entity_datetime` */ - -/*Table structure for table `sales_order_entity_decimal` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_order_entity_decimal')}; -CREATE TABLE {$this->getTable('sales_order_entity_decimal')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_entity_decimal_entity_type` (`entity_type_id`), - KEY `FK_sales_order_entity_decimal_attribute` (`attribute_id`), - KEY `FK_sales_order_entity_decimal_store` (`store_id`), - KEY `FK_sales_order_entity_decimal` (`entity_id`), - CONSTRAINT `FK_sales_order_entity_decimal` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_order_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_decimal_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_decimal_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_decimal_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_order_entity_decimal` */ - -/*Table structure for table `sales_order_entity_int` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_order_entity_int')}; -CREATE TABLE {$this->getTable('sales_order_entity_int')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_entity_int_entity_type` (`entity_type_id`), - KEY `FK_sales_order_entity_int_attribute` (`attribute_id`), - KEY `FK_sales_order_entity_int_store` (`store_id`), - KEY `FK_sales_order_entity_int` (`entity_id`), - CONSTRAINT `FK_sales_order_entity_int` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_order_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_int_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_int_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_int_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_order_entity_int` */ - -/*Table structure for table `sales_order_entity_text` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_order_entity_text')}; -CREATE TABLE {$this->getTable('sales_order_entity_text')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_entity_text_entity_type` (`entity_type_id`), - KEY `FK_sales_order_entity_text_attribute` (`attribute_id`), - KEY `FK_sales_order_entity_text_store` (`store_id`), - KEY `FK_sales_order_entity_text` (`entity_id`), - CONSTRAINT `FK_sales_order_entity_text` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_order_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_text_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_text_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_text_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_order_entity_text` */ - -/*Table structure for table `sales_order_entity_varchar` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_order_entity_varchar')}; -CREATE TABLE {$this->getTable('sales_order_entity_varchar')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_entity_varchar_entity_type` (`entity_type_id`), - KEY `FK_sales_order_entity_varchar_attribute` (`attribute_id`), - KEY `FK_sales_order_entity_varchar_store` (`store_id`), - KEY `FK_sales_order_entity_varchar` (`entity_id`), - CONSTRAINT `FK_sales_order_entity_varchar` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_order_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_varchar_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_varchar_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_varchar_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_order_entity_varchar` */ - -/*Table structure for table `sales_quote_entity` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_quote_entity')}; -CREATE TABLE {$this->getTable('sales_quote_entity')} ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_sales_quote_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_entity_store` (`store_id`), - CONSTRAINT `FK_sales_quote_entity_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - -/*Table structure for table `sales_quote_entity_datetime` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_quote_entity_datetime')}; -CREATE TABLE {$this->getTable('sales_quote_entity_datetime')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_entity_datetime_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_entity_datetime_attribute` (`attribute_id`), - KEY `FK_sales_quote_entity_datetime_store` (`store_id`), - KEY `FK_sales_quote_entity_datetime` (`entity_id`), - CONSTRAINT `FK_sales_quote_entity_datetime` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_quote_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_datetime_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_datetime_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_datetime_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_quote_entity_datetime` */ - -/*Table structure for table `sales_quote_entity_decimal` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_quote_entity_decimal')}; -CREATE TABLE {$this->getTable('sales_quote_entity_decimal')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_entity_decimal_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_entity_decimal_attribute` (`attribute_id`), - KEY `FK_sales_quote_entity_decimal_store` (`store_id`), - KEY `FK_sales_quote_entity_decimal` (`entity_id`), - CONSTRAINT `FK_sales_quote_entity_decimal` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_quote_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_decimal_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_decimal_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_decimal_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -/*Table structure for table `sales_quote_entity_int` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_quote_entity_int')}; -CREATE TABLE {$this->getTable('sales_quote_entity_int')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_entity_int_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_entity_int_attribute` (`attribute_id`), - KEY `FK_sales_quote_entity_int_store` (`store_id`), - KEY `FK_sales_quote_entity_int` (`entity_id`), - CONSTRAINT `FK_sales_quote_entity_int` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_quote_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_int_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_int_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_int_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -/*Table structure for table `sales_quote_entity_text` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_quote_entity_text')}; -CREATE TABLE {$this->getTable('sales_quote_entity_text')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_entity_text_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_entity_text_attribute` (`attribute_id`), - KEY `FK_sales_quote_entity_text_store` (`store_id`), - KEY `FK_sales_quote_entity_text` (`entity_id`), - CONSTRAINT `FK_sales_quote_entity_text` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_quote_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_text_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_text_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_text_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_quote_entity_text` */ - -/*Table structure for table `sales_quote_entity_varchar` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_quote_entity_varchar')}; -CREATE TABLE {$this->getTable('sales_quote_entity_varchar')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_entity_varchar_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_entity_varchar_attribute` (`attribute_id`), - KEY `FK_sales_quote_entity_varchar_store` (`store_id`), - KEY `FK_sales_quote_entity_varchar` (`entity_id`), - CONSTRAINT `FK_sales_quote_entity_varchar` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_quote_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_varchar_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_varchar_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_varchar_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Table structure for table `sales_quote_rule` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_quote_rule')}; -CREATE TABLE {$this->getTable('sales_quote_rule')} ( - `quote_rule_id` int(10) unsigned NOT NULL auto_increment, - `name` varchar(255) NOT NULL default '', - `description` text NOT NULL, - `is_active` tinyint(4) NOT NULL default '0', - `start_at` datetime NOT NULL default '0000-00-00 00:00:00', - `expire_at` datetime NOT NULL default '0000-00-00 00:00:00', - `coupon_code` varchar(50) NOT NULL default '', - `customer_registered` tinyint(1) NOT NULL default '2', - `customer_new_buyer` tinyint(1) NOT NULL default '2', - `show_in_catalog` tinyint(1) NOT NULL default '0', - `sort_order` smallint(6) NOT NULL default '0', - `conditions_serialized` text NOT NULL, - `actions_serialized` text NOT NULL, - PRIMARY KEY (`quote_rule_id`), - KEY `rule_name` (`name`), - KEY `is_active` (`is_active`,`start_at`,`expire_at`,`coupon_code`,`customer_registered`, - `customer_new_buyer`,`show_in_catalog`,`sort_order`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_quote_rule` */ - -/*Table structure for table `sales_quote_temp` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_quote_temp')}; -CREATE TABLE {$this->getTable('sales_quote_temp')} ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_sales_quote_temp_type` (`entity_type_id`), - KEY `FK_sales_quote_temp_store` (`store_id`), - CONSTRAINT `FK_sales_quote_temp_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - -/*Data for the table `sales_quote_temp` */ - -/*Table structure for table `sales_quote_temp_datetime` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_quote_temp_datetime')}; -CREATE TABLE {$this->getTable('sales_quote_temp_datetime')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_temp_datetime_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_temp_datetime_attribute` (`attribute_id`), - KEY `FK_sales_quote_temp_datetime_store` (`store_id`), - KEY `FK_sales_quote_temp_datetime` (`entity_id`), - CONSTRAINT `FK_sales_quote_temp_datetime` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_quote_temp')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_datetime_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_datetime_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_datetime_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_quote_temp_datetime` */ - -/*Table structure for table `sales_quote_temp_decimal` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_quote_temp_decimal')}; -CREATE TABLE {$this->getTable('sales_quote_temp_decimal')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_temp_decimal_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_temp_decimal_attribute` (`attribute_id`), - KEY `FK_sales_quote_temp_decimal_store` (`store_id`), - KEY `FK_sales_quote_temp_decimal` (`entity_id`), - CONSTRAINT `FK_sales_quote_temp_decimal` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_quote_temp')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_decimal_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_decimal_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_decimal_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_quote_temp_decimal` */ - -/*Table structure for table `sales_quote_temp_int` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_quote_temp_int')}; -CREATE TABLE {$this->getTable('sales_quote_temp_int')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_temp_int_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_temp_int_attribute` (`attribute_id`), - KEY `FK_sales_quote_temp_int_store` (`store_id`), - KEY `FK_sales_quote_temp_int` (`entity_id`), - CONSTRAINT `FK_sales_quote_temp_int` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_quote_temp')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_int_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_int_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_int_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_quote_temp_int` */ - -/*Table structure for table `sales_quote_temp_text` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_quote_temp_text')}; -CREATE TABLE {$this->getTable('sales_quote_temp_text')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_temp_text_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_temp_text_attribute` (`attribute_id`), - KEY `FK_sales_quote_temp_text_store` (`store_id`), - KEY `FK_sales_quote_temp_text` (`entity_id`), - CONSTRAINT `FK_sales_quote_temp_text` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_quote_temp')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_text_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_text_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_text_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_quote_temp_text` */ - -/*Table structure for table `sales_quote_temp_varchar` */ - --- DROP TABLE IF EXISTS {$this->getTable('sales_quote_temp_varchar')}; -CREATE TABLE {$this->getTable('sales_quote_temp_varchar')} ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_temp_varchar_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_temp_varchar_attribute` (`attribute_id`), - KEY `FK_sales_quote_temp_varchar_store` (`store_id`), - KEY `FK_sales_quote_temp_varchar` (`entity_id`), - CONSTRAINT `FK_sales_quote_temp_varchar` FOREIGN KEY (`entity_id`) - REFERENCES {$this->getTable('sales_quote_temp')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_varchar_attribute` FOREIGN KEY (`attribute_id`) - REFERENCES {$this->getTable('eav_attribute')} (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_varchar_entity_type` FOREIGN KEY (`entity_type_id`) - REFERENCES {$this->getTable('eav_entity_type')} (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_varchar_store` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `sales_quote_temp_varchar` */ - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; - "); - -$installer->installEntities(); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.8.11.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.8.11.php deleted file mode 100644 index 1f9e25edc66..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.8.11.php +++ /dev/null @@ -1,365 +0,0 @@ -startSetup(); - -$installer->run(" --- DROP TABLE IF EXISTS `{$installer->getTable('sales_counter')}`; -CREATE TABLE `{$installer->getTable('sales_counter')}` ( - `counter_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned NOT NULL default '0', - `counter_type` varchar(50) NOT NULL default '', - `counter_value` varchar(50) NOT NULL default '', - PRIMARY KEY (`counter_id`), - UNIQUE KEY `store_id` (`store_id`,`counter_type`), - CONSTRAINT `FK_SALES_COUNTER_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_discount_coupon')}`; -CREATE TABLE `{$installer->getTable('sales_discount_coupon')}` ( - `coupon_id` int(10) unsigned NOT NULL auto_increment, - `coupon_code` varchar(50) NOT NULL default '', - `discount_percent` decimal(10,4) NOT NULL default '0.0000', - `discount_fixed` decimal(10,4) NOT NULL default '0.0000', - `is_active` tinyint(1) NOT NULL default '1', - `from_date` datetime NOT NULL default '0000-00-00 00:00:00', - `to_date` datetime NOT NULL default '0000-00-00 00:00:00', - `min_subtotal` decimal(12,4) NOT NULL default '0.0000', - `limit_products` text NOT NULL, - `limit_categories` text NOT NULL, - `limit_attributes` text NOT NULL, - PRIMARY KEY (`coupon_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_order_entity')}`; -CREATE TABLE `{$installer->getTable('sales_order_entity')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned default NULL, - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_sales_order_entity_type` (`entity_type_id`), - KEY `FK_sales_order_entity_store` (`store_id`), - CONSTRAINT `FK_SALE_ORDER_ENTITY_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_order_entity_datetime')}`; -CREATE TABLE `{$installer->getTable('sales_order_entity_datetime')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_entity_datetime_entity_type` (`entity_type_id`), - KEY `FK_sales_order_entity_datetime_attribute` (`attribute_id`), - KEY `FK_sales_order_entity_datetime` (`entity_id`), - CONSTRAINT `FK_sales_order_entity_datetime` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_datetime_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_datetime_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_order_entity_decimal')}`; -CREATE TABLE `{$installer->getTable('sales_order_entity_decimal')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_entity_decimal_entity_type` (`entity_type_id`), - KEY `FK_sales_order_entity_decimal_attribute` (`attribute_id`), - KEY `FK_sales_order_entity_decimal` (`entity_id`), - CONSTRAINT `FK_sales_order_entity_decimal` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_decimal_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_decimal_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_order_entity_int')}`; -CREATE TABLE `{$installer->getTable('sales_order_entity_int')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_entity_int_entity_type` (`entity_type_id`), - KEY `FK_sales_order_entity_int_attribute` (`attribute_id`), - KEY `FK_sales_order_entity_int` (`entity_id`), - CONSTRAINT `FK_sales_order_entity_int` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_int_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_int_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_order_entity_text')}`; -CREATE TABLE `{$installer->getTable('sales_order_entity_text')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_entity_text_entity_type` (`entity_type_id`), - KEY `FK_sales_order_entity_text_attribute` (`attribute_id`), - KEY `FK_sales_order_entity_text` (`entity_id`), - CONSTRAINT `FK_sales_order_entity_text` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_text_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_text_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_order_entity_varchar')}`; -CREATE TABLE `{$installer->getTable('sales_order_entity_varchar')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_entity_varchar_entity_type` (`entity_type_id`), - KEY `FK_sales_order_entity_varchar_attribute` (`attribute_id`), - KEY `FK_sales_order_entity_varchar` (`entity_id`), - CONSTRAINT `FK_sales_order_entity_varchar` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_varchar_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_entity_varchar_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_entity')}`; -CREATE TABLE `{$installer->getTable('sales_quote_entity')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_sales_quote_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_entity_store` (`store_id`), - CONSTRAINT `FK_sales_quote_entity_store` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_entity_datetime')}`; -CREATE TABLE `{$installer->getTable('sales_quote_entity_datetime')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_entity_datetime_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_entity_datetime_attribute` (`attribute_id`), - KEY `FK_sales_quote_entity_datetime` (`entity_id`), - CONSTRAINT `FK_sales_quote_entity_datetime` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_datetime_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_datetime_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_entity_decimal')}`; -CREATE TABLE `{$installer->getTable('sales_quote_entity_decimal')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_entity_decimal_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_entity_decimal_attribute` (`attribute_id`), - KEY `FK_sales_quote_entity_decimal` (`entity_id`), - CONSTRAINT `FK_sales_quote_entity_decimal` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_decimal_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_decimal_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_entity_int')}`; -CREATE TABLE `{$installer->getTable('sales_quote_entity_int')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_entity_int_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_entity_int_attribute` (`attribute_id`), - KEY `FK_sales_quote_entity_int` (`entity_id`), - CONSTRAINT `FK_sales_quote_entity_int` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_int_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_int_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_entity_text')}`; -CREATE TABLE `{$installer->getTable('sales_quote_entity_text')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_entity_text_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_entity_text_attribute` (`attribute_id`), - KEY `FK_sales_quote_entity_text` (`entity_id`), - CONSTRAINT `FK_sales_quote_entity_text` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_text_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_text_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_entity_varchar')}`; -CREATE TABLE `{$installer->getTable('sales_quote_entity_varchar')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_entity_varchar_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_entity_varchar_attribute` (`attribute_id`), - KEY `FK_sales_quote_entity_varchar` (`entity_id`), - CONSTRAINT `FK_sales_quote_entity_varchar` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_varchar_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_entity_varchar_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_rule')}`; -CREATE TABLE `{$installer->getTable('sales_quote_rule')}` ( - `quote_rule_id` int(10) unsigned NOT NULL auto_increment, - `name` varchar(255) NOT NULL default '', - `description` text NOT NULL, - `is_active` tinyint(4) NOT NULL default '0', - `start_at` datetime NOT NULL default '0000-00-00 00:00:00', - `expire_at` datetime NOT NULL default '0000-00-00 00:00:00', - `coupon_code` varchar(50) NOT NULL default '', - `customer_registered` tinyint(1) NOT NULL default '2', - `customer_new_buyer` tinyint(1) NOT NULL default '2', - `show_in_catalog` tinyint(1) NOT NULL default '0', - `sort_order` smallint(6) NOT NULL default '0', - `conditions_serialized` text NOT NULL, - `actions_serialized` text NOT NULL, - PRIMARY KEY (`quote_rule_id`), - KEY `rule_name` (`name`), - KEY `is_active` (`is_active`,`start_at`,`expire_at`,`coupon_code`,`customer_registered`,`customer_new_buyer`,`show_in_catalog`,`sort_order`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp')}`; -CREATE TABLE `{$installer->getTable('sales_quote_temp')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_sales_quote_temp_type` (`entity_type_id`), - KEY `FK_sales_quote_temp_store` (`store_id`), - CONSTRAINT `FK_sales_quote_temp_store` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_datetime')}`; -CREATE TABLE `{$installer->getTable('sales_quote_temp_datetime')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_temp_datetime_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_temp_datetime_attribute` (`attribute_id`), - KEY `FK_sales_quote_temp_datetime` (`entity_id`), - CONSTRAINT `FK_sales_quote_temp_datetime` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_temp')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_datetime_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_datetime_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_decimal')}`; -CREATE TABLE `{$installer->getTable('sales_quote_temp_decimal')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_temp_decimal_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_temp_decimal_attribute` (`attribute_id`), - KEY `FK_sales_quote_temp_decimal` (`entity_id`), - CONSTRAINT `FK_sales_quote_temp_decimal` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_temp')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_decimal_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_decimal_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_int')}`; -CREATE TABLE `{$installer->getTable('sales_quote_temp_int')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_temp_int_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_temp_int_attribute` (`attribute_id`), - KEY `FK_sales_quote_temp_int` (`entity_id`), - CONSTRAINT `FK_sales_quote_temp_int` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_temp')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_int_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_int_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_text')}`; -CREATE TABLE `{$installer->getTable('sales_quote_temp_text')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_temp_text_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_temp_text_attribute` (`attribute_id`), - KEY `FK_sales_quote_temp_text` (`entity_id`), - CONSTRAINT `FK_sales_quote_temp_text` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_temp')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_text_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_text_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_varchar')}`; -CREATE TABLE `{$installer->getTable('sales_quote_temp_varchar')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_sales_quote_temp_varchar_entity_type` (`entity_type_id`), - KEY `FK_sales_quote_temp_varchar_attribute` (`attribute_id`), - KEY `FK_sales_quote_temp_varchar` (`entity_id`), - CONSTRAINT `FK_sales_quote_temp_varchar` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_temp')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_varchar_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_quote_temp_varchar_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); -$installer->endSetup(); - -$installer->installEntities(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.9.0.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.9.0.php deleted file mode 100644 index 926d9de608b..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.9.0.php +++ /dev/null @@ -1,502 +0,0 @@ -startSetup(); - -$installer->run(" -DROP TABLE IF EXISTS `{$installer->getTable('sales_flat_quote')}`; -CREATE TABLE `{$installer->getTable('sales_flat_quote')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `converted_at` datetime NOT NULL default '0000-00-00 00:00:00', - - `is_active` tinyint(1) unsigned default '1', - `is_virtual` tinyint(1) unsigned default '0', - `is_multi_shipping` tinyint(1) unsigned default '0', - - `items_count` int(10) unsigned default '0', - `items_qty` decimal(12,4) default '0.0000', - - `orig_order_id` int(10) unsigned default '0', - - `store_to_base_rate` decimal(12,4) default '0.0000', - `store_to_quote_rate` decimal(12,4) default '0.0000', - `base_currency_code` varchar(255) default NULL, - `store_currency_code` varchar(255) default NULL, - `quote_currency_code` varchar(255) default NULL, - - `grand_total` decimal(12,4) default '0.0000', - `base_grand_total` decimal(12,4) default '0.0000', - - `checkout_method` varchar(255) default NULL, - - `customer_id` int(10) unsigned default '0', - `customer_tax_class_id` int(10) unsigned default '0', - `customer_group_id` int(10) unsigned default '0', - `customer_email` varchar(255) default NULL, - `customer_prefix` varchar(40) default NULL, - `customer_firstname` varchar(255) default NULL, - `customer_middlename` varchar(40) default NULL, - `customer_lastname` varchar(255) default NULL, - `customer_suffix` varchar(40) default NULL, - `customer_dob` datetime default NULL, - `customer_note` varchar(255) default NULL, - `customer_note_notify` tinyint(1) unsigned default '1', - `customer_is_guest` tinyint(1) unsigned default '0', - - `remote_ip` varchar(32) default NULL, - `applied_rule_ids` varchar(255) default NULL, - `reserved_order_id` varchar(64) default '', - `password_hash` varchar(255) default NULL, - `coupon_code` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `FK_SALES_QUOTE_STORE` (`store_id`), - KEY `IDX_CUSTOMER` (`customer_id`,`store_id`,`is_active`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_flat_quote_address')}`; -CREATE TABLE `{$installer->getTable('sales_flat_quote_address')}` ( - `address_id` int(10) unsigned NOT NULL auto_increment, - `quote_id` int(10) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - - `customer_id` int(10) unsigned default NULL, - `save_in_address_book` tinyint(1) default '0', - `customer_address_id` int(10) unsigned default NULL, - `address_type` varchar(255) default NULL, - `email` varchar(255) default NULL, - `prefix` varchar(40) default NULL, - `firstname` varchar(255) default NULL, - `middlename` varchar(40) default NULL, - `lastname` varchar(255) default NULL, - `suffix` varchar(40) default NULL, - `company` varchar(255) default NULL, - `street` varchar(255) default NULL, - `city` varchar(255) default NULL, - `region` varchar(255) default NULL, - `region_id` int(10) unsigned default NULL, - `postcode` varchar(255) default NULL, - `country_id` varchar(255) default NULL, - `telephone` varchar(255) default NULL, - `fax` varchar(255) default NULL, - - `same_as_billing` tinyint(1) unsigned NOT NULL default '0', - `free_shipping` tinyint(1) unsigned NOT NULL default '0', - `collect_shipping_rates` tinyint(1) unsigned NOT NULL default '0', - `shipping_method` varchar(255) NOT NULL default '', - `shipping_description` varchar(255) NOT NULL default '', - `weight` decimal(12,4) NOT NULL default '0.0000', - - `subtotal` decimal(12,4) NOT NULL default '0.0000', - `base_subtotal` decimal(12,4) NOT NULL default '0.0000', - `subtotal_with_discount` decimal(12,4) NOT NULL default '0.0000', - `base_subtotal_with_discount` decimal(12,4) NOT NULL default '0.0000', - `tax_amount` decimal(12,4) NOT NULL default '0.0000', - `base_tax_amount` decimal(12,4) NOT NULL default '0.0000', - `shipping_amount` decimal(12,4) NOT NULL default '0.0000', - `base_shipping_amount` decimal(12,4) NOT NULL default '0.0000', - `shipping_tax_amount` decimal(12,4) default NULL, - `base_shipping_tax_amount` decimal(12,4) default NULL, - `discount_amount` decimal(12,4) NOT NULL default '0.0000', - `base_discount_amount` decimal(12,4) NOT NULL default '0.0000', - `grand_total` decimal(12,4) NOT NULL default '0.0000', - `base_grand_total` decimal(12,4) NOT NULL default '0.0000', - - `customer_notes` text, - PRIMARY KEY (`address_id`), - KEY `FK_SALES_QUOTE_ADDRESS_SALES_QUOTE` (`quote_id`), - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_SALES_QUOTE` FOREIGN KEY (`quote_id`) REFERENCES `{$installer->getTable('sales_flat_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_flat_quote_address_item')}`; -CREATE TABLE `{$installer->getTable('sales_flat_quote_address_item')}` ( - `address_item_id` int(10) unsigned NOT NULL auto_increment, - `quote_address_id` int(10) unsigned NOT NULL default '0', - `quote_item_id` int(10) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - - `applied_rule_ids` text, - `additional_data` text, - `weight` decimal(12,4) default '0.0000', - `qty` decimal(12,4) NOT NULL default '0.0000', - `discount_amount` decimal(12,4) default '0.0000', - `tax_amount` decimal(12,4) default '0.0000', - - `row_total` decimal(12,4) NOT NULL default '0.0000', - `base_row_total` decimal(12,4) NOT NULL default '0.0000', - `row_total_with_discount` decimal(12,4) default '0.0000', - `base_discount_amount` decimal(12,4) default '0.0000', - `base_tax_amount` decimal(12,4) default '0.0000', - `row_weight` decimal(12,4) default '0.0000', - PRIMARY KEY (`address_item_id`), - KEY `FK_QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS` (`quote_address_id`), - KEY `FK_SALES_QUOTE_ADDRESS_ITEM_QUOTE_ITEM` (`quote_item_id`), - CONSTRAINT `FK_QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS` FOREIGN KEY (`quote_address_id`) REFERENCES `{$installer->getTable('sales_flat_quote_address')}` (`address_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_ITEM_QUOTE_ITEM` FOREIGN KEY (`quote_item_id`) REFERENCES `{$installer->getTable('sales_flat_quote_item')}` (`item_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_flat_quote_item')}`; -CREATE TABLE `{$installer->getTable('sales_flat_quote_item')}` ( - `item_id` int(10) unsigned NOT NULL auto_increment, - `quote_id` int(10) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - - `product_id` int(10) unsigned default NULL, - `super_product_id` int(10) unsigned default NULL, - `parent_product_id` int(10) unsigned default NULL, - `is_virtual` tinyint(1) unsigned default NULL, - - `sku` varchar(255) NOT NULL default '', - `name` varchar(255) default NULL, - `description` text, - `applied_rule_ids` text, - `additional_data` text, - `free_shipping` tinyint(1) unsigned NOT NULL default '0', - `is_qty_decimal` tinyint(1) unsigned default NULL, - `no_discount` tinyint(1) unsigned default '0', - - `weight` decimal(12,4) default '0.0000', - `qty` decimal(12,4) NOT NULL default '0.0000', - `price` decimal(12,4) NOT NULL default '0.0000', - `base_price` decimal(12,4) NOT NULL default '0.0000', - `custom_price` decimal(12,4) default NULL, - `discount_percent` decimal(12,4) default '0.0000', - `discount_amount` decimal(12,4) default '0.0000', - `base_discount_amount` decimal(12,4) default '0.0000', - `tax_percent` decimal(12,4) default '0.0000', - `tax_amount` decimal(12,4) default '0.0000', - `base_tax_amount` decimal(12,4) default '0.0000', - `row_total` decimal(12,4) NOT NULL default '0.0000', - `base_row_total` decimal(12,4) NOT NULL default '0.0000', - `row_total_with_discount` decimal(12,4) default '0.0000', - `row_weight` decimal(12,4) default '0.0000', - PRIMARY KEY (`item_id`), - KEY `FK_SALES_QUOTE_ITEM_SALES_QUOTE` (`quote_id`), - CONSTRAINT `FK_SALES_QUOTE_ITEM_SALES_QUOTE` FOREIGN KEY (`quote_id`) REFERENCES `{$installer->getTable('sales_flat_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_flat_quote_item_option')}`; -CREATE TABLE `{$installer->getTable('sales_flat_quote_item_option')}` ( - `option_id` int(10) unsigned NOT NULL auto_increment, - `item_id` int(10) unsigned NOT NULL, - `product_id` int(10) unsigned NOT NULL, - `code` varchar(255) NOT NULL, - `value` text NOT NULL, - PRIMARY KEY (`option_id`), - KEY `FK_SALES_QUOTE_ITEM_OPTION_ITEM_ID` (`item_id`), - CONSTRAINT `FK_SALES_QUOTE_ITEM_OPTION_ITEM_ID` FOREIGN KEY (`item_id`) REFERENCES `{$installer->getTable('sales_flat_quote_item')}` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Additional options for quote item'; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_flat_quote_payment')}`; -CREATE TABLE `{$installer->getTable('sales_flat_quote_payment')}` ( - `payment_id` int(10) unsigned NOT NULL auto_increment, - `quote_id` int(10) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `method` varchar(255) default '', - - `cc_type` varchar(255) default '', - `cc_number_enc` varchar(255) default '', - `cc_last4` varchar(255) default '', - `cc_cid_enc` varchar(255) default '', - `cc_owner` varchar(255) default '', - `cc_exp_month` tinyint(2) unsigned default '0', - `cc_exp_year` smallint(4) unsigned default '0', - `cc_ss_owner` varchar(255) default '', - `cc_ss_start_month` tinyint(2) unsigned default '0', - `cc_ss_start_year` smallint(4) unsigned default '0', - - `cybersource_token` varchar(255) default '', - `paypal_correlation_id` varchar(255) default '', - `paypal_payer_id` varchar(255) default '', - `paypal_payer_status` varchar(255) default '', - `po_number` varchar(255) default '', - PRIMARY KEY (`payment_id`), - KEY `FK_SALES_QUOTE_PAYMENT_SALES_QUOTE` (`quote_id`), - CONSTRAINT `FK_SALES_QUOTE_PAYMENT_SALES_QUOTE` FOREIGN KEY (`quote_id`) REFERENCES `{$installer->getTable('sales_flat_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_flat_quote_shipping_rate')}`; -CREATE TABLE `{$installer->getTable('sales_flat_quote_shipping_rate')}` ( - `rate_id` int(10) unsigned NOT NULL auto_increment, - `address_id` int(10) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - - `carrier` varchar(255) default NULL, - `carrier_title` varchar(255) default NULL, - `code` varchar(255) default NULL, - `method` varchar(255) default NULL, - `method_description` text, - `price` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`rate_id`), - KEY `FK_SALES_QUOTE_SHIPPING_RATE_ADDRESS` (`address_id`), - CONSTRAINT `FK_SALES_QUOTE_SHIPPING_RATE_ADDRESS` FOREIGN KEY (`address_id`) REFERENCES `{$installer->getTable('sales_flat_quote_address')}` (`address_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_order')}`; -CREATE TABLE `{$installer->getTable('sales_order')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned default NULL, - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - `customer_id` int(11) default NULL, - `tax_amount` decimal(12,4) NOT NULL default '0.0000', - `shipping_amount` decimal(12,4) NOT NULL default '0.0000', - `discount_amount` decimal(12,4) NOT NULL default '0.0000', - `subtotal` decimal(12,4) NOT NULL default '0.0000', - `grand_total` decimal(12,4) NOT NULL default '0.0000', - `total_paid` decimal(12,4) NOT NULL default '0.0000', - `total_refunded` decimal(12,4) NOT NULL default '0.0000', - `total_qty_ordered` decimal(12,4) NOT NULL default '0.0000', - `total_canceled` decimal(12,4) NOT NULL default '0.0000', - `total_invoiced` decimal(12,4) NOT NULL default '0.0000', - `total_online_refunded` decimal(12,4) NOT NULL default '0.0000', - `total_offline_refunded` decimal(12,4) NOT NULL default '0.0000', - `base_tax_amount` decimal(12,4) NOT NULL default '0.0000', - `base_shipping_amount` decimal(12,4) NOT NULL default '0.0000', - `base_discount_amount` decimal(12,4) NOT NULL default '0.0000', - `base_subtotal` decimal(12,4) NOT NULL default '0.0000', - `base_grand_total` decimal(12,4) NOT NULL default '0.0000', - `base_total_paid` decimal(12,4) NOT NULL default '0.0000', - `base_total_refunded` decimal(12,4) NOT NULL default '0.0000', - `base_total_qty_ordered` decimal(12,4) NOT NULL default '0.0000', - `base_total_canceled` decimal(12,4) NOT NULL default '0.0000', - `base_total_invoiced` decimal(12,4) NOT NULL default '0.0000', - `base_total_online_refunded` decimal(12,4) NOT NULL default '0.0000', - `base_total_offline_refunded` decimal(12,4) NOT NULL default '0.0000', - `subtotal_refunded` decimal(12,4) default NULL, - `subtotal_canceled` decimal(12,4) default NULL, - `tax_refunded` decimal(12,4) default NULL, - `tax_canceled` decimal(12,4) default NULL, - `shipping_refunded` decimal(12,4) default NULL, - `shipping_canceled` decimal(12,4) default NULL, - `base_subtotal_refunded` decimal(12,4) default NULL, - `base_subtotal_canceled` decimal(12,4) default NULL, - `base_tax_refunded` decimal(12,4) default NULL, - `base_tax_canceled` decimal(12,4) default NULL, - `base_shipping_refunded` decimal(12,4) default NULL, - `base_shipping_canceled` decimal(12,4) default NULL, - `subtotal_invoiced` decimal(12,4) default NULL, - `tax_invoiced` decimal(12,4) default NULL, - `shipping_invoiced` decimal(12,4) default NULL, - `base_subtotal_invoiced` decimal(12,4) default NULL, - `base_tax_invoiced` decimal(12,4) default NULL, - `base_shipping_invoiced` decimal(12,4) default NULL, - `shipping_tax_amount` decimal(12,4) default NULL, - `base_shipping_tax_amount` decimal(12,4) default NULL, - PRIMARY KEY (`entity_id`), - KEY `FK_SALES_ORDER_TYPE` (`entity_type_id`), - KEY `FK_SALES_ORDER_STORE` (`store_id`), - KEY `IDX_CUSTOMER` (`customer_id`), - CONSTRAINT `FK_SALE_ORDER_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE, - CONSTRAINT `FK_SALE_ORDER_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_order')}_datetime`; -CREATE TABLE `{$this->getTable('sales_order')}_datetime` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_ORDER_DATETIME_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_ORDER_DATETIME_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_ORDER_DATETIME` (`entity_id`), - CONSTRAINT `FK_SALES_ORDER_DATETIME` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('sales_order')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_DATETIME_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_order')}_decimal`; -CREATE TABLE `{$this->getTable('sales_order')}_decimal` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_ORDER_DECIMAL_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_ORDER_DECIMAL_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_ORDER_DECIMAL` (`entity_id`), - CONSTRAINT `FK_SALES_ORDER_DECIMAL` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('sales_order')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_order')}_int`; -CREATE TABLE `{$this->getTable('sales_order')}_int` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_ORDER_INT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_ORDER_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_ORDER_INT` (`entity_id`), - CONSTRAINT `FK_SALES_ORDER_INT` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('sales_order')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_order')}_text`; -CREATE TABLE `{$this->getTable('sales_order')}_text` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_SALES_ORDER_TEXT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_ORDER_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_ORDER_TEXT` (`entity_id`), - CONSTRAINT `FK_SALES_ORDER_TEXT` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('sales_order')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_order')}_varchar`; -CREATE TABLE `{$this->getTable('sales_order')}_varchar` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_ORDER_VARCHAR_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_ORDER_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_ORDER_VARCHAR` (`entity_id`), - CONSTRAINT `FK_SALES_ORDER_VARCHAR` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('sales_order')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_order_entity')}`; -CREATE TABLE `{$installer->getTable('sales_order_entity')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned default NULL, - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - PRIMARY KEY (`entity_id`), - KEY `FK_SALES_ORDER_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_ORDER_ENTITY_STORE` (`store_id`), - CONSTRAINT `FK_SALES_ORDER_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALE_ORDER_ENTITY_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - -DROP TABLE IF EXISTS `{$this->getTable('sales_order_entity')}_datetime`; -CREATE TABLE `{$this->getTable('sales_order_entity')}_datetime` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_ORDER_ENTITY_DATETIME_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_ORDER_ENTITY_DATETIME_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_ORDER_ENTITY_DATETIME` (`entity_id`), - CONSTRAINT `FK_SALES_ORDER_ENTITY_DATETIME` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_ENTITY_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_ENTITY_DATETIME_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$this->getTable('sales_order_entity')}_decimal`; -CREATE TABLE `{$installer->getTable('sales_order_entity')}_decimal` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_ORDER_ENTITY_DECIMAL_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_ORDER_ENTITY_DECIMAL_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_ORDER_ENTITY_DECIMAL` (`entity_id`), - CONSTRAINT `FK_SALES_ORDER_ENTITY_DECIMAL` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_ENTITY_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_ENTITY_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$this->getTable('sales_order_entity')}_int`; -CREATE TABLE `{$installer->getTable('sales_order_entity')}_int` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_ORDER_ENTITY_INT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_ORDER_ENTITY_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_ORDER_ENTITY_INT` (`entity_id`), - CONSTRAINT `FK_SALES_ORDER_ENTITY_INT` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_ENTITY_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_ENTITY_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$this->getTable('sales_order_entity')}_text`; -CREATE TABLE `{$installer->getTable('sales_order_entity')}_text` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_SALES_ORDER_ENTITY_TEXT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_ORDER_ENTITY_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_ORDER_ENTITY_TEXT` (`entity_id`), - CONSTRAINT `FK_SALES_ORDER_ENTITY_TEXT` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_ENTITY_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_ENTITY_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$this->getTable('sales_order_entity')}_varchar`; -CREATE TABLE `{$installer->getTable('sales_order_entity')}_varchar` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_ORDER_ENTITY_VARCHAR_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_ORDER_ENTITY_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_ORDER_ENTITY_VARCHAR` (`entity_id`), - CONSTRAINT `FK_SALES_ORDER_ENTITY_VARCHAR` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_order_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_ENTITY_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_ENTITY_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); - -$installer->installEntities(); -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-1.4.0.0.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-1.4.0.0.php deleted file mode 100644 index c171032c85b..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-1.4.0.0.php +++ /dev/null @@ -1,1300 +0,0 @@ -startSetup(); - -$installer->run(" -/* Orders */ -CREATE TABLE `{$installer->getTable('sales_flat_order')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `state` varchar(32) default NULL, - `status` varchar(32) default NULL, - `coupon_code` varchar(255) default NULL, - `protect_code` varchar(255) default NULL, - `shipping_description` varchar(255) default NULL, - `is_virtual` tinyint(1) unsigned default NULL, - `store_id` smallint(5) unsigned default NULL, - `customer_id` int(10) unsigned default NULL, - `base_discount_amount` decimal(12,4) default NULL, - `base_discount_canceled` decimal(12,4) default NULL, - `base_discount_invoiced` decimal(12,4) default NULL, - `base_discount_refunded` decimal(12,4) default NULL, - `base_grand_total` decimal(12,4) default NULL, - `base_shipping_amount` decimal(12,4) default NULL, - `base_shipping_canceled` decimal(12,4) default NULL, - `base_shipping_invoiced` decimal(12,4) default NULL, - `base_shipping_refunded` decimal(12,4) default NULL, - `base_shipping_tax_amount` decimal(12,4) default NULL, - `base_shipping_tax_refunded` decimal(12,4) default NULL, - `base_subtotal` decimal(12,4) default NULL, - `base_subtotal_canceled` decimal(12,4) default NULL, - `base_subtotal_invoiced` decimal(12,4) default NULL, - `base_subtotal_refunded` decimal(12,4) default NULL, - `base_tax_amount` decimal(12,4) default NULL, - `base_tax_canceled` decimal(12,4) default NULL, - `base_tax_invoiced` decimal(12,4) default NULL, - `base_tax_refunded` decimal(12,4) default NULL, - `base_to_global_rate` decimal(12,4) default NULL, - `base_to_order_rate` decimal(12,4) default NULL, - `base_total_canceled` decimal(12,4) default NULL, - `base_total_invoiced` decimal(12,4) default NULL, - `base_total_invoiced_cost` decimal(12,4) default NULL, - `base_total_offline_refunded` decimal(12,4) default NULL, - `base_total_online_refunded` decimal(12,4) default NULL, - `base_total_paid` decimal(12,4) default NULL, - `base_total_qty_ordered` decimal(12,4) default NULL, - `base_total_refunded` decimal(12,4) default NULL, - `discount_amount` decimal(12,4) default NULL, - `discount_canceled` decimal(12,4) default NULL, - `discount_invoiced` decimal(12,4) default NULL, - `discount_refunded` decimal(12,4) default NULL, - `grand_total` decimal(12,4) default NULL, - `shipping_amount` decimal(12,4) default NULL, - `shipping_canceled` decimal(12,4) default NULL, - `shipping_invoiced` decimal(12,4) default NULL, - `shipping_refunded` decimal(12,4) default NULL, - `shipping_tax_amount` decimal(12,4) default NULL, - `shipping_tax_refunded` decimal(12,4) default NULL, - `store_to_base_rate` decimal(12,4) default NULL, - `store_to_order_rate` decimal(12,4) default NULL, - `subtotal` decimal(12,4) default NULL, - `subtotal_canceled` decimal(12,4) default NULL, - `subtotal_invoiced` decimal(12,4) default NULL, - `subtotal_refunded` decimal(12,4) default NULL, - `tax_amount` decimal(12,4) default NULL, - `tax_canceled` decimal(12,4) default NULL, - `tax_invoiced` decimal(12,4) default NULL, - `tax_refunded` decimal(12,4) default NULL, - `total_canceled` decimal(12,4) default NULL, - `total_invoiced` decimal(12,4) default NULL, - `total_offline_refunded` decimal(12,4) default NULL, - `total_online_refunded` decimal(12,4) default NULL, - `total_paid` decimal(12,4) default NULL, - `total_qty_ordered` decimal(12,4) default NULL, - `total_refunded` decimal(12,4) default NULL, - `can_ship_partially` tinyint(1) unsigned default NULL, - `can_ship_partially_item` tinyint(1) unsigned default NULL, - `customer_is_guest` tinyint(1) unsigned default NULL, - `customer_note_notify` tinyint(1) unsigned default NULL, - `billing_address_id` int(10) default NULL, - `customer_group_id` smallint(5) default NULL, - `edit_increment` int(10) default NULL, - `email_sent` tinyint(1) unsigned default NULL, - `forced_do_shipment_with_invoice` tinyint(1) unsigned default NULL, - `gift_message_id` int(10) default NULL, - `payment_authorization_expiration` int(10) default NULL, - `paypal_ipn_customer_notified` int(10) default NULL, - `quote_address_id` int(10) default NULL, - `quote_id` int(10) default NULL, - `shipping_address_id` int(10) default NULL, - `adjustment_negative` decimal(12,4) default NULL, - `adjustment_positive` decimal(12,4) default NULL, - `base_adjustment_negative` decimal(12,4) default NULL, - `base_adjustment_positive` decimal(12,4) default NULL, - `base_shipping_discount_amount` decimal(12,4) default NULL, - `base_subtotal_incl_tax` decimal(12,4) default NULL, - `base_total_due` decimal(12,4) default NULL, - `payment_authorization_amount` decimal(12,4) default NULL, - `shipping_discount_amount` decimal(12,4) default NULL, - `subtotal_incl_tax` decimal(12,4) default NULL, - `total_due` decimal(12,4) default NULL, - `weight` decimal(12,4) default NULL, - `customer_dob` datetime default NULL, - `increment_id` varchar(50) default NULL, - `applied_rule_ids` varchar(255) default NULL, - `base_currency_code` char(3) default NULL, - `customer_email` varchar(255) default NULL, - `customer_firstname` varchar(255) default NULL, - `customer_lastname` varchar(255) default NULL, - `customer_middlename` varchar(255) default NULL, - `customer_prefix` varchar(255) default NULL, - `customer_suffix` varchar(255) default NULL, - `customer_taxvat` varchar(255) default NULL, - `discount_description` varchar(255) default NULL, - `ext_customer_id` varchar(255) default NULL, - `ext_order_id` varchar(255) default NULL, - `global_currency_code` char(3) default NULL, - `hold_before_state` varchar(255) default NULL, - `hold_before_status` varchar(255) default NULL, - `order_currency_code` varchar(255) default NULL, - `original_increment_id` varchar(50) default NULL, - `relation_child_id` varchar(32) default NULL, - `relation_child_real_id` varchar(32) default NULL, - `relation_parent_id` varchar(32) default NULL, - `relation_parent_real_id` varchar(32) default NULL, - `remote_ip` varchar(255) default NULL, - `shipping_method` varchar(255) default NULL, - `store_currency_code` char(3) default NULL, - `store_name` varchar(255) default NULL, - `x_forwarded_for` varchar(255) default NULL, - `customer_note` text, - `created_at` datetime default NULL, - `updated_at` datetime default NULL, - `total_item_count` smallint(5) unsigned DEFAULT '0', - `customer_gender` int(11) DEFAULT NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STATUS` (`status`), - KEY `IDX_STATE` (`state`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_CUSTOMER_ID` (`customer_id`), - KEY `IDX_EXT_ORDER_ID` (`ext_order_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Orders Grid */ -CREATE TABLE `{$installer->getTable('sales_flat_order_grid')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `status` varchar(32) default NULL, - `store_id` smallint(5) unsigned default NULL, - `customer_id` int(10) unsigned default NULL, - `base_grand_total` decimal(12,4) default NULL, - `base_total_paid` decimal(12,4) default NULL, - `grand_total` decimal(12,4) default NULL, - `total_paid` decimal(12,4) default NULL, - `increment_id` varchar(50) default NULL, - `base_currency_code` char(3) default NULL, - `order_currency_code` varchar(255) default NULL, - `shipping_name` varchar(255) default NULL, - `billing_name` varchar(255) default NULL, - `created_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STATUS` (`status`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_BASE_GRAND_TOTAL` (`base_grand_total`), - KEY `IDX_BASE_TOTAL_PAID` (`base_total_paid`), - KEY `IDX_GRAND_TOTAL` (`grand_total`), - KEY `IDX_TOTAL_PAID` (`total_paid`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_SHIPPING_NAME` (`shipping_name`), - KEY `IDX_BILLING_NAME` (`billing_name`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_CUSTOMER_ID` (`customer_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Order Address */ -CREATE TABLE `{$installer->getTable('sales_flat_order_address')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned default NULL, - `customer_address_id` int(10) default NULL, - `quote_address_id` int(10) default NULL, - `region_id` int(10) default NULL, - `customer_id` int(10) default NULL, - `fax` varchar(255) default NULL, - `region` varchar(255) default NULL, - `postcode` varchar(255) default NULL, - `lastname` varchar(255) default NULL, - `street` varchar(255) default NULL, - `city` varchar(255) default NULL, - `email` varchar(255) default NULL, - `telephone` varchar(255) default NULL, - `country_id` char(2) default NULL, - `firstname` varchar(255) default NULL, - `address_type` varchar(255) default NULL, - `prefix` varchar(255) default NULL, - `middlename` varchar(255) default NULL, - `suffix` varchar(255) default NULL, - `company` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Order Comments */ -CREATE TABLE `{$installer->getTable('sales_flat_order_status_history')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `is_customer_notified` int(10) default NULL, - `comment` text, - `status` varchar(32) default NULL, - `created_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_PARENT_ID` (`parent_id`), - KEY `IDX_CREATED_AT` (`created_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Order Items */ - -CREATE TABLE `{$installer->getTable('sales_flat_order_item')}` ( - `item_id` int(10) unsigned NOT NULL auto_increment, - `order_id` int(10) unsigned NOT NULL default '0', - `parent_item_id` int(10) unsigned default NULL, - `quote_item_id` int(10) unsigned default NULL, - `store_id` smallint(5) unsigned default NULL, - `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `product_id` int(10) unsigned default NULL, - `product_type` varchar(255) default NULL, - `product_options` text, - `weight` decimal(12,4) default '0.0000', - `is_virtual` tinyint(1) unsigned default NULL, - `sku` varchar(255) NOT NULL default '', - `name` varchar(255) default NULL, - `description` text, - `applied_rule_ids` text, - `additional_data` text, - `free_shipping` tinyint(1) unsigned NOT NULL default '0', - `is_qty_decimal` tinyint(1) unsigned default NULL, - `no_discount` tinyint(1) unsigned default '0', - `qty_backordered` decimal(12,4) default '0.0000', - `qty_canceled` decimal(12,4) default '0.0000', - `qty_invoiced` decimal(12,4) default '0.0000', - `qty_ordered` decimal(12,4) default '0.0000', - `qty_refunded` decimal(12,4) default '0.0000', - `qty_shipped` decimal(12,4) default '0.0000', - `base_cost` decimal(12,4) default '0.0000', - `price` decimal(12,4) NOT NULL default '0.0000', - `base_price` decimal(12,4) NOT NULL default '0.0000', - `original_price` decimal(12,4) default NULL, - `base_original_price` decimal(12,4) default NULL, - `tax_percent` decimal(12,4) default '0.0000', - `tax_amount` decimal(12,4) default '0.0000', - `base_tax_amount` decimal(12,4) default '0.0000', - `tax_invoiced` decimal(12,4) default '0.0000', - `base_tax_invoiced` decimal(12,4) default '0.0000', - `discount_percent` decimal(12,4) default '0.0000', - `discount_amount` decimal(12,4) default '0.0000', - `base_discount_amount` decimal(12,4) default '0.0000', - `discount_invoiced` decimal(12,4) default '0.0000', - `base_discount_invoiced` decimal(12,4) default '0.0000', - `amount_refunded` decimal(12,4) default '0.0000', - `base_amount_refunded` decimal(12,4) default '0.0000', - `row_total` decimal(12,4) NOT NULL default '0.0000', - `base_row_total` decimal(12,4) NOT NULL default '0.0000', - `row_invoiced` decimal(12,4) NOT NULL default '0.0000', - `base_row_invoiced` decimal(12,4) NOT NULL default '0.0000', - `row_weight` decimal(12,4) default '0.0000', - `gift_message_id` int(10) default NULL, - `gift_message_available` int(10) default NULL, - `base_tax_before_discount` decimal(12,4) default NULL, - `tax_before_discount` decimal(12,4) default NULL, - `ext_order_item_id` varchar(255) default NULL, - `weee_tax_applied` text, - `weee_tax_applied_amount` decimal(12,4) default NULL, - `weee_tax_applied_row_amount` decimal(12,4) default NULL, - `base_weee_tax_applied_amount` decimal(12,4) default NULL, - `base_weee_tax_applied_row_amount` decimal(12,4) default NULL, - `weee_tax_disposition` decimal(12,4) default NULL, - `weee_tax_row_disposition` decimal(12,4) default NULL, - `base_weee_tax_disposition` decimal(12,4) default NULL, - `base_weee_tax_row_disposition` decimal(12,4) default NULL, - `locked_do_invoice` tinyint(1) unsigned default NULL, - `locked_do_ship` tinyint(1) unsigned default NULL, - `price_incl_tax` decimal(12,4) default NULL, - `base_price_incl_tax` decimal(12,4) default NULL, - `row_total_incl_tax` decimal(12,4) default NULL, - `base_row_total_incl_tax` decimal(12,4) default NULL, - PRIMARY KEY (`item_id`), - KEY `IDX_ORDER` (`order_id`), - KEY `IDX_STORE_ID` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Order Payment */ - -CREATE TABLE `{$installer->getTable('sales_flat_order_payment')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `base_shipping_captured` decimal(12,4) default NULL, - `shipping_captured` decimal(12,4) default NULL, - `amount_refunded` decimal(12,4) default NULL, - `base_amount_paid` decimal(12,4) default NULL, - `amount_canceled` decimal(12,4) default NULL, - `base_amount_authorized` decimal(12,4) default NULL, - `base_amount_paid_online` decimal(12,4) default NULL, - `base_amount_refunded_online` decimal(12,4) default NULL, - `base_shipping_amount` decimal(12,4) default NULL, - `shipping_amount` decimal(12,4) default NULL, - `amount_paid` decimal(12,4) default NULL, - `amount_authorized` decimal(12,4) default NULL, - `base_amount_ordered` decimal(12,4) default NULL, - `base_shipping_refunded` decimal(12,4) default NULL, - `shipping_refunded` decimal(12,4) default NULL, - `base_amount_refunded` decimal(12,4) default NULL, - `amount_ordered` decimal(12,4) default NULL, - `base_amount_canceled` decimal(12,4) default NULL, - `ideal_transaction_checked` tinyint(1) unsigned default NULL, - `quote_payment_id` int(10) default NULL, - `additional_data` text, - `cc_exp_month` varchar(255) default NULL, - `cc_ss_start_year` varchar(255) default NULL, - `echeck_bank_name` varchar(255) default NULL, - `method` varchar(255) default NULL, - `cc_debug_request_body` varchar(255) default NULL, - `cc_secure_verify` varchar(255) default NULL, - `cybersource_token` varchar(255) default NULL, - `ideal_issuer_title` varchar(255) default NULL, - `protection_eligibility` varchar(255) default NULL, - `cc_approval` varchar(255) default NULL, - `cc_last4` varchar(255) default NULL, - `cc_status_description` varchar(255) default NULL, - `echeck_type` varchar(255) default NULL, - `paybox_question_number` varchar(255) default NULL, - `cc_debug_response_serialized` varchar(255) default NULL, - `cc_ss_start_month` varchar(255) default NULL, - `echeck_account_type` varchar(255) default NULL, - `last_trans_id` varchar(255) default NULL, - `cc_cid_status` varchar(255) default NULL, - `cc_owner` varchar(255) default NULL, - `cc_type` varchar(255) default NULL, - `ideal_issuer_id` varchar(255) default NULL, - `po_number` varchar(255) default NULL, - `cc_exp_year` varchar(255) default NULL, - `cc_status` varchar(255) default NULL, - `echeck_routing_number` varchar(255) default NULL, - `account_status` varchar(255) default NULL, - `anet_trans_method` varchar(255) default NULL, - `cc_debug_response_body` varchar(255) default NULL, - `cc_ss_issue` varchar(255) default NULL, - `echeck_account_name` varchar(255) default NULL, - `cc_avs_status` varchar(255) default NULL, - `cc_number_enc` varchar(255) default NULL, - `cc_trans_id` varchar(255) default NULL, - `flo2cash_account_id` varchar(255) default NULL, - `paybox_request_number` varchar(255) default NULL, - `address_status` varchar(255) default NULL, - `additional_information` text, - PRIMARY KEY (`entity_id`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Shipments */ - -CREATE TABLE `{$installer->getTable('sales_flat_shipment')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned default NULL, - `total_weight` decimal(12,4) default NULL, - `total_qty` decimal(12,4) default NULL, - `email_sent` tinyint(1) unsigned default NULL, - `order_id` int(10) unsigned NOT NULL, - `customer_id` int(10) default NULL, - `shipping_address_id` int(10) default NULL, - `billing_address_id` int(10) default NULL, - `shipment_status` int(10) default NULL, - `increment_id` varchar(50) default NULL, - `created_at` datetime default NULL, - `updated_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_TOTAL_QTY` (`total_qty`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_ORDER_ID` (`order_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Shipments Grid */ - -CREATE TABLE `{$installer->getTable('sales_flat_shipment_grid')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned default NULL, - `total_qty` decimal(12,4) default NULL, - `order_id` int(10) unsigned NOT NULL, - `shipment_status` int(10) default NULL, - `increment_id` varchar(50) default NULL, - `order_increment_id` varchar(50) default NULL, - `created_at` datetime default NULL, - `order_created_at` datetime default NULL, - `shipping_name` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_TOTAL_QTY` (`total_qty`), - KEY `IDX_ORDER_ID` (`order_id`), - KEY `IDX_SHIPMENT_STATUS` (`shipment_status`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_ORDER_INCREMENT_ID` (`order_increment_id`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_ORDER_CREATED_AT` (`order_created_at`), - KEY `IDX_SHIPPING_NAME` (`shipping_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Shipment Items */ - -CREATE TABLE `{$installer->getTable('sales_flat_shipment_item')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `row_total` decimal(12,4) default NULL, - `price` decimal(12,4) default NULL, - `weight` decimal(12,4) default NULL, - `qty` decimal(12,4) default NULL, - `product_id` int(10) default NULL, - `order_item_id` int(10) default NULL, - `additional_data` text, - `description` text, - `name` varchar(255) default NULL, - `sku` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Shipping tracking */ - -CREATE TABLE `{$installer->getTable('sales_flat_shipment_track')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `weight` decimal(12,4) default NULL, - `qty` decimal(12,4) default NULL, - `order_id` int(10) unsigned NOT NULL, - `number` text, - `description` text, - `title` varchar(255) default NULL, - `carrier_code` varchar(32) default NULL, - `created_at` datetime default NULL, - `updated_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_PARENT_ID` (`parent_id`), - KEY `IDX_ORDER_ID` (`order_id`), - KEY `IDX_CREATED_AT` (`created_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Shipment Comment */ -CREATE TABLE `{$installer->getTable('sales_flat_shipment_comment')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `is_customer_notified` int(10) default NULL, - `comment` text, - `created_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Invoice Main Table */ -CREATE TABLE `{$installer->getTable('sales_flat_invoice')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned default NULL, - `base_grand_total` decimal(12,4) default NULL, - `shipping_tax_amount` decimal(12,4) default NULL, - `tax_amount` decimal(12,4) default NULL, - `base_tax_amount` decimal(12,4) default NULL, - `store_to_order_rate` decimal(12,4) default NULL, - `base_shipping_tax_amount` decimal(12,4) default NULL, - `base_discount_amount` decimal(12,4) default NULL, - `base_to_order_rate` decimal(12,4) default NULL, - `grand_total` decimal(12,4) default NULL, - `shipping_amount` decimal(12,4) default NULL, - `subtotal_incl_tax` decimal(12,4) default NULL, - `base_subtotal_incl_tax` decimal(12,4) default NULL, - `store_to_base_rate` decimal(12,4) default NULL, - `base_shipping_amount` decimal(12,4) default NULL, - `total_qty` decimal(12,4) default NULL, - `base_to_global_rate` decimal(12,4) default NULL, - `subtotal` decimal(12,4) default NULL, - `base_subtotal` decimal(12,4) default NULL, - `discount_amount` decimal(12,4) default NULL, - `billing_address_id` int(10) default NULL, - `is_used_for_refund` tinyint(1) unsigned default NULL, - `order_id` int(10) unsigned NOT NULL, - `email_sent` tinyint(1) unsigned default NULL, - `can_void_flag` tinyint(1) unsigned default NULL, - `state` int(10) default NULL, - `shipping_address_id` int(10) default NULL, - `cybersource_token` varchar(255) default NULL, - `store_currency_code` char(3) default NULL, - `transaction_id` varchar(255) default NULL, - `order_currency_code` char(3) default NULL, - `base_currency_code` char(3) default NULL, - `global_currency_code` char(3) default NULL, - `increment_id` varchar(50) default NULL, - `created_at` datetime default NULL, - `updated_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_GRAND_TOTAL` (`grand_total`), - KEY `IDX_ORDER_ID` (`order_id`), - KEY `IDX_STATE` (`state`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_CREATED_AT` (`created_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Invoices Grid */ -CREATE TABLE `{$installer->getTable('sales_flat_invoice_grid')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned default NULL, - `base_grand_total` decimal(12,4) default NULL, - `grand_total` decimal(12,4) default NULL, - `order_id` int(10) unsigned NOT NULL, - `state` int(10) default NULL, - `store_currency_code` char(3) default NULL, - `order_currency_code` char(3) default NULL, - `base_currency_code` char(3) default NULL, - `global_currency_code` char(3) default NULL, - `increment_id` varchar(50) default NULL, - `order_increment_id` varchar(50) default NULL, - `created_at` datetime default NULL, - `order_created_at` datetime default NULL, - `billing_name` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_GRAND_TOTAL` (`grand_total`), - KEY `IDX_ORDER_ID` (`order_id`), - KEY `IDX_STATE` (`state`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_ORDER_INCREMENT_ID` (`order_increment_id`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_ORDER_CREATED_AT` (`order_created_at`), - KEY `IDX_BILLING_NAME` (`billing_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Invoice Items */ - -CREATE TABLE `{$installer->getTable('sales_flat_invoice_item')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `base_price` decimal(12,4) default NULL, - `base_weee_tax_row_disposition` decimal(12,4) default NULL, - `weee_tax_applied_row_amount` decimal(12,4) default NULL, - `base_weee_tax_applied_amount` decimal(12,4) default NULL, - `tax_amount` decimal(12,4) default NULL, - `base_row_total` decimal(12,4) default NULL, - `discount_amount` decimal(12,4) default NULL, - `row_total` decimal(12,4) default NULL, - `weee_tax_row_disposition` decimal(12,4) default NULL, - `base_discount_amount` decimal(12,4) default NULL, - `base_weee_tax_disposition` decimal(12,4) default NULL, - `price_incl_tax` decimal(12,4) default NULL, - `weee_tax_applied_amount` decimal(12,4) default NULL, - `base_tax_amount` decimal(12,4) default NULL, - `base_price_incl_tax` decimal(12,4) default NULL, - `qty` decimal(12,4) default NULL, - `weee_tax_disposition` decimal(12,4) default NULL, - `base_cost` decimal(12,4) default NULL, - `base_weee_tax_applied_row_amount` decimal(12,4) default NULL, - `price` decimal(12,4) default NULL, - `base_row_total_incl_tax` decimal(12,4) default NULL, - `row_total_incl_tax` decimal(12,4) default NULL, - `product_id` int(10) default NULL, - `order_item_id` int(10) default NULL, - `additional_data` text, - `description` text, - `weee_tax_applied` text, - `sku` varchar(255) default NULL, - `name` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Invoice Comments */ -CREATE TABLE `{$installer->getTable('sales_flat_invoice_comment')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `is_customer_notified` tinyint(1) unsigned default NULL, - `comment` text, - `created_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* CreditMemo Main table */ -CREATE TABLE `{$installer->getTable('sales_flat_creditmemo')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned default NULL, - `adjustment_positive` decimal(12,4) default NULL, - `base_shipping_tax_amount` decimal(12,4) default NULL, - `store_to_order_rate` decimal(12,4) default NULL, - `base_discount_amount` decimal(12,4) default NULL, - `base_to_order_rate` decimal(12,4) default NULL, - `grand_total` decimal(12,4) default NULL, - `base_adjustment_negative` decimal(12,4) default NULL, - `base_subtotal_incl_tax` decimal(12,4) default NULL, - `shipping_amount` decimal(12,4) default NULL, - `subtotal_incl_tax` decimal(12,4) default NULL, - `adjustment_negative` decimal(12,4) default NULL, - `base_shipping_amount` decimal(12,4) default NULL, - `store_to_base_rate` decimal(12,4) default NULL, - `base_to_global_rate` decimal(12,4) default NULL, - `base_adjustment` decimal(12,4) default NULL, - `base_subtotal` decimal(12,4) default NULL, - `discount_amount` decimal(12,4) default NULL, - `subtotal` decimal(12,4) default NULL, - `adjustment` decimal(12,4) default NULL, - `base_grand_total` decimal(12,4) default NULL, - `base_adjustment_positive` decimal(12,4) default NULL, - `base_tax_amount` decimal(12,4) default NULL, - `shipping_tax_amount` decimal(12,4) default NULL, - `tax_amount` decimal(12,4) default NULL, - `order_id` int(10) unsigned NOT NULL, - `email_sent` tinyint(1) unsigned default NULL, - `creditmemo_status` int(10) default NULL, - `state` int(10) default NULL, - `shipping_address_id` int(10) default NULL, - `billing_address_id` int(10) default NULL, - `invoice_id` int(10) default NULL, - `cybersource_token` varchar(255) default NULL, - `store_currency_code` char(3) default NULL, - `order_currency_code` char(3) default NULL, - `base_currency_code` char(3) default NULL, - `global_currency_code` char(3) default NULL, - `transaction_id` varchar(255) default NULL, - `increment_id` varchar(50) default NULL, - `created_at` datetime default NULL, - `updated_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_ORDER_ID` (`order_id`), - KEY `IDX_CREDITMEMO_STATUS` (`creditmemo_status`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_STATE` (`state`), - KEY `IDX_CREATED_AT` (`created_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* CreditMemo Grid */ -CREATE TABLE `{$installer->getTable('sales_flat_creditmemo_grid')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned default NULL, - `store_to_order_rate` decimal(12,4) default NULL, - `base_to_order_rate` decimal(12,4) default NULL, - `grand_total` decimal(12,4) default NULL, - `store_to_base_rate` decimal(12,4) default NULL, - `base_to_global_rate` decimal(12,4) default NULL, - `base_grand_total` decimal(12,4) default NULL, - `order_id` int(10) unsigned NOT NULL, - `creditmemo_status` int(10) default NULL, - `state` int(10) default NULL, - `invoice_id` int(10) default NULL, - `store_currency_code` char(3) default NULL, - `order_currency_code` char(3) default NULL, - `base_currency_code` char(3) default NULL, - `global_currency_code` char(3) default NULL, - `increment_id` varchar(50) default NULL, - `order_increment_id` varchar(50) default NULL, - `created_at` datetime default NULL, - `order_created_at` datetime default NULL, - `billing_name` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_GRAND_TOTAL` (`grand_total`), - KEY `IDX_BASE_GRAND_TOTAL` (`base_grand_total`), - KEY `IDX_ORDER_ID` (`order_id`), - KEY `IDX_CREDITMEMO_STATUS` (`creditmemo_status`), - KEY `IDX_STATE` (`state`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_ORDER_INCREMENT_ID` (`order_increment_id`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_ORDER_CREATED_AT` (`order_created_at`), - KEY `IDX_BILLING_NAME` (`billing_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* CreditMemo Item */ - -CREATE TABLE `{$installer->getTable('sales_flat_creditmemo_item')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `weee_tax_applied_row_amount` decimal(12,4) default NULL, - `base_price` decimal(12,4) default NULL, - `base_weee_tax_row_disposition` decimal(12,4) default NULL, - `tax_amount` decimal(12,4) default NULL, - `base_weee_tax_applied_amount` decimal(12,4) default NULL, - `weee_tax_row_disposition` decimal(12,4) default NULL, - `base_row_total` decimal(12,4) default NULL, - `discount_amount` decimal(12,4) default NULL, - `row_total` decimal(12,4) default NULL, - `weee_tax_applied_amount` decimal(12,4) default NULL, - `base_discount_amount` decimal(12,4) default NULL, - `base_weee_tax_disposition` decimal(12,4) default NULL, - `price_incl_tax` decimal(12,4) default NULL, - `base_tax_amount` decimal(12,4) default NULL, - `weee_tax_disposition` decimal(12,4) default NULL, - `base_price_incl_tax` decimal(12,4) default NULL, - `qty` decimal(12,4) default NULL, - `base_cost` decimal(12,4) default NULL, - `base_weee_tax_applied_row_amount` decimal(12,4) default NULL, - `price` decimal(12,4) default NULL, - `base_row_total_incl_tax` decimal(12,4) default NULL, - `row_total_incl_tax` decimal(12,4) default NULL, - `product_id` int(10) default NULL, - `order_item_id` int(10) default NULL, - `additional_data` text, - `description` text, - `weee_tax_applied` text, - `sku` varchar(255) default NULL, - `name` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* CreditMemo Comment */ - -CREATE TABLE `{$installer->getTable('sales_flat_creditmemo_comment')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `is_customer_notified` int(10) default NULL, - `comment` text, - `created_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_flat_quote')}` ( - `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `store_id` smallint(5) unsigned NOT NULL DEFAULT '0', - `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `converted_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned DEFAULT '1', - `is_virtual` tinyint(1) unsigned DEFAULT '0', - `is_multi_shipping` tinyint(1) unsigned DEFAULT '0', - `items_count` int(10) unsigned DEFAULT '0', - `items_qty` decimal(12,4) DEFAULT '0.0000', - `orig_order_id` int(10) unsigned DEFAULT '0', - `store_to_base_rate` decimal(12,4) DEFAULT '0.0000', - `store_to_quote_rate` decimal(12,4) DEFAULT '0.0000', - `base_currency_code` varchar(255) DEFAULT NULL, - `store_currency_code` varchar(255) DEFAULT NULL, - `quote_currency_code` varchar(255) DEFAULT NULL, - `grand_total` decimal(12,4) DEFAULT '0.0000', - `base_grand_total` decimal(12,4) DEFAULT '0.0000', - `checkout_method` varchar(255) DEFAULT NULL, - `customer_id` int(10) unsigned DEFAULT '0', - `customer_tax_class_id` int(10) unsigned DEFAULT '0', - `customer_group_id` int(10) unsigned DEFAULT '0', - `customer_email` varchar(255) DEFAULT NULL, - `customer_prefix` varchar(40) DEFAULT NULL, - `customer_firstname` varchar(255) DEFAULT NULL, - `customer_middlename` varchar(40) DEFAULT NULL, - `customer_lastname` varchar(255) DEFAULT NULL, - `customer_suffix` varchar(40) DEFAULT NULL, - `customer_dob` datetime DEFAULT NULL, - `customer_note` varchar(255) DEFAULT NULL, - `customer_note_notify` tinyint(1) unsigned DEFAULT '1', - `customer_is_guest` tinyint(1) unsigned DEFAULT '0', - `remote_ip` varchar(32) DEFAULT NULL, - `applied_rule_ids` varchar(255) DEFAULT NULL, - `reserved_order_id` varchar(64) DEFAULT '', - `password_hash` varchar(255) DEFAULT NULL, - `coupon_code` varchar(255) DEFAULT NULL, - `global_currency_code` varchar(255) DEFAULT NULL, - `base_to_global_rate` decimal(12,4) DEFAULT NULL, - `base_to_quote_rate` decimal(12,4) DEFAULT NULL, - `customer_taxvat` varchar(255) DEFAULT NULL, - `customer_gender` varchar(255) DEFAULT NULL, - `subtotal` decimal(12,4) DEFAULT NULL, - `base_subtotal` decimal(12,4) DEFAULT NULL, - `subtotal_with_discount` decimal(12,4) DEFAULT NULL, - `base_subtotal_with_discount` decimal(12,4) DEFAULT NULL, - `is_changed` int(10) unsigned DEFAULT NULL, - `trigger_recollect` tinyint(1) NOT NULL DEFAULT '0', - `ext_shipping_info` text, - `gift_message_id` int(10) unsigned DEFAULT NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_CUSTOMER` (`customer_id`,`store_id`,`is_active`), - CONSTRAINT `FK_SALES_QUOTE_STORE` FOREIGN KEY (`store_id`) - REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_flat_quote_address')}` ( - `address_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `quote_id` int(10) unsigned NOT NULL DEFAULT '0', - `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `customer_id` int(10) unsigned DEFAULT NULL, - `save_in_address_book` tinyint(1) DEFAULT '0', - `customer_address_id` int(10) unsigned DEFAULT NULL, - `address_type` varchar(255) DEFAULT NULL, - `email` varchar(255) DEFAULT NULL, - `prefix` varchar(40) DEFAULT NULL, - `firstname` varchar(255) DEFAULT NULL, - `middlename` varchar(40) DEFAULT NULL, - `lastname` varchar(255) DEFAULT NULL, - `suffix` varchar(40) DEFAULT NULL, - `company` varchar(255) DEFAULT NULL, - `street` varchar(255) DEFAULT NULL, - `city` varchar(255) DEFAULT NULL, - `region` varchar(255) DEFAULT NULL, - `region_id` int(10) unsigned DEFAULT NULL, - `postcode` varchar(255) DEFAULT NULL, - `country_id` varchar(255) DEFAULT NULL, - `telephone` varchar(255) DEFAULT NULL, - `fax` varchar(255) DEFAULT NULL, - `same_as_billing` tinyint(1) unsigned NOT NULL DEFAULT '0', - `free_shipping` tinyint(1) unsigned NOT NULL DEFAULT '0', - `collect_shipping_rates` tinyint(1) unsigned NOT NULL DEFAULT '0', - `shipping_method` varchar(255) NOT NULL DEFAULT '', - `shipping_description` varchar(255) NOT NULL DEFAULT '', - `weight` decimal(12,4) NOT NULL DEFAULT '0.0000', - `subtotal` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_subtotal` decimal(12,4) NOT NULL DEFAULT '0.0000', - `subtotal_with_discount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_subtotal_with_discount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `tax_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_tax_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `shipping_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_shipping_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `shipping_tax_amount` decimal(12,4) DEFAULT NULL, - `base_shipping_tax_amount` decimal(12,4) DEFAULT NULL, - `discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `grand_total` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_grand_total` decimal(12,4) NOT NULL DEFAULT '0.0000', - `customer_notes` text, - `applied_taxes` text, - `discount_description` varchar(255) DEFAULT NULL, - `shipping_discount_amount` decimal(12,4) DEFAULT NULL, - `base_shipping_discount_amount` decimal(12,4) DEFAULT NULL, - `subtotal_incl_tax` decimal(12,4) DEFAULT NULL, - `base_subtotal_total_incl_tax` decimal(12,4) DEFAULT NULL, - `gift_message_id` int(10) unsigned DEFAULT NULL, - PRIMARY KEY (`address_id`), - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_SALES_QUOTE` FOREIGN KEY (`quote_id`) - REFERENCES `{$installer->getTable('sales_flat_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_flat_quote_address_item')}` ( - `address_item_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `parent_item_id` int(10) unsigned DEFAULT NULL, - `quote_address_id` int(10) unsigned NOT NULL DEFAULT '0', - `quote_item_id` int(10) unsigned NOT NULL DEFAULT '0', - `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `applied_rule_ids` text, - `additional_data` text, - `weight` decimal(12,4) DEFAULT '0.0000', - `qty` decimal(12,4) NOT NULL DEFAULT '0.0000', - `discount_amount` decimal(12,4) DEFAULT '0.0000', - `tax_amount` decimal(12,4) DEFAULT '0.0000', - `row_total` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_row_total` decimal(12,4) NOT NULL DEFAULT '0.0000', - `row_total_with_discount` decimal(12,4) DEFAULT '0.0000', - `base_discount_amount` decimal(12,4) DEFAULT '0.0000', - `base_tax_amount` decimal(12,4) DEFAULT '0.0000', - `row_weight` decimal(12,4) DEFAULT '0.0000', - `product_id` int(10) unsigned DEFAULT NULL, - `super_product_id` int(10) unsigned DEFAULT NULL, - `parent_product_id` int(10) unsigned DEFAULT NULL, - `sku` varchar(255) DEFAULT NULL, - `image` varchar(255) DEFAULT NULL, - `name` varchar(255) DEFAULT NULL, - `description` text, - `free_shipping` int(10) unsigned DEFAULT NULL, - `is_qty_decimal` int(10) unsigned DEFAULT NULL, - `price` decimal(12,4) DEFAULT NULL, - `discount_percent` decimal(12,4) DEFAULT NULL, - `no_discount` int(10) unsigned DEFAULT NULL, - `tax_percent` decimal(12,4) DEFAULT NULL, - `base_price` decimal(12,4) DEFAULT NULL, - `base_cost` decimal(12,4) DEFAULT NULL, - `price_incl_tax` decimal(12,4) DEFAULT NULL, - `base_price_incl_tax` decimal(12,4) DEFAULT NULL, - `row_total_incl_tax` decimal(12,4) DEFAULT NULL, - `base_row_total_incl_tax` decimal(12,4) DEFAULT NULL, - `gift_message_id` int(10) unsigned DEFAULT NULL, - PRIMARY KEY (`address_item_id`), - CONSTRAINT `FK_QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS` FOREIGN KEY (`quote_address_id`) - REFERENCES `{$installer->getTable('sales_flat_quote_address')}` (`address_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_FLAT_QUOTE_ADDRESS_ITEM_PARENT` FOREIGN KEY (`parent_item_id`) - REFERENCES `{$installer->getTable('sales_flat_quote_address_item')}` (`address_item_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_ITEM_QUOTE_ITEM` FOREIGN KEY (`quote_item_id`) - REFERENCES `{$installer->getTable('sales_flat_quote_item')}` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_flat_quote_item')}` ( - `item_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `quote_id` int(10) unsigned NOT NULL DEFAULT '0', - `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `product_id` int(10) unsigned DEFAULT NULL, - `store_id` smallint(5) unsigned DEFAULT NULL, - `parent_item_id` int(10) unsigned DEFAULT NULL, - `is_virtual` tinyint(1) unsigned DEFAULT NULL, - `sku` varchar(255) NOT NULL DEFAULT '', - `name` varchar(255) DEFAULT NULL, - `description` text, - `applied_rule_ids` text, - `additional_data` text, - `free_shipping` tinyint(1) unsigned NOT NULL DEFAULT '0', - `is_qty_decimal` tinyint(1) unsigned DEFAULT NULL, - `no_discount` tinyint(1) unsigned DEFAULT '0', - `weight` decimal(12,4) DEFAULT '0.0000', - `qty` decimal(12,4) NOT NULL DEFAULT '0.0000', - `price` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_price` decimal(12,4) NOT NULL DEFAULT '0.0000', - `custom_price` decimal(12,4) DEFAULT NULL, - `discount_percent` decimal(12,4) DEFAULT '0.0000', - `discount_amount` decimal(12,4) DEFAULT '0.0000', - `base_discount_amount` decimal(12,4) DEFAULT '0.0000', - `tax_percent` decimal(12,4) DEFAULT '0.0000', - `tax_amount` decimal(12,4) DEFAULT '0.0000', - `base_tax_amount` decimal(12,4) DEFAULT '0.0000', - `row_total` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_row_total` decimal(12,4) NOT NULL DEFAULT '0.0000', - `row_total_with_discount` decimal(12,4) DEFAULT '0.0000', - `row_weight` decimal(12,4) DEFAULT '0.0000', - `product_type` varchar(255) DEFAULT NULL, - `base_tax_before_discount` decimal(12,4) DEFAULT NULL, - `tax_before_discount` decimal(12,4) DEFAULT NULL, - `original_custom_price` decimal(12,4) DEFAULT NULL, - `redirect_url` varchar(255) DEFAULT NULL, - `base_cost` decimal(12,4) DEFAULT NULL, - `price_incl_tax` decimal(12,4) DEFAULT NULL, - `base_price_incl_tax` decimal(12,4) DEFAULT NULL, - `row_total_incl_tax` decimal(12,4) DEFAULT NULL, - `base_row_total_incl_tax` decimal(12,4) DEFAULT NULL, - `gift_message_id` int(10) unsigned DEFAULT NULL, - `weee_tax_applied` text, - `weee_tax_applied_amount` decimal(12,4) DEFAULT NULL, - `weee_tax_applied_row_amount` decimal(12,4) DEFAULT NULL, - `base_weee_tax_applied_amount` decimal(12,4) DEFAULT NULL, - `base_weee_tax_applied_row_amount` decimal(12,4) DEFAULT NULL, - `weee_tax_disposition` decimal(12,4) DEFAULT NULL, - `weee_tax_row_disposition` decimal(12,4) DEFAULT NULL, - `base_weee_tax_disposition` decimal(12,4) DEFAULT NULL, - `base_weee_tax_row_disposition` decimal(12,4) DEFAULT NULL, - PRIMARY KEY (`item_id`), - CONSTRAINT `FK_SALES_FLAT_QUOTE_ITEM_PARENT_ITEM` FOREIGN KEY (`parent_item_id`) - REFERENCES `{$installer->getTable('sales_flat_quote_item')}` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ITEM_CATALOG_PRODUCT_ENTITY` FOREIGN KEY (`product_id`) - REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ITEM_SALES_QUOTE` FOREIGN KEY (`quote_id`) - REFERENCES `{$installer->getTable('sales_flat_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ITEM_STORE` FOREIGN KEY (`store_id`) - REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_flat_quote_item_option')}` ( - `option_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `item_id` int(10) unsigned NOT NULL, - `product_id` int(10) unsigned NOT NULL, - `code` varchar(255) NOT NULL, - `value` text NOT NULL, - PRIMARY KEY (`option_id`), - CONSTRAINT `FK_SALES_QUOTE_ITEM_OPTION_ITEM_ID` FOREIGN KEY (`item_id`) - REFERENCES `{$installer->getTable('sales_flat_quote_item')}` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE - -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Additional options for quote item'; - -CREATE TABLE `{$installer->getTable('sales_flat_quote_payment')}` ( - `payment_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `quote_id` int(10) unsigned NOT NULL DEFAULT '0', - `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `method` varchar(255) DEFAULT '', - `cc_type` varchar(255) DEFAULT '', - `cc_number_enc` varchar(255) DEFAULT '', - `cc_last4` varchar(255) DEFAULT '', - `cc_cid_enc` varchar(255) DEFAULT '', - `cc_owner` varchar(255) DEFAULT '', - `cc_exp_month` tinyint(2) unsigned DEFAULT '0', - `cc_exp_year` smallint(4) unsigned DEFAULT '0', - `cc_ss_owner` varchar(255) DEFAULT '', - `cc_ss_start_month` tinyint(2) unsigned DEFAULT '0', - `cc_ss_start_year` smallint(4) unsigned DEFAULT '0', - `cybersource_token` varchar(255) DEFAULT '', - `paypal_correlation_id` varchar(255) DEFAULT '', - `paypal_payer_id` varchar(255) DEFAULT '', - `paypal_payer_status` varchar(255) DEFAULT '', - `po_number` varchar(255) DEFAULT '', - `additional_data` text, - `cc_ss_issue` varchar(255) DEFAULT NULL, - `additional_information` text, - `ideal_issuer_id` varchar(255) DEFAULT NULL, - `ideal_issuer_list` text, - PRIMARY KEY (`payment_id`), - CONSTRAINT `FK_SALES_QUOTE_PAYMENT_SALES_QUOTE` FOREIGN KEY (`quote_id`) - REFERENCES `{$installer->getTable('sales_flat_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_flat_quote_shipping_rate')}` ( - `rate_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `address_id` int(10) unsigned NOT NULL DEFAULT '0', - `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `carrier` varchar(255) DEFAULT NULL, - `carrier_title` varchar(255) DEFAULT NULL, - `code` varchar(255) DEFAULT NULL, - `method` varchar(255) DEFAULT NULL, - `method_description` text, - `price` decimal(12,4) NOT NULL DEFAULT '0.0000', - `error_message` text, - `method_title` text, - PRIMARY KEY (`rate_id`), - CONSTRAINT `FK_SALES_QUOTE_SHIPPING_RATE_ADDRESS` FOREIGN KEY (`address_id`) - REFERENCES `{$installer->getTable('sales_flat_quote_address')}` (`address_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_invoiced_aggregated')}` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned DEFAULT NULL, - `order_status` varchar(50) NOT NULL DEFAULT '', - `orders_count` int(11) NOT NULL DEFAULT '0', - `orders_invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000', - `invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000', - `invoiced_captured` decimal(12,4) NOT NULL DEFAULT '0.0000', - `invoiced_not_captured` decimal(12,4) NOT NULL DEFAULT '0.0000', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`), - KEY `IDX_STORE_ID` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_invoiced_aggregated_order')}` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned DEFAULT NULL, - `order_status` varchar(50) NOT NULL DEFAULT '', - `orders_count` int(11) NOT NULL DEFAULT '0', - `orders_invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000', - `invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000', - `invoiced_captured` decimal(12,4) NOT NULL DEFAULT '0.0000', - `invoiced_not_captured` decimal(12,4) NOT NULL DEFAULT '0.0000', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`), - KEY `IDX_STORE_ID` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_order_aggregated_created')}` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned DEFAULT NULL, - `order_status` varchar(50) NOT NULL DEFAULT '', - `orders_count` int(11) NOT NULL DEFAULT '0', - `total_qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_profit_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_subtotal_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_tax_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_shipping_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_grand_total_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_invoiced_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_refunded_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_canceled_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_tax_invoiced_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_tax_canceled_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_tax_refunded_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_subtotal_invoiced_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_subtotal_refunded_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_subtotal_canceled_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_discount_invoiced_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_discount_canceled_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_discount_refunded_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_shipping_invoiced_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_shipping_canceled_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_shipping_refunded_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_shipping_discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_shipping_tax_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `base_shipping_tax_refunded_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`), - KEY `IDX_STORE_ID` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_payment_transaction')}` ( - `transaction_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `parent_id` int(10) unsigned DEFAULT NULL, - `order_id` int(10) unsigned NOT NULL DEFAULT '0', - `payment_id` int(10) unsigned NOT NULL DEFAULT '0', - `txn_id` varchar(100) NOT NULL DEFAULT '', - `parent_txn_id` varchar(100) DEFAULT NULL, - `txn_type` varchar(15) NOT NULL DEFAULT '', - `is_closed` tinyint(1) unsigned NOT NULL DEFAULT '1', - `additional_information` blob, - PRIMARY KEY (`transaction_id`), - UNIQUE KEY `UNQ_ORDER_PAYMENT_TXN` (`order_id`, `payment_id`,`txn_id`), - KEY `IDX_ORDER_ID` (`order_id`), - KEY `IDX_PARENT_ID` (`parent_id`), - KEY `IDX_PAYMENT_ID` (`payment_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_refunded_aggregated')}` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned DEFAULT NULL, - `order_status` varchar(50) NOT NULL DEFAULT '', - `orders_count` int(11) NOT NULL DEFAULT '0', - `refunded` decimal(12,4) NOT NULL DEFAULT '0.0000', - `online_refunded` decimal(12,4) NOT NULL DEFAULT '0.0000', - `offline_refunded` decimal(12,4) NOT NULL DEFAULT '0.0000', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`), - KEY `IDX_STORE_ID` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_refunded_aggregated_order')}` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned DEFAULT NULL, - `order_status` varchar(50) NOT NULL DEFAULT '', - `orders_count` int(11) NOT NULL DEFAULT '0', - `refunded` decimal(12,4) NOT NULL DEFAULT '0.0000', - `online_refunded` decimal(12,4) NOT NULL DEFAULT '0.0000', - `offline_refunded` decimal(12,4) NOT NULL DEFAULT '0.0000', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`), - KEY `IDX_STORE_ID` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_shipping_aggregated')}` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned DEFAULT NULL, - `order_status` varchar(50) NOT NULL DEFAULT '', - `shipping_description` varchar(255) NOT NULL DEFAULT '', - `orders_count` int(11) NOT NULL DEFAULT '0', - `total_shipping` decimal(12,4) NOT NULL DEFAULT '0.0000', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`,`shipping_description`), - KEY `IDX_STORE_ID` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_shipping_aggregated_order')}` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned DEFAULT NULL, - `order_status` varchar(50) NOT NULL DEFAULT '', - `shipping_description` varchar(255) NOT NULL DEFAULT '', - `orders_count` int(11) NOT NULL DEFAULT '0', - `total_shipping` decimal(12,4) NOT NULL DEFAULT '0.0000', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`,`shipping_description`), - KEY `IDX_STORE_ID` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$constraints = [ - 'sales_flat_order' => [ - 'customer' => ['customer_id', 'customer_entity', 'entity_id', 'set null'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_order_grid' => [ - 'parent' => ['entity_id', 'sales_flat_order', 'entity_id'], - 'customer' => ['customer_id', 'customer_entity', 'entity_id', 'set null'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_order_item' => [ - 'parent' => ['order_id', 'sales_flat_order', 'entity_id'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_order_address' => [ - 'parent' => ['parent_id', 'sales_flat_order', 'entity_id'], - ], - 'sales_flat_order_payment' => [ - 'parent' => ['parent_id', 'sales_flat_order', 'entity_id'], - ], - 'sales_flat_order_status_history' => [ - 'parent' => ['parent_id', 'sales_flat_order', 'entity_id'], - ], - 'sales_flat_shipment' => [ - 'parent' => ['order_id', 'sales_flat_order', 'entity_id'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_shipment_grid' => [ - 'parent' => ['entity_id', 'sales_flat_shipment', 'entity_id'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_shipment_track' => [ - 'parent' => ['parent_id', 'sales_flat_shipment', 'entity_id'], - ], - 'sales_flat_shipment_item' => [ - 'parent' => ['parent_id', 'sales_flat_shipment', 'entity_id'], - ], - 'sales_flat_shipment_comment' => [ - 'parent' => ['parent_id', 'sales_flat_shipment', 'entity_id'], - ], - 'sales_flat_invoice' => [ - 'parent' => ['order_id', 'sales_flat_order', 'entity_id'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_invoice_grid' => [ - 'parent' => ['entity_id', 'sales_flat_invoice', 'entity_id'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_invoice_item' => [ - 'parent' => ['parent_id', 'sales_flat_invoice', 'entity_id'], - ], - 'sales_flat_invoice_comment' => [ - 'parent' => ['parent_id', 'sales_flat_invoice', 'entity_id'], - ], - 'sales_flat_creditmemo' => [ - 'parent' => ['order_id', 'sales_flat_order', 'entity_id'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_creditmemo_grid' => [ - 'parent' => ['entity_id', 'sales_flat_creditmemo', 'entity_id'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_creditmemo_item' => [ - 'parent' => ['parent_id', 'sales_flat_creditmemo', 'entity_id'], - ], - 'sales_flat_creditmemo_comment' => [ - 'parent' => ['parent_id', 'sales_flat_creditmemo', 'entity_id'], - ], - 'sales_payment_transaction' => [ - 'parent' => ['parent_id', 'sales_payment_transaction', 'transaction_id'], - 'order' => ['order_id', 'sales_flat_order', 'entity_id'], - 'payment' => ['payment_id', 'sales_flat_order_payment', 'entity_id'], - ], - 'sales_invoiced_aggregated' => [ - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_invoiced_aggregated_order' => [ - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_order_aggregated_created' => [ - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_refunded_aggregated' => [ - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_refunded_aggregated_order' => [ - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_shipping_aggregated' => [ - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_shipping_aggregated_order' => [ - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], -]; - -foreach ($constraints as $table => $list) { - foreach ($list as $code => $constraint) { - $constraint[1] = $installer->getTable($constraint[1]); - array_unshift($constraint, $installer->getTable($table)); - array_unshift($constraint, strtoupper($table . '_' . $code)); - - call_user_func_array([$installer->getConnection(), 'addConstraint'], $constraint); - } -} - -// Add eav entity types -$installer->addEntityType('order', [ - 'entity_model' => 'sales/order', - 'table' => 'sales/order', - 'increment_model' => 'eav/entity_increment_numeric', - 'increment_per_store' => true, -]); - -$installer->addEntityType('invoice', [ - 'entity_model' => 'sales/order_invoice', - 'table' => 'sales/invoice', - 'increment_model' => 'eav/entity_increment_numeric', - 'increment_per_store' => true, -]); - -$installer->addEntityType('creditmemo', [ - 'entity_model' => 'sales/order_creditmemo', - 'table' => 'sales/creditmemo', - 'increment_model' => 'eav/entity_increment_numeric', - 'increment_per_store' => true, -]); - -$installer->addEntityType('shipment', [ - 'entity_model' => 'sales/order_shipment', - 'table' => 'sales/shipment', - 'increment_model' => 'eav/entity_increment_numeric', - 'increment_per_store' => true, -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.6.2-0.7.0.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.6.2-0.7.0.php deleted file mode 100644 index 8cc3dca9b12..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.6.2-0.7.0.php +++ /dev/null @@ -1,36 +0,0 @@ -startSetup(); - -$installer->run(" - -UPDATE {$this->getTable('core_email_template')} set template_text='\r\n\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \"Magento\"
\r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n

Hello {{var billing.name}},
\r\n Thank you for your order from Magento Demo Store. Once your package ships we will send an email with a link to track your order. You can check the status of your order by logging into your account. If you have any questions about your order please contact us at dummyemail@openmage.org or call us at (555) 555-0123 Monday - Friday, 8am - 5pm PST.

\r\n

Your order confirmation is below. Thank you again for your business.

\r\n \r\n

Your Order #{{var order.increment_id}} (placed on {{var order.getCreatedAtFormated(\'long\')}})

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Billing \r\n Information:Payment \r\n Method:
{{var order.billing_address.getFormated(\'html\')}}  {{var payment_html}}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Shipping \r\n Information:Shipping \r\n Method:
{{var order.shipping_address.getFormated(\'html\')}} {{var order.shipping_description}}

\r\n\r\n{{var items_html}}
\r\n {{var order.getEmailCustomerNote()}} \r\n

Thank you again,
Magento Demo Store

\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n' WHERE template_code='New order (HTML)'; -UPDATE {$this->getTable('core_email_template')} set template_text='\r\n
\r\n\r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \"Magento\"
\r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n

Dear {{var billing.name}},
\r\n Your order # {{var order.increment_id}} has been {{var order.getStatusLabel()}}.

\r\n

{{var comment}}

\r\n

If you have any questions, please feel free to contact us at \r\n dummyemail@openmage.org or by phone at (555) 555-0123.

\r\n

Thank you again,
Magento Demo Store

\r\n
\r\n
\r\n
\r\n' WHERE template_code='Order update (HTML)'; - - DROP TABLE IF EXISTS {$this->getTable('sales_order_status')}; - - "); - -$installer->installEntities(); - -$installer->removeAttribute('order', 'order_status_id'); -$installer->removeAttribute('order_status_history', 'comments'); -$installer->removeAttribute('order_status_history', 'order_status_id'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 9fe25db6251..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,22 +0,0 @@ -installEntities(); -$installer->removeEntityType('invoice_address'); -$installer->removeEntityType('invoice_payment'); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index f0d0c8709cd..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,30 +0,0 @@ -installEntities(); -$installer->startSetup(); -$installer->run(" - DROP TABLE IF EXISTS {$this->getTable('sales_invoice_entity_varchar')}; - DROP TABLE IF EXISTS {$this->getTable('sales_invoice_entity_int')}; - DROP TABLE IF EXISTS {$this->getTable('sales_invoice_entity_decimal')}; - DROP TABLE IF EXISTS {$this->getTable('sales_invoice_entity_datetime')}; - DROP TABLE IF EXISTS {$this->getTable('sales_invoice_entity_text')}; - DROP TABLE IF EXISTS {$this->getTable('sales_invoice_entity')}; -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index 3a89a348bce..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); - -$installer->run(" -UPDATE {$this->getTable('core_email_template')} set template_text='\r\n\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \"Magento\"
\r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n

Hello {{var billing.name}},
\r\n Thank you for your order from Magento Demo Store. Once your package ships we will send an email with a link to track your order. You can check the status of your order by logging into your account. If you have any questions about your order please contact us at dummyemail@openmage.org or call us at (555) 555-0123 Monday - Friday, 8am - 5pm PST.

\r\n

Your order confirmation is below. Thank you again for your business.

\r\n \r\n

Your Order #{{var order.increment_id}} (placed on {{var order.getCreatedAtFormated(\'long\')}})

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Billing \r\n Information:Payment \r\n Method:
{{var order.billing_address.format(\'html\')}}  {{var payment_html}}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Shipping \r\n Information:Shipping \r\n Method:
{{var order.shipping_address.format(\'html\')}} {{var order.shipping_description}}

\r\n\r\n{{var items_html}}
\r\n {{var order.getEmailCustomerNote()}} \r\n

Thank you again,
Magento Demo Store

\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n' WHERE template_code='New order (HTML)'; -UPDATE {$this->getTable('core_email_template')} set template_text='\r\n
\r\n\r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \"Magento\"
\r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n

Dear {{var billing.name}},
\r\n Your order # {{var order.increment_id}} has been {{var order.getStatusLabel()}}.

\r\n

{{var comment}}

\r\n

If you have any questions, please feel free to contact us at \r\n dummyemail@openmage.org or by phone at (555) 555-0123.

\r\n

Thank you again,
Magento Demo Store

\r\n
\r\n
\r\n
\r\n' WHERE template_code='Order update (HTML)'; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.9-0.7.10.php deleted file mode 100644 index 71e2c377827..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ /dev/null @@ -1,22 +0,0 @@ -installEntities(); -$installer->startSetup(); -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.0-0.8.1.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.0-0.8.1.php deleted file mode 100644 index 04e149de5f8..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.0-0.8.1.php +++ /dev/null @@ -1,19 +0,0 @@ -installEntities(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.1-0.8.2.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.1-0.8.2.php deleted file mode 100644 index 23f669e5242..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.1-0.8.2.php +++ /dev/null @@ -1,46 +0,0 @@ -startSetup(); - -try { - $installer->run(" - ALTER TABLE {$this->getTable('sales_order_entity_varchar')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_order_entity_varchar_store`, DROP FOREIGN KEY `FK_sales_order_entity_varchar_store`; - ALTER TABLE {$this->getTable('sales_order_entity_text')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_order_entity_text_store`, DROP FOREIGN KEY `FK_sales_order_entity_text_store`; - ALTER TABLE {$this->getTable('sales_order_entity_int')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_order_entity_int_store`, DROP FOREIGN KEY `FK_sales_order_entity_int_store`; - ALTER TABLE {$this->getTable('sales_order_entity_decimal')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_order_entity_decimal_store`, DROP FOREIGN KEY `FK_sales_order_entity_decimal_store`; - ALTER TABLE {$this->getTable('sales_order_entity_datetime')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_order_entity_datetime_store`, DROP FOREIGN KEY `FK_sales_order_entity_datetime_store`; - - ALTER TABLE {$this->getTable('sales_quote_entity_varchar')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_quote_entity_varchar_store`, DROP FOREIGN KEY `FK_sales_quote_entity_varchar_store`; - ALTER TABLE {$this->getTable('sales_quote_entity_text')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_quote_entity_text_store`, DROP FOREIGN KEY `FK_sales_quote_entity_text_store`; - ALTER TABLE {$this->getTable('sales_quote_entity_int')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_quote_entity_int_store`, DROP FOREIGN KEY `FK_sales_quote_entity_int_store`; - ALTER TABLE {$this->getTable('sales_quote_entity_decimal')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_quote_entity_decimal_store`, DROP FOREIGN KEY `FK_sales_quote_entity_decimal_store`; - ALTER TABLE {$this->getTable('sales_quote_entity_datetime')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_quote_entity_datetime_store`, DROP FOREIGN KEY `FK_sales_quote_entity_datetime_store`; - - ALTER TABLE {$this->getTable('sales_quote_temp_varchar')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_quote_temp_varchar_store`, DROP FOREIGN KEY `FK_sales_quote_temp_varchar_store`; - ALTER TABLE {$this->getTable('sales_quote_temp_text')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_quote_temp_text_store`, DROP FOREIGN KEY `FK_sales_quote_temp_text_store`; - ALTER TABLE {$this->getTable('sales_quote_temp_int')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_quote_temp_int_store`, DROP FOREIGN KEY `FK_sales_quote_temp_int_store`; - ALTER TABLE {$this->getTable('sales_quote_temp_decimal')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_quote_temp_decimal_store`, DROP FOREIGN KEY `FK_sales_quote_temp_decimal_store`; - ALTER TABLE {$this->getTable('sales_quote_temp_datetime')} DROP COLUMN `store_id`, DROP INDEX `FK_sales_quote_temp_datetime_store`, DROP FOREIGN KEY `FK_sales_quote_temp_datetime_store`; - "); -} catch (Exception $e) { -} - -$installer->installEntities(); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.11-0.8.12.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.11-0.8.12.php deleted file mode 100644 index 8eacf912841..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.11-0.8.12.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->installEntities(); -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.12-0.8.13.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.12-0.8.13.php deleted file mode 100644 index bade3097a51..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.12-0.8.13.php +++ /dev/null @@ -1,18 +0,0 @@ -installEntities(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php deleted file mode 100644 index 0337b1323d2..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php +++ /dev/null @@ -1,238 +0,0 @@ -startSetup(); - -$installer->run(" - -/*Table structure for table `sales_order` */ - -DROP TABLE IF EXISTS {$this->getTable('sales_order')}; -CREATE TABLE {$this->getTable('sales_order')} ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `increment_id` varchar(50) NOT NULL default '', - `parent_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned default NULL, - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `is_active` tinyint(1) unsigned NOT NULL default '1', - `customer_id` int(11), - `tax_amount` decimal(12,4) NOT NULL default '0.0000', - `shipping_amount` decimal(12,4) NOT NULL default '0.0000', - `discount_amount` decimal(12,4) NOT NULL default '0.0000', - `subtotal` decimal(12,4) NOT NULL default '0.0000', - `grand_total` decimal(12,4) NOT NULL default '0.0000', - `total_paid` decimal(12,4) NOT NULL default '0.0000', - `total_refunded` decimal(12,4) NOT NULL default '0.0000', - `total_qty_ordered` decimal(12,4) NOT NULL default '0.0000', - `total_canceled` decimal(12,4) NOT NULL default '0.0000', - `total_invoiced` decimal(12,4) NOT NULL default '0.0000', - `total_online_refunded` decimal(12,4) NOT NULL default '0.0000', - `total_offline_refunded` decimal(12,4) NOT NULL default '0.0000', - `base_tax_amount` decimal(12,4) NOT NULL default '0.0000', - `base_shipping_amount` decimal(12,4) NOT NULL default '0.0000', - `base_discount_amount` decimal(12,4) NOT NULL default '0.0000', - `base_subtotal` decimal(12,4) NOT NULL default '0.0000', - `base_grand_total` decimal(12,4) NOT NULL default '0.0000', - `base_total_paid` decimal(12,4) NOT NULL default '0.0000', - `base_total_refunded` decimal(12,4) NOT NULL default '0.0000', - `base_total_qty_ordered` decimal(12,4) NOT NULL default '0.0000', - `base_total_canceled` decimal(12,4) NOT NULL default '0.0000', - `base_total_invoiced` decimal(12,4) NOT NULL default '0.0000', - `base_total_online_refunded` decimal(12,4) NOT NULL default '0.0000', - `base_total_offline_refunded` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`entity_id`), - KEY `FK_sales_order_type` (`entity_type_id`), - KEY `FK_sales_order_store` (`store_id`), - CONSTRAINT `FK_SALE_ORDER_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE, - CONSTRAINT `FK_SALE_ORDER_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - - -DROP TABLE IF EXISTS {$this->getTable('sales_order')}_datetime; -CREATE TABLE `{$this->getTable('sales_order')}_datetime` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_datetime_entity_type` (`entity_type_id`), - KEY `FK_sales_order_datetime_attribute` (`attribute_id`), - KEY `FK_sales_order_datetime` (`entity_id`), - CONSTRAINT `FK_sales_order_datetime` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('sales_order')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_datetime_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_datetime_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS {$this->getTable('sales_order')}_decimal; -CREATE TABLE `{$this->getTable('sales_order')}_decimal` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_decimal_entity_type` (`entity_type_id`), - KEY `FK_sales_order_decimal_attribute` (`attribute_id`), - KEY `FK_sales_order_decimal` (`entity_id`), - CONSTRAINT `FK_sales_order_decimal` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('sales_order')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_decimal_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_decimal_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS {$this->getTable('sales_order')}_int; -CREATE TABLE `{$this->getTable('sales_order')}_int` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_int_entity_type` (`entity_type_id`), - KEY `FK_sales_order_int_attribute` (`attribute_id`), - KEY `FK_sales_order_int` (`entity_id`), - CONSTRAINT `FK_sales_order_int` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('sales_order')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_int_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_int_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS {$this->getTable('sales_order')}_text; -CREATE TABLE `{$this->getTable('sales_order')}_text` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_text_entity_type` (`entity_type_id`), - KEY `FK_sales_order_text_attribute` (`attribute_id`), - KEY `FK_sales_order_text` (`entity_id`), - CONSTRAINT `FK_sales_order_text` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('sales_order')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_text_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_text_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS {$this->getTable('sales_order')}_varchar; -CREATE TABLE `{$this->getTable('sales_order')}_varchar` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(5) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_sales_order_varchar_entity_type` (`entity_type_id`), - KEY `FK_sales_order_varchar_attribute` (`attribute_id`), - KEY `FK_sales_order_varchar` (`entity_id`), - CONSTRAINT `FK_sales_order_varchar` FOREIGN KEY (`entity_id`) REFERENCES `{$this->getTable('sales_order')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_varchar_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_sales_order_varchar_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `{$this->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); - -$orderEntityTypeId = $this->getEntityTypeId('order'); - -$attributes = [ - 'customer_id' => [], - 'tax_amount' => [], - 'shipping_amount' => [], - 'discount_amount' => [], - 'subtotal' => [], - 'grand_total' => [], - 'total_paid' => [], - 'total_refunded' => [], - 'total_qty_ordered' => [], - 'total_canceled' => [], - 'total_invoiced' => [], - 'total_online_refunded' => [], - 'total_offline_refunded' => [], - 'base_tax_amount' => [], - 'base_shipping_amount' => [], - 'base_discount_amount' => [], - 'base_subtotal' => [], - 'base_grand_total' => [], - 'base_total_paid' => [], - 'base_total_refunded' => [], - 'base_total_qty_ordered' => [], - 'base_total_canceled' => [], - 'base_total_invoiced' => [], - 'base_total_online_refunded' => [], - 'base_total_offline_refunded' => [], -]; - -$select = new Zend_Db_Select($installer->getConnection()); -$select->from(['e' => $this->getTable('sales_order_entity')]); - -$attributeIds = []; -foreach (array_keys($attributes) as $code) { - $attributes[$code] = $installer->getAttribute($orderEntityTypeId, $code); - if ($attributes[$code]['backend_type'] != 'static') { - $select->joinLeft( - ["_table_{$code}" => "{$this->getTable('sales_order_entity')}_{$attributes[$code]['backend_type']}"], - "_table_{$code}.attribute_id = {$attributes[$code]['attribute_id']} AND _table_{$code}.entity_id = e.entity_id", - [$code => 'value'], - ); - $select->join( - ["_eav_atr_{$code}" => $this->getTable('eav/attribute')], - "_eav_atr_{$code}.attribute_id = {$attributes[$code]['attribute_id']}", - [], - ); - $attributeIds[] = $attributes[$code]['attribute_id']; - } -} - -$select->where("e.entity_type_id = {$orderEntityTypeId}"); - -$orders = $installer->getConnection()->fetchAll($select); - -foreach ($orders as $order) { - $old_entity_id = $order['entity_id']; - unset($order['entity_id']); - unset($order['parent_id']); - foreach ($order as $key => $field) { - if ($field == '') { - unset($order[$key]); - } - } - $installer->getConnection()->insert($this->getTable('sales_order'), $order); - $new_entity_id = $installer->getConnection()->lastInsertId(); - - $installer->run("UPDATE {$this->getTable('sales_order_entity')} SET parent_id={$new_entity_id} WHERE parent_id={$old_entity_id}"); - - $tables = ['varchar', 'int', 'datetime', 'text', 'decimal']; - foreach ($tables as $table) { - $delete = []; - $attrs = $installer->getConnection()->fetchAll("SELECT tt.* FROM {$this->getTable('sales_order_entity')}_{$table} tt JOIN eav_attribute on eav_attribute.attribute_id = tt.attribute_id WHERE entity_id={$old_entity_id}"); - foreach ($attrs as $attr) { - if (!in_array($attr['attribute_id'], $attributeIds)) { - unset($attr['value_id']); - $attr['entity_id'] = $new_entity_id; - $installer->getConnection()->insert("{$this->getTable('sales_order')}_{$table}", $attr); - } - } - } -} - -$installer->run("DELETE FROM {$this->getTable('sales_order_entity')} WHERE parent_id=0"); - -$installer->installEntities(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.14-0.8.15.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.14-0.8.15.php deleted file mode 100644 index a985366f808..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.14-0.8.15.php +++ /dev/null @@ -1,384 +0,0 @@ -startSetup(); - -$this->run(" -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote')}`; -CREATE TABLE `{$installer->getTable('sales_quote')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `parent_id` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `converted_at` datetime NOT NULL default '0000-00-00 00:00:00', - - `is_active` tinyint(1) unsigned NOT NULL default '1', - `is_virtual` tinyint(1) unsigned NOT NULL default '0', - `is_multi_shipping` tinyint(1) unsigned NOT NULL default '0', - `is_multi_payment` tinyint(1) unsigned NOT NULL default '0', - `customer_note_notify` tinyint(1) unsigned NOT NULL default '1', - `customer_is_guest` tinyint(1) unsigned NOT NULL default '0', - - `quote_status_id` int(10) unsigned NOT NULL, - `billing_address_id` int(10) unsigned NOT NULL, - `orig_order_id` int(10) unsigned NOT NULL, - `customer_id` int(10) unsigned NOT NULL, - `customer_tax_class_id` int(10) unsigned NOT NULL, - `customer_group_id` int(10) unsigned NOT NULL, - `items_count` int(10) unsigned NOT NULL, - - `items_qty` decimal(12,4) NOT NULL default '0.0000', - `store_to_base_rate` decimal(12,4) NOT NULL default '0.0000', - `store_to_quote_rate` decimal(12,4) NOT NULL default '0.0000', - `grand_total` decimal(12,4) NOT NULL default '0.0000', - `base_grand_total` decimal(12,4) NOT NULL default '0.0000', - `custbalance_amount` decimal(12,4) NOT NULL default '0.0000', - - `checkout_method` varchar(255) NOT NULL default '', - `password_hash` varchar(255) NOT NULL default '', - `coupon_code` varchar(255) NOT NULL default '', - `base_currency_code` varchar(255) NOT NULL default '', - `store_currency_code` varchar(255) NOT NULL default '', - `quote_currency_code` varchar(255) NOT NULL default '', - `customer_email` varchar(255) NOT NULL default '', - `customer_firstname` varchar(255) NOT NULL default '', - `customer_lastname` varchar(255) NOT NULL default '', - `customer_note` varchar(255) NOT NULL default '', - `remote_ip` varchar(255) NOT NULL default '', - `applied_rule_ids` varchar(255) NOT NULL default '', - - - - PRIMARY KEY (`entity_id`), - KEY `FK_SALES_QUOTE_STORE` (`store_id`), - CONSTRAINT `FK_SALES_QUOTE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_decimal')}`; -CREATE TABLE `{$installer->getTable('sales_quote_decimal')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_QUOTE_DECIMAL_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_QUOTE_DECIMAL_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_QUOTE_DECIMAL` (`entity_id`), - CONSTRAINT `FK_SALES_QUOTE_DECIMAL` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_int')}`; -CREATE TABLE `{$installer->getTable('sales_quote_int')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_QUOTE_INT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_QUOTE_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_QUOTE_INT` (`entity_id`), - CONSTRAINT `FK_SALES_QUOTE_INT` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_text')}`; -CREATE TABLE `{$installer->getTable('sales_quote_text')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_SALES_QUOTE_TEXT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_QUOTE_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_QUOTE_TEXT` (`entity_id`), - CONSTRAINT `FK_SALES_QUOTE_TEXT` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_varchar')}`; -CREATE TABLE `{$installer->getTable('sales_quote_varchar')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_QUOTE_VARCHAR_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_QUOTE_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_QUOTE_VARCHAR` (`entity_id`), - CONSTRAINT `FK_SALES_QUOTE_VARCHAR` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_item')}`; -CREATE TABLE `{$installer->getTable('sales_quote_item')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `parent_id` int(10) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - - `product_id` int(10) unsigned, - `super_product_id` int(10) unsigned, - `parent_product_id` int(10) unsigned, - - `sku` varchar(255) NOT NULL default '', - `name` varchar(255), - - `description` text, - `applied_rule_ids` text, - `additional_data` text, - - `free_shipping` tinyint(1) unsigned NOT NULL default '0', - `is_qty_decimal` tinyint(1) unsigned, - `no_discount` tinyint(1) unsigned default '0', - - `weight` decimal(12,4) NOT NULL default '0.0000', - `qty` decimal(12,4) NOT NULL default '0.0000', - `price` decimal(12,4) NOT NULL default '0.0000', - `discount_percent` decimal(12,4) NOT NULL default '0.0000', - `discount_amount` decimal(12,4) NOT NULL default '0.0000', - `tax_percent` decimal(12,4) NOT NULL default '0.0000', - `tax_amount` decimal(12,4) NOT NULL default '0.0000', - `row_total` decimal(12,4) NOT NULL default '0.0000', - `row_total_with_discount` decimal(12,4) NOT NULL default '0.0000', - `base_price` decimal(12,4) NOT NULL default '0.0000', - `base_discount_amount` decimal(12,4) NOT NULL default '0.0000', - `base_tax_amount` decimal(12,4) NOT NULL default '0.0000', - `base_row_total` decimal(12,4) NOT NULL default '0.0000', - `row_weight` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`entity_id`), - CONSTRAINT `FK_SALES_QUOTE_ITEM_QUOTE` FOREIGN KEY (`parent_id`) REFERENCES `{$installer->getTable('sales_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_item_decimal')}`; -CREATE TABLE `{$installer->getTable('sales_quote_item_decimal')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_QUOTE_ITEM_DECIMAL_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_QUOTE_ITEM_DECIMAL_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_QUOTE_ITEM_DECIMAL` (`entity_id`), - CONSTRAINT `FK_SALES_QUOTE_ITEM_DECIMAL` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_item')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ITEM_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ITEM_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_item_int')}`; -CREATE TABLE `{$installer->getTable('sales_quote_item_int')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_QUOTE_ITEM_INT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_QUOTE_ITEM_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_QUOTE_ITEM_INT` (`entity_id`), - CONSTRAINT `FK_SALES_QUOTE_ITEM_INT` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_item')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ITEM_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ITEM_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_item_text')}`; -CREATE TABLE `{$installer->getTable('sales_quote_item_text')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_SALES_QUOTE_ITEM_TEXT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_QUOTE_ITEM_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_QUOTE_ITEM_TEXT` (`entity_id`), - CONSTRAINT `FK_SALES_QUOTE_ITEM_TEXT` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_item')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ITEM_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ITEM_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_item_varchar')}`; -CREATE TABLE `{$installer->getTable('sales_quote_item_varchar')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_QUOTE_ITEM_VARCHAR_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_QUOTE_ITEM_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_QUOTE_ITEM_VARCHAR` (`entity_id`), - CONSTRAINT `FK_SALES_QUOTE_ITEM_VARCHAR` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_item')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ITEM_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ITEM_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - - - - - - - - - - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_address')}`; -CREATE TABLE `{$installer->getTable('sales_quote_address')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_set_id` smallint(5) unsigned NOT NULL default '0', - `parent_id` int(10) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - - `customer_id` int(10) unsigned, - `customer_address_id` int(10) unsigned, - - `address_type` varchar(255), - `email` varchar(255), - `firstname` varchar(255), - `lastname` varchar(255), - `company` varchar(255), - `street` varchar(255), - `city` varchar(255), - `region` varchar(255), - `region_id` int(10) unsigned, - `postcode` varchar(255), - `country_id` varchar(255), - `telephone` varchar(255), - `fax` varchar(255), - - `same_as_billing` tinyint(1) unsigned NOT NULL default '0', - `free_shipping` tinyint(1) unsigned NOT NULL default '0', - `collect_shipping_rates` tinyint(1) unsigned NOT NULL default '0', - - `shipping_method` varchar(255) NOT NULL default '', - `shipping_description` varchar(255) NOT NULL default '', - - `weight` decimal(12,4) NOT NULL default '0.0000', - `subtotal` decimal(12,4) NOT NULL default '0.0000', - `subtotal_with_discount` decimal(12,4) NOT NULL default '0.0000', - `tax_amount` decimal(12,4) NOT NULL default '0.0000', - `shipping_amount` decimal(12,4) NOT NULL default '0.0000', - `discount_amount` decimal(12,4) NOT NULL default '0.0000', - `custbalance_amount` decimal(12,4) NOT NULL default '0.0000', - `grand_total` decimal(12,4) NOT NULL default '0.0000', - `base_subtotal` decimal(12,4) NOT NULL default '0.0000', - `base_subtotal_with_discount` decimal(12,4) NOT NULL default '0.0000', - `base_tax_amount` decimal(12,4) NOT NULL default '0.0000', - `base_shipping_amount` decimal(12,4) NOT NULL default '0.0000', - `base_discount_amount` decimal(12,4) NOT NULL default '0.0000', - `base_custbalance_amount` decimal(12,4) NOT NULL default '0.0000', - `base_grand_total` decimal(12,4) NOT NULL default '0.0000', - - `customer_notes` text, - - PRIMARY KEY (`entity_id`), - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_QUOTE` FOREIGN KEY (`parent_id`) REFERENCES `{$installer->getTable('sales_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_address_decimal')}`; -CREATE TABLE `{$installer->getTable('sales_quote_address_decimal')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_QUOTE_ADDRESS_DECIMAL_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_QUOTE_ADDRESS_DECIMAL_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_QUOTE_ADDRESS_DECIMAL` (`entity_id`), - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_DECIMAL` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_address')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_address_int')}`; -CREATE TABLE `{$installer->getTable('sales_quote_address_int')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` int(11) NOT NULL default '0', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_QUOTE_ADDRESS_INT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_QUOTE_ADDRESS_INT_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_QUOTE_ADDRESS_INT` (`entity_id`), - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_INT` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_address')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_address_text')}`; -CREATE TABLE `{$installer->getTable('sales_quote_address_text')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` text NOT NULL, - PRIMARY KEY (`value_id`), - KEY `FK_SALES_QUOTE_ADDRESS_TEXT_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_QUOTE_ADDRESS_TEXT_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_QUOTE_ADDRESS_TEXT` (`entity_id`), - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_TEXT` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_address')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_address_varchar')}`; -CREATE TABLE `{$installer->getTable('sales_quote_address_varchar')}` ( - `value_id` int(11) NOT NULL auto_increment, - `entity_type_id` smallint(8) unsigned NOT NULL default '0', - `attribute_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `value` varchar(255) NOT NULL default '', - PRIMARY KEY (`value_id`), - KEY `FK_SALES_QUOTE_ADDRESS_VARCHAR_ENTITY_TYPE` (`entity_type_id`), - KEY `FK_SALES_QUOTE_ADDRESS_VARCHAR_ATTRIBUTE` (`attribute_id`), - KEY `FK_SALES_QUOTE_ADDRESS_VARCHAR` (`entity_id`), - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_VARCHAR` FOREIGN KEY (`entity_id`) REFERENCES `{$installer->getTable('sales_quote_address')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `{$installer->getTable('eav_entity_type')}` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp')}`; -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_datetime')}`; -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_decimal')}`; -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_int')}`; -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_text')}`; -DROP TABLE IF EXISTS `{$installer->getTable('sales_quote_temp_varchar')}`; -"); - -$this->endSetup(); -$this->installEntities(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.15-0.8.16.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.15-0.8.16.php deleted file mode 100644 index d0eef1b5940..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.15-0.8.16.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($this->getTable('sales_quote_item'), 'custom_price', 'decimal(12,4) NULL AFTER `price`'); - -$this->endSetup(); -$this->installEntities(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.16-0.8.17.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.16-0.8.17.php deleted file mode 100644 index ebd4298941e..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.16-0.8.17.php +++ /dev/null @@ -1,35 +0,0 @@ -startSetup(); - -$this->run(" -ALTER TABLE `{$installer->getTable('sales_quote_item')}` - MODIFY COLUMN `weight` DECIMAL(12,4) DEFAULT '0.0000', - MODIFY COLUMN `discount_percent` DECIMAL(12,4) DEFAULT '0.0000', - MODIFY COLUMN `discount_amount` DECIMAL(12,4) DEFAULT '0.0000', - MODIFY COLUMN `tax_percent` DECIMAL(12,4) DEFAULT '0.0000', - MODIFY COLUMN `tax_amount` DECIMAL(12,4) DEFAULT '0.0000', - MODIFY COLUMN `row_total_with_discount` DECIMAL(12,4) DEFAULT '0.0000', - MODIFY COLUMN `base_discount_amount` DECIMAL(12,4) DEFAULT '0.0000', - MODIFY COLUMN `base_tax_amount` DECIMAL(12,4) DEFAULT '0.0000', - MODIFY COLUMN `row_weight` DECIMAL(12,4) DEFAULT '0.0000'; -"); - -$this->endSetup(); -$this->installEntities(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.17-0.8.18.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.17-0.8.18.php deleted file mode 100644 index 9835e203bf9..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.17-0.8.18.php +++ /dev/null @@ -1,57 +0,0 @@ -startSetup(); - -$this->run(" -ALTER TABLE `{$installer->getTable('sales_quote')}` - change `is_active` `is_active` tinyint (1)UNSIGNED DEFAULT '1' NULL , - change `is_virtual` `is_virtual` tinyint (1)UNSIGNED DEFAULT '0' NULL , - change `is_multi_shipping` `is_multi_shipping` tinyint (1)UNSIGNED DEFAULT '0' NULL , - change `is_multi_payment` `is_multi_payment` tinyint (1)UNSIGNED DEFAULT '0' NULL , - change `customer_note_notify` `customer_note_notify` tinyint (1)UNSIGNED DEFAULT '1' NULL , - change `customer_is_guest` `customer_is_guest` tinyint (1)UNSIGNED DEFAULT '0' NULL , - change `quote_status_id` `quote_status_id` int (10)UNSIGNED DEFAULT '0' NULL , - change `billing_address_id` `billing_address_id` int (10)UNSIGNED DEFAULT '0' NULL , - change `orig_order_id` `orig_order_id` int (10)UNSIGNED DEFAULT '0' NULL , - change `customer_id` `customer_id` int (10)UNSIGNED DEFAULT '0' NULL , - change `customer_tax_class_id` `customer_tax_class_id` int (10)UNSIGNED DEFAULT '0' NULL , - change `customer_group_id` `customer_group_id` int (10)UNSIGNED DEFAULT '0' NULL , - change `items_count` `items_count` int (10)UNSIGNED DEFAULT '0' NULL , - change `items_qty` `items_qty` decimal (12,4) DEFAULT '0.0000' NULL , - change `store_to_base_rate` `store_to_base_rate` decimal (12,4) DEFAULT '0.0000' NULL , - change `store_to_quote_rate` `store_to_quote_rate` decimal (12,4) DEFAULT '0.0000' NULL , - change `grand_total` `grand_total` decimal (12,4) DEFAULT '0.0000' NULL , - change `base_grand_total` `base_grand_total` decimal (12,4) DEFAULT '0.0000' NULL , - change `custbalance_amount` `custbalance_amount` decimal (12,4) DEFAULT '0.0000' NULL , - change `checkout_method` `checkout_method` varchar (255) NULL COLLATE utf8_general_ci , - change `password_hash` `password_hash` varchar (255) NULL COLLATE utf8_general_ci , - change `coupon_code` `coupon_code` varchar (255) NULL COLLATE utf8_general_ci , - change `base_currency_code` `base_currency_code` varchar (255) NULL COLLATE utf8_general_ci , - change `store_currency_code` `store_currency_code` varchar (255) NULL COLLATE utf8_general_ci , - change `quote_currency_code` `quote_currency_code` varchar (255) NULL COLLATE utf8_general_ci , - change `customer_email` `customer_email` varchar (255) NULL COLLATE utf8_general_ci , - change `customer_firstname` `customer_firstname` varchar (255) NULL COLLATE utf8_general_ci , - change `customer_lastname` `customer_lastname` varchar (255) NULL COLLATE utf8_general_ci , - change `customer_note` `customer_note` varchar (255) NULL COLLATE utf8_general_ci , - change `remote_ip` `remote_ip` varchar (255) NULL COLLATE utf8_general_ci , - change `applied_rule_ids` `applied_rule_ids` varchar (255) NULL COLLATE utf8_general_ci -"); - -$this->endSetup(); -$this->installEntities(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.18-0.8.19.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.18-0.8.19.php deleted file mode 100644 index 1e346b85016..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.18-0.8.19.php +++ /dev/null @@ -1,21 +0,0 @@ -addAttribute('order', 'edit_increment', ['type' => 'int']); -$installer->addAttribute('order', 'original_increment_id', ['type' => 'varchar']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.19-0.8.20.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.19-0.8.20.php deleted file mode 100644 index 852860c9c4e..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.19-0.8.20.php +++ /dev/null @@ -1,44 +0,0 @@ -getConnection()->addColumn($this->getTable('sales_order'), 'subtotal_refunded', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'subtotal_canceled', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'tax_refunded', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'tax_canceled', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'shipping_refunded', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'shipping_canceled', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'base_subtotal_refunded', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'base_subtotal_canceled', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'base_tax_refunded', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'base_tax_canceled', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'base_shipping_refunded', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'base_shipping_canceled', 'decimal(12,4) NULL'); - -$installer->addAttribute('order', 'subtotal_refunded', ['type' => 'static']); -$installer->addAttribute('order', 'subtotal_canceled', ['type' => 'static']); -$installer->addAttribute('order', 'tax_refunded', ['type' => 'static']); -$installer->addAttribute('order', 'tax_canceled', ['type' => 'static']); -$installer->addAttribute('order', 'shipping_refunded', ['type' => 'static']); -$installer->addAttribute('order', 'shipping_canceled', ['type' => 'static']); -$installer->addAttribute('order', 'base_subtotal_refunded', ['type' => 'static']); -$installer->addAttribute('order', 'base_subtotal_canceled', ['type' => 'static']); -$installer->addAttribute('order', 'base_tax_refunded', ['type' => 'static']); -$installer->addAttribute('order', 'base_tax_canceled', ['type' => 'static']); -$installer->addAttribute('order', 'base_shipping_refunded', ['type' => 'static']); -$installer->addAttribute('order', 'base_shipping_canceled', ['type' => 'static']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.2-0.8.3.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.2-0.8.3.php deleted file mode 100644 index 8eacf912841..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.2-0.8.3.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->installEntities(); -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.20-0.8.21.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.20-0.8.21.php deleted file mode 100644 index 9c0ce7e94e3..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.20-0.8.21.php +++ /dev/null @@ -1,32 +0,0 @@ -getConnection()->addColumn($this->getTable('sales_order'), 'subtotal_invoiced', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'tax_invoiced', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'shipping_invoiced', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'base_subtotal_invoiced', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'base_tax_invoiced', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'base_shipping_invoiced', 'decimal(12,4) NULL'); - -$installer->addAttribute('order', 'subtotal_invoiced', ['type' => 'static']); -$installer->addAttribute('order', 'tax_invoiced', ['type' => 'static']); -$installer->addAttribute('order', 'shipping_invoiced', ['type' => 'static']); -$installer->addAttribute('order', 'base_subtotal_invoiced', ['type' => 'static']); -$installer->addAttribute('order', 'base_tax_invoiced', ['type' => 'static']); -$installer->addAttribute('order', 'base_shipping_invoiced', ['type' => 'static']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.21-0.8.22.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.21-0.8.22.php deleted file mode 100644 index aea2ebbb269..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.21-0.8.22.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('sales_quote_address'), 'save_in_address_book', 'tinyint(1) default 0 after `customer_id`'); -$installer->addAttribute('quote_address', 'save_in_address_book', ['type' => 'static']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.22-0.8.23.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.22-0.8.23.php deleted file mode 100644 index 3e738f413ab..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.22-0.8.23.php +++ /dev/null @@ -1,21 +0,0 @@ -getConnection()->addColumn($installer->getTable('sales_quote'), 'reserved_order_id', 'varchar(64) default \'\''); -$installer->addAttribute('quote', 'reserved_order_id', ['type' => 'static']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.23-0.8.24.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.23-0.8.24.php deleted file mode 100644 index 4dbde8b64dc..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.23-0.8.24.php +++ /dev/null @@ -1,20 +0,0 @@ -addAttribute('order_payment', 'last_trans_id', []); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.24-0.8.25.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.24-0.8.25.php deleted file mode 100644 index 546445f4ef2..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.24-0.8.25.php +++ /dev/null @@ -1,36 +0,0 @@ -getConnection()->addColumn($this->getTable('sales_quote_address'), 'shipping_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_quote_address'), 'base_shipping_tax_amount', 'decimal(12,4) NULL'); - -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'shipping_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'base_shipping_tax_amount', 'decimal(12,4) NULL'); - -$installer->addAttribute('quote_address', 'shipping_tax_amount', ['type' => 'static']); -$installer->addAttribute('quote_address', 'base_shipping_tax_amount', ['type' => 'static']); - -$installer->addAttribute('order', 'shipping_tax_amount', ['type' => 'static']); -$installer->addAttribute('order', 'base_shipping_tax_amount', ['type' => 'static']); - -$installer->addAttribute('invoice', 'shipping_tax_amount', ['type' => 'decimal']); -$installer->addAttribute('invoice', 'base_shipping_tax_amount', ['type' => 'decimal']); - -$installer->addAttribute('creditmemo', 'shipping_tax_amount', ['type' => 'decimal']); -$installer->addAttribute('creditmemo', 'base_shipping_tax_amount', ['type' => 'decimal']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.25-0.8.26.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.25-0.8.26.php deleted file mode 100644 index 31e1b35af71..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.25-0.8.26.php +++ /dev/null @@ -1,22 +0,0 @@ -run(" - ALTER TABLE `{$this->getTable('sales_order')}` ADD INDEX `IDX_CUSTOMER` (`customer_id`); -"); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.26-0.8.27.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.26-0.8.27.php deleted file mode 100644 index 18fd1873d61..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.26-0.8.27.php +++ /dev/null @@ -1,37 +0,0 @@ -getConnection(); - -$conn->addColumn($installer->getTable('sales_quote'), 'customer_prefix', 'varchar(40) after customer_email'); -$conn->addColumn($installer->getTable('sales_quote'), 'customer_middlename', 'varchar(40) after customer_firstname'); -$conn->addColumn($installer->getTable('sales_quote'), 'customer_suffix', 'varchar(40) after customer_lastname'); - -$conn->addColumn($installer->getTable('sales_quote_address'), 'prefix', 'varchar(40) after email'); -$conn->addColumn($installer->getTable('sales_quote_address'), 'middlename', 'varchar(40) after firstname'); -$conn->addColumn($installer->getTable('sales_quote_address'), 'suffix', 'varchar(40) after lastname'); - -$installer->addAttribute('order', 'customer_prefix', ['type' => 'varchar', 'visible' => false]); -$installer->addAttribute('order', 'customer_middlename', ['type' => 'varchar', 'visible' => false]); -$installer->addAttribute('order', 'customer_suffix', ['type' => 'varchar', 'visible' => false]); - -$installer->addAttribute('order_address', 'prefix', []); -$installer->addAttribute('order_address', 'middlename', []); -$installer->addAttribute('order_address', 'suffix', []); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.27-0.8.28.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.27-0.8.28.php deleted file mode 100644 index 5572bc50859..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.27-0.8.28.php +++ /dev/null @@ -1,26 +0,0 @@ -addAttribute('quote', 'customer_prefix', ['type' => 'static']); -$installer->addAttribute('quote', 'customer_middlename', ['type' => 'static']); -$installer->addAttribute('quote', 'customer_suffix', ['type' => 'static']); - -$installer->addAttribute('quote_address', 'prefix', ['type' => 'static']); -$installer->addAttribute('quote_address', 'middlename', ['type' => 'static']); -$installer->addAttribute('quote_address', 'suffix', ['type' => 'static']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.28-0.8.29.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.28-0.8.29.php deleted file mode 100644 index 8c777227185..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.28-0.8.29.php +++ /dev/null @@ -1,26 +0,0 @@ -getConnection(); - -$conn->addColumn($installer->getTable('sales_quote'), 'customer_dob', 'datetime after customer_suffix'); -$installer->addAttribute('quote', 'customer_dob', ['type' => 'static', 'backend' => 'eav/entity_attribute_backend_datetime']); - -$installer->addAttribute('order', 'customer_dob', ['type' => 'datetime', 'backend' => 'eav/entity_attribute_backend_datetime']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.29-0.9.0.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.29-0.9.0.php deleted file mode 100644 index 69a82db64ff..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.29-0.9.0.php +++ /dev/null @@ -1,343 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$installer->getTable('sales_flat_quote')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `converted_at` datetime NOT NULL default '0000-00-00 00:00:00', - - `is_active` tinyint(1) unsigned default '1', - `is_virtual` tinyint(1) unsigned default '0', - `is_multi_shipping` tinyint(1) unsigned default '0', - - `items_count` int(10) unsigned default '0', - `items_qty` decimal(12,4) default '0.0000', - - `orig_order_id` int(10) unsigned default '0', - - `store_to_base_rate` decimal(12,4) default '0.0000', - `store_to_quote_rate` decimal(12,4) default '0.0000', - `base_currency_code` varchar(255) default NULL, - `store_currency_code` varchar(255) default NULL, - `quote_currency_code` varchar(255) default NULL, - - `grand_total` decimal(12,4) default '0.0000', - `base_grand_total` decimal(12,4) default '0.0000', - - `checkout_method` varchar(255) default NULL, - - `customer_id` int(10) unsigned default '0', - `customer_tax_class_id` int(10) unsigned default '0', - `customer_group_id` int(10) unsigned default '0', - `customer_email` varchar(255) default NULL, - `customer_prefix` varchar(40) default NULL, - `customer_firstname` varchar(255) default NULL, - `customer_middlename` varchar(40) default NULL, - `customer_lastname` varchar(255) default NULL, - `customer_suffix` varchar(40) default NULL, - `customer_dob` datetime default NULL, - `customer_note` varchar(255) default NULL, - `customer_note_notify` tinyint(1) unsigned default '1', - `customer_is_guest` tinyint(1) unsigned default '0', - - `remote_ip` varchar(32) default NULL, - `applied_rule_ids` varchar(255) default NULL, - `reserved_order_id` varchar(64) default '', - `password_hash` varchar(255) default NULL, - `coupon_code` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `FK_SALES_QUOTE_STORE` (`store_id`), - KEY `IDX_CUSTOMER` (`customer_id`,`store_id`,`is_active`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -CREATE TABLE `{$installer->getTable('sales_flat_quote_address')}` ( - `address_id` int(10) unsigned NOT NULL auto_increment, - `quote_id` int(10) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - - `customer_id` int(10) unsigned default NULL, - `save_in_address_book` tinyint(1) default '0', - `customer_address_id` int(10) unsigned default NULL, - `address_type` varchar(255) default NULL, - `email` varchar(255) default NULL, - `prefix` varchar(40) default NULL, - `firstname` varchar(255) default NULL, - `middlename` varchar(40) default NULL, - `lastname` varchar(255) default NULL, - `suffix` varchar(40) default NULL, - `company` varchar(255) default NULL, - `street` varchar(255) default NULL, - `city` varchar(255) default NULL, - `region` varchar(255) default NULL, - `region_id` int(10) unsigned default NULL, - `postcode` varchar(255) default NULL, - `country_id` varchar(255) default NULL, - `telephone` varchar(255) default NULL, - `fax` varchar(255) default NULL, - - `same_as_billing` tinyint(1) unsigned NOT NULL default '0', - `free_shipping` tinyint(1) unsigned NOT NULL default '0', - `collect_shipping_rates` tinyint(1) unsigned NOT NULL default '0', - `shipping_method` varchar(255) NOT NULL default '', - `shipping_description` varchar(255) NOT NULL default '', - `weight` decimal(12,4) NOT NULL default '0.0000', - - `subtotal` decimal(12,4) NOT NULL default '0.0000', - `base_subtotal` decimal(12,4) NOT NULL default '0.0000', - `subtotal_with_discount` decimal(12,4) NOT NULL default '0.0000', - `base_subtotal_with_discount` decimal(12,4) NOT NULL default '0.0000', - `tax_amount` decimal(12,4) NOT NULL default '0.0000', - `base_tax_amount` decimal(12,4) NOT NULL default '0.0000', - `shipping_amount` decimal(12,4) NOT NULL default '0.0000', - `base_shipping_amount` decimal(12,4) NOT NULL default '0.0000', - `shipping_tax_amount` decimal(12,4) default NULL, - `base_shipping_tax_amount` decimal(12,4) default NULL, - `discount_amount` decimal(12,4) NOT NULL default '0.0000', - `base_discount_amount` decimal(12,4) NOT NULL default '0.0000', - `grand_total` decimal(12,4) NOT NULL default '0.0000', - `base_grand_total` decimal(12,4) NOT NULL default '0.0000', - - `customer_notes` text, - PRIMARY KEY (`address_id`), - KEY `FK_SALES_QUOTE_ADDRESS_SALES_QUOTE` (`quote_id`), - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_SALES_QUOTE` FOREIGN KEY (`quote_id`) REFERENCES `{$installer->getTable('sales_flat_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_flat_quote_address_item')}` ( - `address_item_id` int(10) unsigned NOT NULL auto_increment, - `quote_address_id` int(10) unsigned NOT NULL default '0', - `quote_item_id` int(10) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - - `applied_rule_ids` text, - `additional_data` text, - `weight` decimal(12,4) default '0.0000', - `qty` decimal(12,4) NOT NULL default '0.0000', - `discount_amount` decimal(12,4) default '0.0000', - `tax_amount` decimal(12,4) default '0.0000', - - `row_total` decimal(12,4) NOT NULL default '0.0000', - `base_row_total` decimal(12,4) NOT NULL default '0.0000', - `row_total_with_discount` decimal(12,4) default '0.0000', - `base_discount_amount` decimal(12,4) default '0.0000', - `base_tax_amount` decimal(12,4) default '0.0000', - `row_weight` decimal(12,4) default '0.0000', - PRIMARY KEY (`address_item_id`), - KEY `FK_QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS` (`quote_address_id`), - KEY `FK_SALES_QUOTE_ADDRESS_ITEM_QUOTE_ITEM` (`quote_item_id`), - CONSTRAINT `FK_QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS` FOREIGN KEY (`quote_address_id`) REFERENCES `{$installer->getTable('sales_flat_quote_address')}` (`address_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_QUOTE_ADDRESS_ITEM_QUOTE_ITEM` FOREIGN KEY (`quote_item_id`) REFERENCES `{$installer->getTable('sales_flat_quote_item')}` (`item_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_flat_quote_item')}` ( - `item_id` int(10) unsigned NOT NULL auto_increment, - `quote_id` int(10) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - - `product_id` int(10) unsigned default NULL, - `super_product_id` int(10) unsigned default NULL, - `parent_product_id` int(10) unsigned default NULL, - `is_virtual` tinyint(1) unsigned default NULL, - - `sku` varchar(255) NOT NULL default '', - `name` varchar(255) default NULL, - `description` text, - `applied_rule_ids` text, - `additional_data` text, - `free_shipping` tinyint(1) unsigned NOT NULL default '0', - `is_qty_decimal` tinyint(1) unsigned default NULL, - `no_discount` tinyint(1) unsigned default '0', - - `weight` decimal(12,4) default '0.0000', - `qty` decimal(12,4) NOT NULL default '0.0000', - `price` decimal(12,4) NOT NULL default '0.0000', - `base_price` decimal(12,4) NOT NULL default '0.0000', - `custom_price` decimal(12,4) default NULL, - `discount_percent` decimal(12,4) default '0.0000', - `discount_amount` decimal(12,4) default '0.0000', - `base_discount_amount` decimal(12,4) default '0.0000', - `tax_percent` decimal(12,4) default '0.0000', - `tax_amount` decimal(12,4) default '0.0000', - `base_tax_amount` decimal(12,4) default '0.0000', - `row_total` decimal(12,4) NOT NULL default '0.0000', - `base_row_total` decimal(12,4) NOT NULL default '0.0000', - `row_total_with_discount` decimal(12,4) default '0.0000', - `row_weight` decimal(12,4) default '0.0000', - PRIMARY KEY (`item_id`), - KEY `FK_SALES_QUOTE_ITEM_SALES_QUOTE` (`quote_id`), - CONSTRAINT `FK_SALES_QUOTE_ITEM_SALES_QUOTE` FOREIGN KEY (`quote_id`) REFERENCES `{$installer->getTable('sales_flat_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_flat_quote_item_option')}` ( - `option_id` int(10) unsigned NOT NULL auto_increment, - `item_id` int(10) unsigned NOT NULL, - `product_id` int(10) unsigned NOT NULL, - `code` varchar(255) NOT NULL, - `value` text NOT NULL, - PRIMARY KEY (`option_id`), - KEY `FK_SALES_QUOTE_ITEM_OPTION_ITEM_ID` (`item_id`), - CONSTRAINT `FK_SALES_QUOTE_ITEM_OPTION_ITEM_ID` FOREIGN KEY (`item_id`) REFERENCES `{$installer->getTable('sales_flat_quote_item')}` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Additional options for quote item'; - -CREATE TABLE `{$installer->getTable('sales_flat_quote_payment')}` ( - `payment_id` int(10) unsigned NOT NULL auto_increment, - `quote_id` int(10) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - `method` varchar(255) default '', - - `cc_type` varchar(255) default '', - `cc_number_enc` varchar(255) default '', - `cc_last4` varchar(255) default '', - `cc_cid_enc` varchar(255) default '', - `cc_owner` varchar(255) default '', - `cc_exp_month` tinyint(2) unsigned default '0', - `cc_exp_year` smallint(4) unsigned default '0', - `cc_ss_owner` varchar(255) default '', - `cc_ss_start_month` tinyint(2) unsigned default '0', - `cc_ss_start_year` smallint(4) unsigned default '0', - - `cybersource_token` varchar(255) default '', - `paypal_correlation_id` varchar(255) default '', - `paypal_payer_id` varchar(255) default '', - `paypal_payer_status` varchar(255) default '', - `po_number` varchar(255) default '', - PRIMARY KEY (`payment_id`), - KEY `FK_SALES_QUOTE_PAYMENT_SALES_QUOTE` (`quote_id`), - CONSTRAINT `FK_SALES_QUOTE_PAYMENT_SALES_QUOTE` FOREIGN KEY (`quote_id`) REFERENCES `{$installer->getTable('sales_flat_quote')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('sales_flat_quote_shipping_rate')}` ( - `rate_id` int(10) unsigned NOT NULL auto_increment, - `address_id` int(10) unsigned NOT NULL default '0', - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - - `carrier` varchar(255) default NULL, - `carrier_title` varchar(255) default NULL, - `code` varchar(255) default NULL, - `method` varchar(255) default NULL, - `method_description` text, - `price` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`rate_id`), - KEY `FK_SALES_QUOTE_SHIPPING_RATE_ADDRESS` (`address_id`), - CONSTRAINT `FK_SALES_QUOTE_SHIPPING_RATE_ADDRESS` FOREIGN KEY (`address_id`) REFERENCES `{$installer->getTable('sales_flat_quote_address')}` (`address_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DELETE FROM `{$installer->getTable('log_quote')}`; -"); - -$installer->addAttribute('order_item', 'is_virtual', ['type' => 'int']); -$installer->endSetup(); - -/** - * Copy old quotes - */ -@set_time_limit(0); - -$quoteFields = array_keys($installer->getConnection()->describeTable($installer->getTable('sales_flat_quote'))); -$itemFields = array_keys($installer->getConnection()->describeTable($installer->getTable('sales_flat_quote_item'))); - -$quoteRows = []; -$query = $installer->getConnection()->query( - $installer->getConnection()->select() - ->from($installer->getTable('sales_quote'), 'entity_id'), -); -while ($row = $query->fetch()) { - $quoteRows[] = $row['entity_id']; -} - -foreach ($quoteRows as $oldQuoteId) { - $quoteInfo = $installer->getConnection()->fetchRow( - $installer->getConnection()->select() - ->from($installer->getTable('sales_quote')) - ->where('entity_id=?', $oldQuoteId), - ); - - $quoteItems = $installer->getConnection()->fetchAll( - $installer->getConnection()->select() - ->from($installer->getTable('sales_quote_item')) - ->where('parent_id=?', $oldQuoteId), - ); - - if (!empty($quoteItems)) { - unset($quoteInfo['entity_id']); - - $quoteData = []; - foreach ($quoteFields as $field) { - if (isset($quoteInfo[$field])) { - $quoteData[$field] = $quoteInfo[$field]; - } - } - - $installer->getConnection()->insert($installer->getTable('sales_flat_quote'), $quoteData); - $quoteId = $installer->getConnection()->lastInsertId(); - - foreach ($quoteItems as $itemInfo) { - $itemData = [ - 'quote_id' => $quoteId, - ]; - - foreach ($itemFields as $field) { - if (isset($itemInfo[$field])) { - $itemData[$field] = $itemInfo[$field]; - } - } - $installer->getConnection()->insert($installer->getTable('sales_flat_quote_item'), $itemData); - } - } -} - -$installer->startSetup(); -$installer->run(" -DROP TABLE IF EXISTS {$this->getTable('sales_quote')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_address')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_address_decimal')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_address_int')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_address_text')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_address_varchar')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_decimal')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_entity')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_entity_datetime')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_entity_decimal')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_entity_int')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_entity_text')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_entity_varchar')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_int')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_item')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_item_decimal')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_item_int')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_item_text')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_item_varchar')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_text')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_varchar')}; -DROP TABLE IF EXISTS {$this->getTable('sales_quote_rule')}; -DROP TABLE IF EXISTS {$this->getTable('sales_counter')}; -DROP TABLE IF EXISTS {$this->getTable('sales_discount_coupon')}; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.3-0.8.4.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.3-0.8.4.php deleted file mode 100644 index 3903a3907d1..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.3-0.8.4.php +++ /dev/null @@ -1,25 +0,0 @@ -startSetup(); - -$installer->run(" -UPDATE {$this->getTable('core_email_template')} set template_text='\r\n\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \"Magento\"
\r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n

Hello {{var billing.name}},
\r\n Thank you for your order from Magento Demo Store. Once your package ships we will send an email with a link to track your order.{{depend order.getCustomerId()}} You can check the status of your order by logging into your account.{{/depend}} If you have any questions about your order please contact us at dummyemail@openmage.org or call us at (555) 555-0123 Monday - Friday, 8am - 5pm PST.

\r\n

Your order confirmation is below. Thank you again for your business.

\r\n \r\n

Your Order #{{var order.increment_id}} (placed on {{var order.getCreatedAtFormated(\'long\')}})

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Billing \r\n Information:Payment \r\n Method:
{{var order.billing_address.format(\'html\')}}  {{var payment_html}}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Shipping \r\n Information:Shipping \r\n Method:
{{var order.shipping_address.format(\'html\')}} {{var order.shipping_description}}

\r\n\r\n{{var items_html}}
\r\n {{var order.getEmailCustomerNote()}} \r\n

Thank you again,
Magento Demo Store

\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n' WHERE template_code='New order (HTML)'; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.6-0.8.7.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.6-0.8.7.php deleted file mode 100644 index 8eacf912841..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.6-0.8.7.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->installEntities(); -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.7-0.8.8.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.7-0.8.8.php deleted file mode 100644 index 136e7928bb8..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.7-0.8.8.php +++ /dev/null @@ -1,30 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('sales_counter')} - CHANGE `store_id` `store_id` smallint(5) unsigned NOT NULL; -ALTER TABLE {$this->getTable('sales_counter')} - ADD CONSTRAINT `FK_SALES_COUNTER_STORE` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) - ON UPDATE CASCADE - ON DELETE CASCADE; -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.8-0.8.9.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.8-0.8.9.php deleted file mode 100644 index a09d98e7cd1..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.8-0.8.9.php +++ /dev/null @@ -1,54 +0,0 @@ -startSetup(); - -$installer->run(" - ALTER TABLE {$this->getTable('sales_order_entity')} MODIFY COLUMN `store_id` SMALLINT(5) UNSIGNED; -"); - -$installer->getConnection()->dropForeignKey($this->getTable('sales_order_entity'), 'FK_sales_order_entity_store'); -$installer->getConnection()->dropColumn($this->getTable('sales_order_entity_datetime'), 'store_id'); -$installer->getConnection()->dropColumn($this->getTable('sales_order_entity_decimal'), 'store_id'); -$installer->getConnection()->dropColumn($this->getTable('sales_order_entity_int'), 'store_id'); -$installer->getConnection()->dropColumn($this->getTable('sales_order_entity_text'), 'store_id'); -$installer->getConnection()->dropColumn($this->getTable('sales_order_entity_varchar'), 'store_id'); - -$installer->getConnection()->dropColumn($this->getTable('sales_quote_entity_datetime'), 'store_id'); -$installer->getConnection()->dropColumn($this->getTable('sales_quote_entity_decimal'), 'store_id'); -$installer->getConnection()->dropColumn($this->getTable('sales_quote_entity_int'), 'store_id'); -$installer->getConnection()->dropColumn($this->getTable('sales_quote_entity_text'), 'store_id'); -$installer->getConnection()->dropColumn($this->getTable('sales_quote_entity_varchar'), 'store_id'); - -$installer->getConnection()->dropColumn($this->getTable('sales_quote_temp_datetime'), 'store_id'); -$installer->getConnection()->dropColumn($this->getTable('sales_quote_temp_decimal'), 'store_id'); -$installer->getConnection()->dropColumn($this->getTable('sales_quote_temp_int'), 'store_id'); -$installer->getConnection()->dropColumn($this->getTable('sales_quote_temp_text'), 'store_id'); -$installer->getConnection()->dropColumn($this->getTable('sales_quote_temp_varchar'), 'store_id'); - -$installer->getConnection()->addConstraint( - 'SALE_ORDER_ENTITY_STORE', - $this->getTable('sales_order_entity'), - 'store_id', - $this->getTable('core_store'), - 'store_id', - 'SET NULL', -); - -$installer->installEntities(); -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.0-0.9.1.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.0-0.9.1.php deleted file mode 100644 index cfc3a9bb807..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.0-0.9.1.php +++ /dev/null @@ -1,24 +0,0 @@ -getConnection(); - -$installer->addAttribute('quote_item', 'product_type', []); -$installer->addAttribute('order_item', 'product_type', []); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.1-0.9.2.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.1-0.9.2.php deleted file mode 100644 index 5e424a9867b..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.1-0.9.2.php +++ /dev/null @@ -1,20 +0,0 @@ -addAttribute('quote_address', 'applied_taxes', ['type' => 'text']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.10-0.9.11.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.10-0.9.11.php deleted file mode 100644 index c456db138f4..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.10-0.9.11.php +++ /dev/null @@ -1,22 +0,0 @@ -run(" -ALTER TABLE `{$installer->getTable('sales_order_tax')}` ADD `base_real_amount` DECIMAL( 12, 4 ) NOT NULL; -"); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.11-0.9.12.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.11-0.9.12.php deleted file mode 100644 index 26f361d75ec..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.11-0.9.12.php +++ /dev/null @@ -1,20 +0,0 @@ -addAttribute('quote_item', 'original_custom_price', ['type' => 'decimal']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.12-0.9.13.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.12-0.9.13.php deleted file mode 100644 index 770e34bac85..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.12-0.9.13.php +++ /dev/null @@ -1,24 +0,0 @@ -addAttribute('quote', 'subtotal', ['type' => 'decimal']); -$installer->addAttribute('quote', 'base_subtotal', ['type' => 'decimal']); - -$installer->addAttribute('quote', 'subtotal_with_discount', ['type' => 'decimal']); -$installer->addAttribute('quote', 'base_subtotal_with_discount', ['type' => 'decimal']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.13-0.9.14.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.13-0.9.14.php deleted file mode 100644 index 089ded82f8c..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.13-0.9.14.php +++ /dev/null @@ -1,31 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('sales_flat_quote'), - 'customer_taxvat', - 'varchar(255) NULL DEFAULT NULL AFTER `customer_is_guest`', -); -$installer->addAttribute('quote', 'customer_taxvat', ['type' => 'static', 'visible' => false]); - -// add customer_taxvat -$installer->addAttribute('order', 'customer_taxvat', ['type' => 'varchar', 'visible' => false]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.14-0.9.15.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.14-0.9.15.php deleted file mode 100644 index 2a7b72daa35..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.14-0.9.15.php +++ /dev/null @@ -1,31 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropForeignKey($installer->getTable('sales_flat_quote_address_item'), 'FK_SALES_QUOTE_ADDRESS_ITEM_QUOTE_ITEM'); - -$installer->getConnection()->addConstraint( - 'FK_SALES_QUOTE_ADDRESS_ITEM_QUOTE_ITEM', - $installer->getTable('sales_flat_quote_address_item'), - 'quote_item_id', - $installer->getTable('sales_flat_quote_item'), - 'item_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.15-0.9.16.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.15-0.9.16.php deleted file mode 100644 index 5fb14b4c86e..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.15-0.9.16.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->addAttribute('quote', 'is_changed', ['type' => 'int']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.16-0.9.17.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.16-0.9.17.php deleted file mode 100644 index 466ad0d1f49..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.16-0.9.17.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->addAttribute('quote_address_rate', 'method_title', ['type' => 'text']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.17-0.9.18.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.17-0.9.18.php deleted file mode 100644 index 210e6d9fa1a..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.17-0.9.18.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->addAttribute('order', 'shipping_tax_amount', ['type' => 'static']); -$installer->addAttribute('order', 'base_shipping_tax_amount', ['type' => 'static']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.18-0.9.19.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.18-0.9.19.php deleted file mode 100644 index abb126303dd..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.18-0.9.19.php +++ /dev/null @@ -1,22 +0,0 @@ -run(" - ALTER TABLE `{$this->getTable('sales_order')}` ADD INDEX `IDX_INCREMENT_ID` (`increment_id`); -"); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.19-0.9.20.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.19-0.9.20.php deleted file mode 100644 index 923ca6ecc33..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.19-0.9.20.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->addAttribute('order', 'can_ship_partially', ['type' => 'int']); -$installer->addAttribute('order', 'can_ship_partially_item', ['type' => 'int']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.2-0.9.3.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.2-0.9.3.php deleted file mode 100644 index 5921a2d5011..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.2-0.9.3.php +++ /dev/null @@ -1,36 +0,0 @@ -run(" -ALTER TABLE `{$installer->getTable('sales_flat_quote_address')}` CHANGE `applied_taxes` `applied_taxes` TEXT; - -CREATE TABLE `{$installer->getTable('sales_order_tax')}` ( - `tax_id` int(10) unsigned NOT NULL auto_increment, - `order_id` int(10) unsigned NOT NULL, - `code` varchar(255) NOT NULL, - `title` varchar(255) NOT NULL, - `percent` decimal(12,4) NOT NULL, - `priority` int(11) NOT NULL, - `position` int(11) NOT NULL, - PRIMARY KEY (`tax_id`), - KEY `IDX_ORDER_TAX` (`order_id`,`priority`,`position`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; - -ALTER TABLE `{$installer->getTable('sales_order_tax')}` ADD `amount` DECIMAL( 12, 4 ) NOT NULL AFTER `percent`; -"); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.20-0.9.21.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.20-0.9.21.php deleted file mode 100644 index 0646063a55c..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.20-0.9.21.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('sales_flat_quote'), - 'trigger_recollect', - 'tinyint(1) NOT NULL DEFAULT 0', -); -// no need to add attribute to the flat quote - it will be ignored - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.21-0.9.22.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.21-0.9.22.php deleted file mode 100644 index d685b8d69d6..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.21-0.9.22.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->addAttribute('order', 'payment_authorization_amount', ['type' => 'decimal']); -$installer->addAttribute('order', 'payment_authorization_expiration', ['type' => 'int']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.22-0.9.23.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.22-0.9.23.php deleted file mode 100644 index 510f8b73415..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.22-0.9.23.php +++ /dev/null @@ -1,26 +0,0 @@ -getConnection(); - -$conn->addColumn($installer->getTable('sales_flat_quote'), 'customer_dob', 'datetime after customer_suffix'); -$installer->addAttribute('quote', 'customer_dob', ['type' => 'static', 'backend' => 'eav/entity_attribute_backend_datetime']); - -$installer->addAttribute('order', 'customer_dob', ['type' => 'datetime', 'backend' => 'eav/entity_attribute_backend_datetime']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.23-0.9.24.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.23-0.9.24.php deleted file mode 100644 index 93b8fffa743..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.23-0.9.24.php +++ /dev/null @@ -1,21 +0,0 @@ -addAttribute('invoice', 'email_sent', ['type' => 'int']); -$installer->addAttribute('shipment', 'email_sent', ['type' => 'int']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.24-0.9.25.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.24-0.9.25.php deleted file mode 100644 index aea1d0235aa..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.24-0.9.25.php +++ /dev/null @@ -1,24 +0,0 @@ -getConnection()->addColumn($this->getTable('sales_order'), 'shipping_tax_refunded', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'base_shipping_tax_refunded', 'decimal(12,4) NULL'); - -$installer->addAttribute('order', 'shipping_tax_refunded', ['type' => 'static']); -$installer->addAttribute('order', 'base_shipping_tax_refunded', ['type' => 'static']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.25-0.9.26.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.25-0.9.26.php deleted file mode 100644 index a2e61554635..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.25-0.9.26.php +++ /dev/null @@ -1,33 +0,0 @@ -run(" -DELETE FROM `{$this->getTable('sales_order_tax')}` -WHERE `order_id` NOT IN ( - SELECT `entity_id` FROM `{$this->getTable('sales_order')}` -) -"); - -$installer->getConnection()->addConstraint( - 'FK_SALES_ORDER_TAX_ORDER', - $this->getTable('sales_order_tax'), - 'order_id', - $this->getTable('sales_order'), - 'entity_id', -); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.26-0.9.27.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.26-0.9.27.php deleted file mode 100644 index 08b1ad184fe..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.26-0.9.27.php +++ /dev/null @@ -1,170 +0,0 @@ -getConnection()->addColumn( - $this->getTable('sales/quote'), - 'global_currency_code', - 'varchar(255) NULL AFTER `store_to_quote_rate`', -); -$installer->getConnection()->addColumn( - $this->getTable('sales/quote'), - 'base_to_quote_rate', - 'decimal(12,4) NULL AFTER `store_to_quote_rate`', -); -$installer->getConnection()->addColumn( - $this->getTable('sales/quote'), - 'base_to_global_rate', - 'decimal(12,4) NULL AFTER `store_to_quote_rate`', -); - -$installer->addAttribute('quote', 'global_currency_code', ['type' => 'static']); -$installer->addAttribute('quote', 'base_to_global_rate', ['type' => 'static']); -$installer->addAttribute('quote', 'base_to_quote_rate', ['type' => 'static']); - -$installer->addAttribute('order', 'global_currency_code', ['type' => 'varchar']); -$installer->addAttribute('order', 'base_to_global_rate', ['type' => 'decimal']); -$installer->addAttribute('order', 'base_to_order_rate', ['type' => 'decimal']); - -$installer->addAttribute('invoice', 'global_currency_code', ['type' => 'varchar']); -$installer->addAttribute('invoice', 'base_to_global_rate', ['type' => 'decimal']); -$installer->addAttribute('invoice', 'base_to_order_rate', ['type' => 'decimal']); - -$installer->addAttribute('creditmemo', 'global_currency_code', ['type' => 'varchar']); -$installer->addAttribute('creditmemo', 'base_to_global_rate', ['type' => 'decimal']); -$installer->addAttribute('creditmemo', 'base_to_order_rate', ['type' => 'decimal']); - -/* - * getting all base currency codes and placing them in newly created attribute - */ - -$orderEntityType = $installer->getEntityType('order'); -$orderEntityType['entity_table'] = 'sales_order'; -$invoiceEntityType = $installer->getEntityType('invoice'); -$invoiceEntityType['entity_table'] = 'sales_order_entity'; -$creditmemoEntityType = $installer->getEntityType('creditmemo'); -$creditmemoEntityType['entity_table'] = 'sales_order_entity'; - -$entityTypes = [$orderEntityType['entity_type_id'] => $orderEntityType, - $invoiceEntityType['entity_type_id'] => $invoiceEntityType, - $creditmemoEntityType['entity_type_id'] => $creditmemoEntityType]; - -try { - $installer->getConnection()->beginTransaction(); - - foreach ($entityTypes as $typeId => $entity) { - $globalCurrencyCode = $installer->getAttribute($typeId, 'global_currency_code'); - if ($globalCurrencyCode['backend_type'] == 'static') { - $globalCurrencyCodeTable = $this->getTable($entity['entity_table']); - } else { - $globalCurrencyCodeTable = $this->getTable($entity['entity_table']) . '_' - . $globalCurrencyCode['backend_type']; - } - - $baseCurrencyCode = $installer->getAttribute($typeId, 'base_currency_code'); - if ($baseCurrencyCode['backend_type'] == 'static') { - $baseCurrencyCodeTable = $this->getTable($entity['entity_table']); - } else { - $baseCurrencyCodeTable = $this->getTable($entity['entity_table']) . '_' - . $baseCurrencyCode['backend_type']; - } - - $storeCurrencyCode = $installer->getAttribute($typeId, 'store_currency_code'); - if ($storeCurrencyCode['backend_type'] == 'static') { - $storeCurrencyCodeTable = $this->getTable($entity['entity_table']); - } else { - $storeCurrencyCodeTable = $this->getTable($entity['entity_table']) . '_' - . $storeCurrencyCode['backend_type']; - } - - $baseToGlobalRate = $installer->getAttribute($typeId, 'base_to_global_rate'); - if ($baseToGlobalRate['backend_type'] == 'static') { - $baseToGlobalRateTable = $this->getTable($entity['entity_table']); - } else { - $baseToGlobalRateTable = $this->getTable($entity['entity_table']) . '_' . $baseToGlobalRate['backend_type']; - } - - $storeToBaseRate = $installer->getAttribute($typeId, 'store_to_base_rate'); - if ($storeToBaseRate['backend_type'] == 'static') { - $storeToBaseRateTable = $this->getTable($entity['entity_table']); - } else { - $storeToBaseRateTable = $this->getTable($entity['entity_table']) . '_' . $storeToBaseRate['backend_type']; - } - - $baseToOrderRate = $installer->getAttribute($typeId, 'base_to_order_rate'); - if ($baseToOrderRate['backend_type'] == 'static') { - $baseToOrderRateTable = $this->getTable($entity['entity_table']); - } else { - $baseToOrderRateTable = $this->getTable($entity['entity_table']) . '_' . $baseToOrderRate['backend_type']; - } - - $storeToOrderRate = $installer->getAttribute($typeId, 'store_to_order_rate'); - if ($storeToOrderRate['backend_type'] == 'static') { - $storeToOrderRateTable = $this->getTable($entity['entity_table']); - } else { - $storeToOrderRateTable = $this->getTable($entity['entity_table']) . '_' . $storeToOrderRate['backend_type']; - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - //copy data from base_currency_code into global_currency_code - $query = 'INSERT INTO `' . $globalCurrencyCodeTable . - '` (`entity_type_id`, `attribute_id`, `entity_id`, `value`) SELECT `entity_type_id`, "' . - $globalCurrencyCode['attribute_id'] . '" as `attribute_id`, `entity_id`, `value` FROM `' . - $baseCurrencyCodeTable . '` WHERE `attribute_id` = ' . $baseCurrencyCode['attribute_id'] . ';'; - - $installer->getConnection()->query($query); - - //delete old data in base_currency_code - $query = 'DELETE FROM `' . $baseCurrencyCodeTable . '` WHERE `attribute_id` = ' - . $baseCurrencyCode['attribute_id'] . ';'; - - $installer->getConnection()->query($query); - - //copy data from store_currency_code into base_currency_code - $query = 'INSERT INTO `' . $baseCurrencyCodeTable . - '` (`entity_type_id`, `attribute_id`, `entity_id`, `value`) SELECT `entity_type_id`, "' . - $baseCurrencyCode['attribute_id'] . '" as `attribute_id`, `entity_id`, `value` FROM `' . - $storeCurrencyCodeTable . '` WHERE `attribute_id` = ' . $storeCurrencyCode['attribute_id'] . ';'; - - $installer->getConnection()->query($query); - - //copy data from store_to_base_rate into base_to_global_rate - $query = 'INSERT INTO `' . $baseToGlobalRateTable . - '` (`entity_type_id`, `attribute_id`, `entity_id`, `value`) SELECT `entity_type_id`, "' . - $baseToGlobalRate['attribute_id'] . '" as `attribute_id`, `entity_id`, `value` FROM `' . - $storeToBaseRateTable . '` WHERE `attribute_id` = ' . $storeToBaseRate['attribute_id'] . ';'; - - $installer->getConnection()->query($query); - - //copy data from store_to_order_rate into base_to_order_rate - $query = 'INSERT INTO `' . $baseToOrderRateTable . - '` (`entity_type_id`, `attribute_id`, `entity_id`, `value`) SELECT `entity_type_id`, "' . - $baseToOrderRate['attribute_id'] . '" as `attribute_id`, `entity_id`, `value` FROM `' . - $storeToOrderRateTable . '` WHERE `attribute_id` = ' . $storeToOrderRate['attribute_id'] . ';'; - - $installer->getConnection()->query($query); - } - - $installer->getConnection()->commit(); -} catch (Exception $e) { - $installer->getConnection()->rollBack(); - throw $e; -} diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.27-0.9.28.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.27-0.9.28.php deleted file mode 100644 index 63868617636..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.27-0.9.28.php +++ /dev/null @@ -1,36 +0,0 @@ -startSetup(); - -$installer->run(" -DELETE `{$installer->getTable('sales_flat_quote')}`.* FROM `{$installer->getTable('sales_flat_quote')}` - LEFT JOIN `{$installer->getTable('core_store')}` - ON `{$installer->getTable('sales_flat_quote')}`.`store_id`=`{$installer->getTable('core_store')}`.`store_id` - WHERE `{$installer->getTable('core_store')}`.`store_id` IS NULL; -"); - -$installer->getConnection()->addConstraint( - 'FK_SALES_QUOTE_STORE', - $installer->getTable('sales_flat_quote'), - 'store_id', - $installer->getTable('core_store'), - 'store_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.28-0.9.29.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.28-0.9.29.php deleted file mode 100644 index c755e97c7df..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.28-0.9.29.php +++ /dev/null @@ -1,150 +0,0 @@ -getConnection()->addColumn($this->getTable('sales_order'), 'discount_refunded', 'decimal(12,4) default NULL AFTER `subtotal_canceled`'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'discount_canceled', 'decimal(12,4) default NULL AFTER `discount_refunded`'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'discount_invoiced', 'decimal(12,4) default NULL AFTER `discount_canceled`'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'base_discount_refunded', 'decimal(12,4) default NULL AFTER `base_subtotal_canceled`'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'base_discount_canceled', 'decimal(12,4) default NULL AFTER `base_discount_refunded`'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), 'base_discount_invoiced', 'decimal(12,4) default NULL AFTER `base_discount_canceled`'); - -$installer->addAttribute('order', 'discount_refunded', ['type' => 'static']); -$installer->addAttribute('order', 'discount_canceled', ['type' => 'static']); -$installer->addAttribute('order', 'discount_invoiced', ['type' => 'static']); -$installer->addAttribute('order', 'base_discount_refunded', ['type' => 'static']); -$installer->addAttribute('order', 'base_discount_canceled', ['type' => 'static']); -$installer->addAttribute('order', 'base_discount_invoiced', ['type' => 'static']); - -$sql = " - SELECT `e_int`.`value` AS `order_id`, - SUM(e_decimal.value) AS `order_discount`, - SUM(e_decimal_base.value) AS `order_base_discount` - FROM `%s` AS `e_int` - INNER JOIN `%s` AS `e_decimal` - ON e_int.entity_id=e_decimal.entity_id AND e_decimal.attribute_id='%d' - INNER JOIN `%s` AS `e_decimal_base` - ON e_int.entity_id=e_decimal_base.entity_id AND e_decimal_base.attribute_id='%d' - WHERE e_int.entity_type_id='%d' AND e_int.attribute_id='%d' - GROUP BY `e_int`.`value` -"; - -$ordersEntity = $installer->getEntityType('order'); -// hardcoding `sales_order` due to change in config.xml for 'sales/order' from `sales_order` to `sales_flat_order` -$ordersEntity['entity_table'] = 'sales_order'; -$ordersTable = $installer->getTable($ordersEntity['entity_table']); - -// Update discount_refunded (base_discount_refunded) -$entityTypeId = $installer->getEntityTypeId('creditmemo'); -$orderAttributeId = $installer->getAttributeId($entityTypeId, 'order_id'); -$orderAttributeTable = $installer->getAttributeTable($entityTypeId, 'order_id'); -$discountAttributeId = $installer->getAttributeId($entityTypeId, 'discount_amount'); -$discountAttributeTable = $installer->getAttributeTable($entityTypeId, 'discount_amount'); -$baseDiscountAttributeId = $installer->getAttributeId($entityTypeId, 'base_discount_amount'); -$baseDiscountAttributeTable = $installer->getAttributeTable($entityTypeId, 'base_discount_amount'); - -$temporaryTableName = 'sales_sql_update' . crc32(uniqid('sales')); - -$preparedSql = 'CREATE TEMPORARY TABLE ' . $installer->getConnection()->quoteIdentifier($temporaryTableName) . ' ' . sprintf( - $sql, - $orderAttributeTable, - $discountAttributeTable, - $discountAttributeId, - $baseDiscountAttributeTable, - $baseDiscountAttributeId, - $entityTypeId, - $orderAttributeId, -); - -$installer->getConnection()->query($preparedSql); -$select = $installer->getConnection()->select(); -$select->join( - ['to_update' => $temporaryTableName], - 'to_update.order_id = main_table.entity_id', - [ - 'discount_refunded' => 'order_discount', - 'base_discount_refunded' => 'order_base_discount', - ], -); - -$installer->getConnection()->query( - $select->crossUpdateFromSelect(['main_table' => $ordersTable]), -); - -$installer->getConnection()->query( - 'DROP TEMPORARY TABLE ' . $installer->getConnection()->quoteIdentifier($temporaryTableName), -); - -// Update discount_invoiced (base_discount_invoiced) -$entityTypeId = $installer->getEntityTypeId('invoice'); -$orderAttributeId = $installer->getAttributeId($entityTypeId, 'order_id'); -$orderAttributeTable = $installer->getAttributeTable($entityTypeId, 'order_id'); -$discountAttributeId = $installer->getAttributeId($entityTypeId, 'discount_amount'); -$discountAttributeTable = $installer->getAttributeTable($entityTypeId, 'discount_amount'); -$baseDiscountAttributeId = $installer->getAttributeId($entityTypeId, 'base_discount_amount'); -$baseDiscountAttributeTable = $installer->getAttributeTable($entityTypeId, 'base_discount_amount'); - -$preparedSql = 'CREATE TEMPORARY TABLE ' . $installer->getConnection()->quoteIdentifier($temporaryTableName) . ' ' . sprintf( - $sql, - $orderAttributeTable, - $discountAttributeTable, - $discountAttributeId, - $baseDiscountAttributeTable, - $baseDiscountAttributeId, - $entityTypeId, - $orderAttributeId, -); - -$installer->getConnection()->query($preparedSql); -$select = $installer->getConnection()->select(); -$select->join( - ['to_update' => $temporaryTableName], - 'to_update.order_id = main_table.entity_id', - [ - 'discount_invoiced' => 'order_discount', - 'base_discount_invoiced' => 'order_base_discount', - ], -); - -$installer->getConnection()->query( - $select->crossUpdateFromSelect(['main_table' => $ordersTable]), -); - -$installer->getConnection()->query( - 'DROP TEMPORARY TABLE ' . $installer->getConnection()->quoteIdentifier($temporaryTableName), -); - -// Update discount_canceled (base_discount_canceled) -$statusAttributeId = $installer->getAttributeId($ordersEntity['entity_type_id'], 'status'); -// hardcoding `sales_order_varchar` due to change in config.xml for 'sales/order' from `sales_order` to `sales_flat_order` -$statusAttributeTable = $installer->getTable($ordersTable . '_varchar'); - -$select = $installer->getConnection()->select(); -$select->from( - ['s' => $statusAttributeTable], - ['order_id' => 's.entity_id'], -) - ->where('s.attribute_id=?', $statusAttributeId) - ->where('s.value=?', Mage_Sales_Model_Order::STATE_CANCELED); - -$installer->run(" - UPDATE `{$ordersTable}` SET - `discount_canceled`=`discount_amount`-`discount_invoiced`, - `base_discount_canceled`=`base_discount_amount`-`base_discount_invoiced` - WHERE `entity_id` IN({$select->assemble()}); -"); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.29-0.9.30.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.29-0.9.30.php deleted file mode 100644 index 97d4c197535..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.29-0.9.30.php +++ /dev/null @@ -1,70 +0,0 @@ -getTable('sales_order'); -$tableOrderEntity = $this->getTable('sales_order_entity'); - -$cleanTables = [ - $tableOrder . '_datetime', - $tableOrder . '_decimal', - $tableOrder . '_int', - $tableOrder . '_text', - $tableOrder . '_varchar', - $tableOrderEntity . '_decimal', - $tableOrderEntity . '_datetime', - $tableOrderEntity . '_int', - $tableOrderEntity . '_text', - $tableOrderEntity . '_varchar', -]; -foreach ($cleanTables as $tableName) { - $select = $installer->getConnection()->select() - ->from($tableName, [ - 'entity_id' => 'entity_id', - 'attribute_id' => 'attribute_id', - 'entity_type_id' => 'entity_type_id', - 'rows_count' => 'COUNT(*)']) - ->group(['entity_id', 'attribute_id', 'entity_type_id']) - ->having('rows_count > 1'); - $query = $installer->getConnection()->query($select); - - while ($row = $query->fetch()) { - $sql = 'DELETE FROM `' . $tableName . '`' - . ' WHERE entity_id=? AND attribute_id=? AND entity_type_id=?' - . ' LIMIT ' . ($row['rows_count'] - 1); - $installer->getConnection()->query($sql, [ - $row['entity_id'], - $row['attribute_id'], - $row['entity_type_id'], - ]); - } -} - -$installer->getConnection()->addKey("{$tableOrder}_datetime", 'UNQ_ENTITY_ATTRIBUTE_TYPE', ['entity_id', 'attribute_id', 'entity_type_id'], 'unique'); -$installer->getConnection()->addKey("{$tableOrder}_decimal", 'UNQ_ENTITY_ATTRIBUTE_TYPE', ['entity_id', 'attribute_id', 'entity_type_id'], 'unique'); -$installer->getConnection()->addKey("{$tableOrder}_int", 'UNQ_ENTITY_ATTRIBUTE_TYPE', ['entity_id', 'attribute_id', 'entity_type_id'], 'unique'); -$installer->getConnection()->addKey("{$tableOrder}_text", 'UNQ_ENTITY_ATTRIBUTE_TYPE', ['entity_id', 'attribute_id', 'entity_type_id'], 'unique'); -$installer->getConnection()->addKey("{$tableOrder}_varchar", 'UNQ_ENTITY_ATTRIBUTE_TYPE', ['entity_id', 'attribute_id', 'entity_type_id'], 'unique'); - -$installer->getConnection()->addKey("{$tableOrderEntity}_datetime", 'UNQ_ENTITY_ATTRIBUTE_TYPE', ['entity_id', 'attribute_id', 'entity_type_id'], 'unique'); -$installer->getConnection()->addKey("{$tableOrderEntity}_decimal", 'UNQ_ENTITY_ATTRIBUTE_TYPE', ['entity_id', 'attribute_id', 'entity_type_id'], 'unique'); -$installer->getConnection()->addKey("{$tableOrderEntity}_int", 'UNQ_ENTITY_ATTRIBUTE_TYPE', ['entity_id', 'attribute_id', 'entity_type_id'], 'unique'); -$installer->getConnection()->addKey("{$tableOrderEntity}_text", 'UNQ_ENTITY_ATTRIBUTE_TYPE', ['entity_id', 'attribute_id', 'entity_type_id'], 'unique'); -$installer->getConnection()->addKey("{$tableOrderEntity}_varchar", 'UNQ_ENTITY_ATTRIBUTE_TYPE', ['entity_id', 'attribute_id', 'entity_type_id'], 'unique'); - -$installer->getConnection()->addKey($tableOrderEntity, 'IDX_SALES_ORDER_ENTITY_PARENT', 'parent_id'); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.3-0.9.4.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.3-0.9.4.php deleted file mode 100644 index 58312b93900..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.3-0.9.4.php +++ /dev/null @@ -1,159 +0,0 @@ -run(" -CREATE TABLE `{$installer->getTable('sales_flat_order_item')}` ( - `item_id` int(10) unsigned NOT NULL auto_increment, - `order_id` int(10) unsigned NOT NULL default '0', - `parent_item_id` int(10) unsigned default NULL, - `quote_item_id` int(10) unsigned default NULL, - `created_at` datetime NOT NULL default '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', - - `product_id` int(10) unsigned default NULL, - `product_type` varchar(255) default NULL, - `product_options` text default NULL, - `weight` decimal(12,4) default '0.0000', - `is_virtual` tinyint(1) unsigned default NULL, - `sku` varchar(255) NOT NULL default '', - `name` varchar(255) default NULL, - `description` text, - `applied_rule_ids` text, - `additional_data` text, - - `free_shipping` tinyint(1) unsigned NOT NULL default '0', - `is_qty_decimal` tinyint(1) unsigned default NULL, - `no_discount` tinyint(1) unsigned default '0', - - `qty_backordered` decimal(12,4) default '0.0000', - `qty_canceled` decimal(12,4) default '0.0000', - `qty_invoiced` decimal(12,4) default '0.0000', - `qty_ordered` decimal(12,4) default '0.0000', - `qty_refunded` decimal(12,4) default '0.0000', - `qty_shipped` decimal(12,4) default '0.0000', - - `cost` decimal(12,4) default '0.0000', - `price` decimal(12,4) NOT NULL default '0.0000', - `base_price` decimal(12,4) NOT NULL default '0.0000', - `original_price` decimal(12,4) default NULL, - `base_original_price` decimal(12,4) default NULL, - - `tax_percent` decimal(12,4) default '0.0000', - `tax_amount` decimal(12,4) default '0.0000', - `base_tax_amount` decimal(12,4) default '0.0000', - `tax_invoiced` decimal(12,4) default '0.0000', - `base_tax_invoiced` decimal(12,4) default '0.0000', - - `discount_percent` decimal(12,4) default '0.0000', - `discount_amount` decimal(12,4) default '0.0000', - `base_discount_amount` decimal(12,4) default '0.0000', - `discount_invoiced` decimal(12,4) default '0.0000', - `base_discount_invoiced` decimal(12,4) default '0.0000', - - `amount_refunded` decimal(12,4) default '0.0000', - `base_amount_refunded` decimal(12,4) default '0.0000', - - `row_total` decimal(12,4) NOT NULL default '0.0000', - `base_row_total` decimal(12,4) NOT NULL default '0.0000', - `row_invoiced` decimal(12,4) NOT NULL default '0.0000', - `base_row_invoiced` decimal(12,4) NOT NULL default '0.0000', - - `row_weight` decimal(12,4) default '0.0000', - - `gift_message_id` int(10) default NULL, - `gift_message_available` int(10) default NULL, - - PRIMARY KEY (`item_id`), - KEY `IDX_ORDER` (`order_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$itemFields = $installer->getConnection()->describeTable($installer->getTable('sales_flat_order_item')); -$itemEntityId = $installer->getEntityTypeId('order_item'); - -$itemAttributes = $installer->getConnection()->fetchPairs("SELECT attribute_id, attribute_code FROM {$installer->getTable('eav_attribute')} WHERE entity_type_id={$itemEntityId}"); - -$items = $installer->getConnection()->fetchAll("SELECT * FROM {$installer->getTable('sales_order_entity')} WHERE entity_type_id={$itemEntityId}"); - -foreach ($items as $itemData) { - $itemId = $itemData['entity_id']; - $sql = " - SELECT - attribute_id, value - FROM {$installer->getTable('sales_order_entity_decimal')} - WHERE - entity_id={$itemId} - AND entity_type_id={$itemEntityId} - - UNION - SELECT - attribute_id, value - FROM {$installer->getTable('sales_order_entity_datetime')} - WHERE - entity_id={$itemId} - AND entity_type_id={$itemEntityId} - - UNION - - SELECT - attribute_id, value - FROM {$installer->getTable('sales_order_entity_int')} - WHERE - entity_id={$itemId} - AND entity_type_id={$itemEntityId} - - UNION - - SELECT - attribute_id, value - FROM {$installer->getTable('sales_order_entity_text')} - WHERE - entity_id={$itemId} - AND entity_type_id={$itemEntityId} - - UNION - - SELECT - attribute_id, value - FROM {$installer->getTable('sales_order_entity_varchar')} - WHERE - entity_id={$itemId} - AND entity_type_id={$itemEntityId} - "; - - $data = $installer->getConnection()->fetchPairs($sql); - foreach ($data as $attributeId => $attributeValue) { - if (isset($itemAttributes[$attributeId])) { - $itemData[$itemAttributes[$attributeId]] = $attributeValue; - } - } - - $newItemData = [ - 'item_id' => $itemData['entity_id'], - 'order_id' => $itemData['parent_id'], - ]; - - foreach ($itemData as $key => $value) { - if (isset($itemFields[$key])) { - $newItemData[$key] = $value; - } - } - - $installer->getConnection()->insert($installer->getTable('sales_flat_order_item'), $newItemData); -} diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.30-0.9.31.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.30-0.9.31.php deleted file mode 100644 index 8aa0d8e5f1b..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.30-0.9.31.php +++ /dev/null @@ -1,31 +0,0 @@ -getConnection()->modifyColumn($installer->getTable('sales/quote_item'), 'base_tax_before_discount', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote_item'), 'tax_before_discount', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/order_item'), 'base_tax_before_discount', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/order_item'), 'tax_before_discount', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote_item'), 'original_custom_price', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote'), 'subtotal', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote'), 'base_subtotal', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote'), 'subtotal_with_discount', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote'), 'base_subtotal_with_discount', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote'), 'is_changed', 'int(10) unsigned'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote'), 'base_to_global_rate', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote'), 'base_to_quote_rate', 'decimal(12,4)'); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.31-0.9.32.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.31-0.9.32.php deleted file mode 100644 index 68c68a4c247..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.31-0.9.32.php +++ /dev/null @@ -1,20 +0,0 @@ -getConnection()->modifyColumn($installer->getTable('sales/quote'), 'global_currency_code', 'varchar(255)'); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.32-0.9.33.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.32-0.9.33.php deleted file mode 100644 index c4a1f5bb922..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.32-0.9.33.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->addAttribute('order', 'ext_order_item_id', ['type' => 'varchar']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.33-0.9.34.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.33-0.9.34.php deleted file mode 100644 index c3168e76ffe..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.33-0.9.34.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->addAttribute('quote', 'ext_shipping_info', ['type' => 'text']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.34-0.9.35.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.34-0.9.35.php deleted file mode 100644 index e75ac1977db..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.34-0.9.35.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->removeAttribute('order', 'ext_order_item_id'); -$installer->addAttribute('order_item', 'ext_order_item_id', ['type' => 'varchar']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.35-0.9.36.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.35-0.9.36.php deleted file mode 100644 index f548f9d3a22..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.35-0.9.36.php +++ /dev/null @@ -1,15 +0,0 @@ -startSetup(); - -$installer->addAttribute('order_item', 'locked_do_invoice', ['type' => 'int', 'default' => 0]); -$installer->addAttribute('order_item', 'locked_do_ship', ['type' => 'int', 'default' => 0]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.37-0.9.38.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.37-0.9.38.php deleted file mode 100644 index 9b05a3f2863..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.37-0.9.38.php +++ /dev/null @@ -1,39 +0,0 @@ -startSetup(); - -$installer->run(" -UPDATE `{$installer->getTable('sales_order')}` AS `s` - LEFT JOIN `{$installer->getTable('customer_entity')}` AS `c` - ON `s`.`customer_id`=`c`.`entity_id` - SET `s`.`customer_id`=NULL -WHERE `c`.`entity_id` IS NULL; -"); -$installer->getConnection()->modifyColumn($installer->getTable('sales_order'), 'customer_id', 'INT UNSIGNED NULL DEFAULT NULL'); -$installer->getConnection()->addConstraint( - 'FK_SALES_ORDER_CUSTOMER', - $installer->getTable('sales_order'), - 'customer_id', - $installer->getTable('customer_entity'), - 'entity_id', - 'set null', - 'cascade', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.38-0.9.39.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.38-0.9.39.php deleted file mode 100644 index 9451e3e2ca7..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.38-0.9.39.php +++ /dev/null @@ -1,53 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('sales_flat_quote_item'), - 'store_id', - 'smallint(5) unsigned default null AFTER `product_id`', -); -$installer->getConnection()->addConstraint( - 'FK_SALES_QUOTE_ITEM_STORE', - $installer->getTable('sales_flat_quote_item'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'set null', - 'cascade', -); -$installer->getConnection()->addColumn( - $installer->getTable('sales_flat_order_item'), - 'store_id', - 'smallint(5) unsigned default null AFTER `quote_item_id`', -); -$installer->getConnection()->addConstraint( - 'FK_SALES_ORDER_ITEM_STORE', - $installer->getTable('sales_flat_order_item'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'set null', - 'cascade', -); -$installer->addAttribute('quote_item', 'redirect_url', [ - 'type' => 'varchar', -]); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.39-0.9.40.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.39-0.9.40.php deleted file mode 100644 index 3d7956d30a3..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.39-0.9.40.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$this->removeAttribute('order', 'giftcert_code'); -$this->removeAttribute('order', 'giftcert_amount'); -$this->removeAttribute('order', 'base_giftcert_amount'); -$this->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.4-0.9.5.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.4-0.9.5.php deleted file mode 100644 index ff0cd7996e1..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.4-0.9.5.php +++ /dev/null @@ -1,31 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropColumn($installer->getTable('sales_flat_quote_item'), 'super_product_id'); -$installer->getConnection()->changeColumn($installer->getTable('sales_flat_quote_item'), 'parent_product_id', 'parent_item_id', 'INTEGER UNSIGNED DEFAULT NULL'); -$installer->getConnection()->addConstraint( - 'FK_SALES_FLAT_QUOTE_ITEM_PARENT_ITEM', - $installer->getTable('sales_flat_quote_item'), - 'parent_item_id', - $installer->getTable('sales_flat_quote_item'), - 'item_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.40-0.9.41.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.40-0.9.41.php deleted file mode 100644 index 844b44f97dd..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.40-0.9.41.php +++ /dev/null @@ -1,47 +0,0 @@ -startSetup(); - -$installer->addAttribute('quote_item', 'base_cost', [ - 'type' => 'decimal', - 'label' => 'Cost', - 'visible' => false, - 'required' => false, -]); - -$installer->addAttribute('quote_address_item', 'base_cost', [ - 'type' => 'decimal', - 'label' => 'Cost', - 'visible' => false, - 'required' => false, -]); - -$installer->getConnection()->changeColumn($installer->getTable('sales_flat_order_item'), 'cost', 'base_cost', 'DECIMAL( 12, 4 ) NULL DEFAULT \'0.0000\''); - -$installer->getConnection()->addColumn($installer->getTable('sales_order'), 'base_total_invoiced_cost', 'DECIMAL( 12, 4 ) NULL DEFAULT NULL'); - -$installer->addAttribute('order', 'base_total_invoiced_cost', [ - 'type' => 'static', -]); - -$installer->updateAttribute('order_item', 'cost', ['attribute_code' => 'base_cost']); -$installer->updateAttribute('invoice_item', 'cost', ['attribute_code' => 'base_cost']); -$installer->updateAttribute('creditmemo_item', 'cost', ['attribute_code' => 'base_cost']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.41-0.9.42.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.41-0.9.42.php deleted file mode 100644 index adf7772e646..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.41-0.9.42.php +++ /dev/null @@ -1,19 +0,0 @@ -startSetup(); -$this->addAttribute('order', 'x_forwarded_for', ['type' => 'varchar']); -$this->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.42-0.9.43.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.42-0.9.43.php deleted file mode 100644 index 640517e1b5c..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.42-0.9.43.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$orderAddressEntityTypeId = 'order_address'; -$attributeLabels = [ - 'firstname' => 'First Name', - 'lastname' => 'Last Name', - 'company' => 'Company', - 'street' => 'Street Address', - 'city' => 'City', - 'region_id' => 'State/Province', - 'postcode' => 'Zip/Postal Code', - 'country_id' => 'Country', - 'telephone' => 'Telephone', - 'email' => 'Email', -]; - -foreach ($attributeLabels as $attributeCode => $attributeLabel) { - $this->updateAttribute($orderAddressEntityTypeId, $attributeCode, 'frontend_label', $attributeLabel); -} - -$this->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.43-0.9.44.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.43-0.9.44.php deleted file mode 100644 index fd4e096aa6f..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.43-0.9.44.php +++ /dev/null @@ -1,24 +0,0 @@ -getConnection()->addColumn($installer->getTable('sales_order'), 'protect_code', 'VARCHAR( 6 ) NULL DEFAULT NULL'); - -$installer->addAttribute('order', 'protect_code', ['type' => 'static']); - -$installer->run("UPDATE `{$installer->getTable('sales_order')}` SET protect_code = SUBSTRING(MD5(CONCAT(RAND(), DATE_FORMAT(NOW(), '%H %k %I %r %T %S'), RAND())), 5, 6) WHERE protect_code IS NULL"); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.44-0.9.45.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.44-0.9.45.php deleted file mode 100644 index 9f47aad827d..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.44-0.9.45.php +++ /dev/null @@ -1,64 +0,0 @@ -getEntityType('order'); -$orderEntityTypeId = $orderEntityType['entity_type_id']; - -$attributes = [ - $installer->getAttribute($orderEntityTypeId, 'store_to_base_rate'), - $installer->getAttribute($orderEntityTypeId, 'store_to_order_rate'), - $installer->getAttribute($orderEntityTypeId, 'base_to_global_rate'), - $installer->getAttribute($orderEntityTypeId, 'base_to_order_rate'), -]; - -foreach ($attributes as $attribute) { - $installer->getConnection()->addColumn($this->getTable('sales_order'), $attribute['attribute_code'], 'decimal(12,4) NULL'); -} - -try { - $installer->getConnection()->beginTransaction(); - - foreach ($attributes as $attribute) { - $installer->run(" - UPDATE {$this->getTable('sales_order')} AS o, {$this->getTable('sales_order')}_{$attribute['backend_type']} AS od - SET o.{$attribute['attribute_code']} = od.value - WHERE od.entity_id = o.entity_id - AND od.attribute_id = {$attribute['attribute_id']} - AND od.entity_type_id = {$orderEntityTypeId} - "); - - $installer->run(" - DELETE FROM {$this->getTable('sales_order')}_{$attribute['backend_type']} - WHERE attribute_id = {$attribute['attribute_id']} - AND entity_type_id = {$orderEntityTypeId} - "); - } - - foreach ($attributes as $attribute) { - $installer->updateAttribute($orderEntityTypeId, $attribute['attribute_code'], ['backend_type' => 'static']); - } - - $installer->getConnection()->commit(); -} catch (Exception $e) { - $installer->getConnection()->rollBack(); - foreach ($attributes as $attribute) { - $installer->getConnection()->dropColumn($this->getTable('sales_order'), $attribute['attribute_code']); - } - throw $e; -} diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.45-0.9.46.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.45-0.9.46.php deleted file mode 100644 index 47a8e87b3ba..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.45-0.9.46.php +++ /dev/null @@ -1,97 +0,0 @@ -startSetup(); - -$orderEntityType = $installer->getEntityType('order'); -$orderEntityTypeId = $orderEntityType['entity_type_id']; - -$attributesToModify = [ - $installer->getAttribute($orderEntityTypeId, 'store_to_base_rate'), - $installer->getAttribute($orderEntityTypeId, 'store_to_order_rate'), - $installer->getAttribute($orderEntityTypeId, 'base_to_global_rate'), - $installer->getAttribute($orderEntityTypeId, 'base_to_order_rate'), -]; - -$attributesToMove = [ - $installer->getAttribute($orderEntityTypeId, 'status'), - $installer->getAttribute($orderEntityTypeId, 'state'), -]; - -// modify existing attributes in sales/order table -foreach ($attributesToModify as $attribute) { - $installer->getConnection()->modifyColumn($this->getTable('sales_order'), $attribute['attribute_code'], "decimal(12,4) NOT NULL DEFAULT '0'"); -} - -foreach ($attributesToMove as $attribute) { - $installer->getConnection()->addColumn($this->getTable('sales_order'), $attribute['attribute_code'], 'varchar(50) NULL'); -} - -foreach ($attributesToMove as $attribute) { - $installer->run(" - UPDATE {$this->getTable('sales_order')} AS o, {$this->getTable('sales_order')}_{$attribute['backend_type']} AS od - SET o.{$attribute['attribute_code']} = od.value - WHERE od.entity_id = o.entity_id - AND od.attribute_id = {$attribute['attribute_id']} - AND od.entity_type_id = {$orderEntityTypeId} - "); - - $installer->run(" - DELETE FROM {$this->getTable('sales_order')}_{$attribute['backend_type']} - WHERE attribute_id = {$attribute['attribute_id']} - AND entity_type_id = {$orderEntityTypeId} - "); -} - -foreach ($attributesToMove as $attribute) { - $installer->updateAttribute($orderEntityTypeId, $attribute['attribute_code'], ['backend_type' => 'static']); -} - -$installer->run(" - CREATE TABLE IF NOT EXISTS `{$installer->getTable('sales/order_aggregated_created')}` - ( - `id` int(11) unsigned NOT NULL auto_increment, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned NULL DEFAULT NULL, - `order_status` varchar(50) NOT NULL default '', - `orders_count` int(11) NOT NULL DEFAULT '0', - `total_qty_ordered` decimal(12,4) NOT NULL DEFAULT '0', - `base_profit_amount` decimal(12,4) NOT NULL DEFAULT '0', - `base_subtotal_amount` decimal(12,4) NOT NULL DEFAULT '0', - `base_tax_amount` decimal(12,4) NOT NULL DEFAULT '0', - `base_shipping_amount` decimal(12,4) NOT NULL DEFAULT '0', - `base_discount_amount` decimal(12,4) NOT NULL DEFAULT '0', - `base_grand_total_amount` decimal(12,4) NOT NULL DEFAULT '0', - `base_invoiced_amount` decimal(12,4) NOT NULL DEFAULT '0', - `base_refunded_amount` decimal(12,4) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`, `order_status`), - KEY `IDX_STORE_ID` (`store_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->getConnection()->addConstraint( - 'SALES_ORDER_AGGREGATED_CREATED', - $installer->getTable('sales/order_aggregated_created'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'SET NULL', -); - -$this->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php deleted file mode 100644 index c03343df419..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php +++ /dev/null @@ -1,112 +0,0 @@ -startSetup(); - -$orderEntityType = $installer->getEntityType('order'); -$orderEntityTypeId = $orderEntityType['entity_type_id']; - -$attributes = [ - $installer->getAttribute($orderEntityTypeId, 'is_virtual'), - $installer->getAttribute($orderEntityTypeId, 'shipping_description'), -]; - -$installer->getConnection()->addColumn($this->getTable('sales_order'), $attributes[0]['attribute_code'], 'tinyint(1) UNSIGNED NOT NULL DEFAULT 0'); -$installer->getConnection()->addColumn($this->getTable('sales_order'), $attributes[1]['attribute_code'], "varchar(255) NOT NULL DEFAULT ''"); - -try { - $installer->getConnection()->beginTransaction(); - - foreach ($attributes as $attribute) { - $installer->run(" - UPDATE {$this->getTable('sales_order')} AS o, {$this->getTable('sales_order')}_{$attribute['backend_type']} AS od - SET o.{$attribute['attribute_code']} = od.value - WHERE od.entity_id = o.entity_id - AND od.attribute_id = {$attribute['attribute_id']} - AND od.entity_type_id = {$orderEntityTypeId} - "); - - $installer->run(" - DELETE FROM {$this->getTable('sales_order')}_{$attribute['backend_type']} - WHERE attribute_id = {$attribute['attribute_id']} - AND entity_type_id = {$orderEntityTypeId} - "); - } - - foreach ($attributes as $attribute) { - $installer->updateAttribute($orderEntityTypeId, $attribute['attribute_code'], ['backend_type' => 'static']); - } - - $installer->getConnection()->commit(); -} catch (Exception $e) { - $installer->getConnection()->rollBack(); - foreach ($attributes as $attribute) { - $installer->getConnection()->dropColumn($this->getTable('sales_order'), $attribute['attribute_code']); - } - throw $e; -} - -$installer->run(" - CREATE TABLE `{$installer->getTable('sales/shipping_aggregated')}` - ( - `id` int(11) unsigned NOT NULL auto_increment, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned NULL DEFAULT NULL, - `order_status` varchar(50) NOT NULL default '', - `shipping_description` varchar(255) NOT NULL default '', - `orders_count` int(11) NOT NULL DEFAULT '0', - `total_shipping` decimal(12,4) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`, `order_status`, `shipping_description`), - KEY `IDX_STORE_ID` (`store_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - CREATE TABLE `{$installer->getTable('sales/shipping_aggregated_order')}` - ( - `id` int(11) unsigned NOT NULL auto_increment, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned NULL DEFAULT NULL, - `order_status` varchar(50) NOT NULL default '', - `shipping_description` varchar(255) NOT NULL default '', - `orders_count` int(11) NOT NULL DEFAULT '0', - `total_shipping` decimal(12,4) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`, `order_status`, `shipping_description`), - KEY `IDX_STORE_ID` (`store_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->getConnection()->addConstraint( - 'SALES_SHIPPING_AGGREGATED_STORE', - $installer->getTable('sales/shipping_aggregated'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'SET NULL', -); - -$installer->getConnection()->addConstraint( - 'SALES_SHIPPING_AGGREGATED_ORDER_STORE', - $installer->getTable('sales/shipping_aggregated_order'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'SET NULL', -); - -$this->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.47-0.9.48.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.47-0.9.48.php deleted file mode 100644 index d6ac9acf515..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.47-0.9.48.php +++ /dev/null @@ -1,73 +0,0 @@ -startSetup(); - -$installer->run(" - CREATE TABLE `{$installer->getTable('sales/invoiced_aggregated')}` - ( - `id` int(11) unsigned NOT NULL auto_increment, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned NULL DEFAULT NULL, - `order_status` varchar(50) NOT NULL default '', - `orders_count` int(11) NOT NULL DEFAULT '0', - `orders_invoiced` decimal(12,4) NOT NULL DEFAULT '0', - `invoiced` decimal(12,4) NOT NULL DEFAULT '0', - `invoiced_captured` decimal(12,4) NOT NULL DEFAULT '0', - `invoiced_not_captured` decimal(12,4) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`, `order_status`), - KEY `IDX_STORE_ID` (`store_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - CREATE TABLE `{$installer->getTable('sales/invoiced_aggregated_order')}` - ( - `id` int(11) unsigned NOT NULL auto_increment, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned NULL DEFAULT NULL, - `order_status` varchar(50) NOT NULL default '', - `orders_count` int(11) NOT NULL DEFAULT '0', - `orders_invoiced` decimal(12,4) NOT NULL DEFAULT '0', - `invoiced` decimal(12,4) NOT NULL DEFAULT '0', - `invoiced_captured` decimal(12,4) NOT NULL DEFAULT '0', - `invoiced_not_captured` decimal(12,4) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`, `order_status`), - KEY `IDX_STORE_ID` (`store_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->getConnection()->addConstraint( - 'SALES_INVOICED_AGGREGATED_STORE', - $installer->getTable('sales/invoiced_aggregated'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'SET NULL', -); - -$installer->getConnection()->addConstraint( - 'SALES_INVOICED_AGGREGATED_ORDER_STORE', - $installer->getTable('sales/invoiced_aggregated_order'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'SET NULL', -); - -$this->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.48-0.9.49.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.48-0.9.49.php deleted file mode 100644 index 6d4b4952e6f..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.48-0.9.49.php +++ /dev/null @@ -1,69 +0,0 @@ -startSetup(); - -$installer->run(" - CREATE TABLE `{$installer->getTable('sales/refunded_aggregated')}` ( - `id` int(11) unsigned NOT NULL auto_increment, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned NULL DEFAULT NULL, - `order_status` varchar(50) NOT NULL default '', - `orders_count` int(11) NOT NULL DEFAULT '0', - `refunded` decimal(12,4) NOT NULL DEFAULT '0', - `online_refunded` decimal(12,4) NOT NULL DEFAULT '0', - `offline_refunded` decimal(12,4) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`, `order_status`), - KEY `IDX_STORE_ID` (`store_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - CREATE TABLE `{$installer->getTable('sales/refunded_aggregated_order')}` ( - `id` int(11) unsigned NOT NULL auto_increment, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned NULL DEFAULT NULL, - `order_status` varchar(50) NOT NULL default '', - `orders_count` int(11) NOT NULL DEFAULT '0', - `refunded` decimal(12,4) NOT NULL DEFAULT '0', - `online_refunded` decimal(12,4) NOT NULL DEFAULT '0', - `offline_refunded` decimal(12,4) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`, `order_status`), - KEY `IDX_STORE_ID` (`store_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->getConnection()->addConstraint( - 'SALES_REFUNDED_AGGREGATED_STORE', - $installer->getTable('sales/refunded_aggregated'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'SET NULL', -); - -$installer->getConnection()->addConstraint( - 'SALES_REFUNDED_AGGREGATED_ORDER_STORE', - $installer->getTable('sales/refunded_aggregated_order'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'SET NULL', -); - -$this->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.49-0.9.50.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.49-0.9.50.php deleted file mode 100644 index 9da83782965..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.49-0.9.50.php +++ /dev/null @@ -1,64 +0,0 @@ -getTable('sales/payment_transaction'); -$tableOrders = $this->getTable('sales_order'); -$tableOrderPayment = $this->getTable('sales_order_entity'); - -$installer->run(" -CREATE TABLE `{$tablePaymentTransaction}` ( - `transaction_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `parent_id` int(10) unsigned DEFAULT NULL, - `order_id` int(10) unsigned NOT NULL DEFAULT '0', - `payment_id` int(10) unsigned NOT NULL DEFAULT '0', - `txn_id` varchar(100) NOT NULL DEFAULT '', - `parent_txn_id` varchar(100) DEFAULT NULL, - `txn_type` varchar(15) NOT NULL DEFAULT '', - `is_closed` tinyint(1) unsigned NOT NULL DEFAULT '1', - `additional_information` blob, - PRIMARY KEY (`transaction_id`), - UNIQUE KEY `UNQ_ORDER_PAYMENT_TXN` (`order_id`,`payment_id`,`txn_id`), - KEY `IDX_ORDER_ID` (`order_id`), - KEY `IDX_PARENT_ID` (`parent_id`), - KEY `IDX_PAYMENT_ID` (`payment_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - -$installer->getConnection()->addConstraint( - 'SALES_PAYMENT_TRANSACTION_PARENT', - $tablePaymentTransaction, - 'parent_id', - $tablePaymentTransaction, - 'transaction_id', -); - -$installer->getConnection()->addConstraint( - 'SALES_PAYMENT_TRANSACTION_ORDER', - $tablePaymentTransaction, - 'order_id', - $tableOrders, - 'entity_id', -); - -$installer->getConnection()->addConstraint( - 'SALES_PAYMENT_TRANSACTION_PAYMENT', - $tablePaymentTransaction, - 'payment_id', - $tableOrderPayment, - 'entity_id', -); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.5-0.9.6.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.5-0.9.6.php deleted file mode 100644 index 4d361c00e1e..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.5-0.9.6.php +++ /dev/null @@ -1,32 +0,0 @@ -run(" -ALTER TABLE `{$installer->getTable('sales_flat_quote_address_item')}` - ADD COLUMN `parent_item_id` INTEGER UNSIGNED AFTER `address_item_id`, - ADD KEY `IDX_PARENT_ITEM_ID` (`parent_item_id`); -"); - -$installer->getConnection()->addConstraint( - 'SALES_FLAT_QUOTE_ADDRESS_ITEM_PARENT', - $installer->getTable('sales_flat_quote_address_item'), - 'parent_item_id', - $installer->getTable('sales_flat_quote_address_item'), - 'address_item_id', -); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php deleted file mode 100644 index ba8a5c154ee..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php +++ /dev/null @@ -1,127 +0,0 @@ -startSetup(); - -$installer->addAttribute('order_payment', 'additional_information', ['type' => 'text']); -$installer->addAttribute('quote_payment', 'additional_information', ['type' => 'text']); - -$processingItemsCountForOneIteration = 1000; - -$connection = $installer->getConnection(); - -$paymentMethods = [ - 'paypal_standard', - 'paypal_express', - 'paypal_direct', - 'paypaluk_direct', - 'paypaluk_express', -]; -$entityTypeCode = 'order_payment'; -$attributesIds = [ - 'method' => false, - 'additional_data' => false, - 'additional_information' => false, -]; - -/* get order_payment entity type code*/ -$entityTypeId = $connection->fetchOne(" - SELECT entity_type_id - FROM {$this->getTable('eav_entity_type')} - WHERE entity_type_code = '{$entityTypeCode}'; -"); - -/* get order_payment attribute codes*/ -foreach (array_keys($attributesIds) as $attributeCode) { - $attributesIds[$attributeCode] = $connection->fetchOne(" - SELECT attribute_id - FROM {$this->getTable('eav_attribute')} - WHERE attribute_code = '{$attributeCode}' and entity_type_id = {$entityTypeId}; - "); -} - -/* get count of paypal order payments*/ -$methodIds = "'" . implode("','", $paymentMethods) . "'"; -$paymentsCount = $connection->fetchOne(" - SELECT count(entity_id) as count - FROM {$this->getTable('sales_order_entity_varchar')} - WHERE attribute_id = {$attributesIds['method']} and value in ({$methodIds}); -"); - -$connection->beginTransaction(); -try { - /* process payment attributes*/ - for ($i = 0; $i <= $paymentsCount; $i += $processingItemsCountForOneIteration) { - /* get payment ids for current iteration*/ - $currentPaymentIds = $installer->getConnection()->fetchCol(" - SELECT entity_id - FROM {$this->getTable('sales_order_entity_varchar')} - WHERE attribute_id = {$attributesIds['method']} and value in ({$methodIds}) - LIMIT {$i}, {$processingItemsCountForOneIteration}; - "); - - if (!count($currentPaymentIds)) { - continue; - } - - $currentPaymentIdsCondition = implode(',', $currentPaymentIds); - - /* get data for current payment ids*/ - $data = $installer->getConnection()->fetchAll(" - SELECT - e.entity_id, - ev_additional_data.value as additional_data - FROM {$this->getTable('sales_order_entity')} as e - LEFT JOIN {$this->getTable('sales_order_entity_text')} as ev_additional_data on (ev_additional_data.entity_id = e.entity_id and ev_additional_data.attribute_id = {$attributesIds['additional_data']}) - WHERE e.entity_id in ({$currentPaymentIdsCondition}) - "); - - /* prepare query data items */ - $insertQueryItems = []; - foreach ($data as $item) { - if ($item['additional_data'] != '') { - $additionalInformationFields = []; - $additionalInformationFields['paypal_payer_email'] = $item['additional_data']; - $additionalInformation = serialize($additionalInformationFields); - - $insertQueryItems[] = [ - $entityTypeId, - $attributesIds['additional_information'], - $item['entity_id'], - $additionalInformation, - ]; - } - } - - if (!count($insertQueryItems)) { - continue; - } - - $connection->insertArray( - $this->getTable('sales_order_entity_text'), - ['entity_type_id', 'attribute_id', 'entity_id', 'value'], - $insertQueryItems, - ); - } -} catch (Exception $e) { - $connection->rollBack(); - throw $e; -} -$connection->commit(); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.51-0.9.52.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.51-0.9.52.php deleted file mode 100644 index 73659cbc8a5..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.51-0.9.52.php +++ /dev/null @@ -1,36 +0,0 @@ -getTable('sales_order'); -$tableOrderItem = $this->getTable('sales_flat_order_item'); - -$select = $installer->getConnection()->select() - ->from($tableOrderItem, [ - 'total_qty_ordered' => 'SUM(qty_ordered)', - 'entity_id' => 'order_id']) - ->group(['order_id']); - -$installer->run('CREATE TEMPORARY TABLE `tmp_order_items` ' . $select->assemble()); - -$select->reset() - ->join('tmp_order_items', 'tmp_order_items.entity_id = order.entity_id', ['total_qty_ordered', 'entity_id']); -$sqlQuery = $select->crossUpdateFromSelect(['order' => $tableOrder]); -$installer->getConnection()->query($sqlQuery); - -$installer->run('DROP TEMPORARY TABLE `tmp_order_items`'); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.52-0.9.53.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.52-0.9.53.php deleted file mode 100644 index 71258a54cab..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.52-0.9.53.php +++ /dev/null @@ -1,22 +0,0 @@ -addAttribute('quote', 'customer_gender', ['type' => 'int', 'visible' => false]); - -$installer->addAttribute('order', 'customer_gender', ['type' => 'int', 'visible' => false]); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.53-0.9.54.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.53-0.9.54.php deleted file mode 100644 index 4b3bbb8bd18..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.53-0.9.54.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('sales/order_aggregated_created'), - 'base_canceled_amount', - 'decimal(12,4) NOT NULL DEFAULT \'0\'', -); - -$this->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.54-0.9.55.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.54-0.9.55.php deleted file mode 100644 index 8b799246daa..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.54-0.9.55.php +++ /dev/null @@ -1,21 +0,0 @@ -addAttribute('order_payment', 'base_amount_paid_online', ['type' => 'decimal']); -$installer->addAttribute('order_payment', 'base_amount_refunded_online', ['type' => 'decimal']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.55-0.9.56.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.55-0.9.56.php deleted file mode 100644 index 65f193e4ad4..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.55-0.9.56.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->updateAttribute('order', 'customer_dob', 'backend_model', ''); -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.6-0.9.7.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.6-0.9.7.php deleted file mode 100644 index 6bba66214fa..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.6-0.9.7.php +++ /dev/null @@ -1,24 +0,0 @@ -addAttribute('quote_item', 'base_tax_before_discount', ['type' => 'decimal']); -$installer->addAttribute('quote_item', 'tax_before_discount', ['type' => 'decimal']); - -$installer->addAttribute('order_item', 'base_tax_before_discount', ['type' => 'decimal']); -$installer->addAttribute('order_item', 'tax_before_discount', ['type' => 'decimal']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.7-0.9.8.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.7-0.9.8.php deleted file mode 100644 index 47b47db502e..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.7-0.9.8.php +++ /dev/null @@ -1,22 +0,0 @@ -run(" -ALTER TABLE `{$installer->getTable('sales_order_tax')}` ADD `base_amount` DECIMAL( 12, 4 ) NOT NULL, ADD `process` SMALLINT NOT NULL; -"); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.8-0.9.9.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.8-0.9.9.php deleted file mode 100644 index 98f114906a7..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.8-0.9.9.php +++ /dev/null @@ -1,22 +0,0 @@ -addAttribute('invoice', 'store_id', ['type' => 'static']); -$installer->addAttribute('creditmemo', 'store_id', ['type' => 'static']); -$installer->addAttribute('shipment', 'store_id', ['type' => 'static']); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.9-0.9.10.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.9-0.9.10.php deleted file mode 100644 index 89ea004a441..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.9-0.9.10.php +++ /dev/null @@ -1,35 +0,0 @@ -run(" -DELETE FROM `{$this->getTable('sales_flat_quote_item')}` -WHERE `product_id` NOT IN ( - SELECT `entity_id` FROM `{$this->getTable('catalog_product_entity')}` -) -"); - -$installer->getConnection()->addConstraint( - 'FK_SALES_QUOTE_ITEM_CATALOG_PRODUCT_ENTITY', - $this->getTable('sales_flat_quote_item'), - 'product_id', - $this->getTable('catalog_product_entity'), - 'entity_id', -); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.3.99-1.4.0.0.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.3.99-1.4.0.0.php deleted file mode 100644 index f23e23e81b2..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.3.99-1.4.0.0.php +++ /dev/null @@ -1,1261 +0,0 @@ -startSetup(); - -/* Include code from mysql4-upgrade-0.9.38-0.9.39.php */ -$installer->getConnection()->addColumn( - $installer->getTable('sales_flat_quote_item'), - 'store_id', - 'smallint(5) unsigned default null AFTER `product_id`', -); -$installer->getConnection()->addConstraint( - 'FK_SALES_QUOTE_ITEM_STORE', - $installer->getTable('sales_flat_quote_item'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'set null', - 'cascade', -); -$installer->getConnection()->addColumn( - $installer->getTable('sales_flat_order_item'), - 'store_id', - 'smallint(5) unsigned default null AFTER `quote_item_id`', -); -$installer->getConnection()->addConstraint( - 'FK_SALES_ORDER_ITEM_STORE', - $installer->getTable('sales_flat_order_item'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'set null', - 'cascade', -); -$installer->addAttribute('quote_item', 'redirect_url', [ - 'type' => 'varchar', -]); -/* including end */ - -$installer->run(" -/* Orders */ -CREATE TABLE `{$installer->getTable('sales_flat_order')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `state` varchar(32) default NULL, - `status` varchar(32) default NULL, - `coupon_code` varchar(255) default NULL, - `protect_code` varchar(255) default NULL, - `shipping_description` varchar(255) default NULL, - `is_virtual` tinyint(1) unsigned default NULL, - `store_id` smallint(5) unsigned default NULL, - `customer_id` int(10) unsigned default NULL, - `base_discount_amount` decimal(12,4) default NULL, - `base_discount_canceled` decimal(12,4) default NULL, - `base_discount_invoiced` decimal(12,4) default NULL, - `base_discount_refunded` decimal(12,4) default NULL, - `base_grand_total` decimal(12,4) default NULL, - `base_shipping_amount` decimal(12,4) default NULL, - `base_shipping_canceled` decimal(12,4) default NULL, - `base_shipping_invoiced` decimal(12,4) default NULL, - `base_shipping_refunded` decimal(12,4) default NULL, - `base_shipping_tax_amount` decimal(12,4) default NULL, - `base_shipping_tax_refunded` decimal(12,4) default NULL, - `base_subtotal` decimal(12,4) default NULL, - `base_subtotal_canceled` decimal(12,4) default NULL, - `base_subtotal_invoiced` decimal(12,4) default NULL, - `base_subtotal_refunded` decimal(12,4) default NULL, - `base_tax_amount` decimal(12,4) default NULL, - `base_tax_canceled` decimal(12,4) default NULL, - `base_tax_invoiced` decimal(12,4) default NULL, - `base_tax_refunded` decimal(12,4) default NULL, - `base_to_global_rate` decimal(12,4) default NULL, - `base_to_order_rate` decimal(12,4) default NULL, - `base_total_canceled` decimal(12,4) default NULL, - `base_total_invoiced` decimal(12,4) default NULL, - `base_total_invoiced_cost` decimal(12,4) default NULL, - `base_total_offline_refunded` decimal(12,4) default NULL, - `base_total_online_refunded` decimal(12,4) default NULL, - `base_total_paid` decimal(12,4) default NULL, - `base_total_qty_ordered` decimal(12,4) default NULL, - `base_total_refunded` decimal(12,4) default NULL, - `discount_amount` decimal(12,4) default NULL, - `discount_canceled` decimal(12,4) default NULL, - `discount_invoiced` decimal(12,4) default NULL, - `discount_refunded` decimal(12,4) default NULL, - `grand_total` decimal(12,4) default NULL, - `shipping_amount` decimal(12,4) default NULL, - `shipping_canceled` decimal(12,4) default NULL, - `shipping_invoiced` decimal(12,4) default NULL, - `shipping_refunded` decimal(12,4) default NULL, - `shipping_tax_amount` decimal(12,4) default NULL, - `shipping_tax_refunded` decimal(12,4) default NULL, - `store_to_base_rate` decimal(12,4) default NULL, - `store_to_order_rate` decimal(12,4) default NULL, - `subtotal` decimal(12,4) default NULL, - `subtotal_canceled` decimal(12,4) default NULL, - `subtotal_invoiced` decimal(12,4) default NULL, - `subtotal_refunded` decimal(12,4) default NULL, - `tax_amount` decimal(12,4) default NULL, - `tax_canceled` decimal(12,4) default NULL, - `tax_invoiced` decimal(12,4) default NULL, - `tax_refunded` decimal(12,4) default NULL, - `total_canceled` decimal(12,4) default NULL, - `total_invoiced` decimal(12,4) default NULL, - `total_offline_refunded` decimal(12,4) default NULL, - `total_online_refunded` decimal(12,4) default NULL, - `total_paid` decimal(12,4) default NULL, - `total_qty_ordered` decimal(12,4) default NULL, - `total_refunded` decimal(12,4) default NULL, - `can_ship_partially` tinyint(1) unsigned default NULL, - `can_ship_partially_item` tinyint(1) unsigned default NULL, - `customer_is_guest` tinyint(1) unsigned default NULL, - `customer_note_notify` tinyint(1) unsigned default NULL, - `billing_address_id` int(10) default NULL, - `customer_group_id` smallint(5) default NULL, - `edit_increment` int(10) default NULL, - `email_sent` tinyint(1) unsigned default NULL, - `forced_do_shipment_with_invoice` tinyint(1) unsigned default NULL, - `gift_message_id` int(10) default NULL, - `payment_authorization_expiration` int(10) default NULL, - `paypal_ipn_customer_notified` int(10) default NULL, - `quote_address_id` int(10) default NULL, - `quote_id` int(10) default NULL, - `shipping_address_id` int(10) default NULL, - `adjustment_negative` decimal(12,4) default NULL, - `adjustment_positive` decimal(12,4) default NULL, - `base_adjustment_negative` decimal(12,4) default NULL, - `base_adjustment_positive` decimal(12,4) default NULL, - `base_shipping_discount_amount` decimal(12,4) default NULL, - `base_subtotal_incl_tax` decimal(12,4) default NULL, - `base_total_due` decimal(12,4) default NULL, - `payment_authorization_amount` decimal(12,4) default NULL, - `shipping_discount_amount` decimal(12,4) default NULL, - `subtotal_incl_tax` decimal(12,4) default NULL, - `total_due` decimal(12,4) default NULL, - `weight` decimal(12,4) default NULL, - `customer_dob` datetime default NULL, - `increment_id` varchar(50) default NULL, - `applied_rule_ids` varchar(255) default NULL, - `base_currency_code` char(3) default NULL, - `customer_email` varchar(255) default NULL, - `customer_firstname` varchar(255) default NULL, - `customer_lastname` varchar(255) default NULL, - `customer_middlename` varchar(255) default NULL, - `customer_prefix` varchar(255) default NULL, - `customer_suffix` varchar(255) default NULL, - `customer_taxvat` varchar(255) default NULL, - `discount_description` varchar(255) default NULL, - `ext_customer_id` varchar(255) default NULL, - `ext_order_id` varchar(255) default NULL, - `global_currency_code` char(3) default NULL, - `hold_before_state` varchar(255) default NULL, - `hold_before_status` varchar(255) default NULL, - `order_currency_code` varchar(255) default NULL, - `original_increment_id` varchar(50) default NULL, - `relation_child_id` varchar(32) default NULL, - `relation_child_real_id` varchar(32) default NULL, - `relation_parent_id` varchar(32) default NULL, - `relation_parent_real_id` varchar(32) default NULL, - `remote_ip` varchar(255) default NULL, - `shipping_method` varchar(255) default NULL, - `store_currency_code` char(3) default NULL, - `store_name` varchar(255) default NULL, - `x_forwarded_for` varchar(255) default NULL, - `customer_note` text, - `created_at` datetime default NULL, - `updated_at` datetime default NULL, - `total_item_count` smallint(5) unsigned DEFAULT '0', - `customer_gender` int(11) DEFAULT NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STATUS` (`status`), - KEY `IDX_STATE` (`state`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_CUSTOMER_ID` (`customer_id`), - KEY `IDX_EXT_ORDER_ID` (`ext_order_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Orders Grid */ -CREATE TABLE `{$installer->getTable('sales_flat_order_grid')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `status` varchar(32) default NULL, - `store_id` smallint(5) unsigned default NULL, - `customer_id` int(10) unsigned default NULL, - `base_grand_total` decimal(12,4) default NULL, - `base_total_paid` decimal(12,4) default NULL, - `grand_total` decimal(12,4) default NULL, - `total_paid` decimal(12,4) default NULL, - `increment_id` varchar(50) default NULL, - `base_currency_code` char(3) default NULL, - `order_currency_code` varchar(255) default NULL, - `shipping_name` varchar(255) default NULL, - `billing_name` varchar(255) default NULL, - `created_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STATUS` (`status`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_BASE_GRAND_TOTAL` (`base_grand_total`), - KEY `IDX_BASE_TOTAL_PAID` (`base_total_paid`), - KEY `IDX_GRAND_TOTAL` (`grand_total`), - KEY `IDX_TOTAL_PAID` (`total_paid`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_SHIPPING_NAME` (`shipping_name`), - KEY `IDX_BILLING_NAME` (`billing_name`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_CUSTOMER_ID` (`customer_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Order Address */ -CREATE TABLE `{$installer->getTable('sales_flat_order_address')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned default NULL, - `customer_address_id` int(10) default NULL, - `quote_address_id` int(10) default NULL, - `region_id` int(10) default NULL, - `customer_id` int(10) default NULL, - `fax` varchar(255) default NULL, - `region` varchar(255) default NULL, - `postcode` varchar(255) default NULL, - `lastname` varchar(255) default NULL, - `street` varchar(255) default NULL, - `city` varchar(255) default NULL, - `email` varchar(255) default NULL, - `telephone` varchar(255) default NULL, - `country_id` char(2) default NULL, - `firstname` varchar(255) default NULL, - `address_type` varchar(255) default NULL, - `prefix` varchar(255) default NULL, - `middlename` varchar(255) default NULL, - `suffix` varchar(255) default NULL, - `company` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Order Comments */ -CREATE TABLE `{$installer->getTable('sales_flat_order_status_history')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `is_customer_notified` int(10) default NULL, - `comment` text, - `status` varchar(32) default NULL, - `created_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_PARENT_ID` (`parent_id`), - KEY `IDX_CREATED_AT` (`created_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Order Payment */ - -CREATE TABLE `{$installer->getTable('sales_flat_order_payment')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `base_shipping_captured` decimal(12,4) default NULL, - `shipping_captured` decimal(12,4) default NULL, - `amount_refunded` decimal(12,4) default NULL, - `base_amount_paid` decimal(12,4) default NULL, - `amount_canceled` decimal(12,4) default NULL, - `base_amount_authorized` decimal(12,4) default NULL, - `base_amount_paid_online` decimal(12,4) default NULL, - `base_amount_refunded_online` decimal(12,4) default NULL, - `base_shipping_amount` decimal(12,4) default NULL, - `shipping_amount` decimal(12,4) default NULL, - `amount_paid` decimal(12,4) default NULL, - `amount_authorized` decimal(12,4) default NULL, - `base_amount_ordered` decimal(12,4) default NULL, - `base_shipping_refunded` decimal(12,4) default NULL, - `shipping_refunded` decimal(12,4) default NULL, - `base_amount_refunded` decimal(12,4) default NULL, - `amount_ordered` decimal(12,4) default NULL, - `base_amount_canceled` decimal(12,4) default NULL, - `ideal_transaction_checked` tinyint(1) unsigned default NULL, - `quote_payment_id` int(10) default NULL, - `additional_data` text, - `cc_exp_month` varchar(255) default NULL, - `cc_ss_start_year` varchar(255) default NULL, - `echeck_bank_name` varchar(255) default NULL, - `method` varchar(255) default NULL, - `cc_debug_request_body` varchar(255) default NULL, - `cc_secure_verify` varchar(255) default NULL, - `cybersource_token` varchar(255) default NULL, - `ideal_issuer_title` varchar(255) default NULL, - `protection_eligibility` varchar(255) default NULL, - `cc_approval` varchar(255) default NULL, - `cc_last4` varchar(255) default NULL, - `cc_status_description` varchar(255) default NULL, - `echeck_type` varchar(255) default NULL, - `paybox_question_number` varchar(255) default NULL, - `cc_debug_response_serialized` varchar(255) default NULL, - `cc_ss_start_month` varchar(255) default NULL, - `echeck_account_type` varchar(255) default NULL, - `last_trans_id` varchar(255) default NULL, - `cc_cid_status` varchar(255) default NULL, - `cc_owner` varchar(255) default NULL, - `cc_type` varchar(255) default NULL, - `ideal_issuer_id` varchar(255) default NULL, - `po_number` varchar(255) default NULL, - `cc_exp_year` varchar(255) default NULL, - `cc_status` varchar(255) default NULL, - `echeck_routing_number` varchar(255) default NULL, - `account_status` varchar(255) default NULL, - `anet_trans_method` varchar(255) default NULL, - `cc_debug_response_body` varchar(255) default NULL, - `cc_ss_issue` varchar(255) default NULL, - `echeck_account_name` varchar(255) default NULL, - `cc_avs_status` varchar(255) default NULL, - `cc_number_enc` varchar(255) default NULL, - `cc_trans_id` varchar(255) default NULL, - `flo2cash_account_id` varchar(255) default NULL, - `paybox_request_number` varchar(255) default NULL, - `address_status` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Shipments */ - -CREATE TABLE `{$installer->getTable('sales_flat_shipment')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned default NULL, - `total_weight` decimal(12,4) default NULL, - `total_qty` decimal(12,4) default NULL, - `email_sent` tinyint(1) unsigned default NULL, - `order_id` int(10) unsigned NOT NULL, - `customer_id` int(10) default NULL, - `shipping_address_id` int(10) default NULL, - `billing_address_id` int(10) default NULL, - `shipment_status` int(10) default NULL, - `increment_id` varchar(50) default NULL, - `created_at` datetime default NULL, - `updated_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_TOTAL_QTY` (`total_qty`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_ORDER_ID` (`order_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Shipments Grid */ - -CREATE TABLE `{$installer->getTable('sales_flat_shipment_grid')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned default NULL, - `total_qty` decimal(12,4) default NULL, - `order_id` int(10) unsigned NOT NULL, - `shipment_status` int(10) default NULL, - `increment_id` varchar(50) default NULL, - `order_increment_id` varchar(50) default NULL, - `created_at` datetime default NULL, - `order_created_at` datetime default NULL, - `shipping_name` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_TOTAL_QTY` (`total_qty`), - KEY `IDX_ORDER_ID` (`order_id`), - KEY `IDX_SHIPMENT_STATUS` (`shipment_status`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_ORDER_INCREMENT_ID` (`order_increment_id`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_ORDER_CREATED_AT` (`order_created_at`), - KEY `IDX_SHIPPING_NAME` (`shipping_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Shipment Items */ - -CREATE TABLE `{$installer->getTable('sales_flat_shipment_item')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `row_total` decimal(12,4) default NULL, - `price` decimal(12,4) default NULL, - `weight` decimal(12,4) default NULL, - `qty` decimal(12,4) default NULL, - `product_id` int(10) default NULL, - `order_item_id` int(10) default NULL, - `additional_data` text, - `description` text, - `name` varchar(255) default NULL, - `sku` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Shipping tracking */ - -CREATE TABLE `{$installer->getTable('sales_flat_shipment_track')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `weight` decimal(12,4) default NULL, - `qty` decimal(12,4) default NULL, - `order_id` int(10) unsigned NOT NULL, - `number` text, - `description` text, - `title` varchar(255) default NULL, - `carrier_code` varchar(32) default NULL, - `created_at` datetime default NULL, - `updated_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_PARENT_ID` (`parent_id`), - KEY `IDX_ORDER_ID` (`order_id`), - KEY `IDX_CREATED_AT` (`created_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Shipment Comment */ -CREATE TABLE `{$installer->getTable('sales_flat_shipment_comment')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `is_customer_notified` int(10) default NULL, - `comment` text, - `created_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Invoice Main Table */ -CREATE TABLE `{$installer->getTable('sales_flat_invoice')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned default NULL, - `base_grand_total` decimal(12,4) default NULL, - `shipping_tax_amount` decimal(12,4) default NULL, - `tax_amount` decimal(12,4) default NULL, - `base_tax_amount` decimal(12,4) default NULL, - `store_to_order_rate` decimal(12,4) default NULL, - `base_shipping_tax_amount` decimal(12,4) default NULL, - `base_discount_amount` decimal(12,4) default NULL, - `base_to_order_rate` decimal(12,4) default NULL, - `grand_total` decimal(12,4) default NULL, - `shipping_amount` decimal(12,4) default NULL, - `subtotal_incl_tax` decimal(12,4) default NULL, - `base_subtotal_incl_tax` decimal(12,4) default NULL, - `store_to_base_rate` decimal(12,4) default NULL, - `base_shipping_amount` decimal(12,4) default NULL, - `total_qty` decimal(12,4) default NULL, - `base_to_global_rate` decimal(12,4) default NULL, - `subtotal` decimal(12,4) default NULL, - `base_subtotal` decimal(12,4) default NULL, - `discount_amount` decimal(12,4) default NULL, - `billing_address_id` int(10) default NULL, - `is_used_for_refund` tinyint(1) unsigned default NULL, - `order_id` int(10) unsigned NOT NULL, - `email_sent` tinyint(1) unsigned default NULL, - `can_void_flag` tinyint(1) unsigned default NULL, - `state` int(10) default NULL, - `shipping_address_id` int(10) default NULL, - `cybersource_token` varchar(255) default NULL, - `store_currency_code` char(3) default NULL, - `transaction_id` varchar(255) default NULL, - `order_currency_code` char(3) default NULL, - `base_currency_code` char(3) default NULL, - `global_currency_code` char(3) default NULL, - `increment_id` varchar(50) default NULL, - `created_at` datetime default NULL, - `updated_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_GRAND_TOTAL` (`grand_total`), - KEY `IDX_ORDER_ID` (`order_id`), - KEY `IDX_STATE` (`state`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_CREATED_AT` (`created_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Invoices Grid */ -CREATE TABLE `{$installer->getTable('sales_flat_invoice_grid')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned default NULL, - `base_grand_total` decimal(12,4) default NULL, - `grand_total` decimal(12,4) default NULL, - `order_id` int(10) unsigned NOT NULL, - `state` int(10) default NULL, - `store_currency_code` char(3) default NULL, - `order_currency_code` char(3) default NULL, - `base_currency_code` char(3) default NULL, - `global_currency_code` char(3) default NULL, - `increment_id` varchar(50) default NULL, - `order_increment_id` varchar(50) default NULL, - `created_at` datetime default NULL, - `order_created_at` datetime default NULL, - `billing_name` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_GRAND_TOTAL` (`grand_total`), - KEY `IDX_ORDER_ID` (`order_id`), - KEY `IDX_STATE` (`state`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_ORDER_INCREMENT_ID` (`order_increment_id`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_ORDER_CREATED_AT` (`order_created_at`), - KEY `IDX_BILLING_NAME` (`billing_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Invoice Items */ - -CREATE TABLE `{$installer->getTable('sales_flat_invoice_item')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `base_price` decimal(12,4) default NULL, - `base_weee_tax_row_disposition` decimal(12,4) default NULL, - `weee_tax_applied_row_amount` decimal(12,4) default NULL, - `base_weee_tax_applied_amount` decimal(12,4) default NULL, - `tax_amount` decimal(12,4) default NULL, - `base_row_total` decimal(12,4) default NULL, - `discount_amount` decimal(12,4) default NULL, - `row_total` decimal(12,4) default NULL, - `weee_tax_row_disposition` decimal(12,4) default NULL, - `base_discount_amount` decimal(12,4) default NULL, - `base_weee_tax_disposition` decimal(12,4) default NULL, - `price_incl_tax` decimal(12,4) default NULL, - `weee_tax_applied_amount` decimal(12,4) default NULL, - `base_tax_amount` decimal(12,4) default NULL, - `base_price_incl_tax` decimal(12,4) default NULL, - `qty` decimal(12,4) default NULL, - `weee_tax_disposition` decimal(12,4) default NULL, - `base_cost` decimal(12,4) default NULL, - `base_weee_tax_applied_row_amount` decimal(12,4) default NULL, - `price` decimal(12,4) default NULL, - `base_row_total_incl_tax` decimal(12,4) default NULL, - `row_total_incl_tax` decimal(12,4) default NULL, - `product_id` int(10) default NULL, - `order_item_id` int(10) default NULL, - `additional_data` text, - `description` text, - `weee_tax_applied` text, - `sku` varchar(255) default NULL, - `name` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Invoice Comments */ -CREATE TABLE `{$installer->getTable('sales_flat_invoice_comment')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `is_customer_notified` tinyint(1) unsigned default NULL, - `comment` text, - `created_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* CreditMemo Main table */ -CREATE TABLE `{$installer->getTable('sales_flat_creditmemo')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned default NULL, - `adjustment_positive` decimal(12,4) default NULL, - `base_shipping_tax_amount` decimal(12,4) default NULL, - `store_to_order_rate` decimal(12,4) default NULL, - `base_discount_amount` decimal(12,4) default NULL, - `base_to_order_rate` decimal(12,4) default NULL, - `grand_total` decimal(12,4) default NULL, - `base_adjustment_negative` decimal(12,4) default NULL, - `base_subtotal_incl_tax` decimal(12,4) default NULL, - `shipping_amount` decimal(12,4) default NULL, - `subtotal_incl_tax` decimal(12,4) default NULL, - `adjustment_negative` decimal(12,4) default NULL, - `base_shipping_amount` decimal(12,4) default NULL, - `store_to_base_rate` decimal(12,4) default NULL, - `base_to_global_rate` decimal(12,4) default NULL, - `base_adjustment` decimal(12,4) default NULL, - `base_subtotal` decimal(12,4) default NULL, - `discount_amount` decimal(12,4) default NULL, - `subtotal` decimal(12,4) default NULL, - `adjustment` decimal(12,4) default NULL, - `base_grand_total` decimal(12,4) default NULL, - `base_adjustment_positive` decimal(12,4) default NULL, - `base_tax_amount` decimal(12,4) default NULL, - `shipping_tax_amount` decimal(12,4) default NULL, - `tax_amount` decimal(12,4) default NULL, - `order_id` int(10) unsigned NOT NULL, - `email_sent` tinyint(1) unsigned default NULL, - `creditmemo_status` int(10) default NULL, - `state` int(10) default NULL, - `shipping_address_id` int(10) default NULL, - `billing_address_id` int(10) default NULL, - `invoice_id` int(10) default NULL, - `cybersource_token` varchar(255) default NULL, - `store_currency_code` char(3) default NULL, - `order_currency_code` char(3) default NULL, - `base_currency_code` char(3) default NULL, - `global_currency_code` char(3) default NULL, - `transaction_id` varchar(255) default NULL, - `increment_id` varchar(50) default NULL, - `created_at` datetime default NULL, - `updated_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_ORDER_ID` (`order_id`), - KEY `IDX_CREDITMEMO_STATUS` (`creditmemo_status`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_STATE` (`state`), - KEY `IDX_CREATED_AT` (`created_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* CreditMemo Grid */ -CREATE TABLE `{$installer->getTable('sales_flat_creditmemo_grid')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `store_id` smallint(5) unsigned default NULL, - `store_to_order_rate` decimal(12,4) default NULL, - `base_to_order_rate` decimal(12,4) default NULL, - `grand_total` decimal(12,4) default NULL, - `store_to_base_rate` decimal(12,4) default NULL, - `base_to_global_rate` decimal(12,4) default NULL, - `base_grand_total` decimal(12,4) default NULL, - `order_id` int(10) unsigned NOT NULL, - `creditmemo_status` int(10) default NULL, - `state` int(10) default NULL, - `invoice_id` int(10) default NULL, - `store_currency_code` char(3) default NULL, - `order_currency_code` char(3) default NULL, - `base_currency_code` char(3) default NULL, - `global_currency_code` char(3) default NULL, - `increment_id` varchar(50) default NULL, - `order_increment_id` varchar(50) default NULL, - `created_at` datetime default NULL, - `order_created_at` datetime default NULL, - `billing_name` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_GRAND_TOTAL` (`grand_total`), - KEY `IDX_BASE_GRAND_TOTAL` (`base_grand_total`), - KEY `IDX_ORDER_ID` (`order_id`), - KEY `IDX_CREDITMEMO_STATUS` (`creditmemo_status`), - KEY `IDX_STATE` (`state`), - KEY `IDX_INCREMENT_ID` (`increment_id`), - KEY `IDX_ORDER_INCREMENT_ID` (`order_increment_id`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_ORDER_CREATED_AT` (`order_created_at`), - KEY `IDX_BILLING_NAME` (`billing_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* CreditMemo Item */ - -CREATE TABLE `{$installer->getTable('sales_flat_creditmemo_item')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `weee_tax_applied_row_amount` decimal(12,4) default NULL, - `base_price` decimal(12,4) default NULL, - `base_weee_tax_row_disposition` decimal(12,4) default NULL, - `tax_amount` decimal(12,4) default NULL, - `base_weee_tax_applied_amount` decimal(12,4) default NULL, - `weee_tax_row_disposition` decimal(12,4) default NULL, - `base_row_total` decimal(12,4) default NULL, - `discount_amount` decimal(12,4) default NULL, - `row_total` decimal(12,4) default NULL, - `weee_tax_applied_amount` decimal(12,4) default NULL, - `base_discount_amount` decimal(12,4) default NULL, - `base_weee_tax_disposition` decimal(12,4) default NULL, - `price_incl_tax` decimal(12,4) default NULL, - `base_tax_amount` decimal(12,4) default NULL, - `weee_tax_disposition` decimal(12,4) default NULL, - `base_price_incl_tax` decimal(12,4) default NULL, - `qty` decimal(12,4) default NULL, - `base_cost` decimal(12,4) default NULL, - `base_weee_tax_applied_row_amount` decimal(12,4) default NULL, - `price` decimal(12,4) default NULL, - `base_row_total_incl_tax` decimal(12,4) default NULL, - `row_total_incl_tax` decimal(12,4) default NULL, - `product_id` int(10) default NULL, - `order_item_id` int(10) default NULL, - `additional_data` text, - `description` text, - `weee_tax_applied` text, - `sku` varchar(255) default NULL, - `name` varchar(255) default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* CreditMemo Comment */ - -CREATE TABLE `{$installer->getTable('sales_flat_creditmemo_comment')}` ( - `entity_id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL, - `is_customer_notified` int(10) default NULL, - `comment` text, - `created_at` datetime default NULL, - PRIMARY KEY (`entity_id`), - KEY `IDX_CREATED_AT` (`created_at`), - KEY `IDX_PARENT_ID` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales_flat_order_item'), - 'FK_SALES_ORDER_ITEM_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales_payment_transaction'), - 'FK_SALES_PAYMENT_TXN_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales_payment_transaction'), - 'FK_SALES_TXN_ORDER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales_payment_transaction'), - 'FK_SALES_TXN_PAYMENT', -); - -$installer->getConnection()->dropKey( - $installer->getTable('sales_flat_order_item'), - 'FK_SALES_ORDER_ITEM_STORE', -); - -$installer->getConnection()->addKey( - $installer->getTable('sales_flat_order_item'), - 'IDX_STORE_ID', - 'store_id', -); - -$installer->getConnection()->dropColumn($installer->getTable('sales_flat_order_item'), 'is_active'); - -$excludeAttributes = [ - 'all' => ['entity_type_id', 'attribute_set_id', 'is_active'], - 'order_payment' => ['increment_id','created_at', 'updated_at', 'store_id'], - 'order_status_history' => ['updated_at', 'store_id', 'increment_id'], - 'invoice_comment' => ['updated_at', 'store_id', 'increment_id'], - 'shipment_comment' => ['updated_at', 'store_id', 'increment_id'], - 'creditmemo_comment' => ['updated_at', 'store_id', 'increment_id'], - 'invoice_item' => ['increment_id','created_at', 'updated_at', 'store_id'], - 'shipment_item' => ['increment_id','created_at', 'updated_at', 'store_id'], - 'creditmemo_item' => ['increment_id','created_at', 'updated_at', 'store_id'], - 'order_address' => ['increment_id','created_at', 'updated_at', 'store_id'], - 'order' => ['payment_authorization_amount', 'parent_id'], - 'creditmemo' => ['parent_id'], - 'invoice' => ['parent_id'], - 'shipment' => ['parent_id'], - 'shipment_track' => ['increment_id', 'store_id'], -]; - -$entityToFlat = [ - 'order' => ['grid' => true], - 'order_item' => ['flat' => true], - 'order_address' => [], - 'order_payment' => [], - 'order_status_history' => [], - 'invoice' => ['grid' => true], - 'invoice_item' => [], - 'invoice_comment' => [], - 'creditmemo' => ['grid' => true], - 'creditmemo_item' => [], - 'creditmemo_comment' => [], - 'shipment' => ['grid' => true], - 'shipment_item' => [], - 'shipment_comment' => [], - 'shipment_track' => [], -]; - -$select = $installer->getConnection()->select(); - -$select - ->from(['attribute' => $installer->getTable('eav/attribute')], [ - 'id' => 'attribute_id', - 'code' => 'attribute_code', - 'type' => 'backend_type', - 'table' => 'backend_table']) - ->join(['entity' => $installer->getTable('eav/entity_type')], 'attribute.entity_type_id = entity.entity_type_id', [ - 'entity' => 'entity_type_code', - 'type_id' => 'entity_type_id', - ]) - ->where('entity.entity_type_code IN (?)', array_keys($entityToFlat)) - ->where('attribute.attribute_code NOT IN(?)', $excludeAttributes['all']); - -$attributes = []; - -foreach ($installer->getConnection()->fetchAll($select) as $attribute) { - $attributes[$attribute['entity']][$attribute['code']] = $attribute; -} - -$definitions = [ - 'datetime' => 'datetime default null', - 'int' => 'int(11) default null', - 'varchar' => 'varchar(255) default null', - 'text' => 'text default null', - 'decimal' => 'decimal(12,4) default null', -]; - -foreach ($entityToFlat as $entityCode => $flags) { - $flatTablePrefix = 'sales_flat_' . $entityCode; - $flatFields = $installer->getConnection()->fetchPairs( - 'DESCRIBE ' . $installer->getTable($flatTablePrefix), - ); - - if (!empty($flags['flat'])) { - $entityTable = $installer->getTable('sales_flat_' . $entityCode); - } else { - $entityTable = $this->getTable($entityCode == 'order' ? 'sales_order' : 'sales_order_entity'); - $firstAttribute = current($attributes[$entityCode]); - $entityTypeId = $firstAttribute['type_id']; - } - - $entityFields = $installer->getConnection()->fetchPairs( - 'DESCRIBE ' . $entityTable, - ); - - $entityIndex = $installer->getConnection()->getIndexList($entityTable); - $entityFieldInIndex = []; - - // Create list of entity fields in index to not loose them. - foreach ($entityIndex as $name => $info) { - $entityFieldInIndex += array_combine($info['fields'], array_fill(0, count($info['fields']), $name)); - } - - // Copy all fields from entity tables - $addIndex = []; - - foreach ($entityFields as $code => $definition) { - if (!isset($flatFields[$code]) && - !in_array($code, $excludeAttributes['all']) && - (!isset($excludeAttributes[$entityCode]) || - !in_array($code, $excludeAttributes[$entityCode])) - ) { - $installer->getConnection()->addColumn( - $installer->getTable($flatTablePrefix), - $code, - $definition, - ); - - if (isset($entityFieldInIndex[$code])) { // Add entity table indexes with custom fields - $addIndex[] = $entityFieldInIndex[$code]; - } - - $flatFields[$code] = $definition; - } - } - - foreach ($addIndex as $indexName) { // Adding indexes to not loose them in customizations - $fields = array_intersect($entityIndex[$indexName]['fields'], array_keys($flatFields)); - $installer->getConnection()->addKey( - $installer->getTable($flatTablePrefix), - $indexName, - $fields, - $entityIndex[$indexName]['type'], - ); - } - - $attributesByTable = []; - - if (empty($flags['flat']) && isset($attributes[$entityCode])) { - // If our table is not flat we need to add field from attributes too - foreach ($attributes[$entityCode] as $attributeCode => $attribute) { - if ($attribute['type'] == 'static') { - continue; - } - - if (!isset($flatFields[$attributeCode]) && - isset($definitions[$attribute['type']]) && - !in_array($attributeCode, $excludeAttributes['all']) && - (!isset($excludeAttributes[$entityCode]) || - !in_array($attributeCode, $excludeAttributes[$entityCode])) - ) { - $installer->getConnection()->addColumn( - $installer->getTable($flatTablePrefix), - $attributeCode, - $definitions[$attribute['type']], - ); - - $flatFields[$attributeCode] = $definitions[$attribute['type']]; - } - - // Collect data for fast access on update - $attributesByTable[$entityTable . '_' . $attribute['type']][] = $attribute; - } - } - - // Create list of keys inserted from base entity table - $keys = array_keys(array_intersect_key($entityFields, $flatFields)); - - $fields = array_combine($keys, $keys); - - if ($entityTable !== $installer->getTable($flatTablePrefix)) { - $select->reset() - ->from(['e' => $entityTable], $fields); - - $select->where('e.entity_type_id = ?', $entityTypeId); - - $sql = $select->insertFromSelect($installer->getTable($flatTablePrefix), array_keys($fields), false) . "; \n"; - - // Update base record with eav attributes values - foreach ($attributesByTable as $table => $updateAttributes) { - $select->reset(); - $joinCount = 0; - foreach ($updateAttributes as $attribute) { - if (isset($entityFields[$attribute['code']]) || !isset($flatFields[$attribute['code']])) { - continue; - } - - $alias = '_table_' . $attribute['code']; - $select->joinLeft( - [$alias => $table], - $alias . '.entity_id = e.entity_id AND ' . $alias . '.attribute_id = ' . $attribute['id'], - [$attribute['code'] => 'value'], - ); - $joinCount++; - - if ($joinCount > 60) { // If we have too much joins for mysql - $joinCount = 0; - $sql .= $select->crossUpdateFromSelect(['e' => $installer->getTable($flatTablePrefix)]) . "; \n"; - $select->reset(); - } - } - - if ($joinCount > 0) { - $sql .= $select->crossUpdateFromSelect(['e' => $installer->getTable($flatTablePrefix)]) . "; \n"; - } - } - } else { - $sql = ''; - } - - if (!empty($flags['grid'])) { // Filling grid table with default base record - $gridFields = array_keys( - array_intersect_key( - $installer->getConnection()->describeTable( - $installer->getTable($flatTablePrefix . '_grid'), - ), - $flatFields, - ), - ); - - $select->reset(); - $select->from($installer->getTable($flatTablePrefix), $gridFields); - $sql .= $select->insertFromSelect($installer->getTable($flatTablePrefix . '_grid'), $gridFields, false); - } - - $installer->run($sql); -} - -// Insert virtual grid fields (shipping_name, billing_name, etc) - -// Order Grid -$select->reset(); -$select->join( - ['order' => $installer->getTable('sales_flat_order')], - 'order.entity_id = e.entity_id', - [], -); - -$select->joinLeft( - ['shipping_address' => $installer->getTable('sales_flat_order_address')], - 'order.shipping_address_id = shipping_address.entity_id', - ['shipping_name' => 'IF(shipping_address.entity_id IS NOT NULL, CONCAT(shipping_address.firstname, \' \', shipping_address.lastname), NULL)'], -); - -$select->joinLeft( - ['billing_address' => $installer->getTable('sales_flat_order_address')], - 'order.billing_address_id = billing_address.entity_id', - ['billing_name' => 'IF(billing_address.entity_id IS NOT NULL, CONCAT(billing_address.firstname, \' \', billing_address.lastname), NULL)'], -); - -$installer->run($select->crossUpdateFromSelect(['e' => $installer->getTable('sales_flat_order_grid')])); - -// Invoice and Creditmemo grid -$select->reset(); -$select->join( - ['order' => $installer->getTable('sales_flat_order')], - 'order.entity_id = e.order_id', - ['order_increment_id' => 'increment_id', 'order_created_at' => 'created_at'], -); - -$select->joinLeft( - ['billing_address' => $installer->getTable('sales_flat_order_address')], - 'order.billing_address_id = billing_address.entity_id', - ['billing_name' => 'IF(billing_address.entity_id IS NOT NULL, CONCAT(billing_address.firstname, \' \', billing_address.lastname), NULL)'], -); - -$installer->run($select->crossUpdateFromSelect(['e' => $installer->getTable('sales_flat_creditmemo_grid')])); -$installer->run($select->crossUpdateFromSelect(['e' => $installer->getTable('sales_flat_invoice_grid')])); - -// Shipment grid -$select->reset(); -$select->join( - ['order' => $installer->getTable('sales_flat_order')], - 'order.entity_id = e.order_id', - ['order_increment_id' => 'increment_id', 'order_created_at' => 'created_at'], -); - -$select->joinLeft( - ['shipping_address' => $installer->getTable('sales_flat_order_address')], - 'order.shipping_address_id = shipping_address.entity_id', - ['shipping_name' => 'IF(shipping_address.entity_id IS NOT NULL, CONCAT(shipping_address.firstname, \' \', shipping_address.lastname), NULL)'], -); - -$installer->run($select->crossUpdateFromSelect(['e' => $installer->getTable('sales_flat_shipment_grid')])); - -$constraints = [ - 'sales_flat_order' => [ - 'customer' => ['customer_id', 'customer_entity', 'entity_id', 'set null'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_order_grid' => [ - 'parent' => ['entity_id', 'sales_flat_order', 'entity_id'], - 'customer' => ['customer_id', 'customer_entity', 'entity_id', 'set null'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_order_item' => [ - 'parent' => ['order_id', 'sales_flat_order', 'entity_id'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_order_address' => [ - 'parent' => ['parent_id', 'sales_flat_order', 'entity_id'], - ], - 'sales_flat_order_payment' => [ - 'parent' => ['parent_id', 'sales_flat_order', 'entity_id'], - ], - 'sales_flat_order_status_history' => [ - 'parent' => ['parent_id', 'sales_flat_order', 'entity_id'], - ], - 'sales_flat_shipment' => [ - 'parent' => ['order_id', 'sales_flat_order', 'entity_id'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_shipment_grid' => [ - 'parent' => ['entity_id', 'sales_flat_shipment', 'entity_id'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_shipment_track' => [ - 'parent' => ['parent_id', 'sales_flat_shipment', 'entity_id'], - ], - 'sales_flat_shipment_item' => [ - 'parent' => ['parent_id', 'sales_flat_shipment', 'entity_id'], - ], - 'sales_flat_shipment_comment' => [ - 'parent' => ['parent_id', 'sales_flat_shipment', 'entity_id'], - ], - 'sales_flat_invoice' => [ - 'parent' => ['order_id', 'sales_flat_order', 'entity_id'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_invoice_grid' => [ - 'parent' => ['entity_id', 'sales_flat_invoice', 'entity_id'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_invoice_item' => [ - 'parent' => ['parent_id', 'sales_flat_invoice', 'entity_id'], - ], - 'sales_flat_invoice_comment' => [ - 'parent' => ['parent_id', 'sales_flat_invoice', 'entity_id'], - ], - 'sales_flat_creditmemo' => [ - 'parent' => ['order_id', 'sales_flat_order', 'entity_id'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_creditmemo_grid' => [ - 'parent' => ['entity_id', 'sales_flat_creditmemo', 'entity_id'], - 'store' => ['store_id', 'core_store', 'store_id', 'set null'], - ], - 'sales_flat_creditmemo_item' => [ - 'parent' => ['parent_id', 'sales_flat_creditmemo', 'entity_id'], - ], - 'sales_flat_creditmemo_comment' => [ - 'parent' => ['parent_id', 'sales_flat_creditmemo', 'entity_id'], - ], - 'sales_payment_transaction' => [ - 'parent' => ['parent_id', 'sales_payment_transaction', 'transaction_id'], - 'order' => ['order_id', 'sales_flat_order', 'entity_id'], - 'payment' => ['payment_id', 'sales_flat_order_payment', 'entity_id'], - ], -]; - -foreach ($constraints as $table => $list) { - foreach ($list as $code => $constraint) { - $constraint[1] = $installer->getTable($constraint[1]); - array_unshift($constraint, $installer->getTable($table)); - array_unshift($constraint, strtoupper($table . '_' . $code)); - - call_user_func_array([$installer->getConnection(), 'addConstraint'], $constraint); - } -} - -/** - * Add additional columns for order aggregation table - */ -$table = $installer->getTable('sales_order_aggregated_created'); -$installer->run('TRUNCATE TABLE ' . $installer->getConnection()->quoteIdentifier($table)); -$installer->getConnection()->addColumn($table, 'base_tax_invoiced_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); -$installer->getConnection()->addColumn($table, 'base_tax_canceled_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); -$installer->getConnection()->addColumn($table, 'base_tax_refunded_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); - -$installer->getConnection()->addColumn($table, 'base_subtotal_invoiced_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); -$installer->getConnection()->addColumn($table, 'base_subtotal_refunded_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); -$installer->getConnection()->addColumn($table, 'base_subtotal_canceled_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); - -$installer->getConnection()->addColumn($table, 'base_discount_invoiced_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); -$installer->getConnection()->addColumn($table, 'base_discount_canceled_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); -$installer->getConnection()->addColumn($table, 'base_discount_refunded_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); - -$installer->getConnection()->addColumn($table, 'base_shipping_invoiced_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); -$installer->getConnection()->addColumn($table, 'base_shipping_canceled_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); -$installer->getConnection()->addColumn($table, 'base_shipping_refunded_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); -$installer->getConnection()->addColumn($table, 'base_shipping_discount_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); -$installer->getConnection()->addColumn($table, 'base_shipping_tax_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); -$installer->getConnection()->addColumn($table, 'base_shipping_tax_refunded_amount', 'decimal(12,4) NOT NULL DEFAULT \'0.0000\''); - -$flag = Mage::getModel('reports/flag') - ->setReportFlagCode(Mage_Reports_Model_Flag::REPORT_ORDER_FLAG_CODE) - ->loadSelf(); - -if ($flag->getId()) { - $flag->delete(); -} - -$select = $installer->getConnection()->select(); -$select->from($installer->getTable('sales/order_item'), [ - 'total_item_count' => 'COUNT(item_id)', - 'entity_id' => 'order_id']) - ->where('parent_item_id IS NULL') - ->group(['order_id']); - -$temporaryTable = 'tmp_sales_order_item_count_' . md5(uniqid('order_item_count')); - -$installer->getConnection()->query('CREATE TEMPORARY TABLE ' . $installer->getConnection()->quoteIdentifier($temporaryTable) . ' ' . $select->assemble()); - -$select->reset() - ->join(['items_count_table' => $temporaryTable], 'items_count_table.entity_id = order_table.entity_id', [ - 'total_item_count' => 'total_item_count', - ]); - -$installer->getConnection()->query($select->crossUpdateFromSelect(['order_table' => $installer->getTable('sales/order')])); -$installer->getConnection()->query('DROP TEMPORARY TABLE ' . $temporaryTable); - -/** - * Workaround for the coupon_code attribute that may be missed in the Mage_SalesRule/sql/mysql4-upgrade-0.7.10-0.7.11.php - * The problem is that Mage_SalesRule depends on Mage_Sales and sometimes the attribute doesn't get updated before this line of code. - * As a result: an existing column in the sales_flat_order table, but wrong type in the attribute registry and sometimes even data lost - * Reproduces on upgrading from 1.4.0.x to 1.4.1.0 - * - * Test case: - * 1) Have Magento instance without flat sales yet, and without Mage_SalesRule/sql/mysql4-upgrade-0.7.10-0.7.11.php - * 2) Upgrade it to the flat one instantly (runs this upgrade). Without this code the proper upgrade of coupon_code is missed. Data is lost. - * 3) The Mage_SalesRule/sql/mysql4-upgrade-0.7.10-0.7.11.php runs AFTER this code, because it depends on Mage_Sales. But it is too late. - * Result: the attribute has wrong type and data may be lost depending on upgrade history. - */ -$orderEntityType = $installer->getEntityType('order'); -$orderEntityTypeId = $orderEntityType['entity_type_id']; -$attribute = $installer->getAttribute($orderEntityTypeId, 'coupon_code'); - -if ($attribute && is_array($attribute) && isset($attribute['backend_type']) && $attribute['backend_type'] !== 'static') { - try { - $installer->getConnection()->beginTransaction(); - $installer->run(" - UPDATE {$installer->getTable('sales_flat_order')} AS o, {$installer->getTable('sales_order_entity_varchar')} AS od - SET o.{$attribute['attribute_code']} = od.value - WHERE od.entity_id = o.entity_id - AND od.attribute_id = {$attribute['attribute_id']} - AND od.entity_type_id = {$orderEntityTypeId} - "); - $installer->updateAttribute($orderEntityTypeId, $attribute['attribute_code'], ['backend_type' => 'static']); - $installer->getConnection()->commit(); - } catch (Exception $e) { - $installer->getConnection()->rollBack(); - throw $e; - } -} - -// Remove previous tables -$tablesToDrop = [ - 'sales_order_entity_decimal', - 'sales_order_entity_datetime', - 'sales_order_entity_int', - 'sales_order_entity_text', - 'sales_order_entity_varchar', - 'sales_order_entity', - 'sales_order_decimal', - 'sales_order_datetime', - 'sales_order_int', - 'sales_order_text', - 'sales_order_varchar', - 'sales_order', -]; - -foreach ($tablesToDrop as $table) { - $table = $installer->getTable($table); - if (!$installer->tableExists($table)) { - continue; - } - $installer->getConnection()->query( - 'DROP TABLE ' . $installer->getConnection()->quoteIdentifier($table), - ); -} - -/* Add columns to tables */ -$tableData = [ - 'sales/quote_item' => [ - 'price_incl_tax' => 'decimal', - 'base_price_incl_tax' => 'decimal', - 'row_total_incl_tax' => 'decimal', - 'base_row_total_incl_tax' => 'decimal', - ], - 'sales/order_item' => [ - 'price_incl_tax' => 'decimal', - 'base_price_incl_tax' => 'decimal', - 'row_total_incl_tax' => 'decimal', - 'base_row_total_incl_tax' => 'decimal', - ], - 'sales/quote_address' => [ - 'shipping_discount_amount' => 'decimal', - 'base_shipping_discount_amount' => 'decimal', - 'subtotal_incl_tax' => 'decimal', - 'base_subtotal_total_incl_tax' => 'decimal', - 'discount_description' => 'varchar', - ], - 'sales/quote_address_item' => [ - 'product_id' => 'int', - 'super_product_id' => 'int', - 'parent_product_id' => 'int', - 'sku' => 'varchar', - 'image' => 'varchar', - 'name' => 'varchar', - 'description' => 'text', - 'free_shipping' => 'int', - 'is_qty_decimal' => 'int', - 'price' => 'decimal', - 'discount_percent' => 'decimal', - 'no_discount' => 'int', - 'tax_percent' => 'decimal', - 'base_price' => 'decimal', - 'price_incl_tax' => 'decimal', - 'base_price_incl_tax' => 'decimal', - 'row_total_incl_tax' => 'decimal', - 'base_row_total_incl_tax' => 'decimal', - ], - 'sales/quote_payment' => [ - 'additional_data' => 'text', - 'cc_ss_issue' => 'varchar', - ], - 'sales/quote_address_shipping_rate' => [ - 'error_message' => 'text', - ], -]; - -foreach ($tableData as $table => $columns) { - foreach ($columns as $columnName => $columnType) { - $installer->getConnection()->addColumn( - $installer->getTable($table), - $columnName, - $definitions[$columnType], - ); - } -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php deleted file mode 100644 index 795d0c5c82f..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php +++ /dev/null @@ -1,26 +0,0 @@ -getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'updated_at', 'datetime default NULL'); -$installer->getConnection()->addKey($installer->getTable('sales_flat_order_grid'), 'IDX_UPDATED_AT', 'updated_at'); -$installer->run(" - UPDATE {$installer->getTable('sales_flat_order_grid')} AS g - JOIN {$installer->getTable('sales_flat_order')} AS o ON g.entity_id=o.entity_id - SET g.updated_at=o.updated_at -"); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php deleted file mode 100644 index 62a43b5d0cb..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php +++ /dev/null @@ -1,22 +0,0 @@ -getConnection()->addKey($installer->getTable('sales_flat_order'), 'IDX_UPDATED_AT', 'updated_at'); -$installer->getConnection()->addKey($installer->getTable('sales_flat_shipment'), 'IDX_CREATED_AT', 'created_at'); -$installer->getConnection()->addKey($installer->getTable('sales_flat_shipment'), 'IDX_UPDATED_AT', 'updated_at'); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.15-1.4.0.16.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.15-1.4.0.16.php deleted file mode 100644 index 6cf83877d5d..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.15-1.4.0.16.php +++ /dev/null @@ -1,22 +0,0 @@ -getConnection()->addColumn($installer->getTable('sales/order_item'), 'tax_canceled', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'hidden_tax_canceled', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'tax_refunded', 'decimal(12,4) NULL'); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.16-1.4.0.17.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.16-1.4.0.17.php deleted file mode 100644 index 4f6c56a9bb6..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.16-1.4.0.17.php +++ /dev/null @@ -1,36 +0,0 @@ -getTable('sales/billing_agreement'); - -$installer->getConnection()->addColumn( - $billingAgreementTable, - 'store_id', - 'smallint(5) unsigned DEFAULT NULL', -); - -$installer->getConnection()->addConstraint( - 'FK_BILLING_AGREEMENT_STORE', - $billingAgreementTable, - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'SET NULL', - 'CASCADE', -); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.17-1.4.0.18.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.17-1.4.0.18.php deleted file mode 100644 index 91d4538bfac..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.17-1.4.0.18.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('sales/invoice_comment'), - 'is_visible_on_front', - 'tinyint(1) unsigned not null default 0 after `is_customer_notified`', -); -$installer->getConnection()->addColumn( - $installer->getTable('sales/shipment_comment'), - 'is_visible_on_front', - 'tinyint(1) unsigned not null default 0 after `is_customer_notified`', -); -$installer->getConnection()->addColumn( - $installer->getTable('sales/creditmemo_comment'), - 'is_visible_on_front', - 'tinyint(1) unsigned not null default 0 after `is_customer_notified`', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.18-1.4.0.19.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.18-1.4.0.19.php deleted file mode 100644 index af4a329064b..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.18-1.4.0.19.php +++ /dev/null @@ -1,26 +0,0 @@ -getTable('sales/billing_agreement'); - -$installer->getConnection()->addColumn( - $billingAgreementTable, - 'agreement_label', - 'varchar(255)', -); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.19-1.4.0.20.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.19-1.4.0.20.php deleted file mode 100644 index d8aa5c4d6e0..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.19-1.4.0.20.php +++ /dev/null @@ -1,21 +0,0 @@ -getConnection()->addKey($installer->getTable('sales/quote'), 'IDX_IS_ACTIVE', 'is_active'); -$installer->getConnection()->addKey($installer->getTable('sales/order_item'), 'IDX_PRODUCT_ID', 'product_id'); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php deleted file mode 100644 index 6c5aa78cb1b..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php +++ /dev/null @@ -1,60 +0,0 @@ -getConnection()->addColumn($installer->getTable('sales/order'), 'hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'base_hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'shipping_hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'base_shipping_hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'hidden_tax_invoiced', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'base_hidden_tax_invoiced', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'hidden_tax_refunded', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'base_hidden_tax_refunded', 'decimal(12,4) NULL'); - -$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'base_hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'hidden_tax_invoiced', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'base_hidden_tax_invoiced', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'hidden_tax_refunded', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'base_hidden_tax_refunded', 'decimal(12,4) NULL'); - -$installer->getConnection()->addColumn($installer->getTable('sales/invoice'), 'hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/invoice'), 'base_hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/invoice'), 'shipping_hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/invoice'), 'base_shipping_hidden_tax_amount', 'decimal(12,4) NULL'); - -$installer->getConnection()->addColumn($installer->getTable('sales/invoice_item'), 'hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/invoice_item'), 'base_hidden_tax_amount', 'decimal(12,4) NULL'); - -$installer->getConnection()->addColumn($installer->getTable('sales/creditmemo'), 'hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/creditmemo'), 'base_hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/creditmemo'), 'shipping_hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/creditmemo'), 'base_shipping_hidden_tax_amount', 'decimal(12,4) NULL'); - -$installer->getConnection()->addColumn($installer->getTable('sales/creditmemo_item'), 'hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/creditmemo_item'), 'base_hidden_tax_amount', 'decimal(12,4) NULL'); - -$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'base_hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'shipping_hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'base_shipping_hidden_tax_amount', 'decimal(12,4) NULL'); - -$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_item'), 'hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_item'), 'base_hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'hidden_tax_amount', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'base_hidden_tax_amount', 'decimal(12,4) NULL'); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.20-1.4.0.21.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.20-1.4.0.21.php deleted file mode 100644 index afd206b9c0a..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.20-1.4.0.21.php +++ /dev/null @@ -1,61 +0,0 @@ - 'FK_PRODUCT_ORDERED_AGGREGATED_%s_STORE_ID', - 'column' => 'store_id', - 'refTable' => 'core/store', - 'refColumn' => 'store_id', - ], - [ - 'name' => 'FK_PRODUCT_ORDERED_AGGREGATED_%s_PRODUCT_ID', - 'column' => 'product_id', - 'refTable' => 'catalog/product', - 'refColumn' => 'entity_id', - ], -]; - -/* - * Alter foreign keys to add 'CASCADE' instead of 'SET_NULL' action - * Also remove all wrong report records with NULL in 'product_id' field - */ -$connection = $installer->getConnection(); -foreach ($frequencies as $frequency) { - $tableName = $installer->getTable('sales/bestsellers_aggregated_' . $frequency); - - foreach ($foreignKeys as $fkInfo) { - $connection->addConstraint( - sprintf($fkInfo['name'], strtoupper($frequency)), - $tableName, - $fkInfo['column'], - $installer->getTable($fkInfo['refTable']), - $fkInfo['refColumn'], - ); - } - - $connection->delete($tableName, 'product_id IS NULL'); -} diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.21-1.4.0.22.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.21-1.4.0.22.php deleted file mode 100644 index 2fe2041c69c..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.21-1.4.0.22.php +++ /dev/null @@ -1,28 +0,0 @@ -getTable($table); - $installer->getConnection()->dropKey($tableName, 'IDX_INCREMENT_ID'); - $installer->getConnection()->addKey($tableName, 'UNQ_INCREMENT_ID', 'increment_id', 'unique'); -} diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.22-1.4.0.23.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.22-1.4.0.23.php deleted file mode 100644 index 70b572a1918..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.22-1.4.0.23.php +++ /dev/null @@ -1,83 +0,0 @@ -getTable('sales/order_status'); -$statusStateTable = $installer->getTable('sales/order_status_state'); -$statusLabelTable = $installer->getTable('sales/order_status_label'); - -$installer->run(" -CREATE TABLE `{$statusTable}` ( - `status` varchar(32) NOT NULL, - `label` varchar(128) NOT NULL, - PRIMARY KEY (`status`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 -"); - -$statuses = Mage::getConfig()->getNode('global/sales/order/statuses')->asArray(); -$data = []; -foreach ($statuses as $code => $info) { - $data[] = [ - 'status' => $code, - 'label' => $info['label'], - ]; -} -$installer->getConnection()->insertArray($statusTable, ['status', 'label'], $data); - -$installer->run(" -CREATE TABLE `{$statusStateTable}` ( - `status` varchar(32) NOT NULL, - `state` varchar(32) NOT NULL, - `is_default` tinyint(1) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`status`,`state`), - CONSTRAINT `FK_SALES_ORDER_STATUS_STATE_STATUS` FOREIGN KEY (`status`) - REFERENCES `{$statusTable}` (`status`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 -"); -$states = Mage::getConfig()->getNode('global/sales/order/states')->asArray(); -$data = []; -foreach ($states as $code => $info) { - if (isset($info['statuses'])) { - foreach ($info['statuses'] as $status => $statusInfo) { - $data[] = [ - 'status' => $status, - 'state' => $code, - 'is_default' => is_array($statusInfo) && isset($statusInfo['@']['default']) ? 1 : 0, - ]; - } - } -} -$installer->getConnection()->insertArray( - $statusStateTable, - ['status', 'state', 'is_default'], - $data, -); - -$installer->run(" -CREATE TABLE `{$statusLabelTable}` ( - `status` varchar(32) NOT NULL, - `store_id` smallint(5) unsigned NOT NULL, - `label` varchar(128) NOT NULL, - PRIMARY KEY (`status`,`store_id`), - KEY `FK_SALES_ORDER_STATUS_LABEL_STORE` (`store_id`), - CONSTRAINT `FK_SALES_ORDER_STATUS_LABEL_STATUS` FOREIGN KEY (`status`) - REFERENCES `{$statusTable}` (`status`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALES_ORDER_STATUS_LABEL_STORE` FOREIGN KEY (`store_id`) - REFERENCES `{$installer->getTable('core/store')}` (`store_id`)ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 -"); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.23-1.4.0.24.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.23-1.4.0.24.php deleted file mode 100644 index a5194caf473..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.23-1.4.0.24.php +++ /dev/null @@ -1,24 +0,0 @@ -getConnection()->addColumn( - $installer->getTable('sales/invoice'), - 'base_total_refunded', - 'decimal(12,4) default NULL', -); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.24-1.4.0.25.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.24-1.4.0.25.php deleted file mode 100644 index 5768104e273..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.24-1.4.0.25.php +++ /dev/null @@ -1,20 +0,0 @@ -getConnection()->addKey($this->getTable('sales/order'), 'IDX_QUOTE_ID', 'quote_id'); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.3-1.4.0.4.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.3-1.4.0.4.php deleted file mode 100644 index 9ebeb72f8cf..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.3-1.4.0.4.php +++ /dev/null @@ -1,57 +0,0 @@ -getTable('sales/bestsellers_aggregated_' . $frequency); - - $installer->run(" - CREATE TABLE `{$tableName}` ( - `id` int(11) unsigned NOT NULL auto_increment, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned NULL DEFAULT NULL, - `product_id` int(10) unsigned NULL DEFAULT NULL, - `product_name` varchar(255) NOT NULL DEFAULT '', - `product_price` decimal(12,4) NOT NULL DEFAULT '0', - `qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000', - `rating_pos` smallint(5) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_PRODUCT` (`period`, `store_id`, `product_id`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_PRODUCT_ID` (`product_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - "); - - $installer->getConnection()->addConstraint( - 'PRODUCT_ORDERED_AGGREGATED_' . strtoupper($frequency) . '_STORE_ID', - $tableName, - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'SET NULL', - ); - - $installer->getConnection()->addConstraint( - 'PRODUCT_ORDERED_AGGREGATED_' . strtoupper($frequency) . '_PRODUCT_ID', - $tableName, - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', - 'SET NULL', - ); -} diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.4-1.4.0.5.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.4-1.4.0.5.php deleted file mode 100644 index 87d1f48708c..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.4-1.4.0.5.php +++ /dev/null @@ -1,30 +0,0 @@ -getConnection()->addColumn($installer->getTable('sales/order'), 'shipping_incl_tax', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'base_shipping_incl_tax', 'decimal(12,4) NULL'); - -$installer->getConnection()->addColumn($installer->getTable('sales/invoice'), 'shipping_incl_tax', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/invoice'), 'base_shipping_incl_tax', 'decimal(12,4) NULL'); - -$installer->getConnection()->addColumn($installer->getTable('sales/creditmemo'), 'shipping_incl_tax', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/creditmemo'), 'base_shipping_incl_tax', 'decimal(12,4) NULL'); - -$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'shipping_incl_tax', 'decimal(12,4) NULL'); -$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'base_shipping_incl_tax', 'decimal(12,4) NULL'); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.5-1.4.0.6.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.5-1.4.0.6.php deleted file mode 100644 index b0a93081217..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.5-1.4.0.6.php +++ /dev/null @@ -1,60 +0,0 @@ -getConnection()->addColumn( - $installer->getTable('sales/shipping_aggregated_order'), - 'total_shipping_actual', - "decimal(12,4) NOT NULL default '0.0000'", -); - -$installer->getConnection()->addColumn( - $installer->getTable('sales/shipping_aggregated'), - 'total_shipping_actual', - "decimal(12,4) NOT NULL default '0.0000'", -); - -$installer->run(" -DROP TABLE `{$installer->getTable('sales/order_aggregated_created')}`; -CREATE TABLE `{$installer->getTable('sales/order_aggregated_created')}` ( - `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `period` DATE NOT NULL DEFAULT '0000-00-00', - `store_id` SMALLINT(5) UNSIGNED DEFAULT NULL, - `order_status` VARCHAR(50) NOT NULL DEFAULT '', - `orders_count` INT(11) NOT NULL DEFAULT '0', - `total_qty_ordered` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - `total_qty_invoiced` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - `total_income_amount` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - `total_revenue_amount` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - `total_profit_amount` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - `total_invoiced_amount` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - `total_canceled_amount` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - `total_paid_amount` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - `total_refunded_amount` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - `total_tax_amount` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - `total_tax_amount_actual` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - `total_shipping_amount` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - `total_shipping_amount_actual` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - `total_discount_amount` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - `total_discount_amount_actual` DECIMAL(12,4) NOT NULL DEFAULT '0.0000', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`), - KEY `IDX_STORE_ID` (`store_id`), - CONSTRAINT `FK_SALES_ORDER_AGGREGATED_CREATED` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=INNODB DEFAULT CHARSET=utf8; -"); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.6-1.4.0.7.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.6-1.4.0.7.php deleted file mode 100644 index 54a78b1f67a..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.6-1.4.0.7.php +++ /dev/null @@ -1,27 +0,0 @@ -getTable('sales_flat_order_status_history'); -$installer->getConnection()->addColumn( - $orderHistoryTable, - 'is_visible_on_front', - "tinyint(1) UNSIGNED NOT NULL default '0' after `is_customer_notified`", -); -$installer->run("UPDATE {$orderHistoryTable} SET - is_visible_on_front = (is_customer_notified = 1 AND comment IS NOT NULL AND comment <> '');"); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.7-1.4.0.8.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.7-1.4.0.8.php deleted file mode 100644 index 8e1cbc4c752..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.7-1.4.0.8.php +++ /dev/null @@ -1,28 +0,0 @@ -getTable('sales/order'); - -$installer->run(" -UPDATE {$orderTable} SET - base_discount_canceled = (ABS(base_discount_amount) - IFNULL(base_discount_invoiced, 0)), - base_total_canceled = (base_subtotal_canceled + IFNULL(base_tax_canceled, 0) + IFNULL(base_shipping_canceled, 0) - IFNULL(ABS(base_discount_amount) - IFNULL(base_discount_invoiced, 0), 0)), - discount_canceled = (ABS(discount_amount) - IFNULL(discount_invoiced, 0)), - total_canceled = (subtotal_canceled + IFNULL(tax_canceled, 0) + IFNULL(shipping_canceled, 0) - IFNULL(ABS(discount_amount) - IFNULL(discount_invoiced, 0), 0)) -"); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.8-1.4.0.15.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.8-1.4.0.15.php deleted file mode 100644 index 29c8aa8b252..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.8-1.4.0.15.php +++ /dev/null @@ -1,190 +0,0 @@ -getTable('sales/order_grid'); -$orderTable = $installer->getTable('sales/order'); -$paymentTransactionTable = $installer->getTable('sales/payment_transaction'); -$profileTable = $installer->getTable('sales_recurring_profile'); -$orderItemTable = $installer->getTable('sales_flat_order_item'); -$flatOrderTable = $installer->getTable('sales_flat_order'); -$profileOrderTable = $installer->getTable('sales_recurring_profile_order'); -$customerEntityTable = $installer->getTable('customer_entity'); -$coreStoreTable = $installer->getTable('core_store'); -$billingAgreementTable = $installer->getTable('sales/billing_agreement'); -$billingAgreementOrderTable = $installer->getTable('sales/billing_agreement_order'); - -//------- -$installer->getConnection()->addColumn( - $orderGridTable, - 'store_name', - 'varchar(255) null default null AFTER `store_id`', -); - -$installer->run(" - UPDATE {$orderGridTable} AS og - INNER JOIN {$orderTable} AS o on (og.entity_id=o.entity_id) - SET - og.store_name = o.store_name -"); - -//------- -$installer->getConnection()->addColumn( - $paymentTransactionTable, - 'created_at', - 'DATETIME NULL', -); - -//------- -$this->getConnection()->addColumn($orderItemTable, 'is_nominal', 'int NOT NULL DEFAULT \'0\''); - -//------- -$installer->run(" - CREATE TABLE `{$billingAgreementTable}` ( - `agreement_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `customer_id` int(10) unsigned NOT NULL, - `method_code` varchar(32) NOT NULL, - `reference_id` varchar(32) NOT NULL, - `status` varchar(20) NOT NULL, - `created_at` datetime NOT NULL, - `updated_at` datetime DEFAULT NULL, - PRIMARY KEY (`agreement_id`), - KEY `IDX_CUSTOMER` (`customer_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->getConnection()->addConstraint( - 'FK_BILLING_AGREEMENT_CUSTOMER', - $billingAgreementTable, - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -//------- -$installer->run(" - CREATE TABLE `{$billingAgreementOrderTable}` ( - `agreement_id` int(10) unsigned NOT NULL, - `order_id` int(10) unsigned NOT NULL, - UNIQUE KEY `UNQ_BILLING_AGREEMENT_ORDER` (`agreement_id`,`order_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->getConnection()->addConstraint( - 'FK_BILLING_AGREEMENT_ORDER_AGREEMENT', - $billingAgreementOrderTable, - 'agreement_id', - $billingAgreementTable, - 'agreement_id', -); - -$installer->getConnection()->addConstraint( - 'FK_BILLING_AGREEMENT_ORDER_ORDER', - $billingAgreementOrderTable, - 'order_id', - $orderTable, - 'entity_id', -); - -//------- - -$this->run(" -CREATE TABLE `{$profileTable}` ( - `profile_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `state` varchar(20) NOT NULL, - `customer_id` int(10) unsigned DEFAULT NULL, - `store_id` smallint(5) unsigned DEFAULT NULL, - `method_code` varchar(32) NOT NULL, - `created_at` datetime NOT NULL, - `updated_at` datetime DEFAULT NULL, - `reference_id` varchar(32) DEFAULT NULL, - `subscriber_name` varchar(150) DEFAULT NULL, - `start_datetime` datetime NOT NULL, - `internal_reference_id` varchar(42) NOT NULL, - `schedule_description` varchar(255) NOT NULL, - `suspension_threshold` smallint(6) unsigned DEFAULT NULL, - `bill_failed_later` tinyint(1) unsigned NOT NULL DEFAULT '0', - `period_unit` varchar(20) NOT NULL, - `period_frequency` tinyint(3) unsigned DEFAULT NULL, - `period_max_cycles` tinyint(3) unsigned DEFAULT NULL, - `billing_amount` double(12,4) unsigned NOT NULL DEFAULT '0.0000', - `trial_period_unit` varchar(20) DEFAULT NULL, - `trial_period_frequency` tinyint(3) unsigned DEFAULT NULL, - `trial_period_max_cycles` tinyint(3) unsigned DEFAULT NULL, - `trial_billing_amount` double(12,4) unsigned DEFAULT NULL, - `currency_code` char(3) NOT NULL, - `shipping_amount` decimal(12,4) unsigned DEFAULT NULL, - `tax_amount` decimal(12,4) unsigned DEFAULT NULL, - `init_amount` decimal(12,4) unsigned DEFAULT NULL, - `init_may_fail` tinyint(1) unsigned NOT NULL DEFAULT '0', - `order_info` text NOT NULL, - `order_item_info` text NOT NULL, - `billing_address_info` text NOT NULL, - `shipping_address_info` text DEFAULT NULL, - `profile_vendor_info` text DEFAULT NULL, - `additional_info` text DEFAULT NULL, - PRIMARY KEY (`profile_id`), - UNIQUE KEY `UNQ_INTERNAL_REF_ID` (`internal_reference_id`), - KEY `IDX_RECURRING_PROFILE_CUSTOMER` (`customer_id`), - KEY `IDX_RECURRING_PROFILE_STORE` (`store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - -$this->getConnection()->addConstraint( - 'FK_RECURRING_PROFILE_CUSTOMER', - $profileTable, - 'customer_id', - $customerEntityTable, - 'entity_id', - 'SET NULL', -); - -$this->getConnection()->addConstraint( - 'FK_RECURRING_PROFILE_STORE', - $profileTable, - 'store_id', - $coreStoreTable, - 'store_id', - 'SET NULL', -); - -$this->run(" -CREATE TABLE `{$profileOrderTable}` ( - `link_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `profile_id` int(10) unsigned NOT NULL DEFAULT '0', - `order_id` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`link_id`), - UNIQUE KEY `UNQ_PROFILE_ORDER` (`profile_id`,`order_id`), - KEY `IDX_ORDER` (`order_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$this->getConnection()->addConstraint( - 'FK_RECURRING_PROFILE_ORDER_PROFILE', - $profileOrderTable, - 'profile_id', - $profileTable, - 'profile_id', -); - -$this->getConnection()->addConstraint( - 'FK_RECURRING_PROFILE_ORDER_ORDER', - $profileOrderTable, - 'order_id', - $flatOrderTable, - 'entity_id', -); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index c91cb113733..00000000000 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,8188 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/bestsellers_aggregated_daily'), - 'FK_PRODUCT_ORDERED_AGGREGATED_DAILY_PRODUCT_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/bestsellers_aggregated_daily'), - 'FK_PRODUCT_ORDERED_AGGREGATED_DAILY_STORE_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/bestsellers_aggregated_monthly'), - 'FK_PRODUCT_ORDERED_AGGREGATED_MONTHLY_PRODUCT_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/bestsellers_aggregated_monthly'), - 'FK_PRODUCT_ORDERED_AGGREGATED_MONTHLY_STORE_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/bestsellers_aggregated_yearly'), - 'FK_PRODUCT_ORDERED_AGGREGATED_YEARLY_PRODUCT_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/bestsellers_aggregated_yearly'), - 'FK_PRODUCT_ORDERED_AGGREGATED_YEARLY_STORE_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/billing_agreement'), - 'FK_BILLING_AGREEMENT_CUSTOMER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/billing_agreement'), - 'FK_BILLING_AGREEMENT_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/billing_agreement_order'), - 'FK_BILLING_AGREEMENT_ORDER_AGREEMENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/billing_agreement_order'), - 'FK_BILLING_AGREEMENT_ORDER_ORDER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/creditmemo'), - 'FK_SALES_FLAT_CREDITMEMO_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/creditmemo'), - 'FK_SALES_FLAT_CREDITMEMO_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/creditmemo_comment'), - 'FK_SALES_FLAT_CREDITMEMO_COMMENT_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/creditmemo_grid'), - 'FK_SALES_FLAT_CREDITMEMO_GRID_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/creditmemo_grid'), - 'FK_SALES_FLAT_CREDITMEMO_GRID_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/creditmemo_item'), - 'FK_SALES_FLAT_CREDITMEMO_ITEM_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/invoice'), - 'FK_SALES_FLAT_INVOICE_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/invoice'), - 'FK_SALES_FLAT_INVOICE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/invoice_comment'), - 'FK_SALES_FLAT_INVOICE_COMMENT_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/invoice_grid'), - 'FK_SALES_FLAT_INVOICE_GRID_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/invoice_grid'), - 'FK_SALES_FLAT_INVOICE_GRID_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/invoice_item'), - 'FK_SALES_FLAT_INVOICE_ITEM_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order'), - 'FK_SALES_FLAT_ORDER_CUSTOMER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order'), - 'FK_SALES_FLAT_ORDER_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order_address'), - 'FK_SALES_FLAT_ORDER_ADDRESS_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order_grid'), - 'FK_SALES_FLAT_ORDER_GRID_CUSTOMER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order_grid'), - 'FK_SALES_FLAT_ORDER_GRID_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order_grid'), - 'FK_SALES_FLAT_ORDER_GRID_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order_item'), - 'FK_SALES_FLAT_ORDER_ITEM_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order_item'), - 'FK_SALES_FLAT_ORDER_ITEM_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order_payment'), - 'FK_SALES_FLAT_ORDER_PAYMENT_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order_status_history'), - 'FK_SALES_FLAT_ORDER_STATUS_HISTORY_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/quote'), - 'FK_SALES_QUOTE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/quote_address'), - 'FK_SALES_QUOTE_ADDRESS_SALES_QUOTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/quote_address_item'), - 'FK_QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/quote_address_item'), - 'FK_SALES_FLAT_QUOTE_ADDRESS_ITEM_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/quote_address_item'), - 'FK_SALES_QUOTE_ADDRESS_ITEM_QUOTE_ITEM', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/quote_item'), - 'FK_SALES_FLAT_QUOTE_ITEM_PARENT_ITEM', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/quote_item'), - 'FK_SALES_QUOTE_ITEM_CATALOG_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/quote_item'), - 'FK_SALES_QUOTE_ITEM_SALES_QUOTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/quote_item'), - 'FK_SALES_QUOTE_ITEM_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/quote_item_option'), - 'FK_SALES_QUOTE_ITEM_OPTION_ITEM_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/quote_payment'), - 'FK_SALES_QUOTE_PAYMENT_SALES_QUOTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/quote_address_shipping_rate'), - 'FK_SALES_QUOTE_SHIPPING_RATE_ADDRESS', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/shipment'), - 'FK_SALES_FLAT_SHIPMENT_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/shipment'), - 'FK_SALES_FLAT_SHIPMENT_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/shipment_comment'), - 'FK_SALES_FLAT_SHIPMENT_COMMENT_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/shipment_grid'), - 'FK_SALES_FLAT_SHIPMENT_GRID_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/shipment_grid'), - 'FK_SALES_FLAT_SHIPMENT_GRID_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/shipment_item'), - 'FK_SALES_FLAT_SHIPMENT_ITEM_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/shipment_track'), - 'FK_SALES_FLAT_SHIPMENT_TRACK_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/invoiced_aggregated'), - 'FK_SALES_INVOICED_AGGREGATED_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/invoiced_aggregated_order'), - 'FK_SALES_INVOICED_AGGREGATED_ORDER_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order_aggregated_created'), - 'FK_SALES_ORDER_AGGREGATED_CREATED', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order_status_label'), - 'FK_SALES_ORDER_STATUS_LABEL_STATUS', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order_status_label'), - 'FK_SALES_ORDER_STATUS_LABEL_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order_status_state'), - 'FK_SALES_ORDER_STATUS_STATE_STATUS', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/order_tax'), - 'FK_SALES_ORDER_TAX_ORDER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/payment_transaction'), - 'FK_SALES_PAYMENT_TRANSACTION_ORDER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/payment_transaction'), - 'FK_SALES_PAYMENT_TRANSACTION_PARENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/payment_transaction'), - 'FK_SALES_PAYMENT_TRANSACTION_PAYMENT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/recurring_profile'), - 'FK_RECURRING_PROFILE_CUSTOMER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/recurring_profile'), - 'FK_RECURRING_PROFILE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/recurring_profile_order'), - 'FK_RECURRING_PROFILE_ORDER_ORDER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/recurring_profile_order'), - 'FK_RECURRING_PROFILE_ORDER_PROFILE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/refunded_aggregated'), - 'FK_SALES_REFUNDED_AGGREGATED_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/refunded_aggregated_order'), - 'FK_SALES_REFUNDED_AGGREGATED_ORDER_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/shipping_aggregated'), - 'FK_SALES_SHIPPING_AGGREGATED_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('sales/shipping_aggregated_order'), - 'FK_SALES_SHIPPING_AGGREGATED_ORDER_STORE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('sales/bestsellers_aggregated_daily'), - 'UNQ_PERIOD_STORE_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/bestsellers_aggregated_daily'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/bestsellers_aggregated_daily'), - 'IDX_PRODUCT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/bestsellers_aggregated_monthly'), - 'UNQ_PERIOD_STORE_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/bestsellers_aggregated_monthly'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/bestsellers_aggregated_monthly'), - 'IDX_PRODUCT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/bestsellers_aggregated_yearly'), - 'UNQ_PERIOD_STORE_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/bestsellers_aggregated_yearly'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/bestsellers_aggregated_yearly'), - 'IDX_PRODUCT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/billing_agreement'), - 'IDX_CUSTOMER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/billing_agreement'), - 'FK_BILLING_AGREEMENT_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/billing_agreement_order'), - 'UNQ_BILLING_AGREEMENT_ORDER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/billing_agreement_order'), - 'FK_BILLING_AGREEMENT_ORDER_ORDER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo'), - 'UNQ_INCREMENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo'), - 'IDX_ORDER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo'), - 'IDX_CREDITMEMO_STATUS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo'), - 'IDX_STATE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo'), - 'IDX_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo_comment'), - 'IDX_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo_comment'), - 'IDX_PARENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo_grid'), - 'UNQ_INCREMENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo_grid'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo_grid'), - 'IDX_GRAND_TOTAL', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo_grid'), - 'IDX_BASE_GRAND_TOTAL', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo_grid'), - 'IDX_ORDER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo_grid'), - 'IDX_CREDITMEMO_STATUS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo_grid'), - 'IDX_STATE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo_grid'), - 'IDX_ORDER_INCREMENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo_grid'), - 'IDX_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo_grid'), - 'IDX_ORDER_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo_grid'), - 'IDX_BILLING_NAME', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/creditmemo_item'), - 'IDX_PARENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice'), - 'UNQ_INCREMENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice'), - 'IDX_GRAND_TOTAL', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice'), - 'IDX_ORDER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice'), - 'IDX_STATE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice'), - 'IDX_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice_comment'), - 'IDX_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice_comment'), - 'IDX_PARENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice_grid'), - 'UNQ_INCREMENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice_grid'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice_grid'), - 'IDX_GRAND_TOTAL', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice_grid'), - 'IDX_ORDER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice_grid'), - 'IDX_STATE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice_grid'), - 'IDX_ORDER_INCREMENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice_grid'), - 'IDX_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice_grid'), - 'IDX_ORDER_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice_grid'), - 'IDX_BILLING_NAME', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoice_item'), - 'IDX_PARENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order'), - 'UNQ_INCREMENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order'), - 'IDX_STATUS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order'), - 'IDX_STATE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order'), - 'IDX_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order'), - 'IDX_CUSTOMER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order'), - 'IDX_EXT_ORDER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order'), - 'IDX_UPDATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order'), - 'IDX_QUOTE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_address'), - 'IDX_PARENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_grid'), - 'UNQ_INCREMENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_grid'), - 'IDX_STATUS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_grid'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_grid'), - 'IDX_BASE_GRAND_TOTAL', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_grid'), - 'IDX_BASE_TOTAL_PAID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_grid'), - 'IDX_GRAND_TOTAL', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_grid'), - 'IDX_TOTAL_PAID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_grid'), - 'IDX_SHIPPING_NAME', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_grid'), - 'IDX_BILLING_NAME', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_grid'), - 'IDX_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_grid'), - 'IDX_CUSTOMER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_grid'), - 'IDX_UPDATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_item'), - 'IDX_ORDER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_item'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_item'), - 'IDX_PRODUCT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_payment'), - 'IDX_PARENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_status_history'), - 'IDX_PARENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_status_history'), - 'IDX_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/quote'), - 'FK_SALES_QUOTE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/quote'), - 'IDX_CUSTOMER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/quote'), - 'IDX_IS_ACTIVE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/quote_address'), - 'FK_SALES_QUOTE_ADDRESS_SALES_QUOTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/quote_address_item'), - 'FK_QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/quote_address_item'), - 'FK_SALES_QUOTE_ADDRESS_ITEM_QUOTE_ITEM', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/quote_address_item'), - 'FK_SALES_FLAT_QUOTE_ADDRESS_ITEM_PARENT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/quote_item'), - 'FK_SALES_QUOTE_ITEM_SALES_QUOTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/quote_item'), - 'FK_SALES_FLAT_QUOTE_ITEM_PARENT_ITEM', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/quote_item'), - 'FK_SALES_QUOTE_ITEM_CATALOG_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/quote_item'), - 'FK_SALES_QUOTE_ITEM_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/quote_item_option'), - 'FK_SALES_QUOTE_ITEM_OPTION_ITEM_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/quote_payment'), - 'FK_SALES_QUOTE_PAYMENT_SALES_QUOTE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/quote_address_shipping_rate'), - 'FK_SALES_QUOTE_SHIPPING_RATE_ADDRESS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment'), - 'UNQ_INCREMENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment'), - 'IDX_TOTAL_QTY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment'), - 'IDX_ORDER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment'), - 'IDX_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment'), - 'IDX_UPDATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_comment'), - 'IDX_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_comment'), - 'IDX_PARENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_grid'), - 'UNQ_INCREMENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_grid'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_grid'), - 'IDX_TOTAL_QTY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_grid'), - 'IDX_ORDER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_grid'), - 'IDX_SHIPMENT_STATUS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_grid'), - 'IDX_ORDER_INCREMENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_grid'), - 'IDX_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_grid'), - 'IDX_ORDER_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_grid'), - 'IDX_SHIPPING_NAME', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_item'), - 'IDX_PARENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_track'), - 'IDX_PARENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_track'), - 'IDX_ORDER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipment_track'), - 'IDX_CREATED_AT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoiced_aggregated'), - 'UNQ_PERIOD_STORE_ORDER_STATUS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoiced_aggregated'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoiced_aggregated_order'), - 'UNQ_PERIOD_STORE_ORDER_STATUS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/invoiced_aggregated_order'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_aggregated_created'), - 'UNQ_PERIOD_STORE_ORDER_STATUS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_aggregated_created'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_status_label'), - 'FK_SALES_ORDER_STATUS_LABEL_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/order_tax'), - 'IDX_ORDER_TAX', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/payment_transaction'), - 'UNQ_ORDER_PAYMENT_TXN', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/payment_transaction'), - 'IDX_ORDER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/payment_transaction'), - 'IDX_PARENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/payment_transaction'), - 'IDX_PAYMENT_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/recurring_profile'), - 'UNQ_INTERNAL_REF_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/recurring_profile'), - 'IDX_RECURRING_PROFILE_CUSTOMER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/recurring_profile'), - 'IDX_RECURRING_PROFILE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/recurring_profile_order'), - 'UNQ_PROFILE_ORDER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/recurring_profile_order'), - 'IDX_ORDER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/refunded_aggregated'), - 'UNQ_PERIOD_STORE_ORDER_STATUS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/refunded_aggregated'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/refunded_aggregated_order'), - 'UNQ_PERIOD_STORE_ORDER_STATUS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/refunded_aggregated_order'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipping_aggregated'), - 'UNQ_PERIOD_STORE_ORDER_STATUS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipping_aggregated'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipping_aggregated_order'), - 'UNQ_PERIOD_STORE_ORDER_STATUS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('sales/shipping_aggregated_order'), - 'IDX_STORE_ID', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('sales/quote') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Updated At', - ], - 'converted_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Converted At', - ], - 'is_active' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '1', - 'comment' => 'Is Active', - ], - 'is_virtual' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Is Virtual', - ], - 'is_multi_shipping' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Is Multi Shipping', - ], - 'items_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Items Count', - ], - 'items_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Items Qty', - ], - 'orig_order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Orig Order Id', - ], - 'store_to_base_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Store To Base Rate', - ], - 'store_to_quote_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Store To Quote Rate', - ], - 'base_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Base Currency Code', - ], - 'store_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Store Currency Code', - ], - 'quote_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Quote Currency Code', - ], - 'grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Grand Total', - ], - 'base_grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Base Grand Total', - ], - 'checkout_method' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Checkout Method', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Customer Id', - ], - 'customer_tax_class_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Customer Tax Class Id', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Customer Group Id', - ], - 'customer_email' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Customer Email', - ], - 'customer_prefix' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 40, - 'comment' => 'Customer Prefix', - ], - 'customer_firstname' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Customer Firstname', - ], - 'customer_middlename' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 40, - 'comment' => 'Customer Middlename', - ], - 'customer_lastname' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Customer Lastname', - ], - 'customer_suffix' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 40, - 'comment' => 'Customer Suffix', - ], - 'customer_dob' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATETIME, - 'comment' => 'Customer Dob', - ], - 'customer_note' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Customer Note', - ], - 'customer_note_notify' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '1', - 'comment' => 'Customer Note Notify', - ], - 'customer_is_guest' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Customer Is Guest', - ], - 'remote_ip' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Remote Ip', - ], - 'applied_rule_ids' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Applied Rule Ids', - ], - 'reserved_order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 64, - 'comment' => 'Reserved Order Id', - ], - 'password_hash' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Password Hash', - ], - 'coupon_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Coupon Code', - ], - 'global_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Global Currency Code', - ], - 'base_to_global_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base To Global Rate', - ], - 'base_to_quote_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base To Quote Rate', - ], - 'customer_taxvat' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Customer Taxvat', - ], - 'customer_gender' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Customer Gender', - ], - 'subtotal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Subtotal', - ], - 'base_subtotal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Subtotal', - ], - 'subtotal_with_discount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Subtotal With Discount', - ], - 'base_subtotal_with_discount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Subtotal With Discount', - ], - 'is_changed' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Is Changed', - ], - 'trigger_recollect' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'comment' => 'Trigger Recollect', - ], - 'ext_shipping_info' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Ext Shipping Info', - ], - ], - 'comment' => 'Sales Flat Quote', - ], - $installer->getTable('sales/quote_item') => [ - 'columns' => [ - 'item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Item Id', - ], - 'quote_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Quote Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Updated At', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Product Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'parent_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Parent Item Id', - ], - 'is_virtual' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Is Virtual', - ], - 'sku' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Sku', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Name', - ], - 'description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Description', - ], - 'applied_rule_ids' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Applied Rule Ids', - ], - 'additional_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Additional Data', - ], - 'free_shipping' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Free Shipping', - ], - 'is_qty_decimal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Is Qty Decimal', - ], - 'no_discount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'No Discount', - ], - 'weight' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Weight', - ], - 'qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Qty', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Price', - ], - 'base_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Base Price', - ], - 'custom_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Custom Price', - ], - 'discount_percent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Discount Percent', - ], - 'discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Discount Amount', - ], - 'base_discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Base Discount Amount', - ], - 'tax_percent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Tax Percent', - ], - 'tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Tax Amount', - ], - 'base_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Base Tax Amount', - ], - 'row_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Row Total', - ], - 'base_row_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Base Row Total', - ], - 'row_total_with_discount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Row Total With Discount', - ], - 'row_weight' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Row Weight', - ], - 'product_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Product Type', - ], - 'base_tax_before_discount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Tax Before Discount', - ], - 'tax_before_discount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tax Before Discount', - ], - 'original_custom_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Original Custom Price', - ], - 'redirect_url' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Redirect Url', - ], - 'base_cost' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Cost', - ], - 'price_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price Incl Tax', - ], - 'base_price_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Price Incl Tax', - ], - 'row_total_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Row Total Incl Tax', - ], - 'base_row_total_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Row Total Incl Tax', - ], - 'hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Hidden Tax Amount', - ], - 'base_hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Hidden Tax Amount', - ], - ], - 'comment' => 'Sales Flat Quote Item', - ], - $installer->getTable('sales/quote_address') => [ - 'columns' => [ - 'address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Address Id', - ], - 'quote_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Quote Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Updated At', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Customer Id', - ], - 'save_in_address_book' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'default' => '0', - 'comment' => 'Save In Address Book', - ], - 'customer_address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Customer Address Id', - ], - 'address_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Address Type', - ], - 'email' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Email', - ], - 'prefix' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 40, - 'comment' => 'Prefix', - ], - 'firstname' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Firstname', - ], - 'middlename' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 40, - 'comment' => 'Middlename', - ], - 'lastname' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Lastname', - ], - 'suffix' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 40, - 'comment' => 'Suffix', - ], - 'company' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Company', - ], - 'street' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Street', - ], - 'city' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'City', - ], - 'region' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Region', - ], - 'region_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Region Id', - ], - 'postcode' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Postcode', - ], - 'country_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Country Id', - ], - 'telephone' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Telephone', - ], - 'fax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Fax', - ], - 'same_as_billing' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Same As Billing', - ], - 'free_shipping' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Free Shipping', - ], - 'collect_shipping_rates' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Collect Shipping Rates', - ], - 'shipping_method' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Shipping Method', - ], - 'shipping_description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Shipping Description', - ], - 'weight' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Weight', - ], - 'subtotal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Subtotal', - ], - 'base_subtotal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Base Subtotal', - ], - 'subtotal_with_discount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Subtotal With Discount', - ], - 'base_subtotal_with_discount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Base Subtotal With Discount', - ], - 'tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Tax Amount', - ], - 'base_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Base Tax Amount', - ], - 'shipping_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Shipping Amount', - ], - 'base_shipping_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Base Shipping Amount', - ], - 'shipping_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Tax Amount', - ], - 'base_shipping_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Tax Amount', - ], - 'discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Discount Amount', - ], - 'base_discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Base Discount Amount', - ], - 'grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Grand Total', - ], - 'base_grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Base Grand Total', - ], - 'customer_notes' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Customer Notes', - ], - 'applied_taxes' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Applied Taxes', - ], - 'discount_description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Discount Description', - ], - 'shipping_discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Discount Amount', - ], - 'base_shipping_discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Discount Amount', - ], - 'subtotal_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Subtotal Incl Tax', - ], - 'base_subtotal_total_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Subtotal Total Incl Tax', - ], - 'hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Hidden Tax Amount', - ], - 'base_hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Hidden Tax Amount', - ], - 'shipping_hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Hidden Tax Amount', - ], - 'shipping_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Incl Tax', - ], - 'base_shipping_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Incl Tax', - ], - ], - 'comment' => 'Sales Flat Quote Address', - ], - $installer->getTable('sales/quote_address_item') => [ - 'columns' => [ - 'address_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Address Item Id', - ], - 'parent_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Parent Item Id', - ], - 'quote_address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Quote Address Id', - ], - 'quote_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Quote Item Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Updated At', - ], - 'applied_rule_ids' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Applied Rule Ids', - ], - 'additional_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Additional Data', - ], - 'weight' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Weight', - ], - 'qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Qty', - ], - 'discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Discount Amount', - ], - 'tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Tax Amount', - ], - 'row_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Row Total', - ], - 'base_row_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Base Row Total', - ], - 'row_total_with_discount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Row Total With Discount', - ], - 'base_discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Base Discount Amount', - ], - 'base_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Base Tax Amount', - ], - 'row_weight' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Row Weight', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Product Id', - ], - 'super_product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Super Product Id', - ], - 'parent_product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Parent Product Id', - ], - 'sku' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Sku', - ], - 'image' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Image', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Name', - ], - 'description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Description', - ], - 'free_shipping' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Free Shipping', - ], - 'is_qty_decimal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Is Qty Decimal', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'discount_percent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Discount Percent', - ], - 'no_discount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'No Discount', - ], - 'tax_percent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tax Percent', - ], - 'base_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Price', - ], - 'base_cost' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Cost', - ], - 'price_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price Incl Tax', - ], - 'base_price_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Price Incl Tax', - ], - 'row_total_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Row Total Incl Tax', - ], - 'base_row_total_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Row Total Incl Tax', - ], - 'hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Hidden Tax Amount', - ], - 'base_hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Hidden Tax Amount', - ], - ], - 'comment' => 'Sales Flat Quote Address Item', - ], - $installer->getTable('sales/quote_item_option') => [ - 'columns' => [ - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Option Id', - ], - 'item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Item Id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Product Id', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Code', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Value', - ], - ], - 'comment' => 'Sales Flat Quote Item Option', - ], - $installer->getTable('sales/quote_payment') => [ - 'columns' => [ - 'payment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Payment Id', - ], - 'quote_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Quote Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Updated At', - ], - 'method' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Method', - ], - 'cc_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Type', - ], - 'cc_number_enc' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Number Enc', - ], - 'cc_last4' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Last4', - ], - 'cc_cid_enc' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Cid Enc', - ], - 'cc_owner' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Owner', - ], - 'cc_exp_month' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Cc Exp Month', - ], - 'cc_exp_year' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Cc Exp Year', - ], - 'cc_ss_owner' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Ss Owner', - ], - 'cc_ss_start_month' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Cc Ss Start Month', - ], - 'cc_ss_start_year' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'default' => '0', - 'comment' => 'Cc Ss Start Year', - ], - 'po_number' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Po Number', - ], - 'additional_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Additional Data', - ], - 'cc_ss_issue' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Ss Issue', - ], - 'additional_information' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Additional Information', - ], - ], - 'comment' => 'Sales Flat Quote Payment', - ], - $installer->getTable('sales/quote_address_shipping_rate') => [ - 'columns' => [ - 'rate_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Rate Id', - ], - 'address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Address Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Updated At', - ], - 'carrier' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Carrier', - ], - 'carrier_title' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Carrier Title', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Code', - ], - 'method' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Method', - ], - 'method_description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Method Description', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Price', - ], - 'error_message' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Error Message', - ], - 'method_title' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Method Title', - ], - ], - 'comment' => 'Sales Flat Quote Shipping Rate', - ], - $installer->getTable('sales/order') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'state' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'State', - ], - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Status', - ], - 'coupon_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Coupon Code', - ], - 'protect_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Protect Code', - ], - 'shipping_description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Shipping Description', - ], - 'is_virtual' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Is Virtual', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Customer Id', - ], - 'base_discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Discount Amount', - ], - 'base_discount_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Discount Canceled', - ], - 'base_discount_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Discount Invoiced', - ], - 'base_discount_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Discount Refunded', - ], - 'base_grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Grand Total', - ], - 'base_shipping_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Amount', - ], - 'base_shipping_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Canceled', - ], - 'base_shipping_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Invoiced', - ], - 'base_shipping_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Refunded', - ], - 'base_shipping_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Tax Amount', - ], - 'base_shipping_tax_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Tax Refunded', - ], - 'base_subtotal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Subtotal', - ], - 'base_subtotal_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Subtotal Canceled', - ], - 'base_subtotal_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Subtotal Invoiced', - ], - 'base_subtotal_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Subtotal Refunded', - ], - 'base_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Tax Amount', - ], - 'base_tax_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Tax Canceled', - ], - 'base_tax_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Tax Invoiced', - ], - 'base_tax_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Tax Refunded', - ], - 'base_to_global_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base To Global Rate', - ], - 'base_to_order_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base To Order Rate', - ], - 'base_total_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Total Canceled', - ], - 'base_total_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Total Invoiced', - ], - 'base_total_invoiced_cost' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Total Invoiced Cost', - ], - 'base_total_offline_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Total Offline Refunded', - ], - 'base_total_online_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Total Online Refunded', - ], - 'base_total_paid' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Total Paid', - ], - 'base_total_qty_ordered' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Total Qty Ordered', - ], - 'base_total_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Total Refunded', - ], - 'discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Discount Amount', - ], - 'discount_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Discount Canceled', - ], - 'discount_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Discount Invoiced', - ], - 'discount_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Discount Refunded', - ], - 'grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Grand Total', - ], - 'shipping_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Amount', - ], - 'shipping_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Canceled', - ], - 'shipping_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Invoiced', - ], - 'shipping_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Refunded', - ], - 'shipping_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Tax Amount', - ], - 'shipping_tax_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Tax Refunded', - ], - 'store_to_base_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Store To Base Rate', - ], - 'store_to_order_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Store To Order Rate', - ], - 'subtotal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Subtotal', - ], - 'subtotal_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Subtotal Canceled', - ], - 'subtotal_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Subtotal Invoiced', - ], - 'subtotal_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Subtotal Refunded', - ], - 'tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tax Amount', - ], - 'tax_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tax Canceled', - ], - 'tax_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tax Invoiced', - ], - 'tax_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tax Refunded', - ], - 'total_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Canceled', - ], - 'total_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Invoiced', - ], - 'total_offline_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Offline Refunded', - ], - 'total_online_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Online Refunded', - ], - 'total_paid' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Paid', - ], - 'total_qty_ordered' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Qty Ordered', - ], - 'total_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Refunded', - ], - 'can_ship_partially' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Can Ship Partially', - ], - 'can_ship_partially_item' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Can Ship Partially Item', - ], - 'customer_is_guest' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Customer Is Guest', - ], - 'customer_note_notify' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Customer Note Notify', - ], - 'billing_address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Billing Address Id', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'comment' => 'Customer Group Id', - ], - 'edit_increment' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Edit Increment', - ], - 'email_sent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Email Sent', - ], - 'quote_address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Quote Address Id', - ], - 'quote_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Quote Id', - ], - 'shipping_address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Shipping Address Id', - ], - 'adjustment_negative' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Adjustment Negative', - ], - 'adjustment_positive' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Adjustment Positive', - ], - 'base_adjustment_negative' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Adjustment Negative', - ], - 'base_adjustment_positive' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Adjustment Positive', - ], - 'base_shipping_discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Discount Amount', - ], - 'base_subtotal_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Subtotal Incl Tax', - ], - 'base_total_due' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Total Due', - ], - 'payment_authorization_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Payment Authorization Amount', - ], - 'shipping_discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Discount Amount', - ], - 'subtotal_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Subtotal Incl Tax', - ], - 'total_due' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Due', - ], - 'weight' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weight', - ], - 'customer_dob' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATETIME, - 'comment' => 'Customer Dob', - ], - 'increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Increment Id', - ], - 'applied_rule_ids' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Applied Rule Ids', - ], - 'base_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Base Currency Code', - ], - 'customer_email' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Customer Email', - ], - 'customer_firstname' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Customer Firstname', - ], - 'customer_lastname' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Customer Lastname', - ], - 'customer_middlename' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Customer Middlename', - ], - 'customer_prefix' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Customer Prefix', - ], - 'customer_suffix' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Customer Suffix', - ], - 'customer_taxvat' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Customer Taxvat', - ], - 'discount_description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Discount Description', - ], - 'ext_customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Ext Customer Id', - ], - 'ext_order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Ext Order Id', - ], - 'global_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Global Currency Code', - ], - 'hold_before_state' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Hold Before State', - ], - 'hold_before_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Hold Before Status', - ], - 'order_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Order Currency Code', - ], - 'original_increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Original Increment Id', - ], - 'relation_child_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Relation Child Id', - ], - 'relation_child_real_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Relation Child Real Id', - ], - 'relation_parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Relation Parent Id', - ], - 'relation_parent_real_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Relation Parent Real Id', - ], - 'remote_ip' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Remote Ip', - ], - 'shipping_method' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Shipping Method', - ], - 'store_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Store Currency Code', - ], - 'store_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Store Name', - ], - 'x_forwarded_for' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'X Forwarded For', - ], - 'customer_note' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Customer Note', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Updated At', - ], - 'total_item_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Total Item Count', - ], - 'customer_gender' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Customer Gender', - ], - 'hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Hidden Tax Amount', - ], - 'base_hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Hidden Tax Amount', - ], - 'shipping_hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Hidden Tax Amount', - ], - /* TODO: remove comment - 'base_shipping_hidden_tax_amnt' => array( - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Hidden Tax Amount' - ), - */ - 'hidden_tax_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Hidden Tax Invoiced', - ], - 'base_hidden_tax_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Hidden Tax Invoiced', - ], - 'hidden_tax_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Hidden Tax Refunded', - ], - 'base_hidden_tax_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Hidden Tax Refunded', - ], - 'shipping_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Incl Tax', - ], - 'base_shipping_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Incl Tax', - ], - ], - 'comment' => 'Sales Flat Order', - ], - $installer->getTable('sales/order_grid') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Status', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'store_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Store Name', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Customer Id', - ], - 'base_grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Grand Total', - ], - 'base_total_paid' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Total Paid', - ], - 'grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Grand Total', - ], - 'total_paid' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Paid', - ], - 'increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Increment Id', - ], - 'base_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Base Currency Code', - ], - 'order_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Order Currency Code', - ], - 'shipping_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Shipping Name', - ], - 'billing_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Billing Name', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Updated At', - ], - ], - 'comment' => 'Sales Flat Order Grid', - ], - $installer->getTable('sales/order_item') => [ - 'columns' => [ - 'item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Item Id', - ], - 'order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Order Id', - ], - 'parent_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Parent Item Id', - ], - 'quote_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Quote Item Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Updated At', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Product Id', - ], - 'product_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Product Type', - ], - 'product_options' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Product Options', - ], - 'weight' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Weight', - ], - 'is_virtual' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Is Virtual', - ], - 'sku' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Sku', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Name', - ], - 'description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Description', - ], - 'applied_rule_ids' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Applied Rule Ids', - ], - 'additional_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Additional Data', - ], - 'free_shipping' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Free Shipping', - ], - 'is_qty_decimal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Is Qty Decimal', - ], - 'no_discount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'No Discount', - ], - 'qty_backordered' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Qty Backordered', - ], - 'qty_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Qty Canceled', - ], - 'qty_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Qty Invoiced', - ], - 'qty_ordered' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Qty Ordered', - ], - 'qty_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Qty Refunded', - ], - 'qty_shipped' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Qty Shipped', - ], - 'base_cost' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Base Cost', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Price', - ], - 'base_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Base Price', - ], - 'original_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Original Price', - ], - 'base_original_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Original Price', - ], - 'tax_percent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Tax Percent', - ], - 'tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Tax Amount', - ], - 'base_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Base Tax Amount', - ], - 'tax_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Tax Invoiced', - ], - 'base_tax_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Base Tax Invoiced', - ], - 'discount_percent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Discount Percent', - ], - 'discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Discount Amount', - ], - 'base_discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Base Discount Amount', - ], - 'discount_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Discount Invoiced', - ], - 'base_discount_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Base Discount Invoiced', - ], - 'amount_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Amount Refunded', - ], - 'base_amount_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Base Amount Refunded', - ], - 'row_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Row Total', - ], - 'base_row_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Base Row Total', - ], - 'row_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Row Invoiced', - ], - 'base_row_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Base Row Invoiced', - ], - 'row_weight' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'default' => '0.0000', - 'comment' => 'Row Weight', - ], - 'base_tax_before_discount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Tax Before Discount', - ], - 'tax_before_discount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tax Before Discount', - ], - 'ext_order_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Ext Order Item Id', - ], - 'locked_do_invoice' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Locked Do Invoice', - ], - 'locked_do_ship' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Locked Do Ship', - ], - 'price_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price Incl Tax', - ], - 'base_price_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Price Incl Tax', - ], - 'row_total_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Row Total Incl Tax', - ], - 'base_row_total_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Row Total Incl Tax', - ], - 'hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Hidden Tax Amount', - ], - 'base_hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Hidden Tax Amount', - ], - 'hidden_tax_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Hidden Tax Invoiced', - ], - 'base_hidden_tax_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Hidden Tax Invoiced', - ], - 'hidden_tax_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Hidden Tax Refunded', - ], - 'base_hidden_tax_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Hidden Tax Refunded', - ], - 'is_nominal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Is Nominal', - ], - 'tax_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tax Canceled', - ], - 'hidden_tax_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Hidden Tax Canceled', - ], - 'tax_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tax Refunded', - ], - ], - 'comment' => 'Sales Flat Order Item', - ], - $installer->getTable('sales/order_address') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Parent Id', - ], - 'customer_address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Customer Address Id', - ], - 'quote_address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Quote Address Id', - ], - 'region_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Region Id', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Customer Id', - ], - 'fax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Fax', - ], - 'region' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Region', - ], - 'postcode' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Postcode', - ], - 'lastname' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Lastname', - ], - 'street' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Street', - ], - 'city' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'City', - ], - 'email' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Email', - ], - 'telephone' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Telephone', - ], - 'country_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 2, - 'comment' => 'Country Id', - ], - 'firstname' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Firstname', - ], - 'address_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Address Type', - ], - 'prefix' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Prefix', - ], - 'middlename' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Middlename', - ], - 'suffix' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Suffix', - ], - 'company' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Company', - ], - ], - 'comment' => 'Sales Flat Order Address', - ], - $installer->getTable('sales/order_payment') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Parent Id', - ], - 'base_shipping_captured' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Captured', - ], - 'shipping_captured' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Captured', - ], - 'amount_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Amount Refunded', - ], - 'base_amount_paid' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Amount Paid', - ], - 'amount_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Amount Canceled', - ], - 'base_amount_authorized' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Amount Authorized', - ], - 'base_amount_paid_online' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Amount Paid Online', - ], - 'base_amount_refunded_online' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Amount Refunded Online', - ], - 'base_shipping_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Amount', - ], - 'shipping_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Amount', - ], - 'amount_paid' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Amount Paid', - ], - 'amount_authorized' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Amount Authorized', - ], - 'base_amount_ordered' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Amount Ordered', - ], - 'base_shipping_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Refunded', - ], - 'shipping_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Refunded', - ], - 'base_amount_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Amount Refunded', - ], - 'amount_ordered' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Amount Ordered', - ], - 'base_amount_canceled' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Amount Canceled', - ], - 'quote_payment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Quote Payment Id', - ], - 'additional_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Additional Data', - ], - 'cc_exp_month' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Exp Month', - ], - 'cc_ss_start_year' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Ss Start Year', - ], - 'echeck_bank_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Echeck Bank Name', - ], - 'method' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Method', - ], - 'cc_debug_request_body' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Debug Request Body', - ], - 'cc_secure_verify' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Secure Verify', - ], - 'protection_eligibility' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Protection Eligibility', - ], - 'cc_approval' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Approval', - ], - 'cc_last4' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Last4', - ], - 'cc_status_description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Status Description', - ], - 'echeck_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Echeck Type', - ], - 'cc_debug_response_serialized' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Debug Response Serialized', - ], - 'cc_ss_start_month' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Ss Start Month', - ], - 'echeck_account_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Echeck Account Type', - ], - 'last_trans_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Last Trans Id', - ], - 'cc_cid_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Cid Status', - ], - 'cc_owner' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Owner', - ], - 'cc_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Type', - ], - 'po_number' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Po Number', - ], - 'cc_exp_year' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Exp Year', - ], - 'cc_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Status', - ], - 'echeck_routing_number' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Echeck Routing Number', - ], - 'account_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Account Status', - ], - 'anet_trans_method' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Anet Trans Method', - ], - 'cc_debug_response_body' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Debug Response Body', - ], - 'cc_ss_issue' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Ss Issue', - ], - 'echeck_account_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Echeck Account Name', - ], - 'cc_avs_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Avs Status', - ], - 'cc_number_enc' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Number Enc', - ], - 'cc_trans_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Cc Trans Id', - ], - 'paybox_request_number' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Paybox Request Number', - ], - 'address_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Address Status', - ], - 'additional_information' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Additional Information', - ], - ], - 'comment' => 'Sales Flat Order Payment', - ], - $installer->getTable('sales/order_status_history') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Parent Id', - ], - 'is_customer_notified' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Is Customer Notified', - ], - 'is_visible_on_front' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Is Visible On Front', - ], - 'comment' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Comment', - ], - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Status', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - ], - 'comment' => 'Sales Flat Order Status History', - ], - $installer->getTable('sales/order_status') => [ - 'columns' => [ - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Status', - ], - 'label' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 128, - 'nullable' => false, - 'comment' => 'Label', - ], - ], - 'comment' => 'Sales Order Status Table', - ], - $installer->getTable('sales/order_status_state') => [ - 'columns' => [ - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Status', - ], - 'state' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Label', - ], - 'is_default' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Is Default', - ], - ], - 'comment' => 'Sales Order Status Table', - ], - $installer->getTable('sales/order_status_label') => [ - 'columns' => [ - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Status', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Store Id', - ], - 'label' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 128, - 'nullable' => false, - 'comment' => 'Label', - ], - ], - 'comment' => 'Sales Order Status Label Table', - ], - $installer->getTable('sales/invoice') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'base_grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Grand Total', - ], - 'shipping_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Tax Amount', - ], - 'tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tax Amount', - ], - 'base_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Tax Amount', - ], - 'store_to_order_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Store To Order Rate', - ], - 'base_shipping_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Tax Amount', - ], - 'base_discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Discount Amount', - ], - 'base_to_order_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base To Order Rate', - ], - 'grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Grand Total', - ], - 'shipping_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Amount', - ], - 'subtotal_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Subtotal Incl Tax', - ], - 'base_subtotal_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Subtotal Incl Tax', - ], - 'store_to_base_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Store To Base Rate', - ], - 'base_shipping_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Amount', - ], - 'total_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Qty', - ], - 'base_to_global_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base To Global Rate', - ], - 'subtotal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Subtotal', - ], - 'base_subtotal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Subtotal', - ], - 'discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Discount Amount', - ], - 'billing_address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Billing Address Id', - ], - 'is_used_for_refund' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Is Used For Refund', - ], - 'order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Order Id', - ], - 'email_sent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Email Sent', - ], - 'can_void_flag' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Can Void Flag', - ], - 'state' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'State', - ], - 'shipping_address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Shipping Address Id', - ], - 'store_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Store Currency Code', - ], - 'transaction_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Transaction Id', - ], - 'order_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Order Currency Code', - ], - 'base_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Base Currency Code', - ], - 'global_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Global Currency Code', - ], - 'increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Increment Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Updated At', - ], - 'hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Hidden Tax Amount', - ], - 'base_hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Hidden Tax Amount', - ], - 'shipping_hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Hidden Tax Amount', - ], - /* TODO: remove comment - 'base_shipping_hidden_tax_amnt' => array( - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Hidden Tax Amount' - ), - */ - 'shipping_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Incl Tax', - ], - 'base_shipping_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Incl Tax', - ], - 'base_total_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Total Refunded', - ], - ], - 'comment' => 'Sales Flat Invoice', - ], - $installer->getTable('sales/invoice_grid') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'base_grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Grand Total', - ], - 'grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Grand Total', - ], - 'order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Order Id', - ], - 'state' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'State', - ], - 'store_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Store Currency Code', - ], - 'order_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Order Currency Code', - ], - 'base_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Base Currency Code', - ], - 'global_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Global Currency Code', - ], - 'increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Increment Id', - ], - 'order_increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Order Increment Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - 'order_created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Order Created At', - ], - 'billing_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Billing Name', - ], - ], - 'comment' => 'Sales Flat Invoice Grid', - ], - $installer->getTable('sales/invoice_item') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Parent Id', - ], - 'base_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Price', - ], - 'tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tax Amount', - ], - 'base_row_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Row Total', - ], - 'discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Discount Amount', - ], - 'row_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Row Total', - ], - 'base_discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Discount Amount', - ], - 'price_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price Incl Tax', - ], - 'base_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Tax Amount', - ], - 'base_price_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Price Incl Tax', - ], - 'qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Qty', - ], - 'base_cost' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Cost', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'base_row_total_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Row Total Incl Tax', - ], - 'row_total_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Row Total Incl Tax', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Product Id', - ], - 'order_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Order Item Id', - ], - 'additional_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Additional Data', - ], - 'description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Description', - ], - 'sku' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Sku', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Name', - ], - 'hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Hidden Tax Amount', - ], - 'base_hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Hidden Tax Amount', - ], - ], - 'comment' => 'Sales Flat Invoice Item', - ], - $installer->getTable('sales/invoice_comment') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Parent Id', - ], - 'is_customer_notified' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Is Customer Notified', - ], - 'is_visible_on_front' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Is Visible On Front', - ], - 'comment' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Comment', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - ], - 'comment' => 'Sales Flat Invoice Comment', - ], - $installer->getTable('sales/shipment') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'total_weight' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Weight', - ], - 'total_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Qty', - ], - 'email_sent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Email Sent', - ], - 'order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Order Id', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Customer Id', - ], - 'shipping_address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Shipping Address Id', - ], - 'billing_address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Billing Address Id', - ], - 'shipment_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Shipment Status', - ], - 'increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Increment Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Updated At', - ], - ], - 'comment' => 'Sales Flat Shipment', - ], - $installer->getTable('sales/shipment_grid') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'total_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Qty', - ], - 'order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Order Id', - ], - 'shipment_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Shipment Status', - ], - 'increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Increment Id', - ], - 'order_increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Order Increment Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - 'order_created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Order Created At', - ], - 'shipping_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Shipping Name', - ], - ], - 'comment' => 'Sales Flat Shipment Grid', - ], - $installer->getTable('sales/shipment_item') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Parent Id', - ], - 'row_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Row Total', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'weight' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weight', - ], - 'qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Qty', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Product Id', - ], - 'order_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Order Item Id', - ], - 'additional_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Additional Data', - ], - 'description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Description', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Name', - ], - 'sku' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Sku', - ], - ], - 'comment' => 'Sales Flat Shipment Item', - ], - $installer->getTable('sales/shipment_comment') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Parent Id', - ], - 'is_customer_notified' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Is Customer Notified', - ], - 'is_visible_on_front' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Is Visible On Front', - ], - 'comment' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Comment', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - ], - 'comment' => 'Sales Flat Shipment Comment', - ], - $installer->getTable('sales/shipment_track') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Parent Id', - ], - 'weight' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weight', - ], - 'qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Qty', - ], - 'order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Order Id', - ], - 'description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Description', - ], - 'title' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Title', - ], - 'carrier_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Carrier Code', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Updated At', - ], - ], - 'comment' => 'Sales Flat Shipment Track', - ], - $installer->getTable('sales/creditmemo') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'adjustment_positive' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Adjustment Positive', - ], - 'base_shipping_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Tax Amount', - ], - 'store_to_order_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Store To Order Rate', - ], - 'base_discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Discount Amount', - ], - 'base_to_order_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base To Order Rate', - ], - 'grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Grand Total', - ], - 'base_adjustment_negative' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Adjustment Negative', - ], - 'base_subtotal_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Subtotal Incl Tax', - ], - 'shipping_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Amount', - ], - 'subtotal_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Subtotal Incl Tax', - ], - 'adjustment_negative' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Adjustment Negative', - ], - 'base_shipping_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Amount', - ], - 'store_to_base_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Store To Base Rate', - ], - 'base_to_global_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base To Global Rate', - ], - 'base_adjustment' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Adjustment', - ], - 'base_subtotal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Subtotal', - ], - 'discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Discount Amount', - ], - 'subtotal' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Subtotal', - ], - 'adjustment' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Adjustment', - ], - 'base_grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Grand Total', - ], - 'base_adjustment_positive' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Adjustment Positive', - ], - 'base_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Tax Amount', - ], - 'shipping_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Tax Amount', - ], - 'tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tax Amount', - ], - 'order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Order Id', - ], - 'email_sent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Email Sent', - ], - 'creditmemo_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Creditmemo Status', - ], - 'state' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'State', - ], - 'shipping_address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Shipping Address Id', - ], - 'billing_address_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Billing Address Id', - ], - 'invoice_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Invoice Id', - ], - 'store_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Store Currency Code', - ], - 'order_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Order Currency Code', - ], - 'base_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Base Currency Code', - ], - 'global_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Global Currency Code', - ], - 'transaction_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Transaction Id', - ], - 'increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Increment Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Updated At', - ], - 'hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Hidden Tax Amount', - ], - 'base_hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Hidden Tax Amount', - ], - 'shipping_hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Hidden Tax Amount', - ], - /* TODO: remove comment - 'base_shipping_hidden_tax_amnt' => array( - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Hidden Tax Amount' - ), - */ - 'shipping_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Incl Tax', - ], - 'base_shipping_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Incl Tax', - ], - ], - 'comment' => 'Sales Flat Creditmemo', - ], - $installer->getTable('sales/creditmemo_grid') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'store_to_order_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Store To Order Rate', - ], - 'base_to_order_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base To Order Rate', - ], - 'grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Grand Total', - ], - 'store_to_base_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Store To Base Rate', - ], - 'base_to_global_rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base To Global Rate', - ], - 'base_grand_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Grand Total', - ], - 'order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Order Id', - ], - 'creditmemo_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Creditmemo Status', - ], - 'state' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'State', - ], - 'invoice_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Invoice Id', - ], - 'store_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Store Currency Code', - ], - 'order_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Order Currency Code', - ], - 'base_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Base Currency Code', - ], - 'global_currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'comment' => 'Global Currency Code', - ], - 'increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Increment Id', - ], - 'order_increment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Order Increment Id', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - 'order_created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Order Created At', - ], - 'billing_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Billing Name', - ], - ], - 'comment' => 'Sales Flat Creditmemo Grid', - ], - $installer->getTable('sales/creditmemo_item') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Parent Id', - ], - 'base_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Price', - ], - 'tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tax Amount', - ], - 'base_row_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Row Total', - ], - 'discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Discount Amount', - ], - 'row_total' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Row Total', - ], - 'base_discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Discount Amount', - ], - 'price_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price Incl Tax', - ], - 'base_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Tax Amount', - ], - 'base_price_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Price Incl Tax', - ], - 'qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Qty', - ], - 'base_cost' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Cost', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Price', - ], - 'base_row_total_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Row Total Incl Tax', - ], - 'row_total_incl_tax' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Row Total Incl Tax', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Product Id', - ], - 'order_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Order Item Id', - ], - 'additional_data' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Additional Data', - ], - 'description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Description', - ], - 'sku' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Sku', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Name', - ], - 'hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Hidden Tax Amount', - ], - 'base_hidden_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Hidden Tax Amount', - ], - ], - 'comment' => 'Sales Flat Creditmemo Item', - ], - $installer->getTable('sales/creditmemo_comment') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Entity Id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Parent Id', - ], - 'is_customer_notified' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Is Customer Notified', - ], - 'is_visible_on_front' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Is Visible On Front', - ], - 'comment' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Comment', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - ], - 'comment' => 'Sales Flat Creditmemo Comment', - ], - $installer->getTable('sales/recurring_profile') => [ - 'columns' => [ - 'profile_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Profile Id', - ], - 'state' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 20, - 'nullable' => false, - 'comment' => 'State', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Customer Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'method_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'comment' => 'Method Code', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Updated At', - ], - 'reference_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Reference Id', - ], - 'subscriber_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 150, - 'comment' => 'Subscriber Name', - ], - 'start_datetime' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Start Datetime', - ], - 'internal_reference_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 42, - 'nullable' => false, - 'comment' => 'Internal Reference Id', - ], - 'schedule_description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Schedule Description', - ], - 'suspension_threshold' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Suspension Threshold', - ], - 'bill_failed_later' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Bill Failed Later', - ], - 'period_unit' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 20, - 'nullable' => false, - 'comment' => 'Period Unit', - ], - 'period_frequency' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Period Frequency', - ], - 'period_max_cycles' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Period Max Cycles', - ], - 'billing_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Billing Amount', - ], - 'trial_period_unit' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 20, - 'comment' => 'Trial Period Unit', - ], - 'trial_period_frequency' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Trial Period Frequency', - ], - 'trial_period_max_cycles' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Trial Period Max Cycles', - ], - 'trial_billing_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Trial Billing Amount', - ], - 'currency_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 3, - 'nullable' => false, - 'comment' => 'Currency Code', - ], - 'shipping_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Shipping Amount', - ], - 'tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Tax Amount', - ], - 'init_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Init Amount', - ], - 'init_may_fail' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Init May Fail', - ], - 'order_info' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'nullable' => false, - 'comment' => 'Order Info', - ], - 'order_item_info' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'nullable' => false, - 'comment' => 'Order Item Info', - ], - 'billing_address_info' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'nullable' => false, - 'comment' => 'Billing Address Info', - ], - 'shipping_address_info' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Shipping Address Info', - ], - 'profile_vendor_info' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Profile Vendor Info', - ], - 'additional_info' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Additional Info', - ], - ], - 'comment' => 'Sales Recurring Profile', - ], - $installer->getTable('sales/recurring_profile_order') => [ - 'columns' => [ - 'link_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Link Id', - ], - 'profile_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Profile Id', - ], - 'order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Order Id', - ], - ], - 'comment' => 'Sales Recurring Profile Order', - ], - $installer->getTable('sales/order_tax') => [ - 'columns' => [ - 'tax_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Tax Id', - ], - 'order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Order Id', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Code', - ], - 'title' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Title', - ], - 'percent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Percent', - ], - 'amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Amount', - ], - 'priority' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Priority', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Position', - ], - 'base_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Amount', - ], - 'process' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'comment' => 'Process', - ], - 'base_real_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Real Amount', - ], - 'hidden' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Hidden', - ], - ], - 'comment' => 'Sales Order Tax Table', - ], - $installer->getTable('sales/order_aggregated_created') => [ - 'columns' => [ - 'id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Id', - ], - 'period' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Period', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'order_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'nullable' => false, - 'comment' => 'Order Status', - ], - 'orders_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Orders Count', - ], - 'total_qty_ordered' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Qty Ordered', - ], - 'total_qty_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Qty Invoiced', - ], - 'total_income_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Income Amount', - ], - 'total_revenue_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Revenue Amount', - ], - 'total_profit_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Profit Amount', - ], - 'total_invoiced_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Invoiced Amount', - ], - 'total_canceled_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Canceled Amount', - ], - 'total_paid_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Paid Amount', - ], - 'total_refunded_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Refunded Amount', - ], - 'total_tax_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Tax Amount', - ], - 'total_tax_amount_actual' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Tax Amount Actual', - ], - 'total_shipping_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Shipping Amount', - ], - 'total_shipping_amount_actual' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Shipping Amount Actual', - ], - 'total_discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Discount Amount', - ], - 'total_discount_amount_actual' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Discount Amount Actual', - ], - ], - 'comment' => 'Sales Order Aggregated Created', - ], - $installer->getTable('sales/shipping_aggregated') => [ - 'columns' => [ - 'id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Id', - ], - 'period' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Period', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'order_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Order Status', - ], - 'shipping_description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Shipping Description', - ], - 'orders_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Orders Count', - ], - 'total_shipping' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Shipping', - ], - 'total_shipping_actual' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Shipping Actual', - ], - ], - 'comment' => 'Sales Shipping Aggregated', - ], - $installer->getTable('sales/shipping_aggregated_order') => [ - 'columns' => [ - 'id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Id', - ], - 'period' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Period', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'order_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Order Status', - ], - 'shipping_description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Shipping Description', - ], - 'orders_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Orders Count', - ], - 'total_shipping' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Shipping', - ], - 'total_shipping_actual' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Total Shipping Actual', - ], - ], - 'comment' => 'Sales Shipping Aggregated Order', - ], - $installer->getTable('sales/invoiced_aggregated') => [ - 'columns' => [ - 'id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Id', - ], - 'period' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Period', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'order_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Order Status', - ], - 'orders_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Orders Count', - ], - 'orders_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Orders Invoiced', - ], - 'invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Invoiced', - ], - 'invoiced_captured' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Invoiced Captured', - ], - 'invoiced_not_captured' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Invoiced Not Captured', - ], - ], - 'comment' => 'Sales Invoiced Aggregated', - ], - $installer->getTable('sales/invoiced_aggregated_order') => [ - 'columns' => [ - 'id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Id', - ], - 'period' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Period', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'order_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'nullable' => false, - 'comment' => 'Order Status', - ], - 'orders_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Orders Count', - ], - 'orders_invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Orders Invoiced', - ], - 'invoiced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Invoiced', - ], - 'invoiced_captured' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Invoiced Captured', - ], - 'invoiced_not_captured' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Invoiced Not Captured', - ], - ], - 'comment' => 'Sales Invoiced Aggregated Order', - ], - $installer->getTable('sales/refunded_aggregated') => [ - 'columns' => [ - 'id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Id', - ], - 'period' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Period', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'order_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'nullable' => false, - 'comment' => 'Order Status', - ], - 'orders_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Orders Count', - ], - 'refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Refunded', - ], - 'online_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Online Refunded', - ], - 'offline_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Offline Refunded', - ], - ], - 'comment' => 'Sales Refunded Aggregated', - ], - $installer->getTable('sales/refunded_aggregated_order') => [ - 'columns' => [ - 'id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Id', - ], - 'period' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Period', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'order_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Order Status', - ], - 'orders_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Orders Count', - ], - 'refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Refunded', - ], - 'online_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Online Refunded', - ], - 'offline_refunded' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Offline Refunded', - ], - ], - 'comment' => 'Sales Refunded Aggregated Order', - ], - $installer->getTable('sales/payment_transaction') => [ - 'columns' => [ - 'transaction_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Transaction Id', - ], - 'parent_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Parent Id', - ], - 'order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Order Id', - ], - 'payment_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Payment Id', - ], - 'txn_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 100, - 'comment' => 'Txn Id', - ], - 'parent_txn_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 100, - 'comment' => 'Parent Txn Id', - ], - 'txn_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 15, - 'comment' => 'Txn Type', - ], - 'is_closed' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Is Closed', - ], - 'additional_information' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_BLOB, - 'length' => '64K', - 'comment' => 'Additional Information', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - ], - 'comment' => 'Sales Payment Transaction', - ], - $installer->getTable('sales/bestsellers_aggregated_daily') => [ - 'columns' => [ - 'id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Id', - ], - 'period' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Period', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Product Id', - ], - 'product_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Product Name', - ], - 'product_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Product Price', - ], - 'qty_ordered' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Qty Ordered', - ], - 'rating_pos' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Rating Pos', - ], - ], - 'comment' => 'Sales Bestsellers Aggregated Daily', - ], - $installer->getTable('sales/bestsellers_aggregated_monthly') => [ - 'columns' => [ - 'id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Id', - ], - 'period' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Period', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Product Id', - ], - 'product_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Product Name', - ], - 'product_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Product Price', - ], - 'qty_ordered' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Qty Ordered', - ], - 'rating_pos' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Rating Pos', - ], - ], - 'comment' => 'Sales Bestsellers Aggregated Monthly', - ], - $installer->getTable('sales/bestsellers_aggregated_yearly') => [ - 'columns' => [ - 'id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Id', - ], - 'period' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Period', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Product Id', - ], - 'product_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Product Name', - ], - 'product_price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Product Price', - ], - 'qty_ordered' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Qty Ordered', - ], - 'rating_pos' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Rating Pos', - ], - ], - 'comment' => 'Sales Bestsellers Aggregated Yearly', - ], - $installer->getTable('sales/billing_agreement') => [ - 'columns' => [ - 'agreement_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Agreement Id', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Customer Id', - ], - 'method_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'comment' => 'Method Code', - ], - 'reference_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'comment' => 'Reference Id', - ], - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 20, - 'nullable' => false, - 'comment' => 'Status', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'nullable' => false, - 'comment' => 'Created At', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Updated At', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'agreement_label' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Agreement Label', - ], - ], - 'comment' => 'Sales Billing Agreement', - ], - $installer->getTable('sales/billing_agreement_order') => [ - 'columns' => [ - 'agreement_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Agreement Id', - ], - 'order_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Order Id', - ], - ], - 'comment' => 'Sales Billing Agreement Order', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -$installer->getConnection()->changeColumn( - $installer->getTable('sales/creditmemo'), - 'base_shipping_hidden_tax_amount', - 'base_shipping_hidden_tax_amnt', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Hidden Tax Amount', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('sales/invoice'), - 'base_shipping_hidden_tax_amount', - 'base_shipping_hidden_tax_amnt', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Hidden Tax Amount', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('sales/order'), - 'forced_do_shipment_with_invoice', - 'forced_shipment_with_invoice', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Forced Do Shipment With Invoice', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('sales/order'), - 'payment_authorization_expiration', - 'payment_auth_expiration', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'comment' => 'Payment Authorization Expiration', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('sales/order'), - 'base_shipping_hidden_tax_amount', - 'base_shipping_hidden_tax_amnt', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Hidden Tax Amount', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('sales/quote_address'), - 'base_shipping_hidden_tax_amount', - 'base_shipping_hidden_tax_amnt', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Shipping Hidden Tax Amount', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('sales/shipment_track'), - 'number', - 'track_number', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Number', - ], -); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('sales/bestsellers_aggregated_daily'), - $installer->getIdxName( - 'sales/bestsellers_aggregated_daily', - ['period', 'store_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['period', 'store_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/bestsellers_aggregated_daily'), - $installer->getIdxName('sales/bestsellers_aggregated_daily', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/bestsellers_aggregated_daily'), - $installer->getIdxName('sales/bestsellers_aggregated_daily', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/bestsellers_aggregated_monthly'), - $installer->getIdxName( - 'sales/bestsellers_aggregated_monthly', - ['period', 'store_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['period', 'store_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/bestsellers_aggregated_monthly'), - $installer->getIdxName('sales/bestsellers_aggregated_monthly', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/bestsellers_aggregated_monthly'), - $installer->getIdxName('sales/bestsellers_aggregated_monthly', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/bestsellers_aggregated_yearly'), - $installer->getIdxName( - 'sales/bestsellers_aggregated_yearly', - ['period', 'store_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['period', 'store_id', 'product_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/bestsellers_aggregated_yearly'), - $installer->getIdxName('sales/bestsellers_aggregated_yearly', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/bestsellers_aggregated_yearly'), - $installer->getIdxName('sales/bestsellers_aggregated_yearly', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/billing_agreement'), - $installer->getIdxName('sales/billing_agreement', ['customer_id']), - ['customer_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/billing_agreement'), - $installer->getIdxName('sales/billing_agreement', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/billing_agreement_order'), - 'PRIMARY', - ['agreement_id', 'order_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/billing_agreement_order'), - $installer->getIdxName('sales/billing_agreement_order', ['order_id']), - ['order_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo'), - $installer->getIdxName( - 'sales/creditmemo', - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo'), - $installer->getIdxName('sales/creditmemo', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo'), - $installer->getIdxName('sales/creditmemo', ['order_id']), - ['order_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo'), - $installer->getIdxName('sales/creditmemo', ['creditmemo_status']), - ['creditmemo_status'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo'), - $installer->getIdxName('sales/creditmemo', ['state']), - ['state'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo'), - $installer->getIdxName('sales/creditmemo', ['created_at']), - ['created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo_comment'), - $installer->getIdxName('sales/creditmemo_comment', ['created_at']), - ['created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo_comment'), - $installer->getIdxName('sales/creditmemo_comment', ['parent_id']), - ['parent_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo_grid'), - $installer->getIdxName( - 'sales/creditmemo_grid', - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo_grid'), - $installer->getIdxName('sales/creditmemo_grid', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo_grid'), - $installer->getIdxName('sales/creditmemo_grid', ['grand_total']), - ['grand_total'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo_grid'), - $installer->getIdxName('sales/creditmemo_grid', ['base_grand_total']), - ['base_grand_total'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo_grid'), - $installer->getIdxName('sales/creditmemo_grid', ['order_id']), - ['order_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo_grid'), - $installer->getIdxName('sales/creditmemo_grid', ['creditmemo_status']), - ['creditmemo_status'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo_grid'), - $installer->getIdxName('sales/creditmemo_grid', ['state']), - ['state'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo_grid'), - $installer->getIdxName('sales/creditmemo_grid', ['order_increment_id']), - ['order_increment_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo_grid'), - $installer->getIdxName('sales/creditmemo_grid', ['created_at']), - ['created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo_grid'), - $installer->getIdxName('sales/creditmemo_grid', ['order_created_at']), - ['order_created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo_grid'), - $installer->getIdxName('sales/creditmemo_grid', ['billing_name']), - ['billing_name'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/creditmemo_item'), - $installer->getIdxName('sales/creditmemo_item', ['parent_id']), - ['parent_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice'), - $installer->getIdxName( - 'sales/invoice', - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice'), - $installer->getIdxName('sales/invoice', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice'), - $installer->getIdxName('sales/invoice', ['grand_total']), - ['grand_total'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice'), - $installer->getIdxName('sales/invoice', ['order_id']), - ['order_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice'), - $installer->getIdxName('sales/invoice', ['state']), - ['state'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice'), - $installer->getIdxName('sales/invoice', ['created_at']), - ['created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice_comment'), - $installer->getIdxName('sales/invoice_comment', ['created_at']), - ['created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice_comment'), - $installer->getIdxName('sales/invoice_comment', ['parent_id']), - ['parent_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice_grid'), - $installer->getIdxName( - 'sales/invoice_grid', - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice_grid'), - $installer->getIdxName('sales/invoice_grid', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice_grid'), - $installer->getIdxName('sales/invoice_grid', ['grand_total']), - ['grand_total'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice_grid'), - $installer->getIdxName('sales/invoice_grid', ['order_id']), - ['order_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice_grid'), - $installer->getIdxName('sales/invoice_grid', ['state']), - ['state'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice_grid'), - $installer->getIdxName('sales/invoice_grid', ['order_increment_id']), - ['order_increment_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice_grid'), - $installer->getIdxName('sales/invoice_grid', ['created_at']), - ['created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice_grid'), - $installer->getIdxName('sales/invoice_grid', ['order_created_at']), - ['order_created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice_grid'), - $installer->getIdxName('sales/invoice_grid', ['billing_name']), - ['billing_name'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoice_item'), - $installer->getIdxName('sales/invoice_item', ['parent_id']), - ['parent_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order'), - $installer->getIdxName( - 'sales/order', - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order'), - $installer->getIdxName('sales/order', ['status']), - ['status'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order'), - $installer->getIdxName('sales/order', ['state']), - ['state'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order'), - $installer->getIdxName('sales/order', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order'), - $installer->getIdxName('sales/order', ['created_at']), - ['created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order'), - $installer->getIdxName('sales/order', ['customer_id']), - ['customer_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order'), - $installer->getIdxName('sales/order', ['ext_order_id']), - ['ext_order_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order'), - $installer->getIdxName('sales/order', ['quote_id']), - ['quote_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order'), - $installer->getIdxName('sales/order', ['updated_at']), - ['updated_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_address'), - $installer->getIdxName('sales/order_address', ['parent_id']), - ['parent_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_grid'), - $installer->getIdxName( - 'sales/order_grid', - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_grid'), - $installer->getIdxName('sales/order_grid', ['status']), - ['status'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_grid'), - $installer->getIdxName('sales/order_grid', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_grid'), - $installer->getIdxName('sales/order_grid', ['base_grand_total']), - ['base_grand_total'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_grid'), - $installer->getIdxName('sales/order_grid', ['base_total_paid']), - ['base_total_paid'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_grid'), - $installer->getIdxName('sales/order_grid', ['grand_total']), - ['grand_total'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_grid'), - $installer->getIdxName('sales/order_grid', ['total_paid']), - ['total_paid'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_grid'), - $installer->getIdxName('sales/order_grid', ['shipping_name']), - ['shipping_name'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_grid'), - $installer->getIdxName('sales/order_grid', ['billing_name']), - ['billing_name'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_grid'), - $installer->getIdxName('sales/order_grid', ['created_at']), - ['created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_grid'), - $installer->getIdxName('sales/order_grid', ['customer_id']), - ['customer_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_grid'), - $installer->getIdxName('sales/order_grid', ['updated_at']), - ['updated_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_item'), - $installer->getIdxName('sales/order_item', ['order_id']), - ['order_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_item'), - $installer->getIdxName('sales/order_item', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_payment'), - $installer->getIdxName('sales/order_payment', ['parent_id']), - ['parent_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_status_history'), - $installer->getIdxName('sales/order_status_history', ['parent_id']), - ['parent_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_status_history'), - $installer->getIdxName('sales/order_status_history', ['created_at']), - ['created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/quote'), - $installer->getIdxName('sales/quote', ['customer_id', 'store_id', 'is_active']), - ['customer_id', 'store_id', 'is_active'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/quote'), - $installer->getIdxName('sales/quote', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/quote_address'), - $installer->getIdxName('sales/quote_address', ['quote_id']), - ['quote_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/quote_address_item'), - $installer->getIdxName('sales/quote_address_item', ['quote_address_id']), - ['quote_address_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/quote_address_item'), - $installer->getIdxName('sales/quote_address_item', ['parent_item_id']), - ['parent_item_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/quote_address_item'), - $installer->getIdxName('sales/quote_address_item', ['quote_item_id']), - ['quote_item_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/quote_item'), - $installer->getIdxName('sales/quote_item', ['parent_item_id']), - ['parent_item_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/quote_item'), - $installer->getIdxName('sales/quote_item', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/quote_item'), - $installer->getIdxName('sales/quote_item', ['quote_id']), - ['quote_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/quote_item'), - $installer->getIdxName('sales/quote_item', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/quote_item_option'), - $installer->getIdxName('sales/quote_item_option', ['item_id']), - ['item_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/quote_payment'), - $installer->getIdxName('sales/quote_payment', ['quote_id']), - ['quote_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/quote_address_shipping_rate'), - $installer->getIdxName('sales/quote_address_shipping_rate', ['address_id']), - ['address_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment'), - $installer->getIdxName( - 'sales/shipment', - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment'), - $installer->getIdxName('sales/shipment', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment'), - $installer->getIdxName('sales/shipment', ['total_qty']), - ['total_qty'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment'), - $installer->getIdxName('sales/shipment', ['order_id']), - ['order_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment'), - $installer->getIdxName('sales/shipment', ['created_at']), - ['created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment'), - $installer->getIdxName('sales/shipment', ['updated_at']), - ['updated_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_comment'), - $installer->getIdxName('sales/shipment_comment', ['created_at']), - ['created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_comment'), - $installer->getIdxName('sales/shipment_comment', ['parent_id']), - ['parent_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_grid'), - $installer->getIdxName( - 'sales/shipment_grid', - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['increment_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_grid'), - $installer->getIdxName('sales/shipment_grid', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_grid'), - $installer->getIdxName('sales/shipment_grid', ['total_qty']), - ['total_qty'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_grid'), - $installer->getIdxName('sales/shipment_grid', ['order_id']), - ['order_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_grid'), - $installer->getIdxName('sales/shipment_grid', ['shipment_status']), - ['shipment_status'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_grid'), - $installer->getIdxName('sales/shipment_grid', ['order_increment_id']), - ['order_increment_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_grid'), - $installer->getIdxName('sales/shipment_grid', ['created_at']), - ['created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_grid'), - $installer->getIdxName('sales/shipment_grid', ['order_created_at']), - ['order_created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_grid'), - $installer->getIdxName('sales/shipment_grid', ['shipping_name']), - ['shipping_name'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_item'), - $installer->getIdxName('sales/shipment_item', ['parent_id']), - ['parent_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_track'), - $installer->getIdxName('sales/shipment_track', ['parent_id']), - ['parent_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_track'), - $installer->getIdxName('sales/shipment_track', ['order_id']), - ['order_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipment_track'), - $installer->getIdxName('sales/shipment_track', ['created_at']), - ['created_at'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoiced_aggregated'), - $installer->getIdxName( - 'sales/invoiced_aggregated', - ['period', 'store_id', 'order_status'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['period', 'store_id', 'order_status'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoiced_aggregated'), - $installer->getIdxName('sales/invoiced_aggregated', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoiced_aggregated_order'), - $installer->getIdxName( - 'sales/invoiced_aggregated_order', - ['period', 'store_id', 'order_status'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['period', 'store_id', 'order_status'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/invoiced_aggregated_order'), - $installer->getIdxName('sales/invoiced_aggregated_order', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_aggregated_created'), - $installer->getIdxName( - 'sales/order_aggregated_created', - ['period', 'store_id', 'order_status'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['period', 'store_id', 'order_status'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_aggregated_created'), - $installer->getIdxName('sales/order_aggregated_created', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_status_label'), - $installer->getIdxName('sales/order_status_label', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/order_tax'), - $installer->getIdxName('sales/order_tax', ['order_id', 'priority', 'position']), - ['order_id', 'priority', 'position'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/payment_transaction'), - $installer->getIdxName( - 'sales/payment_transaction', - ['order_id', 'payment_id', 'txn_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['order_id', 'payment_id', 'txn_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/payment_transaction'), - $installer->getIdxName('sales/payment_transaction', ['order_id']), - ['order_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/payment_transaction'), - $installer->getIdxName('sales/payment_transaction', ['parent_id']), - ['parent_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/payment_transaction'), - $installer->getIdxName('sales/payment_transaction', ['payment_id']), - ['payment_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/recurring_profile'), - $installer->getIdxName( - 'sales/recurring_profile', - ['internal_reference_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['internal_reference_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/recurring_profile'), - $installer->getIdxName('sales/recurring_profile', ['customer_id']), - ['customer_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/recurring_profile'), - $installer->getIdxName('sales/recurring_profile', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/recurring_profile_order'), - $installer->getIdxName( - 'sales/recurring_profile_order', - ['profile_id', 'order_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['profile_id', 'order_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/recurring_profile_order'), - $installer->getIdxName('sales/recurring_profile_order', ['order_id']), - ['order_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/refunded_aggregated'), - $installer->getIdxName( - 'sales/refunded_aggregated', - ['period', 'store_id', 'order_status'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['period', 'store_id', 'order_status'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/refunded_aggregated'), - $installer->getIdxName('sales/refunded_aggregated', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/refunded_aggregated_order'), - $installer->getIdxName( - 'sales/refunded_aggregated_order', - ['period', 'store_id', 'order_status'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['period', 'store_id', 'order_status'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/refunded_aggregated_order'), - $installer->getIdxName('sales/refunded_aggregated_order', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipping_aggregated'), - $installer->getIdxName( - 'sales/shipping_aggregated', - ['period', 'store_id', 'order_status', 'shipping_description'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['period', 'store_id', 'order_status', 'shipping_description'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipping_aggregated'), - $installer->getIdxName('sales/shipping_aggregated', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipping_aggregated_order'), - $installer->getIdxName( - 'sales/shipping_aggregated_order', - ['period', 'store_id', 'order_status', 'shipping_description'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['period', 'store_id', 'order_status', 'shipping_description'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('sales/shipping_aggregated_order'), - $installer->getIdxName('sales/shipping_aggregated_order', ['store_id']), - ['store_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/bestsellers_aggregated_daily', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/bestsellers_aggregated_daily'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/bestsellers_aggregated_daily', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('sales/bestsellers_aggregated_daily'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/bestsellers_aggregated_monthly', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/bestsellers_aggregated_monthly'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/bestsellers_aggregated_monthly', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('sales/bestsellers_aggregated_monthly'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/bestsellers_aggregated_yearly', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/bestsellers_aggregated_yearly'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/bestsellers_aggregated_yearly', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('sales/bestsellers_aggregated_yearly'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/billing_agreement', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('sales/billing_agreement'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/billing_agreement', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/billing_agreement'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/billing_agreement_order', 'agreement_id', 'sales/billing_agreement', 'agreement_id'), - $installer->getTable('sales/billing_agreement_order'), - 'agreement_id', - $installer->getTable('sales/billing_agreement'), - 'agreement_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/billing_agreement_order', 'order_id', 'sales/order', 'entity_id'), - $installer->getTable('sales/billing_agreement_order'), - 'order_id', - $installer->getTable('sales/order'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/creditmemo', 'order_id', 'sales/order', 'entity_id'), - $installer->getTable('sales/creditmemo'), - 'order_id', - $installer->getTable('sales/order'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/creditmemo', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/creditmemo'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/creditmemo_comment', 'parent_id', 'sales/creditmemo', 'entity_id'), - $installer->getTable('sales/creditmemo_comment'), - 'parent_id', - $installer->getTable('sales/creditmemo'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/creditmemo_grid', 'entity_id', 'sales/creditmemo', 'entity_id'), - $installer->getTable('sales/creditmemo_grid'), - 'entity_id', - $installer->getTable('sales/creditmemo'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/creditmemo_grid', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/creditmemo_grid'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/creditmemo_item', 'parent_id', 'sales/creditmemo', 'entity_id'), - $installer->getTable('sales/creditmemo_item'), - 'parent_id', - $installer->getTable('sales/creditmemo'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/invoice', 'order_id', 'sales/order', 'entity_id'), - $installer->getTable('sales/invoice'), - 'order_id', - $installer->getTable('sales/order'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/invoice', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/invoice'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/invoice_comment', 'parent_id', 'sales/invoice', 'entity_id'), - $installer->getTable('sales/invoice_comment'), - 'parent_id', - $installer->getTable('sales/invoice'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/invoice_grid', 'entity_id', 'sales/invoice', 'entity_id'), - $installer->getTable('sales/invoice_grid'), - 'entity_id', - $installer->getTable('sales/invoice'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/invoice_grid', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/invoice_grid'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/invoice_item', 'parent_id', 'sales/invoice', 'entity_id'), - $installer->getTable('sales/invoice_item'), - 'parent_id', - $installer->getTable('sales/invoice'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/order', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('sales/order'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/order', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/order'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/order_address', 'parent_id', 'sales/order', 'entity_id'), - $installer->getTable('sales/order_address'), - 'parent_id', - $installer->getTable('sales/order'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/order_grid', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('sales/order_grid'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/order_grid', 'entity_id', 'sales/order', 'entity_id'), - $installer->getTable('sales/order_grid'), - 'entity_id', - $installer->getTable('sales/order'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/order_grid', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/order_grid'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/order_item', 'order_id', 'sales/order', 'entity_id'), - $installer->getTable('sales/order_item'), - 'order_id', - $installer->getTable('sales/order'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/order_item', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/order_item'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/order_payment', 'parent_id', 'sales/order', 'entity_id'), - $installer->getTable('sales/order_payment'), - 'parent_id', - $installer->getTable('sales/order'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/order_status_history', 'parent_id', 'sales/order', 'entity_id'), - $installer->getTable('sales/order_status_history'), - 'parent_id', - $installer->getTable('sales/order'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/quote', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/quote'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/quote_address', 'quote_id', 'sales/quote', 'entity_id'), - $installer->getTable('sales/quote_address'), - 'quote_id', - $installer->getTable('sales/quote'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/quote_address_item', 'quote_item_id', 'sales/quote_item', 'item_id'), - $installer->getTable('sales/quote_address_item'), - 'quote_item_id', - $installer->getTable('sales/quote_item'), - 'item_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/quote_address_item', 'parent_item_id', 'sales/quote_address_item', 'address_item_id'), - $installer->getTable('sales/quote_address_item'), - 'parent_item_id', - $installer->getTable('sales/quote_address_item'), - 'address_item_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/quote_address_item', 'quote_address_id', 'sales/quote_address', 'address_id'), - $installer->getTable('sales/quote_address_item'), - 'quote_address_id', - $installer->getTable('sales/quote_address'), - 'address_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/quote_item', 'parent_item_id', 'sales/quote_item', 'item_id'), - $installer->getTable('sales/quote_item'), - 'parent_item_id', - $installer->getTable('sales/quote_item'), - 'item_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/quote_item', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('sales/quote_item'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/quote_item', 'quote_id', 'sales/quote', 'entity_id'), - $installer->getTable('sales/quote_item'), - 'quote_id', - $installer->getTable('sales/quote'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/quote_item', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/quote_item'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/quote_item_option', 'item_id', 'sales/quote_item', 'item_id'), - $installer->getTable('sales/quote_item_option'), - 'item_id', - $installer->getTable('sales/quote_item'), - 'item_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/quote_payment', 'quote_id', 'sales/quote', 'entity_id'), - $installer->getTable('sales/quote_payment'), - 'quote_id', - $installer->getTable('sales/quote'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/quote_address_shipping_rate', 'address_id', 'sales/quote_address', 'address_id'), - $installer->getTable('sales/quote_address_shipping_rate'), - 'address_id', - $installer->getTable('sales/quote_address'), - 'address_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/shipment', 'order_id', 'sales/order', 'entity_id'), - $installer->getTable('sales/shipment'), - 'order_id', - $installer->getTable('sales/order'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/shipment', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/shipment'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/shipment_comment', 'parent_id', 'sales/shipment', 'entity_id'), - $installer->getTable('sales/shipment_comment'), - 'parent_id', - $installer->getTable('sales/shipment'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/shipment_grid', 'entity_id', 'sales/shipment', 'entity_id'), - $installer->getTable('sales/shipment_grid'), - 'entity_id', - $installer->getTable('sales/shipment'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/shipment_grid', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/shipment_grid'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/shipment_item', 'parent_id', 'sales/shipment', 'entity_id'), - $installer->getTable('sales/shipment_item'), - 'parent_id', - $installer->getTable('sales/shipment'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/shipment_track', 'parent_id', 'sales/shipment', 'entity_id'), - $installer->getTable('sales/shipment_track'), - 'parent_id', - $installer->getTable('sales/shipment'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/invoiced_aggregated', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/invoiced_aggregated'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/invoiced_aggregated_order', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/invoiced_aggregated_order'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/order_aggregated_created', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/order_aggregated_created'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/order_status_label', 'status', 'sales/order_status', 'status'), - $installer->getTable('sales/order_status_label'), - 'status', - $installer->getTable('sales/order_status'), - 'status', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/order_status_label', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/order_status_label'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/order_status_state', 'status', 'sales/order_status', 'status'), - $installer->getTable('sales/order_status_state'), - 'status', - $installer->getTable('sales/order_status'), - 'status', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/payment_transaction', 'order_id', 'sales/order', 'entity_id'), - $installer->getTable('sales/payment_transaction'), - 'order_id', - $installer->getTable('sales/order'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/payment_transaction', 'parent_id', 'sales/payment_transaction', 'transaction_id'), - $installer->getTable('sales/payment_transaction'), - 'parent_id', - $installer->getTable('sales/payment_transaction'), - 'transaction_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/payment_transaction', 'payment_id', 'sales/order_payment', 'entity_id'), - $installer->getTable('sales/payment_transaction'), - 'payment_id', - $installer->getTable('sales/order_payment'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/recurring_profile', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('sales/recurring_profile'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/recurring_profile', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/recurring_profile'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/recurring_profile_order', 'order_id', 'sales/order', 'entity_id'), - $installer->getTable('sales/recurring_profile_order'), - 'order_id', - $installer->getTable('sales/order'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/recurring_profile_order', 'profile_id', 'sales/recurring_profile', 'profile_id'), - $installer->getTable('sales/recurring_profile_order'), - 'profile_id', - $installer->getTable('sales/recurring_profile'), - 'profile_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/refunded_aggregated', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/refunded_aggregated'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/refunded_aggregated_order', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/refunded_aggregated_order'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/shipping_aggregated', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/shipping_aggregated'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('sales/shipping_aggregated_order', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sales/shipping_aggregated_order'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 709ef6fb72a..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,99 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('salesrule')}; -CREATE TABLE {$this->getTable('salesrule')} ( - `rule_id` int(10) unsigned NOT NULL auto_increment, - `name` varchar(255) NOT NULL default '', - `description` text NOT NULL, - `from_date` date default '0000-00-00', - `to_date` date default '0000-00-00', - `store_ids` varchar(255) NOT NULL default '', - `coupon_code` varchar(255) default NULL, - `uses_per_coupon` smallint(11) NOT NULL default '0', - `uses_per_customer` smallint(11) NOT NULL default '0', - `customer_group_ids` varchar(255) NOT NULL default '', - `is_active` tinyint(1) NOT NULL default '0', - `conditions_serialized` text NOT NULL, - `actions_serialized` text NOT NULL, - `stop_rules_processing` tinyint(1) NOT NULL default '1', - `is_advanced` tinyint(3) unsigned NOT NULL default '1', - `product_ids` text, - `sort_order` int(10) unsigned NOT NULL default '0', - `simple_action` varchar(32) NOT NULL default '', - `discount_amount` decimal(12,4) NOT NULL default '0.0000', - `discount_qty` decimal(12,4) unsigned default NULL, - `simple_free_shipping` tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (`rule_id`), - KEY `sort_order` (`is_active`,`sort_order`,`to_date`,`from_date`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('salesrule_customer')}; -CREATE TABLE {$this->getTable('salesrule_customer')} ( - `rule_customer_id` int(10) unsigned NOT NULL auto_increment, - `rule_id` int(10) unsigned NOT NULL default '0', - `customer_id` int(10) unsigned NOT NULL default '0', - `times_used` smallint(11) unsigned NOT NULL default '0', - PRIMARY KEY (`rule_customer_id`), - KEY `rule_id` (`rule_id`,`customer_id`), - KEY `customer_id` (`customer_id`,`rule_id`), - CONSTRAINT `FK_salesrule_customer_id` FOREIGN KEY (`customer_id`) REFERENCES {$this->getTable('customer_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_salesrule_customer_rule` FOREIGN KEY (`rule_id`) REFERENCES {$this->getTable('salesrule')} (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('salesrule_product')}; -CREATE TABLE {$this->getTable('salesrule_product')} ( - `rule_product_id` int(10) unsigned NOT NULL auto_increment, - `rule_id` int(10) unsigned NOT NULL default '0', - `from_time` int(10) unsigned NOT NULL default '0', - `to_time` int(10) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `customer_group_id` smallint(5) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `coupon_code` varchar(255) default NULL, - `sort_order` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`rule_product_id`), - UNIQUE KEY `sort_order` (`from_time`,`to_time`,`store_id`,`customer_group_id`,`product_id`,`coupon_code`,`sort_order`), - KEY `FK_salesrule_product_rule` (`rule_id`), - KEY `FK_salesrule_product_store` (`store_id`), - KEY `FK_salesrule_product_customergroup` (`customer_group_id`), - CONSTRAINT `FK_salesrule_product_customergroup` FOREIGN KEY (`customer_group_id`) REFERENCES {$this->getTable('customer_group')} (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_salesrule_product_rule` FOREIGN KEY (`rule_id`) REFERENCES {$this->getTable('salesrule')} (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_salesrule_product_store` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('salesrule_product_action')}; -CREATE TABLE {$this->getTable('salesrule_product_action')} ( - `rule_product_action_id` int(10) unsigned NOT NULL auto_increment, - `rule_product_id` int(10) unsigned NOT NULL default '0', - `action_type` varchar(255) NOT NULL default '', - `action_attribute` varchar(255) NOT NULL default '', - `action_operator` varchar(255) NOT NULL default '', - `action_value` varchar(255) NOT NULL default '', - PRIMARY KEY (`rule_product_action_id`), - KEY `rule_product_id` (`rule_product_id`), - CONSTRAINT `salesrule_product_action_ibfk_1` FOREIGN KEY (`rule_product_id`) REFERENCES {$this->getTable('salesrule_product')} (`rule_product_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-1.4.0.0.0.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-1.4.0.0.0.php deleted file mode 100644 index 6c069ecd867..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-1.4.0.0.0.php +++ /dev/null @@ -1,128 +0,0 @@ -startSetup(); - -$installer->run(" - -CREATE TABLE `{$installer->getTable('salesrule')}` ( - `rule_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(255) NOT NULL DEFAULT '', - `description` text NOT NULL, - `from_date` date DEFAULT '0000-00-00', - `to_date` date DEFAULT '0000-00-00', - `coupon_code` varchar(255) DEFAULT NULL, - `uses_per_coupon` int(11) NOT NULL DEFAULT '0', - `uses_per_customer` int(11) NOT NULL DEFAULT '0', - `customer_group_ids` varchar(255) NOT NULL DEFAULT '', - `is_active` tinyint(1) NOT NULL DEFAULT '0', - `conditions_serialized` mediumtext NOT NULL, - `actions_serialized` mediumtext NOT NULL, - `stop_rules_processing` tinyint(1) NOT NULL DEFAULT '1', - `is_advanced` tinyint(3) unsigned NOT NULL DEFAULT '1', - `product_ids` text, - `sort_order` int(10) unsigned NOT NULL DEFAULT '0', - `simple_action` varchar(32) NOT NULL DEFAULT '', - `discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `discount_qty` decimal(12,4) unsigned DEFAULT NULL, - `discount_step` int(10) unsigned NOT NULL, - `simple_free_shipping` tinyint(1) unsigned NOT NULL DEFAULT '0', - `apply_to_shipping` tinyint(1) unsigned NOT NULL DEFAULT '0', - `times_used` int(11) unsigned NOT NULL DEFAULT '0', - `is_rss` tinyint(4) NOT NULL DEFAULT '0', - `website_ids` text, - PRIMARY KEY (`rule_id`), - KEY `sort_order` (`is_active`,`sort_order`,`to_date`,`from_date`) -) ENGINE=InnoDB AUTO_INCREMENT=125 DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('salesrule_customer')}` ( - `rule_customer_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `rule_id` int(10) unsigned NOT NULL DEFAULT '0', - `customer_id` int(10) unsigned NOT NULL DEFAULT '0', - `times_used` smallint(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`rule_customer_id`), - KEY `rule_id` (`rule_id`, `customer_id`), - KEY `customer_id` (`customer_id`, `rule_id`), - CONSTRAINT `FK_salesrule_customer_id` FOREIGN KEY (`customer_id`) - REFERENCES `{$installer->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_salesrule_customer_rule` FOREIGN KEY (`rule_id`) - REFERENCES `{$installer->getTable('salesrule')}` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('salesrule_label')}` ( - `label_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `rule_id` int(10) unsigned NOT NULL, - `store_id` smallint(5) unsigned NOT NULL, - `label` varchar(255) DEFAULT NULL, - PRIMARY KEY (`label_id`), - UNIQUE KEY `IDX_RULE_STORE` (`rule_id`,`store_id`), - KEY `FK_SALESRULE_LABEL_STORE` (`store_id`), - KEY `FK_SALESRULE_LABEL_RULE` (`rule_id`), - CONSTRAINT `FK_SALESRULE_LABEL_RULE` FOREIGN KEY (`rule_id`) - REFERENCES `{$installer->getTable('salesrule')}` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALESRULE_LABEL_STORE` FOREIGN KEY (`store_id`) - REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('coupon_aggregated')}` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned DEFAULT NULL, - `order_status` varchar(50) NOT NULL DEFAULT '', - `coupon_code` varchar(50) NOT NULL DEFAULT '', - `coupon_uses` int(11) NOT NULL DEFAULT '0', - `subtotal_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `total_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_COUPON_AGGREGATED_PSOC` (`period`,`store_id`,`order_status`,`coupon_code`), - KEY `IDX_STORE_ID` (`store_id`), - CONSTRAINT `FK_SALESTRULE_COUPON_AGGREGATED_STORE` FOREIGN KEY (`store_id`) - REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('coupon_aggregated_order')}` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned DEFAULT NULL, - `order_status` varchar(50) NOT NULL DEFAULT '', - `coupon_code` varchar(50) NOT NULL DEFAULT '', - `coupon_uses` int(11) NOT NULL DEFAULT '0', - `subtotal_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - `total_amount` decimal(12,4) NOT NULL DEFAULT '0.0000', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_COUPON_AGGREGATED_ORDER_PSOC` (`period`,`store_id`,`order_status`,`coupon_code`), - KEY `IDX_STORE_ID` (`store_id`), - CONSTRAINT `FK_SALESTRULE_COUPON_AGGREGATED_ORDER_STORE` FOREIGN KEY (`store_id`) - REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -/** - * add attributes discount_description, shipping_discount_amount, base_shipping_discount_amount - */ -$installer->addAttribute('quote_address', 'discount_description', ['type' => 'varchar']); -$installer->addAttribute('quote_address', 'shipping_discount_amount', ['type' => 'decimal']); -$installer->addAttribute('quote_address', 'base_shipping_discount_amount', ['type' => 'decimal']); - -$installer->addAttribute('order', 'discount_description', ['type' => 'varchar']); -$installer->addAttribute('order', 'shipping_discount_amount', ['type' => 'decimal']); -$installer->addAttribute('order', 'base_shipping_discount_amount', ['type' => 'decimal']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index c8d9baf87ff..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('salesrule')} - CHANGE `uses_per_coupon` `uses_per_coupon` int (11) DEFAULT '0' NOT NULL , - CHANGE `uses_per_customer` `uses_per_customer` int (11) DEFAULT '0' NOT NULL; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index 80d1aa5fd9e..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE `{$this->getTable('salesrule')}` - ADD COLUMN `times_used` int (11) unsigned DEFAULT '0' NOT NULL - AFTER `simple_free_shipping`; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.10-0.7.11.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.10-0.7.11.php deleted file mode 100644 index f5c78eee017..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.10-0.7.11.php +++ /dev/null @@ -1,109 +0,0 @@ -startSetup(); - -/* - * @deprecated since 1.4 Sales no more eav, moving attributes from eav to flat table, - * already done in sales upgrade - * - -$orderEntityType = $installer->getEntityType('order'); -$orderEntityTypeId = $orderEntityType['entity_type_id']; - - -$attribute = $installer->getAttribute($orderEntityTypeId, 'coupon_code'); - -$installer->getConnection()->addColumn($this->getTable('sales/order'), $attribute['attribute_code'], "varchar(255) NULL DEFAULT NULL"); - -try { - $installer->getConnection()->beginTransaction(); - - $installer->run(" - UPDATE {$this->getTable('sales/order')} AS o, {$this->getTable('sales/order')}_varchar AS od - SET o.{$attribute['attribute_code']} = od.value - WHERE od.entity_id = o.entity_id - AND od.attribute_id = {$attribute['attribute_id']} - AND od.entity_type_id = {$orderEntityTypeId} - "); - - $installer->run(" - DELETE FROM {$this->getTable('sales/order')}_{$attribute['backend_type']} - WHERE attribute_id = {$attribute['attribute_id']} - AND entity_type_id = {$orderEntityTypeId} - "); - - $installer->updateAttribute($orderEntityTypeId, $attribute['attribute_code'], array('backend_type' => 'static')); - - $installer->getConnection()->commit(); -} catch (Exception $e) { - $installer->getConnection()->rollback(); - $installer->getConnection()->dropColumn($this->getTable('sales/order'), $attribute['attribute_code']); - throw $e; -} -*/ - -$installer->run(" - CREATE TABLE `{$installer->getTable('salesrule/coupon_aggregated')}` ( - `id` int(11) unsigned NOT NULL auto_increment, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned NULL DEFAULT NULL, - `order_status` varchar(50) NOT NULL default '', - `coupon_code` varchar(50) NOT NULL default '', - `coupon_uses` int(11) NOT NULL DEFAULT '0', - `subtotal_amount` decimal(12,4) NOT NULL DEFAULT '0', - `discount_amount` decimal(12,4) NOT NULL DEFAULT '0', - `total_amount` decimal(12,4) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_COUPON_AGGREGATED_PSOC` (`period`,`store_id`, `order_status`, `coupon_code`), - KEY `IDX_STORE_ID` (`store_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - CREATE TABLE `{$installer->getTable('salesrule/coupon_aggregated_order')}` ( - `id` int(11) unsigned NOT NULL auto_increment, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned NULL DEFAULT NULL, - `order_status` varchar(50) NOT NULL default '', - `coupon_code` varchar(50) NOT NULL default '', - `coupon_uses` int(11) NOT NULL DEFAULT '0', - `subtotal_amount` decimal(12,4) NOT NULL DEFAULT '0', - `discount_amount` decimal(12,4) NOT NULL DEFAULT '0', - `total_amount` decimal(12,4) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_COUPON_AGGREGATED_ORDER_PSOC` (`period`,`store_id`, `order_status`,`coupon_code`), - KEY `IDX_STORE_ID` (`store_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->getConnection()->addConstraint( - 'FK_SALESTRULE_COUPON_AGGREGATED_ORDER_STORE', - $this->getTable('salesrule/coupon_aggregated_order'), - 'store_id', - $this->getTable('core_store'), - 'store_id', -); - -$installer->getConnection()->addConstraint( - 'FK_SALESTRULE_COUPON_AGGREGATED_STORE', - $this->getTable('salesrule/coupon_aggregated'), - 'store_id', - $this->getTable('core_store'), - 'store_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.11-0.7.12.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.11-0.7.12.php deleted file mode 100644 index e6eb58ba9f1..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.11-0.7.12.php +++ /dev/null @@ -1,15 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('salesrule')} - ADD COLUMN `is_rss` tinyint(4) NOT NULL default '0'; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.3-0.7.4.php deleted file mode 100644 index 7fadfe373e6..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); - -$installer->run(" -DROP TABLE IF EXISTS `{$this->getTable('salesrule_product')}`; -DROP TABLE IF EXISTS `{$this->getTable('salesrule_product_action')}`; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index 645564b4a8a..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,45 +0,0 @@ -startSetup(); - -$conn = $installer->getConnection(); -$websites = $conn->fetchPairs("SELECT store_id, website_id FROM {$this->getTable('core_store')}"); - -$conn->addColumn($this->getTable('salesrule'), 'website_ids', 'text'); - -$select = $conn->select() - ->from($this->getTable('salesrule'), ['rule_id', 'store_ids']); -$rows = $conn->fetchAll($select); - -foreach ($rows as $r) { - $websiteIds = []; - foreach (explode(',', $r['store_ids']) as $storeId) { - if ($storeId !== '') { - $websiteIds[$websites[$storeId]] = true; - } - } - $conn->update( - $this->getTable('salesrule'), - ['website_ids' => implode(',', array_keys($websiteIds))], - 'rule_id=' . $r['rule_id'], - ); -} -$conn->dropColumn($this->getTable('salesrule'), 'store_ids'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.5-0.7.6.php deleted file mode 100644 index 575e4ae28da..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$conn = $installer->getConnection(); -$conn->addColumn($this->getTable('salesrule'), 'discount_step', 'int unsigned not null after discount_qty'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.6-0.7.7.php deleted file mode 100644 index ce53074bc37..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -$installer->getConnection()->changeColumn( - $this->getTable('salesrule'), - 'conditions_serialized', - 'conditions_serialized', - 'mediumtext CHARACTER SET utf8 NOT NULL', -); -$installer->getConnection()->changeColumn( - $this->getTable('salesrule'), - 'actions_serialized', - 'actions_serialized', - 'mediumtext CHARACTER SET utf8 NOT NULL', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.7-0.7.8.php deleted file mode 100644 index 597119f388d..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ /dev/null @@ -1,29 +0,0 @@ -addAttribute('quote_address', 'discount_description', ['type' => 'varchar']); -$installer->addAttribute('quote_address', 'shipping_discount_amount', ['type' => 'decimal']); -$installer->addAttribute('quote_address', 'base_shipping_discount_amount', ['type' => 'decimal']); - -$installer->addAttribute('order', 'discount_description', ['type' => 'varchar']); -$installer->addAttribute('order', 'shipping_discount_amount', ['type' => 'decimal']); -$installer->addAttribute('order', 'base_shipping_discount_amount', ['type' => 'decimal']); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.8-0.7.9.php deleted file mode 100644 index 1170605da7d..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ /dev/null @@ -1,53 +0,0 @@ -getConnection()->addColumn( - $this->getTable('salesrule'), - 'apply_to_shipping', - "tinyint(1) unsigned not null default '0' after simple_free_shipping", -); - -$installer->run(" -CREATE TABLE `{$this->getTable('salesrule/label')}` ( - `label_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `rule_id` int(10) unsigned NOT NULL, - `store_id` smallint(5) unsigned NOT NULL, - `label` varchar(255) DEFAULT NULL, - PRIMARY KEY (`label_id`), - UNIQUE KEY `UNQ_RULE_STORE` (`rule_id`,`store_id`), - KEY `IDX_STORE_ID` (`store_id`), - KEY `IDX_RULE_ID` (`rule_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->getConnection()->addConstraint( - 'SALESRULE_LABEL_RULE', - $this->getTable('salesrule/label'), - 'rule_id', - $this->getTable('salesrule'), - 'rule_id', -); - -$installer->getConnection()->addConstraint( - 'SALESRULE_LABEL_STORE', - $this->getTable('salesrule/label'), - 'store_id', - $this->getTable('core/store'), - 'store_id', -); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.9-0.7.10.php deleted file mode 100644 index e6eb58ba9f1..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ /dev/null @@ -1,15 +0,0 @@ -getConnection(); - -$tableSalesrule = $installer->getTable('salesrule/rule'); -$tableSalesruleCustomer = $installer->getTable('salesrule/rule_customer'); -$tableSalesruleCoupon = $installer->getTable('salesrule/coupon'); -$tableSalesruleCouponUsage = $installer->getTable('salesrule/coupon_usage'); -$tableCustomerEntity = $installer->getTable('customer/entity'); - -$installer->run(" -CREATE TABLE `{$tableSalesruleCoupon}` ( - `coupon_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `rule_id` int(10) unsigned NOT NULL, - `code` varchar(255) NOT NULL, - `usage_limit` int(10) unsigned DEFAULT NULL, - `usage_per_customer` int(10) unsigned DEFAULT NULL, - `times_used` int(10) unsigned NOT NULL DEFAULT '0', - `expiration_date` datetime DEFAULT NULL, - `is_primary` tinyint(1) unsigned DEFAULT NULL, - PRIMARY KEY (`coupon_id`), - UNIQUE KEY `UNQ_COUPON_CODE` (`code`), - UNIQUE KEY `UNQ_RULE_MAIN_COUPON` (`rule_id`, `is_primary`), - KEY `FK_SALESRULE_COUPON_RULE_ID_SALESRULE` (`rule_id`), - CONSTRAINT `FK_SALESRULE_COUPON_RULE_ID_SALESRULE` FOREIGN KEY (`rule_id`) REFERENCES `{$tableSalesrule}` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$tableSalesruleCouponUsage}` ( - `coupon_id` int(10) unsigned NOT NULL, - `customer_id` int(10) unsigned NOT NULL, - `times_used` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`coupon_id`, `customer_id`), - KEY `FK_SALESRULE_COUPON_CUSTOMER_COUPON_ID_CUSTOMER_ENTITY` (`coupon_id`), - KEY `FK_SALESRULE_COUPON_CUSTOMER_CUSTOMER_ID_CUSTOMER_ENTITY` (`customer_id`), - CONSTRAINT `FK_SALESRULE_COUPON_CUSTOMER_COUPON_ID_CUSTOMER_ENTITY` FOREIGN KEY (`coupon_id`) REFERENCES `{$tableSalesruleCoupon}` (`coupon_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_SALESRULE_COUPON_CUSTOMER_CUSTOMER_ID_CUSTOMER_ENTITY` FOREIGN KEY (`customer_id`) REFERENCES `{$tableCustomerEntity}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -INSERT INTO `{$tableSalesruleCoupon}` ( - rule_id -, code -, usage_limit -, usage_per_customer -, times_used -, is_primary -) -SELECT - rule_id -, coupon_code -, uses_per_coupon -, uses_per_customer -, times_used -, 1 -FROM `{$tableSalesrule}` -WHERE - coupon_code <> ''; - -INSERT INTO `{$tableSalesruleCouponUsage}` ( - coupon_id -, customer_id -, times_used -) -SELECT - coupon.coupon_id -, customer.customer_id -, customer.times_used -FROM `{$tableSalesruleCoupon}` coupon -JOIN `{$tableSalesruleCustomer}` customer ON( - customer.rule_id = coupon.rule_id -); - -ALTER TABLE `{$tableSalesrule}` - DROP COLUMN `coupon_code`, - DROP COLUMN `uses_per_coupon`; -"); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php deleted file mode 100644 index dcb92670bb2..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php +++ /dev/null @@ -1,50 +0,0 @@ -getConnection(); -/** @var Varien_Db_Adapter_Pdo_Mysql $connection */ - -$tableSalesrule = $installer->getTable('salesrule/rule'); -$tableSalesruleCoupon = $installer->getTable('salesrule/coupon'); - -$connection->addColumn( - $tableSalesrule, - 'coupon_type', - 'smallint unsigned NOT NULL DEFAULT "' . Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON . '"', -); - -/** - * UPDATE coupon_type to specific in rules with primary coupon - * Always come to ON DUPLICATE KEY UPDATE section of INSERT statement - */ -$installer->run(" -INSERT `{$tableSalesrule}`( - rule_id, /* PRIMARY KEY */ - /* columns with no default value to prevent warnings */ - description, conditions_serialized, actions_serialized, discount_step -) -SELECT DISTINCT - rule_id, /* make sure PRIMARY KEY is DUPLICATED */ - '', '', '', 0 -FROM `{$tableSalesruleCoupon}` -WHERE - is_primary IS NOT NULL /* is_primary = 1 */ -ON DUPLICATE KEY UPDATE - coupon_type = '" . Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC . "'; -"); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php deleted file mode 100644 index bac3d0bbeec..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup(); - -$installer->getConnection() - ->modifyColumn( - $installer->getTable('salesrule'), - 'customer_group_ids', - 'TEXT', - ); - -$installer->endSetup(); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php deleted file mode 100644 index be72e2f6a5e..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php +++ /dev/null @@ -1,36 +0,0 @@ -getConnection()->addColumn( - $installer->getTable('salesrule/coupon_aggregated'), - 'subtotal_amount_actual', - "decimal(12,4) NOT NULL default '0.0000'", -); - -$installer->getConnection()->addColumn( - $installer->getTable('salesrule/coupon_aggregated'), - 'discount_amount_actual', - "decimal(12,4) NOT NULL default '0.0000'", -); - -$installer->getConnection()->addColumn( - $installer->getTable('salesrule/coupon_aggregated'), - 'total_amount_actual', - "decimal(12,4) NOT NULL default '0.0000'", -); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php deleted file mode 100644 index 31079c0dabf..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php +++ /dev/null @@ -1,57 +0,0 @@ -run(" -CREATE TABLE `{$this->getTable('salesrule/product_attribute')}` ( - `rule_id` int(10) unsigned NOT NULL, - `website_id` smallint(5) unsigned NOT NULL, - `customer_group_id` smallint(5) unsigned NOT NULL, - `attribute_id` smallint(5) unsigned NOT NULL, - PRIMARY KEY (`rule_id`,`website_id`,`customer_group_id`,`attribute_id`), - KEY `IDX_WEBSITE` (`website_id`), - KEY `IDX_CUSTOMER_GROUP` (`customer_group_id`), - KEY `IDX_ATTRIBUTE` (`attribute_id`), - CONSTRAINT `FK_SALESRULE_PRODUCT_ATTRIBUTE_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$this->getTable('eav/attribute')}` (`attribute_id`) ON DELETE CASCADE, - CONSTRAINT `FK_SALESRULE_PRODUCT_ATTRIBUTE_CUSTOMER_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES `{$this->getTable('customer/customer_group')}` (`customer_group_id`) ON DELETE CASCADE, - CONSTRAINT `FK_SALESRULE_PRODUCT_ATTRIBUTE_RULE` FOREIGN KEY (`rule_id`) REFERENCES `{$this->getTable('salesrule/rule')}` (`rule_id`) ON DELETE CASCADE, - CONSTRAINT `FK_SALESRULE_PRODUCT_ATTRIBUTE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `{$this->getTable('core/website')}` (`website_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -/** - * We need to fill new table with product attributes already used in promo rules - */ -$installer->run(" -INSERT INTO `{$this->getTable('salesrule/product_attribute')}` - SELECT - sr.rule_id, - cw.website_id, - cg.customer_group_id, - ea.attribute_id - FROM `{$this->getTable('salesrule/rule')}` AS sr - INNER JOIN `{$this->getTable('core/website')}` AS cw - ON FIND_IN_SET(cw.website_id, sr.website_ids) - INNER JOIN `{$this->getTable('customer/customer_group')}` AS cg - ON FIND_IN_SET(cg.customer_group_id , sr.customer_group_ids) - INNER JOIN `{$this->getTable('eav/attribute')}` AS ea - ON ea.entity_type_id = {$installer->getEntityTypeId('catalog_product')} - WHERE - sr.conditions_serialized LIKE CONCAT('%s:32:\"salesrule/rule_condition_product\";s:9:\"attribute\";s:', LENGTH(ea.attribute_code), ':\"', ea.attribute_code, '\"%') - OR sr.actions_serialized LIKE CONCAT('%s:32:\"salesrule/rule_condition_product\";s:9:\"attribute\";s:', LENGTH(ea.attribute_code), ':\"', ea.attribute_code, '\"%') -"); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php deleted file mode 100644 index cde62bc2193..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php +++ /dev/null @@ -1,47 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/coupon_usage'), - 'FK_SALESRULE_COUPON_CUSTOMER_COUPON_ID_CUSTOMER_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/coupon_usage'), - 'FK_SALESRULE_COUPON_CUSTOMER_CUSTOMER_ID_CUSTOMER_ENTITY', -); - -$installer->getConnection()->addConstraint( - 'FK_SALESRULE_CPN_CUST_CPN_ID_CUST_ENTITY', - $installer->getTable('salesrule/coupon_usage'), - 'coupon_id', - $installer->getTable('salesrule/coupon'), - 'coupon_id', -); - -$installer->getConnection()->addConstraint( - 'FK_SALESRULE_CPN_CUST_CUST_ID_CUST_ENTITY', - $installer->getTable('salesrule/coupon_usage'), - 'customer_id', - $installer->getTable('customer_entity'), - 'entity_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 002401d37aa..00000000000 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,927 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/coupon_aggregated'), - 'FK_SALESTRULE_COUPON_AGGREGATED_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/coupon_aggregated_order'), - 'FK_SALESTRULE_COUPON_AGGREGATED_ORDER_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/coupon'), - 'FK_SALESRULE_COUPON_RULE_ID_SALESRULE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/coupon_usage'), - 'FK_SALESRULE_CPN_CUST_CPN_ID_CUST_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/coupon_usage'), - 'FK_SALESRULE_CPN_CUST_CUST_ID_CUST_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/rule_customer'), - 'FK_SALESRULE_CUSTOMER_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/rule_customer'), - 'FK_SALESRULE_CUSTOMER_RULE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/label'), - 'FK_SALESRULE_LABEL_RULE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/label'), - 'FK_SALESRULE_LABEL_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/product_attribute'), - 'FK_SALESRULE_PRODUCT_ATTRIBUTE_ATTRIBUTE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/product_attribute'), - 'FK_SALESRULE_PRODUCT_ATTRIBUTE_CUSTOMER_GROUP', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/product_attribute'), - 'FK_SALESRULE_PRODUCT_ATTRIBUTE_RULE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('salesrule/product_attribute'), - 'FK_SALESRULE_PRODUCT_ATTRIBUTE_WEBSITE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/coupon_aggregated'), - 'UNQ_COUPON_AGGREGATED_PSOC', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/coupon_aggregated'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/coupon_aggregated_order'), - 'UNQ_COUPON_AGGREGATED_ORDER_PSOC', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/coupon_aggregated_order'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/rule'), - 'SORT_ORDER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/coupon'), - 'UNQ_COUPON_CODE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/coupon'), - 'UNQ_RULE_MAIN_COUPON', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/coupon'), - 'FK_SALESRULE_COUPON_RULE_ID_SALESRULE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/coupon_usage'), - 'FK_SALESRULE_COUPON_CUSTOMER_COUPON_ID_CUSTOMER_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/coupon_usage'), - 'FK_SALESRULE_COUPON_CUSTOMER_CUSTOMER_ID_CUSTOMER_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/rule_customer'), - 'RULE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/rule_customer'), - 'CUSTOMER_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/label'), - 'IDX_RULE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/label'), - 'IDX_STORE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/label'), - 'IDX_RULE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/label'), - 'UNQ_RULE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/label'), - 'FK_SALESRULE_LABEL_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/label'), - 'FK_SALESRULE_LABEL_RULE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/product_attribute'), - 'IDX_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/product_attribute'), - 'IDX_CUSTOMER_GROUP', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('salesrule/product_attribute'), - 'IDX_ATTRIBUTE', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('salesrule/rule') => [ - 'columns' => [ - 'rule_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Rule Id', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Name', - ], - 'description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Description', - ], - 'from_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'From Date', - ], - 'to_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'To Date', - ], - 'uses_per_customer' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Uses Per Customer', - ], - 'customer_group_ids' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Customer Group Ids', - ], - 'is_active' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Active', - ], - 'conditions_serialized' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '2M', - 'comment' => 'Conditions Serialized', - ], - 'actions_serialized' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '2M', - 'comment' => 'Actions Serialized', - ], - 'stop_rules_processing' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Stop Rules Processing', - ], - 'is_advanced' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Is Advanced', - ], - 'product_ids' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Product Ids', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort Order', - ], - 'simple_action' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Simple Action', - ], - 'discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Discount Amount', - ], - 'discount_qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Discount Qty', - ], - 'discount_step' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Discount Step', - ], - 'simple_free_shipping' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Simple Free Shipping', - ], - 'apply_to_shipping' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Apply To Shipping', - ], - 'times_used' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Times Used', - ], - 'is_rss' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Rss', - ], - 'website_ids' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Website Ids', - ], - 'coupon_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Coupon Type', - ], - ], - 'comment' => 'Salesrule', - ], - $installer->getTable('salesrule/rule_customer') => [ - 'columns' => [ - 'rule_customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Rule Customer Id', - ], - 'rule_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Rule Id', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Customer Id', - ], - 'times_used' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Times Used', - ], - ], - 'comment' => 'Salesrule Customer', - ], - $installer->getTable('salesrule/label') => [ - 'columns' => [ - 'label_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Label Id', - ], - 'rule_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Rule Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store Id', - ], - 'label' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Label', - ], - ], - 'comment' => 'Salesrule Label', - ], - $installer->getTable('salesrule/coupon') => [ - 'columns' => [ - 'coupon_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Coupon Id', - ], - 'rule_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Rule Id', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Code', - ], - 'usage_limit' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Usage Limit', - ], - 'usage_per_customer' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Usage Per Customer', - ], - 'times_used' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Times Used', - ], - 'expiration_date' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Expiration Date', - ], - 'is_primary' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Is Primary', - ], - ], - 'comment' => 'Salesrule Coupon', - ], - $installer->getTable('salesrule/coupon_usage') => [ - 'columns' => [ - 'coupon_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Coupon Id', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Customer Id', - ], - 'times_used' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Times Used', - ], - ], - 'comment' => 'Salesrule Coupon Usage', - ], - $installer->getTable('salesrule/coupon_aggregated') => [ - 'columns' => [ - 'id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Id', - ], - 'period' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'nullable' => false, - 'comment' => 'Period', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'order_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Order Status', - ], - 'coupon_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Coupon Code', - ], - 'coupon_uses' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Coupon Uses', - ], - 'subtotal_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Subtotal Amount', - ], - 'discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Discount Amount', - ], - 'total_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Amount', - ], - 'subtotal_amount_actual' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Subtotal Amount Actual', - ], - 'discount_amount_actual' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Discount Amount Actual', - ], - 'total_amount_actual' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Amount Actual', - ], - ], - 'comment' => 'Coupon Aggregated', - ], - $installer->getTable('salesrule/coupon_aggregated_order') => [ - 'columns' => [ - 'id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Id', - ], - 'period' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'nullable' => false, - 'comment' => 'Period', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'order_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Order Status', - ], - 'coupon_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'comment' => 'Coupon Code', - ], - 'coupon_uses' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Coupon Uses', - ], - 'subtotal_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Subtotal Amount', - ], - 'discount_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Discount Amount', - ], - 'total_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Total Amount', - ], - ], - 'comment' => 'Coupon Aggregated Order', - ], - $installer->getTable('salesrule/product_attribute') => [ - 'columns' => [ - 'rule_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Rule Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Website Id', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Customer Group Id', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Attribute Id', - ], - ], - 'comment' => 'Salesrule Product Attribute', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/coupon_aggregated'), - $installer->getIdxName( - 'salesrule/coupon_aggregated', - ['period', 'store_id', 'order_status', 'coupon_code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['period', 'store_id', 'order_status', 'coupon_code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/coupon_aggregated'), - $installer->getIdxName('salesrule/coupon_aggregated', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/coupon_aggregated_order'), - $installer->getIdxName( - 'salesrule/coupon_aggregated_order', - ['period', 'store_id', 'order_status', 'coupon_code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['period', 'store_id', 'order_status', 'coupon_code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/coupon_aggregated_order'), - $installer->getIdxName('salesrule/coupon_aggregated_order', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/rule'), - $installer->getIdxName('salesrule/rule', ['is_active', 'sort_order', 'to_date', 'from_date']), - ['is_active', 'sort_order', 'to_date', 'from_date'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/coupon'), - $installer->getIdxName( - 'salesrule/coupon', - ['code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['code'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/coupon'), - $installer->getIdxName( - 'salesrule/coupon', - ['rule_id', 'is_primary'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['rule_id', 'is_primary'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/coupon'), - $installer->getIdxName('salesrule/coupon', ['rule_id']), - ['rule_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/coupon_usage'), - $installer->getIdxName('salesrule/coupon_usage', ['coupon_id']), - ['coupon_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/coupon_usage'), - $installer->getIdxName('salesrule/coupon_usage', ['customer_id']), - ['customer_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/rule_customer'), - $installer->getIdxName('salesrule/rule_customer', ['rule_id', 'customer_id']), - ['rule_id', 'customer_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/rule_customer'), - $installer->getIdxName('salesrule/rule_customer', ['customer_id', 'rule_id']), - ['customer_id', 'rule_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/label'), - $installer->getIdxName( - 'salesrule/label', - ['rule_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['rule_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/label'), - $installer->getIdxName('salesrule/label', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/label'), - $installer->getIdxName('salesrule/label', ['rule_id']), - ['rule_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/product_attribute'), - $installer->getIdxName('salesrule/product_attribute', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/product_attribute'), - $installer->getIdxName('salesrule/product_attribute', ['customer_group_id']), - ['customer_group_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('salesrule/product_attribute'), - $installer->getIdxName('salesrule/product_attribute', ['attribute_id']), - ['attribute_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('salesrule/coupon_aggregated', 'store_id', 'core/store', 'store_id'), - $installer->getTable('salesrule/coupon_aggregated'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('salesrule/coupon_aggregated_order', 'store_id', 'core/store', 'store_id'), - $installer->getTable('salesrule/coupon_aggregated_order'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('salesrule/coupon', 'rule_id', 'salesrule/rule', 'rule_id'), - $installer->getTable('salesrule/coupon'), - 'rule_id', - $installer->getTable('salesrule/rule'), - 'rule_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('salesrule/coupon_usage', 'coupon_id', 'salesrule/coupon', 'coupon_id'), - $installer->getTable('salesrule/coupon_usage'), - 'coupon_id', - $installer->getTable('salesrule/coupon'), - 'coupon_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('salesrule/coupon_usage', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('salesrule/coupon_usage'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('salesrule/rule_customer', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('salesrule/rule_customer'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('salesrule/rule_customer', 'rule_id', 'salesrule/rule', 'rule_id'), - $installer->getTable('salesrule/rule_customer'), - 'rule_id', - $installer->getTable('salesrule/rule'), - 'rule_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('salesrule/label', 'rule_id', 'salesrule/rule', 'rule_id'), - $installer->getTable('salesrule/label'), - 'rule_id', - $installer->getTable('salesrule/rule'), - 'rule_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('salesrule/label', 'store_id', 'core/store', 'store_id'), - $installer->getTable('salesrule/label'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('salesrule/product_attribute', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('salesrule/product_attribute'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, - Varien_Db_Ddl_Table::ACTION_NO_ACTION, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('salesrule/product_attribute', 'customer_group_id', 'customer/customer_group', 'customer_group_id'), - $installer->getTable('salesrule/product_attribute'), - 'customer_group_id', - $installer->getTable('customer/customer_group'), - 'customer_group_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, - Varien_Db_Ddl_Table::ACTION_NO_ACTION, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('salesrule/product_attribute', 'rule_id', 'salesrule/rule', 'rule_id'), - $installer->getTable('salesrule/product_attribute'), - 'rule_id', - $installer->getTable('salesrule/rule'), - 'rule_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, - Varien_Db_Ddl_Table::ACTION_NO_ACTION, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('salesrule/product_attribute', 'website_id', 'core/website', 'website_id'), - $installer->getTable('salesrule/product_attribute'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, - Varien_Db_Ddl_Table::ACTION_NO_ACTION, -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 9500fdfb2b4..00000000000 --- a/app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,40 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('shipping_tablerate')}; -CREATE TABLE {$this->getTable('shipping_tablerate')} ( - `pk` int(10) unsigned NOT NULL auto_increment, - `website_id` int(11) NOT NULL default '0', - `dest_country_id` varchar(4) NOT NULL default '0', - `dest_region_id` int(10) NOT NULL default '0', - `dest_zip` varchar(10) NOT NULL default '', - `condition_name` varchar(20) NOT NULL default '', - `condition_value` decimal(12,4) NOT NULL default '0.0000', - `price` decimal(12,4) NOT NULL default '0.0000', - `cost` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`pk`), - UNIQUE KEY `dest_country` (`website_id`,`dest_country_id`,`dest_region_id`,`dest_zip`,`condition_name`,`condition_value`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 1c5275dd283..00000000000 --- a/app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,120 +0,0 @@ -startSetup(); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('shipping/tablerate'), - 'DEST_COUNTRY', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('shipping/tablerate') => [ - 'columns' => [ - 'pk' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Primary key', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Website Id', - ], - 'dest_country_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 4, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Destination coutry ISO/2 or ISO/3 code', - ], - 'dest_region_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Destination Region Id', - ], - 'dest_zip' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 10, - 'nullable' => false, - 'default' => '*', - 'comment' => 'Destination Post Code (Zip)', - ], - 'condition_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 20, - 'nullable' => false, - 'comment' => 'Rate Condition name', - ], - 'condition_value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Rate condition value', - ], - 'price' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Price', - ], - 'cost' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Cost', - ], - ], - 'comment' => 'Shipping Tablerate', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('shipping/tablerate'), - $installer->getIdxName( - 'shipping/tablerate', - ['website_id', 'dest_country_id', 'dest_region_id', 'dest_zip', 'condition_name', 'condition_value'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['website_id', 'dest_country_id', 'dest_region_id', 'dest_zip', 'condition_name', 'condition_value'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 5e5ca072a63..00000000000 --- a/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -$installer->run(" --- DROP TABLE IF EXISTS `{$this->getTable('sitemap')}`; -CREATE TABLE IF NOT EXISTS `{$this->getTable('sitemap')}` ( - `sitemap_id` int(11) NOT NULL auto_increment, - `sitemap_type` varchar(32) default NULL, - `sitemap_filename` varchar(32) default NULL, - `sitemap_path` tinytext, - `sitemap_time` timestamp NULL default NULL, - `store_id` int(11) default NULL, - PRIMARY KEY (`sitemap_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index d9af7872046..00000000000 --- a/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,31 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('sitemap')} - CHANGE `store_id` `store_id` smallint(5) unsigned NOT NULL; -ALTER TABLE {$this->getTable('sitemap')} - ADD CONSTRAINT `FK_SITEMAP_STORE` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) - ON UPDATE CASCADE - ON DELETE CASCADE; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index c97f4465ec0..00000000000 --- a/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,15 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$connection = $installer->getConnection()->dropForeignKey( - $installer->getTable('sitemap/sitemap'), - 'FK_SITEMAP_STORE', -); - -/** - * Drop indexes - */ -$connection = $installer->getConnection()->dropIndex( - $installer->getTable('sitemap/sitemap'), - 'FK_SITEMAP_STORE', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('sitemap/sitemap') => [ - 'columns' => [ - 'sitemap_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Sitemap Id', - ], - 'sitemap_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Sitemap Type', - ], - 'sitemap_filename' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Sitemap Filename', - ], - 'sitemap_path' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Sitemap Path', - ], - 'sitemap_time' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Sitemap Time', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store id', - ], - ], - 'comment' => 'Google Sitemap', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$connection = $installer->getConnection()->addIndex( - $installer->getTable('sitemap/sitemap'), - $installer->getIdxName('sitemap/sitemap', ['store_id']), - ['store_id'], -); - -/** - * Add foreign keys - */ -$connection = $installer->getConnection()->addForeignKey( - $installer->getFkName('sitemap/sitemap', 'store_id', 'core/store', 'store_id'), - $installer->getTable('sitemap/sitemap'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 68819c49f01..00000000000 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,66 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('tag')}; -CREATE TABLE {$this->getTable('tag')} ( - `tag_id` int(11) unsigned NOT NULL auto_increment, - `name` varchar(255) NOT NULL default '', - `status` smallint(6) NOT NULL default '0', - PRIMARY KEY (`tag_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('tag_relation')}; -CREATE TABLE {$this->getTable('tag_relation')} ( - `tag_relation_id` int(11) unsigned NOT NULL auto_increment, - `tag_id` int(11) unsigned NOT NULL default '0', - `customer_id` int(10) unsigned NOT NULL default '0', - `product_id` int(11) unsigned NOT NULL default '0', - `store_id` smallint(6) unsigned NOT NULL default '1', - `active` tinyint (1) unsigned NOT NULL default '1', - `created_at` datetime default NULL, - PRIMARY KEY (`tag_relation_id`), - KEY `FK_TAG_RELATION_TAG` (`tag_id`), - KEY `FK_TAG_RELATION_CUSTOMER` (`customer_id`), - KEY `FK_TAG_RELATION_PRODUCT` (`product_id`), - KEY `FK_TAG_RELATION_STORE` (`store_id`), - CONSTRAINT `FK_TAG_RELATION_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `tag_relation_ibfk_1` FOREIGN KEY (`tag_id`) REFERENCES {$this->getTable('tag')} (`tag_id`) ON DELETE CASCADE, - CONSTRAINT `tag_relation_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES {$this->getTable('customer_entity')} (`entity_id`) ON DELETE CASCADE, - CONSTRAINT `tag_relation_ibfk_4` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- DROP TABLE IF EXISTS {$this->getTable('tag_summary')}; -CREATE TABLE {$this->getTable('tag_summary')} ( - `tag_id` int(11) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `customers` int(11) unsigned NOT NULL default '0', - `products` int(11) unsigned NOT NULL default '0', - `uses` int(11) unsigned NOT NULL default '0', - `historical_uses` int(11) unsigned NOT NULL default '0', - `popularity` int(11) unsigned NOT NULL default '0', - PRIMARY KEY (`tag_id`,`store_id`), - CONSTRAINT `TAG_SUMMARY_TAG` FOREIGN KEY (`tag_id`) REFERENCES {$this->getTable('tag')} (`tag_id`) ON DELETE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 5925fb84a26..00000000000 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('tag_summary')} - ADD CONSTRAINT `FK_TAG_SUMMARY_STORE` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) - ON UPDATE CASCADE - ON DELETE CASCADE; -"); -$installer->endSetup(); diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index 47093b9e8dc..00000000000 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,147 +0,0 @@ -startSetup(); - -$purgeFk = [ - $installer->getTable('tag/relation') => [ - 'product_id', 'tag_id', 'customer_id', 'store_id', - ], - $installer->getTable('tag/summary') => [ - 'tag_id', - ], -]; -$purgeIndex = [ - [ - $installer->getTable('tag/relation'), - ['product_id'], - ], - [ - $installer->getTable('tag/relation'), - ['tag_id'], - ], - [ - $installer->getTable('tag/relation'), - ['customer_id'], - ], - [ - $installer->getTable('tag/relation'), - ['store_id'], - ], - [ - $installer->getTable('tag/summary'), - ['tag_id'], - ], -]; -foreach ($purgeFk as $tableName => $columns) { - $foreignKeys = $installer->getConnection()->getForeignKeys($tableName); - foreach ($foreignKeys as $fkProp) { - if (in_array($fkProp['COLUMN_NAME'], $columns)) { - $installer->getConnection() - ->dropForeignKey($tableName, $fkProp['FK_NAME']); - } - } -} - -foreach ($purgeIndex as $prop) { - [$tableName, $columns] = $prop; - $indexList = $installer->getConnection()->getIndexList($tableName); - foreach ($indexList as $indexProp) { - if ($columns === $indexProp['COLUMNS_LIST']) { - $installer->getConnection()->dropKey($tableName, $indexProp['KEY_NAME']); - } - } -} - -$installer->getConnection()->addKey( - $installer->getTable('tag/relation'), - 'IDX_PRODUCT', - 'product_id', -); -$installer->getConnection()->addKey( - $installer->getTable('tag/relation'), - 'IDX_TAG', - 'tag_id', -); -$installer->getConnection()->addKey( - $installer->getTable('tag/relation'), - 'IDX_CUSTOMER', - 'customer_id', -); -$installer->getConnection()->addKey( - $installer->getTable('tag/relation'), - 'IDX_STORE', - 'store_id', -); -$installer->getConnection()->addKey( - $installer->getTable('tag/summary'), - 'IDX_TAG', - 'tag_id', -); - -$installer->getConnection()->addConstraint( - 'FK_TAG_RELATION_PRODUCT', - $installer->getTable('tag/relation'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', - 'CASCADE', - 'CASCADE', - true, -); -$installer->getConnection()->addConstraint( - 'FK_TAG_RELATION_TAG', - $installer->getTable('tag/relation'), - 'tag_id', - $installer->getTable('tag/tag'), - 'tag_id', - 'CASCADE', - 'CASCADE', - true, -); -$installer->getConnection()->addConstraint( - 'FK_TAG_RELATION_CUSTOMER', - $installer->getTable('tag/relation'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', - 'CASCADE', - 'CASCADE', - true, -); -$installer->getConnection()->addConstraint( - 'FK_TAG_RELATION_STORE', - $installer->getTable('tag/relation'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'CASCADE', - 'CASCADE', - true, -); -$installer->getConnection()->addConstraint( - 'FK_TAG_SUMMARY_TAG', - $installer->getTable('tag/summary'), - 'tag_id', - $installer->getTable('tag/tag'), - 'tag_id', - 'CASCADE', - 'CASCADE', - true, -); -$installer->endSetup(); diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index 1e068e72674..00000000000 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $this->getTable('tag_summary'), - 'base_popularity', - 'int(11) UNSIGNED DEFAULT \'0\' NOT NULL AFTER `popularity`', -); - -$installer->getConnection()->changeColumn( - $this->getTable('tag_relation'), - 'customer_id', - 'customer_id', - 'INT(10) UNSIGNED NULL DEFAULT NULL', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.3-0.7.4.php deleted file mode 100644 index 22a1e4f3aac..00000000000 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('tag/tag'), 'first_customer_id', "INT(10) UNSIGNED NOT NULL DEFAULT '0'"); - -$groupedTags = $installer->getConnection()->select() - ->from($installer->getTable('tag/relation'))->group('tag_id')->order('created_at ASC'); -$select = $installer->getConnection()->select() - ->reset() - ->joinInner( - ['relation_table' => new Zend_Db_Expr("({$groupedTags->__toString()})")], - 'relation_table.tag_id = main_table.tag_id', - null, - ) - ->columns(['first_customer_id' => 'customer_id']); - -$updateSql = $select->crossUpdateFromSelect(['main_table' => $installer->getTable('tag/tag')]); -$installer->getConnection()->query($updateSql); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index baa8fddeec6..00000000000 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('tag/tag'), 'first_store_id', "smallint(5) UNSIGNED NOT NULL DEFAULT '0'"); - -$groupedTags = $installer->getConnection()->select() - ->from($installer->getTable('tag/relation'))->group('tag_id')->order('created_at ASC'); -$select = $installer->getConnection()->select() - ->reset() - ->joinInner( - ['relation_table' => new Zend_Db_Expr("({$groupedTags->__toString()})")], - 'relation_table.tag_id = main_table.tag_id', - null, - ) - ->columns(['first_store_id' => 'store_id']); - -$updateSql = $select->crossUpdateFromSelect(['main_table' => $installer->getTable('tag/tag')]); -$installer->getConnection()->query($updateSql); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.5-0.7.6.php deleted file mode 100644 index fa8c75009bf..00000000000 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ /dev/null @@ -1,61 +0,0 @@ -getConnection()->modifyColumn( - $installer->getTable('tag/summary'), - 'uses', - "int(11) unsigned NOT NULL default '0' COMMENT '{$deprecatedComment}'", -); -$installer->getConnection()->modifyColumn( - $installer->getTable('tag/summary'), - 'historical_uses', - "int(11) unsigned NOT NULL default '0' COMMENT '{$deprecatedComment}'", -); -$installer->getConnection()->modifyColumn( - $installer->getTable('tag/summary'), - 'base_popularity', - "int(11) UNSIGNED DEFAULT '0' NOT NULL COMMENT '{$deprecatedComment}'", -); - -$installer->run(" - CREATE TABLE {$this->getTable('tag/properties')} ( - `tag_id` int(11) unsigned NOT NULL default '0', - `store_id` smallint(5) unsigned NOT NULL default '0', - `base_popularity` int(11) unsigned NOT NULL default '0', - PRIMARY KEY (`tag_id`,`store_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->getConnection()->addConstraint( - 'TAG_PROPERTIES_TAG', - $installer->getTable('tag/properties'), - 'tag_id', - $installer->getTable('tag/tag'), - 'tag_id', -); - -$installer->getConnection()->addConstraint( - 'TAG_PROPERTIES_STORE', - $installer->getTable('tag/properties'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.6-0.7.7.php deleted file mode 100644 index 79fbeb8e841..00000000000 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ /dev/null @@ -1,26 +0,0 @@ -getConnection() - ->addKey( - $this->getTable('tag/relation'), - 'UNQ_TAG_CUSTOMER_PRODUCT_STORE', - ['tag_id', 'customer_id', 'product_id', 'store_id'], - 'unique', - ); diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index dab1f962f3d..00000000000 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,433 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('tag/properties'), - 'FK_TAG_PROPERTIES_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('tag/properties'), - 'FK_TAG_PROPERTIES_TAG', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('tag/relation'), - 'FK_TAG_RELATION_CUSTOMER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('tag/relation'), - 'FK_TAG_RELATION_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('tag/relation'), - 'FK_TAG_RELATION_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('tag/relation'), - 'FK_TAG_RELATION_TAG', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('tag/summary'), - 'FK_TAG_SUMMARY_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('tag/summary'), - 'FK_TAG_SUMMARY_TAG', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('tag/relation'), - 'UNQ_TAG_CUSTOMER_PRODUCT_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tag/relation'), - 'IDX_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tag/relation'), - 'IDX_TAG', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tag/relation'), - 'IDX_CUSTOMER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tag/relation'), - 'IDX_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tag/properties'), - 'FK_TAG_PROPERTIES_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tag/summary'), - 'FK_TAG_SUMMARY_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tag/summary'), - 'IDX_TAG', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('tag/tag') => [ - 'columns' => [ - 'tag_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Tag Id', - ], - 'name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Name', - ], - 'status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Status', - ], - 'first_customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'First Customer Id', - ], - 'first_store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'First Store Id', - ], - ], - 'comment' => 'Tag', - ], - $installer->getTable('tag/relation') => [ - 'columns' => [ - 'tag_relation_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Tag Relation Id', - ], - 'tag_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Tag Id', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Customer Id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Store Id', - ], - 'active' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '1', - 'comment' => 'Active', - ], - 'created_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Created At', - ], - ], - 'comment' => 'Tag Relation', - ], - $installer->getTable('tag/summary') => [ - 'columns' => [ - 'tag_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Tag Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'customers' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Customers', - ], - 'products' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Products', - ], - 'uses' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Uses', - ], - 'historical_uses' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Historical Uses', - ], - 'popularity' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Popularity', - ], - 'base_popularity' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Base Popularity', - ], - ], - 'comment' => 'Tag Summary', - ], - $installer->getTable('tag/properties') => [ - 'columns' => [ - 'tag_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Tag Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Store Id', - ], - 'base_popularity' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Base Popularity', - ], - ], - 'comment' => 'Tag Properties', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('tag/properties'), - $installer->getIdxName('tag/properties', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tag/relation'), - $installer->getIdxName( - 'tag/relation', - ['tag_id', 'customer_id', 'product_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['tag_id', 'customer_id', 'product_id', 'store_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('tag/relation'), - $installer->getIdxName('tag/relation', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tag/relation'), - $installer->getIdxName('tag/relation', ['tag_id']), - ['tag_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tag/relation'), - $installer->getIdxName('tag/relation', ['customer_id']), - ['customer_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tag/relation'), - $installer->getIdxName('tag/relation', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tag/summary'), - $installer->getIdxName('tag/summary', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tag/summary'), - $installer->getIdxName('tag/summary', ['tag_id']), - ['tag_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('tag/tag', 'first_customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('tag/tag'), - 'first_customer_id', - $installer->getTable('customer/entity'), - 'entity_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, - Varien_Db_Ddl_Table::ACTION_NO_ACTION, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tag/tag', 'first_store_id', 'core/store', 'store_id'), - $installer->getTable('tag/tag'), - 'first_store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, - Varien_Db_Ddl_Table::ACTION_NO_ACTION, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tag/properties', 'store_id', 'core/store', 'store_id'), - $installer->getTable('tag/properties'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tag/properties', 'tag_id', 'tag/tag', 'tag_id'), - $installer->getTable('tag/properties'), - 'tag_id', - $installer->getTable('tag/tag'), - 'tag_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tag/relation', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('tag/relation'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tag/relation', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('tag/relation'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tag/relation', 'store_id', 'core/store', 'store_id'), - $installer->getTable('tag/relation'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tag/relation', 'tag_id', 'tag/tag', 'tag_id'), - $installer->getTable('tag/relation'), - 'tag_id', - $installer->getTable('tag/tag'), - 'tag_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tag/summary', 'store_id', 'core/store', 'store_id'), - $installer->getTable('tag/summary'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tag/summary', 'tag_id', 'tag/tag', 'tag_id'), - $installer->getTable('tag/summary'), - 'tag_id', - $installer->getTable('tag/tag'), - 'tag_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-0.7.0.php deleted file mode 100644 index ebc83f92b80..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,111 +0,0 @@ -startSetup(); - -$installer->run(" - -/*Table structure for table `tax_class` */ - --- DROP TABLE IF EXISTS {$this->getTable('tax_class')}; -CREATE TABLE {$this->getTable('tax_class')} ( - `class_id` smallint(6) NOT NULL auto_increment, - `class_name` varchar(255) NOT NULL default '', - `class_type` enum('CUSTOMER','PRODUCT') NOT NULL default 'CUSTOMER', - PRIMARY KEY (`class_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `tax_class` */ - -insert into {$this->getTable('tax_class')}(`class_id`,`class_name`,`class_type`) values (2,'Taxable Goods','PRODUCT'),(3,'Retail Customer','CUSTOMER'); - -/*Table structure for table `tax_rate` */ - --- DROP TABLE IF EXISTS {$this->getTable('tax_rate')}; - -CREATE TABLE {$this->getTable('tax_rate')} ( - `tax_rate_id` tinyint(4) NOT NULL auto_increment, - `tax_county_id` smallint(6) default NULL, - `tax_region_id` mediumint(9) unsigned default NULL, - `tax_postcode` varchar(12) default NULL, - PRIMARY KEY (`tax_rate_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Base tax rates'; - -/*Data for the table `tax_rate` */ - -insert into {$this->getTable('tax_rate')}(`tax_rate_id`,`tax_county_id`,`tax_region_id`,`tax_postcode`) values (1,0,12,NULL),(2,0,43,NULL); - -/*Table structure for table `tax_rate_data` */ - --- DROP TABLE IF EXISTS {$this->getTable('tax_rate_data')}; - -CREATE TABLE {$this->getTable('tax_rate_data')} ( - `tax_rate_data_id` tinyint(4) NOT NULL auto_increment, - `tax_rate_id` tinyint(4) NOT NULL default '0', - `rate_value` decimal(12,4) NOT NULL default '0.0000', - `rate_type_id` tinyint(4) NOT NULL default '0', - PRIMARY KEY (`tax_rate_data_id`), - KEY `rate_id` (`tax_rate_id`), - KEY `rate_type_id` (`rate_type_id`), - UNIQUE idx_rate_rate_type (tax_rate_id, rate_type_id), - CONSTRAINT `FK_TAX_RATE_DATA_TAX_RATE` FOREIGN KEY (`tax_rate_id`) REFERENCES {$this->getTable('tax_rate')} (`tax_rate_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_TAX_RATE_DATE_TAX_RATE_TYPE` FOREIGN KEY (`rate_type_id`) REFERENCES {$this->getTable('tax_rate_type')} (`type_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `tax_rate_data` */ - -insert into {$this->getTable('tax_rate_data')}(`tax_rate_data_id`,`tax_rate_id`,`rate_value`,`rate_type_id`) values (6,2,8.3750,1),(7,2,0.0000,2),(8,2,0.0000,3),(9,2,0.0000,4),(10,2,0.0000,5),(31,1,8.2500,1),(32,1,0.0000,2),(33,1,0.0000,3),(34,1,0.0000,4),(35,1,0.0000,5); - -/*Table structure for table `tax_rate_type` */ - --- DROP TABLE IF EXISTS {$this->getTable('tax_rate_type')}; -CREATE TABLE {$this->getTable('tax_rate_type')} ( - `type_id` tinyint(4) NOT NULL auto_increment, - `type_name` varchar(255) NOT NULL default '', - PRIMARY KEY (`type_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `tax_rate_type` */ - -insert into {$this->getTable('tax_rate_type')}(`type_id`,`type_name`) values (1,'Rate 1'),(2,'Rate 2'),(3,'Rate 3'),(4,'Rate 4'),(5,'Rate 5'); - -/*Table structure for table `tax_rule` */ - --- DROP TABLE IF EXISTS {$this->getTable('tax_rule')}; -CREATE TABLE {$this->getTable('tax_rule')} ( - `tax_rule_id` tinyint(4) NOT NULL auto_increment, - `tax_customer_class_id` smallint(6) NOT NULL default '0', - `tax_product_class_id` smallint(6) NOT NULL default '0', - `tax_rate_type_id` tinyint(4) NOT NULL default '0', - `tax_shipping` tinyint (1) NOT NULL default '0', - PRIMARY KEY (`tax_rule_id`), - KEY `tax_customer_class_id` (`tax_customer_class_id`,`tax_product_class_id`), - KEY `tax_customer_class_id_2` (`tax_customer_class_id`), - KEY `tax_product_class_id` (`tax_product_class_id`), - KEY `tax_rate_id` (`tax_rate_type_id`), - CONSTRAINT `FK_TAX_RULE_TAX_CLASS_CUSTOMER` FOREIGN KEY (`tax_customer_class_id`) REFERENCES {$this->getTable('tax_class')} (`class_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_TAX_RULE_TAX_CLASS_PRODUCT` FOREIGN KEY (`tax_product_class_id`) REFERENCES {$this->getTable('tax_class')} (`class_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/*Data for the table `tax_rule` */ - -insert into {$this->getTable('tax_rule')}(`tax_rule_id`,`tax_customer_class_id`,`tax_product_class_id`,`tax_rate_type_id`) values (1,3,2,1); - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-1.4.0.0.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-1.4.0.0.php deleted file mode 100644 index 6363353992f..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-1.4.0.0.php +++ /dev/null @@ -1,135 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$installer->getTable('tax_class')}` ( - `class_id` smallint(6) NOT NULL AUTO_INCREMENT, - `class_name` varchar(255) NOT NULL DEFAULT '', - `class_type` enum('CUSTOMER','PRODUCT') NOT NULL DEFAULT 'CUSTOMER', - PRIMARY KEY (`class_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('tax_calculation')}` ( - `tax_calculation_rate_id` int(11) NOT NULL, - `tax_calculation_rule_id` int(11) NOT NULL, - `customer_tax_class_id` smallint(6) NOT NULL, - `product_tax_class_id` smallint(6) NOT NULL, - KEY `FK_TAX_CALCULATION_RULE` (`tax_calculation_rule_id`), - KEY `FK_TAX_CALCULATION_RATE` (`tax_calculation_rate_id`), - KEY `FK_TAX_CALCULATION_CTC` (`customer_tax_class_id`), - KEY `FK_TAX_CALCULATION_PTC` (`product_tax_class_id`), - KEY `IDX_TAX_CALCULATION` (`tax_calculation_rate_id`,`customer_tax_class_id`,`product_tax_class_id`), - CONSTRAINT `FK_TAX_CALCULATION_PTC` FOREIGN KEY (`product_tax_class_id`) - REFERENCES `{$installer->getTable('tax_class')}` (`class_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_TAX_CALCULATION_CTC` FOREIGN KEY (`customer_tax_class_id`) - REFERENCES `{$installer->getTable('tax_class')}` (`class_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_TAX_CALCULATION_RATE` FOREIGN KEY (`tax_calculation_rate_id`) - REFERENCES `{$installer->getTable('tax_calculation_rate')}` (`tax_calculation_rate_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_TAX_CALCULATION_RULE` FOREIGN KEY (`tax_calculation_rule_id`) - REFERENCES `{$installer->getTable('tax_calculation_rule')}` (`tax_calculation_rule_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('tax_calculation_rate')}` ( - `tax_calculation_rate_id` int(11) NOT NULL AUTO_INCREMENT, - `tax_country_id` char(2) NOT NULL, - `tax_region_id` mediumint(9) NOT NULL, - `tax_postcode` varchar(21) NOT NULL, - `code` varchar(255) NOT NULL, - `rate` decimal(12,4) NOT NULL, - `zip_is_range` tinyint(1) DEFAULT NULL, - `zip_from` int(11) unsigned DEFAULT NULL, - `zip_to` int(11) unsigned DEFAULT NULL, - PRIMARY KEY (`tax_calculation_rate_id`), - KEY `IDX_TAX_CALCULATION_RATE` (`tax_country_id`,`tax_region_id`,`tax_postcode`), - KEY `IDX_TAX_CALCULATION_RATE_CODE` (`code`), - KEY `IDX_TAX_CALCULATION_RATE_RANGE` (`tax_calculation_rate_id`,`tax_country_id`,`tax_region_id`,`zip_is_range`,`tax_postcode`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('tax_calculation_rate_title')}` ( - `tax_calculation_rate_title_id` int(11) NOT NULL AUTO_INCREMENT, - `tax_calculation_rate_id` int(11) NOT NULL, - `store_id` smallint(5) unsigned NOT NULL, - `value` varchar(255) NOT NULL, - PRIMARY KEY (`tax_calculation_rate_title_id`), - KEY `IDX_TAX_CALCULATION_RATE_TITLE` (`tax_calculation_rate_id`,`store_id`), - KEY `FK_TAX_CALCULATION_RATE_TITLE_RATE` (`tax_calculation_rate_id`), - KEY `FK_TAX_CALCULATION_RATE_TITLE_STORE` (`store_id`), - CONSTRAINT `FK_TAX_CALCULATION_RATE_TITLE_STORE` FOREIGN KEY (`store_id`) - REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_TAX_CALCULATION_RATE_TITLE_RATE` FOREIGN KEY (`tax_calculation_rate_id`) - REFERENCES `{$installer->getTable('tax_calculation_rate')}` (`tax_calculation_rate_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('tax_calculation_rule')}` ( - `tax_calculation_rule_id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(255) NOT NULL, - `priority` mediumint(9) NOT NULL, - `position` mediumint(9) NOT NULL, - PRIMARY KEY (`tax_calculation_rule_id`), - KEY `IDX_TAX_CALCULATION_RULE` (`priority`,`position`,`tax_calculation_rule_id`), - KEY `IDX_TAX_CALCULATION_RULE_CODE` (`code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('tax_order_aggregated_created')}` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned DEFAULT NULL, - `code` varchar(255) NOT NULL DEFAULT '', - `order_status` varchar(50) NOT NULL DEFAULT '', - `percent` float(12,4) NOT NULL DEFAULT '0.0000', - `orders_count` int(11) unsigned NOT NULL DEFAULT '0', - `tax_base_amount_sum` float(12,4) NOT NULL DEFAULT '0.0000', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_CODE_ORDER_STATUS` (`period`,`store_id`,`code`,`order_status`), - KEY `IDX_STORE_ID` (`store_id`), - CONSTRAINT `FK_TAX_ORDER_AGGREGATED_CREATED_STORE` FOREIGN KEY (`store_id`) - REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$installer->getTable('tax/sales_order_tax')}` ( - `tax_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `order_id` int(10) unsigned NOT NULL, - `code` varchar(255) NOT NULL, - `title` varchar(255) NOT NULL, - `percent` decimal(12,4) NOT NULL, - `amount` decimal(12,4) NOT NULL, - `priority` int(11) NOT NULL, - `position` int(11) NOT NULL, - `base_amount` decimal(12,4) NOT NULL, - `process` smallint(6) NOT NULL, - `base_real_amount` decimal(12,4) NOT NULL, - `hidden` smallint(5) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`tax_id`), - KEY `IDX_ORDER_TAX` (`order_id`,`priority`,`position`) -) ENGINE=InnoDB AUTO_INCREMENT=105 DEFAULT CHARSET=utf8; - -/* Insert initial tax data */ -insert into `{$installer->getTable('tax_class')}`(`class_id`,`class_name`,`class_type`) values (2,'Taxable Goods','PRODUCT'); -insert into `{$installer->getTable('tax_class')}`(`class_id`,`class_name`,`class_type`) values (3,'Retail Customer','CUSTOMER'); -insert into `{$installer->getTable('tax_class')}`(`class_id`,`class_name`,`class_type`) values (4,'Shipping','PRODUCT'); -insert into `{$installer->getTable('tax_calculation')}`(`tax_calculation_rate_id`,`tax_calculation_rule_id`,`customer_tax_class_id`,`product_tax_class_id`) values (1,1,3,2); -insert into `{$installer->getTable('tax_calculation')}`(`tax_calculation_rate_id`,`tax_calculation_rule_id`,`customer_tax_class_id`,`product_tax_class_id`) values (2,1,3,2); -insert into `{$installer->getTable('tax_calculation_rate')}`(`tax_calculation_rate_id`,`tax_country_id`,`tax_region_id`,`tax_postcode`,`code`,`rate`,`zip_is_range`,`zip_from`,`zip_to`) values (1,'US',12,'*','US-CA-*-Rate 1','8.2500',NULL,NULL,NULL); -insert into `{$installer->getTable('tax_calculation_rate')}`(`tax_calculation_rate_id`,`tax_country_id`,`tax_region_id`,`tax_postcode`,`code`,`rate`,`zip_is_range`,`zip_from`,`zip_to`) values (2,'US',43,'*','US-NY-*-Rate 1','8.3750',NULL,NULL,NULL); -insert into `{$installer->getTable('tax_calculation_rule')}`(`tax_calculation_rule_id`,`code`,`priority`,`position`) values (1,'Retail Customer-Taxable Goods-Rate 1',1,1); - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.6.1-0.7.0.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.6.1-0.7.0.php deleted file mode 100644 index d37369497ee..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.6.1-0.7.0.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->run("DROP TABLE IF EXISTS {$this->getTable('tax_class_group')};"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 359c22b75c2..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,29 +0,0 @@ -startSetup(); - -$installer->run(" - ALTER TABLE {$this->getTable('tax_rate_data')} DROP FOREIGN KEY `FK_TAX_RATE_DATA_TAX_RATE`; - ALTER TABLE {$this->getTable('tax_rate')} CHANGE `tax_rate_id` `tax_rate_id` INT UNSIGNED NOT NULL AUTO_INCREMENT; - ALTER TABLE {$this->getTable('tax_rate_data')} CHANGE `tax_rate_data_id` `tax_rate_data_id` INT UNSIGNED NOT NULL AUTO_INCREMENT; - ALTER TABLE {$this->getTable('tax_rate_data')} CHANGE `tax_rate_id` `tax_rate_id` INT UNSIGNED NOT NULL DEFAULT '0'; - ALTER TABLE {$this->getTable('tax_rate_data')} ADD CONSTRAINT `FK_TAX_RATE_DATA_TAX_RATE` FOREIGN KEY (`tax_rate_id`) REFERENCES {$this->getTable('tax_rate')} (`tax_rate_id`) ON DELETE CASCADE ON UPDATE CASCADE; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index fa251cff53a..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,25 +0,0 @@ -startSetup(); - -$conn = $installer->getConnection(); -/** @var Varien_Db_Adapter_Pdo_Mysql $conn */ -$conn->addColumn($installer->getTable('tax_rate'), 'tax_country_id', "char(2) not null default 'US' after `tax_rate_id`"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.10-0.7.11.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.10-0.7.11.php deleted file mode 100644 index 603cf0ddcf6..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.10-0.7.11.php +++ /dev/null @@ -1,45 +0,0 @@ -startSetup(); - -$installer->run(" - CREATE TABLE `{$installer->getTable('tax_order_aggregated_created')}` ( - `id` int(11) unsigned NOT NULL auto_increment, - `period` date NOT NULL DEFAULT '0000-00-00', - `store_id` smallint(5) unsigned NULL DEFAULT NULL, - `code` varchar(255) NOT NULL default '', - `order_status` varchar(50) NOT NULL default '', - `percent` float(12,4) NOT NULL default '0.0000', - `orders_count` int(11) unsigned NOT NULL default '0', - `tax_base_amount_sum` float(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`id`), - UNIQUE KEY `UNQ_PERIOD_STORE_CODE_ORDER_STATUS` (`period`,`store_id`, `code`, `order_status`), - KEY `IDX_STORE_ID` (`store_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->getConnection()->addConstraint( - 'FK_TAX_ORDER_AGGREGATED_CREATED_STORE', - $this->getTable('tax_order_aggregated_created'), - 'store_id', - $this->getTable('core_store'), - 'store_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.11-0.7.12.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.11-0.7.12.php deleted file mode 100644 index c415e9467f8..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.11-0.7.12.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); - -$installer->run(" - ALTER TABLE {$this->getTable('tax_calculation_rate')} CHANGE `zip_from` `zip_from` INT(11) UNSIGNED NULL DEFAULT NULL; - ALTER TABLE {$this->getTable('tax_calculation_rate')} CHANGE `zip_to` `zip_to` INT(11) UNSIGNED NULL DEFAULT NULL; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.12-0.7.13.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.12-0.7.13.php deleted file mode 100644 index a4acf83a743..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.12-0.7.13.php +++ /dev/null @@ -1,25 +0,0 @@ -startSetup(); - -$installer->run(" - ALTER TABLE {$this->getTable('tax_calculation_rate')} CHANGE `tax_postcode` `tax_postcode` VARCHAR(21) NOT NULL; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.2-0.7.3.php deleted file mode 100644 index a6024c7727b..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -if (!$installer->getConnection()->fetchOne("select * from {$this->getTable('tax_class')} where `class_name`='Shipping' and `class_type`='PRODUCT'")) { - $installer->run(" - insert into {$this->getTable('tax_class')} (`class_name`,`class_type`) values ('Shipping','PRODUCT'); - "); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.3-0.7.4.php deleted file mode 100644 index d8bb6ae9b3c..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ /dev/null @@ -1,25 +0,0 @@ -startSetup(); - -$table = $installer->getTable('tax_rate'); -$installer->getConnection()->dropColumn($table, 'tax_county_id'); -$installer->run("update {$table} set tax_postcode='*' where tax_postcode='' or tax_postcode is null"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index a6d1c8d66b7..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,35 +0,0 @@ -startSetup(); - -$customerTaxClassIds = $installer->getConnection()->fetchCol( - "SELECT class_id FROM {$installer->getTable('tax_class')} - WHERE class_type = 'CUSTOMER' - ORDER BY class_id ASC", -); - -if (count($customerTaxClassIds) > 0) { - $installer->run( - "UPDATE {$installer->getTable('customer_group')} - SET tax_class_id = {$customerTaxClassIds[0]} - WHERE tax_class_id NOT IN (" . implode(',', $customerTaxClassIds) . ')', - ); -} - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.5-0.7.6.php deleted file mode 100644 index dda6e0263f1..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$table = $installer->getTable('tax_rule'); -$installer->run(" -ALTER TABLE `{$table}` ADD `priority` SMALLINT( 5 ) NOT NULL; -ALTER TABLE `{$table}` ADD INDEX `IDX_PRIORITY` (`priority`); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.6-0.7.7.php deleted file mode 100644 index 1f88228bfbb..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ /dev/null @@ -1,85 +0,0 @@ -startSetup(); - -$installer->run(" - CREATE TABLE `{$installer->getTable('tax_calculation_rate')}` ( -`tax_calculation_rate_id` INT NOT NULL AUTO_INCREMENT , -`tax_country_id` CHAR( 2 ) NOT NULL , -`tax_region_id` MEDIUMINT NOT NULL , -`tax_postcode` VARCHAR( 12 ) NOT NULL , -`code` VARCHAR( 255 ) NOT NULL , -`rate` DECIMAL( 12, 4 ) NOT NULL , -PRIMARY KEY ( `tax_calculation_rate_id` ), -KEY `IDX_TAX_CALCULATION_RATE` (`tax_country_id`, `tax_region_id`, `tax_postcode`), -KEY `IDX_TAX_CALCULATION_RATE_CODE` (`code`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8; - - CREATE TABLE `{$installer->getTable('tax_calculation_rate_title')}` ( -`tax_calculation_rate_title_id` INT NOT NULL AUTO_INCREMENT , -`tax_calculation_rate_id` INT NOT NULL , -`store_id` SMALLINT( 5 ) UNSIGNED NOT NULL , -`value` VARCHAR( 255 ) NOT NULL , -PRIMARY KEY ( `tax_calculation_rate_title_id` ), -KEY `IDX_TAX_CALCULATION_RATE_TITLE` (`tax_calculation_rate_id`, `store_id`), -KEY `FK_TAX_CALCULATION_RATE_TITLE_RATE` (`tax_calculation_rate_id`), -KEY `FK_TAX_CALCULATION_RATE_TITLE_STORE` (`store_id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8; - - CREATE TABLE `{$installer->getTable('tax_calculation_rule')}` ( -`tax_calculation_rule_id` INT NOT NULL AUTO_INCREMENT , -`code` VARCHAR( 255 ) NOT NULL , -`priority` MEDIUMINT NOT NULL , -`position` MEDIUMINT NOT NULL , -PRIMARY KEY ( `tax_calculation_rule_id` ), -KEY `IDX_TAX_CALCULATION_RULE` (`priority`, `position`, `tax_calculation_rule_id`), -KEY `IDX_TAX_CALCULATION_RULE_CODE` (`code`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8; - - CREATE TABLE `{$installer->getTable('tax_calculation')}` ( -`tax_calculation_rate_id` INT NOT NULL, -`tax_calculation_rule_id` INT NOT NULL , -`customer_tax_class_id` SMALLINT( 6 ) NOT NULL , -`product_tax_class_id` SMALLINT( 6 ) NOT NULL , -KEY `FK_TAX_CALCULATION_RULE` (`tax_calculation_rule_id`), -KEY `FK_TAX_CALCULATION_RATE` (`tax_calculation_rate_id`), -KEY `FK_TAX_CALCULATION_CTC` (`customer_tax_class_id`), -KEY `FK_TAX_CALCULATION_PTC` (`product_tax_class_id`), -KEY `IDX_TAX_CALCULATION` (`tax_calculation_rate_id`, `customer_tax_class_id`, `product_tax_class_id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8; -"); - -$installer->getConnection()->addConstraint('FK_TAX_CALCULATION_RATE_TITLE_RATE', $installer->getTable('tax_calculation_rate_title'), 'tax_calculation_rate_id', $installer->getTable('tax_calculation_rate'), 'tax_calculation_rate_id'); -$installer->getConnection()->addConstraint('FK_TAX_CALCULATION_RATE_TITLE_STORE', $installer->getTable('tax_calculation_rate_title'), 'store_id', $installer->getTable('core_store'), 'store_id'); - -$installer->getConnection()->addConstraint('FK_TAX_CALCULATION_RULE', $installer->getTable('tax_calculation'), 'tax_calculation_rule_id', $installer->getTable('tax_calculation_rule'), 'tax_calculation_rule_id'); -$installer->getConnection()->addConstraint('FK_TAX_CALCULATION_RATE', $installer->getTable('tax_calculation'), 'tax_calculation_rate_id', $installer->getTable('tax_calculation_rate'), 'tax_calculation_rate_id'); -$installer->getConnection()->addConstraint('FK_TAX_CALCULATION_CTC', $installer->getTable('tax_calculation'), 'customer_tax_class_id', $installer->getTable('tax_class'), 'class_id'); -$installer->getConnection()->addConstraint('FK_TAX_CALCULATION_PTC', $installer->getTable('tax_calculation'), 'product_tax_class_id', $installer->getTable('tax_class'), 'class_id'); - -$installer->convertOldTaxData(); - -$installer->run(" -DROP TABLE `{$installer->getTable('tax_rule')}`; -DROP TABLE `{$installer->getTable('tax_rate_type')}`; -DROP TABLE `{$installer->getTable('tax_rate_data')}`; -DROP TABLE `{$installer->getTable('tax_rate')}`; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php deleted file mode 100644 index cc7367e7789..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('sales_order_tax'), 'hidden', 'smallint (5) unsigned not null default 0'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.8-0.7.9.php deleted file mode 100644 index 1d957286706..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ /dev/null @@ -1,56 +0,0 @@ -addAttribute('invoice', 'shipping_tax_amount', ['type' => 'decimal']); -$installer->addAttribute('invoice', 'base_shipping_tax_amount', ['type' => 'decimal']); - -$installer->addAttribute('creditmemo', 'shipping_tax_amount', ['type' => 'decimal']); -$installer->addAttribute('creditmemo', 'base_shipping_tax_amount', ['type' => 'decimal']); - -$installer->addAttribute('quote_item', 'price_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('quote_item', 'base_price_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('quote_item', 'row_total_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('quote_item', 'base_row_total_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('quote_address_item', 'price_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('quote_address_item', 'base_price_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('quote_address_item', 'row_total_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('quote_address_item', 'base_row_total_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('quote_address', 'subtotal_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('quote_address', 'base_subtotal_total_incl_tax', ['type' => 'decimal']); - -$installer->addAttribute('order_item', 'price_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('order_item', 'base_price_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('order_item', 'row_total_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('order_item', 'base_row_total_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('order', 'subtotal_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('order', 'base_subtotal_incl_tax', ['type' => 'decimal']); - -$installer->addAttribute('invoice_item', 'price_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('invoice_item', 'base_price_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('invoice_item', 'row_total_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('invoice_item', 'base_row_total_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('invoice', 'subtotal_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('invoice', 'base_subtotal_incl_tax', ['type' => 'decimal']); - -$installer->addAttribute('creditmemo_item', 'price_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('creditmemo_item', 'base_price_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('creditmemo_item', 'row_total_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('creditmemo_item', 'base_row_total_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('creditmemo', 'subtotal_incl_tax', ['type' => 'decimal']); -$installer->addAttribute('creditmemo', 'base_subtotal_incl_tax', ['type' => 'decimal']); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php deleted file mode 100644 index d05975255bc..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ /dev/null @@ -1,29 +0,0 @@ -startSetup(); - -$table = $installer->getTable('tax_calculation_rate'); - -$installer->getConnection()->addColumn($table, 'zip_is_range', 'TINYINT(1) DEFAULT NULL'); -$installer->getConnection()->addColumn($table, 'zip_from', 'VARCHAR(10) DEFAULT NULL'); -$installer->getConnection()->addColumn($table, 'zip_to', 'VARCHAR(10) DEFAULT NULL'); - -$installer->getConnection()->addKey($table, 'IDX_TAX_CALCULATION_RATE_RANGE', ['tax_calculation_rate_id', 'tax_country_id', 'tax_region_id', 'zip_is_range', 'tax_postcode']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.3.9-1.4.0.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.3.9-1.4.0.php deleted file mode 100644 index b7d02fbf1f1..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.3.9-1.4.0.php +++ /dev/null @@ -1,26 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('tax/sales_order_tax'), - 'FK_SALES_ORDER_TAX_ORDER', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php deleted file mode 100644 index f7da431a461..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php +++ /dev/null @@ -1,32 +0,0 @@ -getTable('tax/tax_order_aggregated_created'); -$installer->getConnection()->truncate($table); -$installer->getConnection()->addKey( - $table, - 'UNQ_PERIOD_STORE_CODE_ORDER_STATUS', - ['period', 'store_id', 'code', 'percent', 'order_status'], - 'unique', -); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php deleted file mode 100644 index 4f1303ce60e..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup(); - -$installer->getConnection()->changeColumn( - $installer->getTable('tax/tax_calculation_rate'), - 'tax_postcode', - 'tax_postcode', - 'VARCHAR(21) NULL DEFAULT NULL', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 44dfd60f926..00000000000 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,525 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('tax/tax_calculation'), - 'FK_TAX_CALCULATION_CTC', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('tax/tax_calculation'), - 'FK_TAX_CALCULATION_PTC', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('tax/tax_calculation'), - 'FK_TAX_CALCULATION_RATE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('tax/tax_calculation'), - 'FK_TAX_CALCULATION_RULE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('tax/tax_calculation_rate_title'), - 'FK_TAX_CALCULATION_RATE_TITLE_RATE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('tax/tax_calculation_rate_title'), - 'FK_TAX_CALCULATION_RATE_TITLE_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('tax/tax_order_aggregated_created'), - 'FK_TAX_ORDER_AGGREGATED_CREATED_STORE', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_calculation'), - 'FK_TAX_CALCULATION_RULE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_calculation'), - 'FK_TAX_CALCULATION_RATE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_calculation'), - 'FK_TAX_CALCULATION_CTC', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_calculation'), - 'FK_TAX_CALCULATION_PTC', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_calculation'), - 'IDX_TAX_CALCULATION', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_calculation_rate'), - 'IDX_TAX_CALCULATION_RATE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_calculation_rate'), - 'IDX_TAX_CALCULATION_RATE_CODE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_calculation_rate'), - 'IDX_TAX_CALCULATION_RATE_RANGE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_calculation_rate_title'), - 'IDX_TAX_CALCULATION_RATE_TITLE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_calculation_rate_title'), - 'FK_TAX_CALCULATION_RATE_TITLE_RATE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_calculation_rate_title'), - 'FK_TAX_CALCULATION_RATE_TITLE_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_calculation_rule'), - 'IDX_TAX_CALCULATION_RULE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_calculation_rule'), - 'IDX_TAX_CALCULATION_RULE_CODE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_order_aggregated_created'), - 'UNQ_PERIOD_STORE_CODE_ORDER_STATUS', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('tax/tax_order_aggregated_created'), - 'IDX_STORE_ID', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('tax/tax_class') => [ - 'columns' => [ - 'class_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Class Id', - ], - 'class_name' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Class Name', - ], - 'class_type' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 8, - 'nullable' => false, - 'default' => Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER, - 'comment' => 'Class Type', - ], - ], - 'comment' => 'Tax Class', - ], - $installer->getTable('tax/tax_calculation') => [ - 'columns' => [ - 'tax_calculation_rate_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Tax Calculation Rate Id', - ], - 'tax_calculation_rule_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Tax Calculation Rule Id', - ], - 'customer_tax_class_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'comment' => 'Customer Tax Class Id', - ], - 'product_tax_class_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'nullable' => false, - 'comment' => 'Product Tax Class Id', - ], - ], - 'comment' => 'Tax Calculation', - ], - $installer->getTable('tax/tax_calculation_rate') => [ - 'columns' => [ - 'tax_calculation_rate_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Tax Calculation Rate Id', - ], - 'tax_country_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 2, - 'nullable' => false, - 'comment' => 'Tax Country Id', - ], - 'tax_region_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Tax Region Id', - ], - 'tax_postcode' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 21, - 'comment' => 'Tax Postcode', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Code', - ], - 'rate' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Rate', - ], - 'zip_is_range' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'comment' => 'Zip Is Range', - ], - 'zip_from' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Zip From', - ], - 'zip_to' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'comment' => 'Zip To', - ], - ], - 'comment' => 'Tax Calculation Rate', - ], - $installer->getTable('tax/tax_calculation_rate_title') => [ - 'columns' => [ - 'tax_calculation_rate_title_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Tax Calculation Rate Title Id', - ], - 'tax_calculation_rate_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Tax Calculation Rate Id', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Store Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Value', - ], - ], - 'comment' => 'Tax Calculation Rate Title', - ], - $installer->getTable('tax/tax_calculation_rule') => [ - 'columns' => [ - 'tax_calculation_rule_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Tax Calculation Rule Id', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Code', - ], - 'priority' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Priority', - ], - 'position' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'nullable' => false, - 'comment' => 'Position', - ], - ], - 'comment' => 'Tax Calculation Rule', - ], - $installer->getTable('tax/tax_order_aggregated_created') => [ - 'columns' => [ - 'id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Id', - ], - 'period' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DATE, - 'comment' => 'Period', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store Id', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Code', - ], - 'order_status' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 50, - 'nullable' => false, - 'comment' => 'Order Status', - ], - 'percent' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_FLOAT, - 'comment' => 'Percent', - ], - 'orders_count' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Orders Count', - ], - 'tax_base_amount_sum' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_FLOAT, - 'comment' => 'Tax Base Amount Sum', - ], - ], - 'comment' => 'Tax Order Aggregation', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -$installer->getConnection()->addColumn( - $installer->getTable('tax/tax_calculation'), - 'tax_calculation_id', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Tax Calculation Id', - ], -); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_calculation'), - $installer->getIdxName('tax/tax_calculation', ['tax_calculation_rule_id']), - ['tax_calculation_rule_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_calculation'), - $installer->getIdxName('tax/tax_calculation', ['tax_calculation_rate_id']), - ['tax_calculation_rate_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_calculation'), - $installer->getIdxName('tax/tax_calculation', ['customer_tax_class_id']), - ['customer_tax_class_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_calculation'), - $installer->getIdxName('tax/tax_calculation', ['product_tax_class_id']), - ['product_tax_class_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_calculation'), - $installer->getIdxName('tax/tax_calculation', ['tax_calculation_rate_id', 'customer_tax_class_id', 'product_tax_class_id']), - ['tax_calculation_rate_id', 'customer_tax_class_id', 'product_tax_class_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_calculation_rate'), - $installer->getIdxName('tax/tax_calculation_rate', ['tax_country_id', 'tax_region_id', 'tax_postcode']), - ['tax_country_id', 'tax_region_id', 'tax_postcode'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_calculation_rate'), - $installer->getIdxName('tax/tax_calculation_rate', ['code']), - ['code'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_calculation_rate'), - $installer->getIdxName('tax/tax_calculation_rate', ['tax_calculation_rate_id', 'tax_country_id', 'tax_region_id', 'zip_is_range', 'tax_postcode']), - ['tax_calculation_rate_id', 'tax_country_id', 'tax_region_id', 'zip_is_range', 'tax_postcode'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_calculation_rate_title'), - $installer->getIdxName('tax/tax_calculation_rate_title', ['tax_calculation_rate_id', 'store_id']), - ['tax_calculation_rate_id', 'store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_calculation_rate_title'), - $installer->getIdxName('tax/tax_calculation_rate_title', ['tax_calculation_rate_id']), - ['tax_calculation_rate_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_calculation_rate_title'), - $installer->getIdxName('tax/tax_calculation_rate_title', ['store_id']), - ['store_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_calculation_rule'), - $installer->getIdxName('tax/tax_calculation_rule', ['priority', 'position', 'tax_calculation_rule_id']), - ['priority', 'position', 'tax_calculation_rule_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_calculation_rule'), - $installer->getIdxName('tax/tax_calculation_rule', ['code']), - ['code'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_order_aggregated_created'), - $installer->getIdxName( - 'tax/tax_order_aggregated_created', - ['period', 'store_id', 'code', 'percent', 'order_status'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['period', 'store_id', 'code', 'percent', 'order_status'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('tax/tax_order_aggregated_created'), - $installer->getIdxName('tax/tax_order_aggregated_created', ['store_id']), - ['store_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('tax/tax_calculation', 'product_tax_class_id', 'tax/tax_class', 'class_id'), - $installer->getTable('tax/tax_calculation'), - 'product_tax_class_id', - $installer->getTable('tax/tax_class'), - 'class_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tax/tax_calculation', 'customer_tax_class_id', 'tax/tax_class', 'class_id'), - $installer->getTable('tax/tax_calculation'), - 'customer_tax_class_id', - $installer->getTable('tax/tax_class'), - 'class_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tax/tax_calculation', 'tax_calculation_rate_id', 'tax/tax_calculation_rate', 'tax_calculation_rate_id'), - $installer->getTable('tax/tax_calculation'), - 'tax_calculation_rate_id', - $installer->getTable('tax/tax_calculation_rate'), - 'tax_calculation_rate_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tax/tax_calculation', 'tax_calculation_rule_id', 'tax/tax_calculation_rule', 'tax_calculation_rule_id'), - $installer->getTable('tax/tax_calculation'), - 'tax_calculation_rule_id', - $installer->getTable('tax/tax_calculation_rule'), - 'tax_calculation_rule_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tax/tax_calculation_rate_title', 'store_id', 'core/store', 'store_id'), - $installer->getTable('tax/tax_calculation_rate_title'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tax/tax_calculation_rate_title', 'tax_calculation_rate_id', 'tax/tax_calculation_rate', 'tax_calculation_rate_id'), - $installer->getTable('tax/tax_calculation_rate_title'), - 'tax_calculation_rate_id', - $installer->getTable('tax/tax_calculation_rate'), - 'tax_calculation_rate_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('tax/tax_order_aggregated_created', 'store_id', 'core/store', 'store_id'), - $installer->getTable('tax/tax_order_aggregated_created'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', -); -$installer->endSetup(); diff --git a/app/code/core/Mage/Usa/sql/usa_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Usa/sql/usa_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index dc205626e24..00000000000 --- a/app/code/core/Mage/Usa/sql/usa_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,23 +0,0 @@ -run("UPDATE {$installer->getTable('core/config_data')} SET `value` = REPLACE(`value`, - 'https://www.ups.com/ups.app/xml/Rate', 'https://onlinetools.ups.com/ups.app/xml/Rate' - ) WHERE `path` = 'carriers/ups/gateway_xml_url'"); diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-install-0.1.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-install-0.1.php deleted file mode 100644 index 3112a5e5e17..00000000000 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-install-0.1.php +++ /dev/null @@ -1,38 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE {$installer->getTable('weee_tax')} ( - `value_id` int(11) NOT NULL auto_increment, - `website_id` smallint(5) unsigned NOT NULL default '0', - `entity_id` int(10) unsigned NOT NULL default '0', - `country` varchar(2) NOT NULL default '', - `value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`value_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_WEBSITE` (`website_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_PRODUCT_ENTITY` (`entity_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_COUNTRY` (`country`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES {$this->getTable('core_website')} (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_COUNTRY` FOREIGN KEY (`country`) REFERENCES {$this->getTable('directory_country')} (`country_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.1-0.2.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.1-0.2.php deleted file mode 100644 index 63fee6fc5aa..00000000000 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.1-0.2.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('weee_tax'), 'state', "varchar (255) not null default '*'"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.10-0.11.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.10-0.11.php deleted file mode 100644 index 524f6b4e0be..00000000000 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.10-0.11.php +++ /dev/null @@ -1,36 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE {$installer->getTable('weee_discount')} ( - `entity_id` int(10) unsigned NOT NULL default '0', - `website_id` smallint(5) unsigned NOT NULL default '0', - `customer_group_id` smallint(5) unsigned NOT NULL, - `value` decimal(12,4) NOT NULL default '0.0000', - KEY `FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_WEBSITE` (`website_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_PRODUCT_ENTITY` (`entity_id`), - KEY `FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_GROUP` (`customer_group_id`), - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES {$this->getTable('core_website')} (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES {$this->getTable('customer_group')} (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php deleted file mode 100644 index ca5b6fc2152..00000000000 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php +++ /dev/null @@ -1,36 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('weee_tax'), 'entity_type_id', 'smallint (5) unsigned not null'); -$installer->run(" -UPDATE - `{$installer->getTable('weee_tax')}` -SET - `entity_type_id` = ( - SELECT - `entity_type_id` - FROM - `{$installer->getTable('eav_entity_type')}` - WHERE - `entity_type_code` = 'catalog_product' - ); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.12-0.13.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.12-0.13.php deleted file mode 100644 index ee092a84e6d..00000000000 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.12-0.13.php +++ /dev/null @@ -1,35 +0,0 @@ -getConnection()->modifyColumn($installer->getTable('sales/quote_item'), 'weee_tax_applied_amount', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote_item'), 'weee_tax_applied_row_amount', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/order_item'), 'weee_tax_applied_amount', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/order_item'), 'weee_tax_applied_row_amount', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote_item'), 'base_weee_tax_applied_amount', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote_item'), 'base_weee_tax_applied_row_amount', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/order_item'), 'base_weee_tax_applied_amount', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/order_item'), 'base_weee_tax_applied_row_amount', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote_item'), 'weee_tax_disposition', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote_item'), 'weee_tax_row_disposition', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote_item'), 'base_weee_tax_disposition', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/quote_item'), 'base_weee_tax_row_disposition', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/order_item'), 'weee_tax_disposition', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/order_item'), 'weee_tax_row_disposition', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/order_item'), 'base_weee_tax_disposition', 'decimal(12,4)'); -$installer->getConnection()->modifyColumn($installer->getTable('sales/order_item'), 'base_weee_tax_row_disposition', 'decimal(12,4)'); diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php deleted file mode 100644 index e3a49f65a2c..00000000000 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($installer->getTable('weee_tax'), 'attribute_id', 'smallint (5) unsigned not null'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.3-0.4.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.3-0.4.php deleted file mode 100644 index 424042dcb33..00000000000 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.3-0.4.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->addAttribute('quote_item', 'weee_tax_applied', ['type' => 'text']); -$installer->addAttribute('order_item', 'weee_tax_applied', ['type' => 'text']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.4-0.5.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.4-0.5.php deleted file mode 100644 index 8d0fa247cd8..00000000000 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.4-0.5.php +++ /dev/null @@ -1,27 +0,0 @@ -startSetup(); - -$installer->addAttribute('quote_item', 'weee_tax_applied_amount', ['type' => 'decimal']); -$installer->addAttribute('quote_item', 'weee_tax_applied_row_amount', ['type' => 'decimal']); - -$installer->addAttribute('order_item', 'weee_tax_applied_amount', ['type' => 'decimal']); -$installer->addAttribute('order_item', 'weee_tax_applied_row_amount', ['type' => 'decimal']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.5-0.6.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.5-0.6.php deleted file mode 100644 index 73df51e7472..00000000000 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.5-0.6.php +++ /dev/null @@ -1,39 +0,0 @@ -startSetup(); - -$installer->addAttribute('quote_item', 'base_weee_tax_applied_amount', ['type' => 'decimal']); -$installer->addAttribute('quote_item', 'base_weee_tax_applied_row_amount', ['type' => 'decimal']); - -$installer->addAttribute('order_item', 'base_weee_tax_applied_amount', ['type' => 'decimal']); -$installer->addAttribute('order_item', 'base_weee_tax_applied_row_amount', ['type' => 'decimal']); - -$installer->addAttribute('creditmemo_item', 'base_weee_tax_applied_amount', ['type' => 'decimal']); -$installer->addAttribute('creditmemo_item', 'base_weee_tax_applied_row_amount', ['type' => 'decimal']); - -$installer->addAttribute('creditmemo_item', 'weee_tax_applied_amount', ['type' => 'decimal']); -$installer->addAttribute('creditmemo_item', 'weee_tax_applied_row_amount', ['type' => 'decimal']); - -$installer->addAttribute('invoice_item', 'base_weee_tax_applied_amount', ['type' => 'decimal']); -$installer->addAttribute('invoice_item', 'base_weee_tax_applied_row_amount', ['type' => 'decimal']); - -$installer->addAttribute('invoice_item', 'weee_tax_applied_amount', ['type' => 'decimal']); -$installer->addAttribute('invoice_item', 'weee_tax_applied_row_amount', ['type' => 'decimal']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.6-0.7.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.6-0.7.php deleted file mode 100644 index 8a85a634ff6..00000000000 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.6-0.7.php +++ /dev/null @@ -1,24 +0,0 @@ -startSetup(); - -$installer->addAttribute('invoice_item', 'weee_tax_applied', ['type' => 'text']); -$installer->addAttribute('creditmemo_item', 'weee_tax_applied', ['type' => 'text']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.7-0.8.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.7-0.8.php deleted file mode 100644 index b5ce1e62738..00000000000 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.7-0.8.php +++ /dev/null @@ -1,23 +0,0 @@ -startSetup(); - -$installer->getConnection()->addConstraint('FK_WEEE_TAX_ATTRIBUTE_ID', $installer->getTable('weee_tax'), 'attribute_id', $installer->getTable('eav_attribute'), 'attribute_id'); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.8-0.9.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.8-0.9.php deleted file mode 100644 index 775e7803ca1..00000000000 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.8-0.9.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -$installer->getConnection()->changeColumn( - $this->getTable('sales_flat_quote_item'), - 'weee_tax_applied', - 'weee_tax_applied', - 'text CHARACTER SET utf8', -); -$installer->getConnection()->changeColumn( - $this->getTable('sales_flat_order_item'), - 'weee_tax_applied', - 'weee_tax_applied', - 'text CHARACTER SET utf8', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.9-0.10.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.9-0.10.php deleted file mode 100644 index 56999c08c76..00000000000 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.9-0.10.php +++ /dev/null @@ -1,45 +0,0 @@ -startSetup(); - -$installer->addAttribute('quote_item', 'weee_tax_disposition', ['type' => 'decimal']); -$installer->addAttribute('quote_item', 'weee_tax_row_disposition', ['type' => 'decimal']); - -$installer->addAttribute('quote_item', 'base_weee_tax_disposition', ['type' => 'decimal']); -$installer->addAttribute('quote_item', 'base_weee_tax_row_disposition', ['type' => 'decimal']); - -$installer->addAttribute('order_item', 'weee_tax_disposition', ['type' => 'decimal']); -$installer->addAttribute('order_item', 'weee_tax_row_disposition', ['type' => 'decimal']); - -$installer->addAttribute('order_item', 'base_weee_tax_disposition', ['type' => 'decimal']); -$installer->addAttribute('order_item', 'base_weee_tax_row_disposition', ['type' => 'decimal']); - -$installer->addAttribute('creditmemo_item', 'weee_tax_disposition', ['type' => 'decimal']); -$installer->addAttribute('creditmemo_item', 'weee_tax_row_disposition', ['type' => 'decimal']); - -$installer->addAttribute('creditmemo_item', 'base_weee_tax_disposition', ['type' => 'decimal']); -$installer->addAttribute('creditmemo_item', 'base_weee_tax_row_disposition', ['type' => 'decimal']); - -$installer->addAttribute('invoice_item', 'weee_tax_disposition', ['type' => 'decimal']); -$installer->addAttribute('invoice_item', 'weee_tax_row_disposition', ['type' => 'decimal']); - -$installer->addAttribute('invoice_item', 'base_weee_tax_disposition', ['type' => 'decimal']); -$installer->addAttribute('invoice_item', 'base_weee_tax_row_disposition', ['type' => 'decimal']); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 88c629bac57..00000000000 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,551 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('weee/discount'), - 'FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_GROUP', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('weee/discount'), - 'FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('weee/discount'), - 'FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('weee/tax'), - 'FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_COUNTRY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('weee/tax'), - 'FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('weee/tax'), - 'FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_WEBSITE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('weee/tax'), - 'FK_WEEE_TAX_ATTRIBUTE_ID', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('weee/discount'), - 'FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('weee/discount'), - 'FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('weee/discount'), - 'FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_GROUP', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('weee/tax'), - 'FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_WEBSITE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('weee/tax'), - 'FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_PRODUCT_ENTITY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('weee/tax'), - 'FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_COUNTRY', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('weee/tax'), - 'FK_WEEE_TAX_ATTRIBUTE_ID', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('weee/tax') => [ - 'columns' => [ - 'value_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Value Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Website Id', - ], - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Id', - ], - 'country' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 2, - 'comment' => 'Country', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Value', - ], - 'state' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'default' => '*', - 'comment' => 'State', - ], - 'attribute_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Attribute Id', - ], - 'entity_type_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Entity Type Id', - ], - ], - 'comment' => 'Weee Tax', - ], - $installer->getTable('weee/discount') => [ - 'columns' => [ - 'entity_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Entity Id', - ], - 'website_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Website Id', - ], - 'customer_group_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Customer Group Id', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'default' => '0.0000', - 'comment' => 'Value', - ], - ], - 'comment' => 'Weee Discount', - ], - $installer->getTable('sales/order_item') => [ - 'columns' => [ - 'weee_tax_applied' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Weee Tax Applied', - ], - 'weee_tax_applied_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Applied Amount', - ], - 'weee_tax_applied_row_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Applied Row Amount', - ], - 'base_weee_tax_applied_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Applied Amount', - ], - 'weee_tax_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Disposition', - ], - 'weee_tax_row_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Row Disposition', - ], - 'base_weee_tax_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Disposition', - ], - 'base_weee_tax_row_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Row Disposition', - ], - ], - ], - $installer->getTable('sales/quote_item') => [ - 'columns' => [ - 'weee_tax_applied' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Weee Tax Applied', - ], - 'weee_tax_applied_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Applied Amount', - ], - 'weee_tax_applied_row_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Applied Row Amount', - ], - 'base_weee_tax_applied_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Applied Amount', - ], - 'weee_tax_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Disposition', - ], - 'weee_tax_row_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Row Disposition', - ], - 'base_weee_tax_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Disposition', - ], - 'base_weee_tax_row_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Row Disposition', - ], - ], - ], - $installer->getTable('sales/invoice_item') => [ - 'columns' => [ - 'weee_tax_applied' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Weee Tax Applied', - ], - 'weee_tax_applied_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Applied Amount', - ], - 'weee_tax_applied_row_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Applied Row Amount', - ], - 'base_weee_tax_applied_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Applied Amount', - ], - 'weee_tax_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Disposition', - ], - 'weee_tax_row_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Row Disposition', - ], - 'base_weee_tax_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Disposition', - ], - 'base_weee_tax_row_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Row Disposition', - ], - ], - ], - $installer->getTable('sales/creditmemo_item') => [ - 'columns' => [ - 'weee_tax_applied' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Weee Tax Applied', - ], - 'weee_tax_applied_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Applied Amount', - ], - 'weee_tax_applied_row_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Applied Row Amount', - ], - 'base_weee_tax_applied_amount' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Applied Amount', - ], - 'weee_tax_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Disposition', - ], - 'weee_tax_row_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Weee Tax Row Disposition', - ], - 'base_weee_tax_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Disposition', - ], - 'base_weee_tax_row_disposition' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Row Disposition', - ], - ], - ], -]; - -$installer->getConnection()->modifyTables($tables); - -$installer->getConnection()->changeColumn( - $installer->getTable('sales/order_item'), - 'base_weee_tax_applied_row_amount', - 'base_weee_tax_applied_row_amnt', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Applied Row Amnt', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('sales/quote_item'), - 'base_weee_tax_applied_row_amount', - 'base_weee_tax_applied_row_amnt', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Applied Row Amnt', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('sales/invoice_item'), - 'base_weee_tax_applied_row_amount', - 'base_weee_tax_applied_row_amnt', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Applied Row Amnt', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('sales/creditmemo_item'), - 'base_weee_tax_applied_row_amount', - 'base_weee_tax_applied_row_amnt', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'comment' => 'Base Weee Tax Applied Row Amnt', - ], -); -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('weee/discount'), - $installer->getIdxName('weee/discount', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('weee/discount'), - $installer->getIdxName('weee/discount', ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('weee/discount'), - $installer->getIdxName('weee/discount', ['customer_group_id']), - ['customer_group_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('weee/tax'), - $installer->getIdxName('weee/tax', ['website_id']), - ['website_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('weee/tax'), - $installer->getIdxName('weee/tax', ['entity_id']), - ['entity_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('weee/tax'), - $installer->getIdxName('weee/tax', ['country']), - ['country'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('weee/tax'), - $installer->getIdxName('weee/tax', ['attribute_id']), - ['attribute_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('weee/discount', 'customer_group_id', 'customer/customer_group', 'customer_group_id'), - $installer->getTable('weee/discount'), - 'customer_group_id', - $installer->getTable('customer/customer_group'), - 'customer_group_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('weee/discount', 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable('weee/discount'), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('weee/discount', 'website_id', 'core/website', 'website_id'), - $installer->getTable('weee/discount'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('weee/tax', 'country', 'directory/country', 'country_id'), - $installer->getTable('weee/tax'), - 'country', - $installer->getTable('directory/country'), - 'country_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('weee/tax', 'entity_id', 'catalog/product', 'entity_id'), - $installer->getTable('weee/tax'), - 'entity_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('weee/tax', 'website_id', 'core/website', 'website_id'), - $installer->getTable('weee/tax'), - 'website_id', - $installer->getTable('core/website'), - 'website_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('weee/tax', 'attribute_id', 'eav/attribute', 'attribute_id'), - $installer->getTable('weee/tax'), - 'attribute_id', - $installer->getTable('eav/attribute'), - 'attribute_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Widget/sql/widget_setup/mysql4-install-1.4.0.0.0.php b/app/code/core/Mage/Widget/sql/widget_setup/mysql4-install-1.4.0.0.0.php deleted file mode 100644 index 8f553c12311..00000000000 --- a/app/code/core/Mage/Widget/sql/widget_setup/mysql4-install-1.4.0.0.0.php +++ /dev/null @@ -1,67 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE IF NOT EXISTS `{$installer->getTable('widget/widget')}` ( - `widget_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `code` VARCHAR(255) NOT NULL, - `type` VARCHAR(255) NOT NULL, - `parameters` text, - PRIMARY KEY (`widget_id`), - KEY `IDX_CODE` (`code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Preconfigured Widgets'; - -CREATE TABLE IF NOT EXISTS `{$installer->getTable('widget/widget_instance')}` ( - `instance_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `type` VARCHAR(255) NOT NULL DEFAULT '', - `package_theme` VARCHAR(255) NOT NULL DEFAULT '', - `title` VARCHAR(255) NOT NULL DEFAULT '', - `store_ids` VARCHAR(255) NOT NULL DEFAULT '0', - `widget_parameters` TEXT, - `sort_order` SMALLINT(5) NOT NULL DEFAULT '0', - PRIMARY KEY (`instance_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `{$installer->getTable('widget/widget_instance_page')}` ( - `page_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `instance_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', - `group` VARCHAR(25) NOT NULL DEFAULT '', - `layout_handle` VARCHAR(255) NOT NULL DEFAULT '', - `block_reference` VARCHAR(255) NOT NULL DEFAULT '', - `for` VARCHAR(25) NOT NULL DEFAULT '', - `entities` TEXT, - `template` VARCHAR(255) NOT NULL DEFAULT '', - PRIMARY KEY (`page_id`), - KEY `IDX_WIDGET_WIDGET_INSTANCE_ID` (`instance_id`), - CONSTRAINT `FK_WIDGET_WIDGET_INSTANCE_ID` FOREIGN KEY (`instance_id`) REFERENCES `{$installer->getTable('widget/widget_instance')}` (`instance_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `{$installer->getTable('widget/widget_instance_page_layout')}` ( - `page_id` int(11) UNSIGNED NOT NULL DEFAULT '0', - `layout_update_id` int(10) UNSIGNED NOT NULL DEFAULT '0', - UNIQUE KEY `page_id` (`page_id`,`layout_update_id`), - KEY `IDX_WIDGET_WIDGET_INSTANCE_PAGE_ID` (`page_id`), - KEY `IDX_WIDGET_WIDGET_INSTANCE_LAYOUT_UPDATE_ID` (`layout_update_id`), - CONSTRAINT `FK_WIDGET_WIDGET_INSTANCE_LAYOUT_UPDATE_ID` FOREIGN KEY (`layout_update_id`) REFERENCES `{$installer->getTable('core/layout_update')}` (`layout_update_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_WIDGET_WIDGET_INSTANCE_PAGE_ID` FOREIGN KEY (`page_id`) REFERENCES `{$installer->getTable('widget/widget_instance_page')}` (`page_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Widget/sql/widget_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Widget/sql/widget_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index 7232d1fd20d..00000000000 --- a/app/code/core/Mage/Widget/sql/widget_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,337 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('widget/widget_instance_page'), - 'FK_WIDGET_WIDGET_INSTANCE_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('widget/widget_instance_page_layout'), - 'FK_WIDGET_WIDGET_INSTANCE_LAYOUT_UPDATE_ID', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('widget/widget_instance_page_layout'), - 'FK_WIDGET_WIDGET_INSTANCE_PAGE_ID', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('widget/widget'), - 'IDX_CODE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('widget/widget_instance_page'), - 'IDX_WIDGET_WIDGET_INSTANCE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('widget/widget_instance_page_layout'), - 'PAGE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('widget/widget_instance_page_layout'), - 'IDX_WIDGET_WIDGET_INSTANCE_PAGE_ID', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('widget/widget_instance_page_layout'), - 'IDX_WIDGET_WIDGET_INSTANCE_LAYOUT_UPDATE_ID', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('widget/widget') => [ - 'columns' => [ - 'widget_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Widget Id', - ], - 'parameters' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Parameters', - ], - ], - 'comment' => 'Preconfigured Widgets', - ], - $installer->getTable('widget/widget_instance') => [ - 'columns' => [ - 'instance_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Instance Id', - ], - 'package_theme' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Package Theme', - ], - 'title' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Widget Title', - ], - 'store_ids' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Store ids', - ], - 'widget_parameters' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Widget parameters', - ], - 'sort_order' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sort order', - ], - ], - 'comment' => 'Instances of Widget for Package Theme', - ], - $installer->getTable('widget/widget_instance_page') => [ - 'columns' => [ - 'page_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Page Id', - ], - 'instance_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Instance Id', - ], - 'layout_handle' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Layout Handle', - ], - 'block_reference' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Block Reference', - ], - 'entities' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Catalog entities (comma separated)', - ], - ], - 'comment' => 'Instance of Widget on Page', - ], - $installer->getTable('widget/widget_instance_page_layout') => [ - 'columns' => [ - 'page_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Page Id', - ], - 'layout_update_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'default' => '0', - 'comment' => 'Layout Update Id', - ], - ], - 'comment' => 'Layout updates', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -$installer->getConnection()->changeColumn( - $installer->getTable('widget/widget'), - 'code', - 'widget_code', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Widget code for template directive', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('widget/widget'), - 'type', - 'widget_type', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Widget Type', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('widget/widget_instance'), - 'type', - 'instance_type', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Instance Type', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('widget/widget_instance_page'), - 'group', - 'page_group', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 25, - 'comment' => 'Block Group Type', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('widget/widget_instance_page'), - 'for', - 'page_for', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 25, - 'comment' => 'For instance entities', - ], -); - -$installer->getConnection()->changeColumn( - $installer->getTable('widget/widget_instance_page'), - 'template', - 'page_template', - [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'comment' => 'Path to widget template', - ], -); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('widget/widget'), - $installer->getIdxName('widget/widget', ['widget_code']), - ['widget_code'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('widget/widget_instance_page'), - $installer->getIdxName('widget/widget_instance_page', ['instance_id']), - ['instance_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('widget/widget_instance_page_layout'), - $installer->getIdxName( - 'widget/widget_instance_page_layout', - ['layout_update_id', 'page_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['layout_update_id', 'page_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('widget/widget_instance_page_layout'), - $installer->getIdxName('widget/widget_instance_page_layout', ['page_id']), - ['page_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('widget/widget_instance_page_layout'), - $installer->getIdxName('widget/widget_instance_page_layout', ['layout_update_id']), - ['layout_update_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'widget/widget_instance_page', - 'instance_id', - 'widget/widget_instance', - 'instance_id', - ), - $installer->getTable('widget/widget_instance_page'), - 'instance_id', - $installer->getTable('widget/widget_instance'), - 'instance_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'widget/widget_instance_page_layout', - 'page_id', - 'widget/widget_instance_page', - 'page_id', - ), - $installer->getTable('widget/widget_instance_page_layout'), - 'page_id', - $installer->getTable('widget/widget_instance_page'), - 'page_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName( - 'widget/widget_instance_page_layout', - 'layout_update_id', - 'core/layout_update', - 'layout_update_id', - ), - $installer->getTable('widget/widget_instance_page_layout'), - 'layout_update_id', - $installer->getTable('core/layout_update'), - 'layout_update_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-install-0.7.0.php deleted file mode 100644 index 47ab80c3c69..00000000000 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,50 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS {$this->getTable('wishlist')}; -CREATE TABLE {$this->getTable('wishlist')} ( - `wishlist_id` int(10) unsigned NOT NULL auto_increment, - `customer_id` int(10) unsigned NOT NULL default '0', - `shared` tinyint(1) unsigned default '0', - `sharing_code` varchar(32) character set latin1 collate latin1_general_ci NOT NULL default '', - PRIMARY KEY (`wishlist_id`), - UNIQUE KEY `FK_CUSTOMER` (`customer_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Wishlist main'; - --- DROP TABLE IF EXISTS {$this->getTable('wishlist_item')}; -CREATE TABLE {$this->getTable('wishlist_item')} ( - `wishlist_item_id` int(10) unsigned NOT NULL auto_increment, - `wishlist_id` int(10) unsigned NOT NULL default '0', - `product_id` int(10) unsigned NOT NULL default '0', - `store_id` int(10) unsigned NOT NULL default '0', - `added_at` datetime default NULL, - `description` text, - PRIMARY KEY (`wishlist_item_id`), - KEY `FK_ITEM_WISHLIST` (`wishlist_id`), - KEY `FK_WISHLIST_PRODUCT` (`product_id`), - KEY `FK_WISHLIST_STORE` (`store_id`), - CONSTRAINT `FK_ITEM_WISHLIST` FOREIGN KEY (`wishlist_id`) REFERENCES {$this->getTable('wishlist')} (`wishlist_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Wishlist items'; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.0-0.7.1.php deleted file mode 100644 index 2a48523a19c..00000000000 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ /dev/null @@ -1,28 +0,0 @@ -startSetup(); - -$installer->run(" - -alter table {$this->getTable('wishlist_item')} add constraint `FK_WISHLIST_PRODUCT` foreign key (`product_id`) references {$this->getTable('catalog_product_entity')} (`entity_id`) on delete cascade on update cascade -; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.1-0.7.2.php deleted file mode 100644 index f4edbd45464..00000000000 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ /dev/null @@ -1,31 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE {$this->getTable('wishlist_item')} - CHANGE `store_id` `store_id` smallint(5) unsigned NOT NULL; -ALTER TABLE {$this->getTable('wishlist_item')} - ADD CONSTRAINT `FK_WISHLIST_ITEM_STORE` FOREIGN KEY (`store_id`) - REFERENCES {$this->getTable('core_store')} (`store_id`) - ON UPDATE CASCADE - ON DELETE CASCADE; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.2-0.7.4.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.2-0.7.4.php deleted file mode 100644 index b4a73f4d629..00000000000 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.2-0.7.4.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); - -$tableWishlist = $this->getTable('wishlist'); -$tableCustomers = $this->getTable('customer/entity'); - -$installer->run("DELETE FROM {$tableWishlist} WHERE customer_id NOT IN (SELECT entity_id FROM {$tableCustomers})"); - -$installer->run(" -ALTER TABLE {$tableWishlist} - ADD CONSTRAINT `FK_CUSTOMER` FOREIGN KEY (`customer_id`) - REFERENCES {$tableCustomers} (`entity_id`) - ON UPDATE CASCADE - ON DELETE CASCADE; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.4-0.7.5.php deleted file mode 100644 index 212b7ed3c90..00000000000 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ /dev/null @@ -1,80 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropForeignKey($installer->getTable('wishlist/item'), 'FK_WISHLIST_ITEM_STORE'); -$installer->getConnection()->dropForeignKey($installer->getTable('wishlist/item'), 'FK_ITEM_WISHLIST'); -$installer->getConnection()->dropForeignKey($installer->getTable('wishlist/item'), 'FK_WISHLIST_PRODUCT'); -$installer->getConnection()->dropForeignKey($installer->getTable('wishlist/wishlist'), 'FK_CUSTOMER'); - -$installer->getConnection()->dropKey($installer->getTable('wishlist/item'), 'FK_ITEM_WISHLIST'); -$installer->getConnection()->dropKey($installer->getTable('wishlist/item'), 'FK_WISHLIST_PRODUCT'); -$installer->getConnection()->dropKey($installer->getTable('wishlist/item'), 'FK_WISHLIST_STORE'); -$installer->getConnection()->dropKey($installer->getTable('wishlist/wishlist'), 'FK_CUSTOMER'); - -$installer->getConnection()->modifyColumn( - $installer->getTable('wishlist/item'), - 'store_id', - 'smallint UNSIGNED DEFAULT NULL', -); - -$installer->getConnection()->addKey($installer->getTable('wishlist/item'), 'IDX_WISHLIST', 'wishlist_id'); -$installer->getConnection()->addKey($installer->getTable('wishlist/item'), 'IDX_PRODUCT', 'product_id'); -$installer->getConnection()->addKey($installer->getTable('wishlist/item'), 'IDX_STORE', 'store_id'); -$installer->getConnection()->addKey($installer->getTable('wishlist/wishlist'), 'UNQ_CUSTOMER', 'customer_id', 'unique'); -$installer->getConnection()->addKey($installer->getTable('wishlist/wishlist'), 'IDX_IS_SHARED', 'shared'); - -$installer->getConnection()->addConstraint( - 'FK_WISHLIST_ITEM_STORE', - $installer->getTable('wishlist/item'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - 'set null', - 'cascade', -); -$installer->getConnection()->addConstraint( - 'FK_WISHLIST_ITEM_WISHLIST', - $installer->getTable('wishlist/item'), - 'wishlist_id', - $installer->getTable('wishlist/wishlist'), - 'wishlist_id', - 'cascade', - 'cascade', -); -$installer->getConnection()->addConstraint( - 'FK_WISHLIST_ITEM_PRODUCT', - $installer->getTable('wishlist/item'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', - 'cascade', - 'cascade', -); -$installer->getConnection()->addConstraint( - 'FK_WISHLIST_CUSTOMER', - $installer->getTable('wishlist/wishlist'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', - 'cascade', - 'cascade', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.5-0.7.6.php deleted file mode 100644 index 950fe95a5f4..00000000000 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ /dev/null @@ -1,15 +0,0 @@ -startSetup(); -$installer->getConnection()->dropColumn($installer->getTable('wishlist'), 'is_dirty'); -$installer->endSetup(); diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.7-0.7.8.php deleted file mode 100644 index 03dc183f62c..00000000000 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$installer->getConnection()->addColumn($this->getTable('wishlist'), 'updated_at', 'datetime NULL DEFAULT NULL'); -$installer->endSetup(); diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.8-0.7.9.php deleted file mode 100644 index c720b39375d..00000000000 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ /dev/null @@ -1,42 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn($this->getTable('wishlist/item'), 'qty', 'DECIMAL( 12, 4 ) NOT NULL'); - -$installer->run(" -CREATE TABLE `{$this->getTable('wishlist/item_option')}` ( - `option_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `wishlist_item_id` int(10) unsigned NOT NULL, - `product_id` int(10) unsigned NOT NULL, - `code` varchar(255) NOT NULL, - `value` text NOT NULL, - PRIMARY KEY (`option_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Additional options for wishlist item'; -"); - -$installer->getConnection()->addConstraint( - 'FK_WISHLIST_ITEM_OPTION_ITEM_ID', - $this->getTable('wishlist/item_option'), - 'wishlist_item_id', - $this->getTable('wishlist/item'), - 'wishlist_item_id', -); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php deleted file mode 100644 index cf30e07d794..00000000000 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ /dev/null @@ -1,293 +0,0 @@ -startSetup(); - -/** - * Drop foreign keys - */ -$installer->getConnection()->dropForeignKey( - $installer->getTable('wishlist/wishlist'), - 'FK_WISHLIST_CUSTOMER', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('wishlist/item'), - 'FK_WISHLIST_ITEM_PRODUCT', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('wishlist/item'), - 'FK_WISHLIST_ITEM_STORE', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('wishlist/item'), - 'FK_WISHLIST_ITEM_WISHLIST', -); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('wishlist/item_option'), - 'FK_WISHLIST_ITEM_OPTION_ITEM_ID', -); - -/** - * Drop indexes - */ -$installer->getConnection()->dropIndex( - $installer->getTable('wishlist/wishlist'), - 'UNQ_CUSTOMER', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('wishlist/wishlist'), - 'IDX_IS_SHARED', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('wishlist/item'), - 'IDX_WISHLIST', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('wishlist/item'), - 'IDX_PRODUCT', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('wishlist/item'), - 'IDX_STORE', -); - -$installer->getConnection()->dropIndex( - $installer->getTable('wishlist/item_option'), - 'FK_WISHLIST_ITEM_OPTION_ITEM_ID', -); - -/** - * Change columns - */ -$tables = [ - $installer->getTable('wishlist/wishlist') => [ - 'columns' => [ - 'wishlist_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Wishlist ID', - ], - 'customer_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Customer ID', - ], - 'shared' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Sharing flag (0 or 1)', - ], - 'sharing_code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'comment' => 'Sharing encrypted code', - ], - 'updated_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Last updated date', - ], - ], - 'comment' => 'Wishlist main Table', - ], - $installer->getTable('wishlist/item') => [ - 'columns' => [ - 'wishlist_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Wishlist item ID', - ], - 'wishlist_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Wishlist ID', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Product ID', - ], - 'store_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'unsigned' => true, - 'comment' => 'Store ID', - ], - 'added_at' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, - 'comment' => 'Add date and time', - ], - 'description' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'comment' => 'Short description of wish list item', - ], - 'qty' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, - 'scale' => 4, - 'precision' => 12, - 'nullable' => false, - 'comment' => 'Qty', - ], - ], - 'comment' => 'Wishlist items', - ], - $installer->getTable('wishlist/item_option') => [ - 'columns' => [ - 'option_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - 'comment' => 'Option Id', - ], - 'wishlist_item_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Wishlist Item Id', - ], - 'product_id' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Product Id', - ], - 'code' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Code', - ], - 'value' => [ - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => '64K', - 'nullable' => true, - 'comment' => 'Value', - ], - ], - 'comment' => 'Wishlist Item Option Table', - ], -]; - -$installer->getConnection()->modifyTables($tables); - -/** - * Add indexes - */ -$installer->getConnection()->addIndex( - $installer->getTable('wishlist/wishlist'), - $installer->getIdxName( - 'wishlist/wishlist', - ['customer_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, - ), - ['customer_id'], - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE, -); - -$installer->getConnection()->addIndex( - $installer->getTable('wishlist/wishlist'), - $installer->getIdxName('wishlist/wishlist', ['shared']), - ['shared'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('wishlist/item'), - $installer->getIdxName('wishlist/item', ['wishlist_id']), - ['wishlist_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('wishlist/item'), - $installer->getIdxName('wishlist/item', ['product_id']), - ['product_id'], -); - -$installer->getConnection()->addIndex( - $installer->getTable('wishlist/item'), - $installer->getIdxName('wishlist/item', ['store_id']), - ['store_id'], -); - -/** - * Add foreign keys - */ -$installer->getConnection()->addForeignKey( - $installer->getFkName('wishlist/wishlist', 'customer_id', 'customer/entity', 'entity_id'), - $installer->getTable('wishlist/wishlist'), - 'customer_id', - $installer->getTable('customer/entity'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('wishlist/item', 'wishlist_id', 'wishlist/wishlist', 'wishlist_id'), - $installer->getTable('wishlist/item'), - 'wishlist_id', - $installer->getTable('wishlist/wishlist'), - 'wishlist_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('wishlist/item', 'product_id', 'catalog/product', 'entity_id'), - $installer->getTable('wishlist/item'), - 'product_id', - $installer->getTable('catalog/product'), - 'entity_id', -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('wishlist/item', 'store_id', 'core/store', 'store_id'), - $installer->getTable('wishlist/item'), - 'store_id', - $installer->getTable('core/store'), - 'store_id', - Varien_Db_Ddl_Table::ACTION_SET_NULL, -); - -$installer->getConnection()->addForeignKey( - $installer->getFkName('wishlist/item_option', 'wishlist_item_id', 'wishlist/item', 'wishlist_item_id'), - $installer->getTable('wishlist/item_option'), - 'wishlist_item_id', - $installer->getTable('wishlist/item'), - 'wishlist_item_id', -); - -$installer->endSetup();