-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from koala-framework/update-scripts
Update scripts
- Loading branch information
Showing
36 changed files
with
293 additions
and
183 deletions.
There are no files selected for viewing
39 changes: 0 additions & 39 deletions
39
KwcShop/Kwc/Shop/Cart/Checkout/Update/20150309Legacy30179.sql
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
KwcShop/Kwc/Shop/Cart/Checkout/Update/20150309Legacy30275.sql
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
KwcShop/Kwc/Shop/Cart/Checkout/Update/20150309Legacy30372.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
KwcShop/Kwc/Shop/Cart/Checkout/Update/20150309Legacy30374.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
18 changes: 9 additions & 9 deletions
18
KwcShop/Kwc/Shop/Cart/Plugins/Voucher/Update/20150309Legacy00001.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
CREATE TABLE `KwcShop_Kwc_Shop_vouchers` ( | ||
CREATE TABLE `kwc_shop_vouchers` ( | ||
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , | ||
`code` VARCHAR( 20 ) NOT NULL , | ||
`amount` DECIMAL( 10, 2 ) NOT NULL , | ||
`date` DATETIME NOT NULL , | ||
`comment` TEXT NOT NULL | ||
) ENGINE = InnoDB; | ||
|
||
ALTER TABLE `KwcShop_Kwc_Shop_vouchers` ADD UNIQUE (`code`) ; | ||
ALTER TABLE `KwcShop_Kwc_Shop_vouchers` CHANGE `id` `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT ; | ||
ALTER TABLE `kwc_shop_vouchers` ADD UNIQUE (`code`) ; | ||
ALTER TABLE `kwc_shop_vouchers` CHANGE `id` `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT ; | ||
|
||
CREATE TABLE `KwcShop_Kwc_Shop_voucher_history` ( | ||
CREATE TABLE `kwc_shop_voucher_history` ( | ||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , | ||
`voucher_id` INT UNSIGNED NOT NULL , | ||
`order_id` INT UNSIGNED NULL , | ||
`amount` DECIMAL( 10, 2 ) NOT NULL , | ||
INDEX ( `voucher_id` ) | ||
) ENGINE = InnoDB ; | ||
ALTER TABLE `KwcShop_Kwc_Shop_voucher_history` ADD INDEX ( `order_id` ) ; | ||
ALTER TABLE `KwcShop_Kwc_Shop_voucher_history` ADD `date` DATETIME NOT NULL , | ||
ALTER TABLE `kwc_shop_voucher_history` ADD INDEX ( `order_id` ) ; | ||
ALTER TABLE `kwc_shop_voucher_history` ADD `date` DATETIME NOT NULL , | ||
ADD `comment` TEXT NOT NULL ; | ||
ALTER TABLE `KwcShop_Kwc_Shop_voucher_history` ADD FOREIGN KEY ( `voucher_id` ) REFERENCES `KwcShop_Kwc_Shop_vouchers` ( | ||
ALTER TABLE `kwc_shop_voucher_history` ADD FOREIGN KEY ( `voucher_id` ) REFERENCES `kwc_shop_vouchers` ( | ||
`id` | ||
); | ||
|
||
ALTER TABLE `KwcShop_Kwc_Shop_voucher_history` ADD FOREIGN KEY ( `order_id` ) REFERENCES `KwcShop_Kwc_Shop_orders` ( | ||
ALTER TABLE `kwc_shop_voucher_history` ADD FOREIGN KEY ( `order_id` ) REFERENCES `kwc_shop_orders` ( | ||
`id` | ||
); | ||
|
||
ALTER TABLE `KwcShop_Kwc_Shop_voucher_history` CHANGE `order_id` `order_id` INT( 10 ) UNSIGNED NULL ; | ||
ALTER TABLE `kwc_shop_voucher_history` CHANGE `order_id` `order_id` INT( 10 ) UNSIGNED NULL ; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
KwcShop/Kwc/Shop/Category/Directory/Update/20150309Legacy00001.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
KwcShop/Kwc/Shop/Products/Directory/Trl/Update/20150309Legacy00001.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
KwcShop/Kwc/Shop/Products/Directory/Update/20150309Shop00001.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?php | ||
class KwcShop_Kwc_Shop_Products_Directory_Update_20150309Shop00001 extends Kwf_Update | ||
{ | ||
public function update() | ||
{ | ||
$db = Kwf_Registry::get('db'); | ||
$executed = $db->fetchOne("SHOW tables LIKE 'kwc_shop_orders'"); | ||
if ($executed) return; | ||
|
||
$db->query(" | ||
CREATE TABLE IF NOT EXISTS `kwc_shop_orders` ( | ||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
`status` enum('cart','ordered','payed') NOT NULL, | ||
`ip` varchar(100) NOT NULL, | ||
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
`payment_component_id` varchar(200) NOT NULL, | ||
`checkout_component_id` varchar(200) NOT NULL, | ||
`cart_component_class` varchar(200) NOT NULL, | ||
`data` text NOT NULL, | ||
`shipped` date DEFAULT NULL, | ||
`payed` date DEFAULT NULL, | ||
`canceled` tinyint(4) NOT NULL, | ||
`invoice_date` date DEFAULT NULL, | ||
`number` int(11) NOT NULL, | ||
`origin` enum('internet','phone','folder','fair') NOT NULL DEFAULT 'internet', | ||
`firstname` varchar(200) NOT NULL, | ||
`lastname` varchar(200) NOT NULL, | ||
`city` varchar(200) NOT NULL, | ||
`email` varchar(200) NOT NULL, | ||
`zip` varchar(50) NOT NULL, | ||
`payment` varchar(100) NOT NULL, | ||
`invoice_number` int(11) NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
CREATE TABLE IF NOT EXISTS `kwc_shop_order_products` ( | ||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
`shop_order_id` int(10) unsigned NOT NULL, | ||
`shop_product_price_id` int(10) unsigned DEFAULT NULL, | ||
`amount` int(11) NOT NULL, | ||
`pos` smallint(6) NOT NULL, | ||
`add_component_id` varchar(200) NOT NULL, | ||
`add_component_class` varchar(200) NOT NULL, | ||
`data` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, | ||
PRIMARY KEY (`id`), | ||
KEY `shop_order_id` (`shop_order_id`), | ||
KEY `shop_product_price_id` (`shop_product_price_id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
CREATE TABLE IF NOT EXISTS `kwc_shop_products` ( | ||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
`category` varchar(255) NOT NULL, | ||
`pos` smallint(6) NOT NULL, | ||
`title` varchar(200) NOT NULL, | ||
`filename` varchar(100) NOT NULL, | ||
`visible` tinyint(4) NOT NULL, | ||
`max_amount` int(11) NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
CREATE TABLE IF NOT EXISTS `kwc_shop_product_prices` ( | ||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
`shop_product_id` int(10) unsigned NOT NULL, | ||
`price` decimal(10,2) NOT NULL, | ||
`valid_from` datetime NOT NULL, | ||
PRIMARY KEY (`id`), | ||
KEY `shop_product_id` (`shop_product_id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
ALTER TABLE `kwc_shop_order_products` | ||
ADD CONSTRAINT `kwc_shop_order_products_ibfk_1` FOREIGN KEY (`shop_order_id`) REFERENCES `kwc_shop_orders` (`id`), | ||
ADD CONSTRAINT `kwc_shop_order_products_ibfk_2` FOREIGN KEY (`shop_product_price_id`) REFERENCES `kwc_shop_product_prices` (`id`); | ||
ALTER TABLE `kwc_shop_product_prices` | ||
ADD CONSTRAINT `kwc_shop_product_prices_ibfk_1` FOREIGN KEY (`shop_product_id`) REFERENCES `kwc_shop_products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; | ||
ALTER TABLE `kwc_shop_order_products` CHANGE `shop_product_price_id` `shop_product_price_id` INT( 10 ) UNSIGNED NULL; | ||
"); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
KwcShop/Kwc/Shop/Products/Directory/Update/20150309Shop00002.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
class KwcShop_Kwc_Shop_Products_Directory_Update_20150309Shop00002 extends Kwf_Update | ||
{ | ||
public function update() | ||
{ | ||
$db = Kwf_Registry::get('db'); | ||
$executed = $db->fetchOne("SHOW columns FROM `kwc_shop_order_products` LIKE 'add_component_class'"); | ||
if ($executed) return; | ||
|
||
$db->query("ALTER TABLE `kwc_shop_order_products` ADD `add_component_class` VARCHAR( 200 ) NOT NULL"); | ||
$db->query("UPDATE kwc_shop_order_products SET add_component_class='Kwc_Babytuch_Shop_AddToCart_Component'"); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
KwcShop/Kwc/Shop/Products/Directory/Update/20150309Shop00003.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
class KwcShop_Kwc_Shop_Products_Directory_Update_20150309Shop00003 extends Kwf_Update | ||
{ | ||
public function update() | ||
{ | ||
$db = Kwf_Registry::get('db'); | ||
$executed = $db->fetchOne("SHOW columns FROM `kwc_shop_order_products` LIKE 'data'"); | ||
if ($executed) return; | ||
|
||
$db->query("ALTER TABLE `kwc_shop_order_products` ADD `data` TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL"); | ||
$db->query("ALTER TABLE `kwc_shop_order_products` CHANGE `size` `size_backup` TINYINT(4) NOT NULL"); | ||
$db->query("ALTER TABLE `kwc_shop_order_products` CHANGE `amount` `amount_backup` SMALLINT NOT NULL"); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
.../Shop/Cart/Update/20150309Legacy00004.php → ...ts/Directory/Update/20150309Shop00004.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
KwcShop/Kwc/Shop/Products/Directory/Update/20150309Shop00005.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
class KwcShop_Kwc_Shop_Products_Directory_Update_20150309Shop00005 extends Kwf_Update | ||
{ | ||
public function update() | ||
{ | ||
$db = Kwf_Registry::get('db'); | ||
$executed = $db->fetchOne("SHOW columns FROM `kwc_shop_products` LIKE 'component'"); | ||
if ($executed) return; | ||
|
||
$db->query("ALTER TABLE `kwc_shop_products` ADD `component` VARCHAR( 255 ) NOT NULL AFTER `id`"); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
KwcShop/Kwc/Shop/Products/Directory/Update/20150309Shop00006.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ALTER TABLE `kwc_shop_product_prices` DROP FOREIGN KEY `kwc_shop_product_prices_ibfk_1` ; | ||
ALTER TABLE `kwc_shop_product_prices` ADD FOREIGN KEY ( `shop_product_id` ) | ||
REFERENCES `kwc_shop_products` ( | ||
`id` | ||
) ON DELETE CASCADE ON UPDATE CASCADE ; |
24 changes: 24 additions & 0 deletions
24
KwcShop/Kwc/Shop/Products/Directory/Update/20150309Shop00007.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
class KwcShop_Kwc_Shop_Products_Directory_Update_20150309Shop00007 extends Kwf_Update | ||
{ | ||
|
||
public function update() | ||
{ | ||
$db = Kwf_Registry::get('db'); | ||
$executed = $db->fetchOne("SHOW columns FROM `kwc_shop_products` LIKE 'component_id'"); | ||
if ($executed) return; | ||
|
||
$db->query("ALTER TABLE `kwc_shop_products` ADD `component_id` VARCHAR( 255 ) NOT NULL AFTER `id`"); | ||
$db->query("ALTER TABLE `kwc_shop_products` ADD INDEX ( `component_id` )"); | ||
} | ||
|
||
public function postUpdate() | ||
{ | ||
$c = Kwf_Component_Data_Root::getInstance() | ||
->getComponentByClass('KwcShop_Kwc_Shop_Products_Directory_Component', array('limit'=>1, 'ignoreVisible'=>true)); | ||
p($c); | ||
if ($c) { | ||
Kwf_Registry::get('db')->query("UPDATE kwc_shop_products SET component_id='$c->dbId'"); | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
KwcShop/Kwc/Shop/Products/Directory/Update/20150309Shop00008.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
class KwcShop_Kwc_Shop_Products_Directory_Update_20150309Shop00008 extends Kwf_Update | ||
{ | ||
public function update() | ||
{ | ||
$db = Kwf_Registry::get('db'); | ||
$executed = $db->fetchOne("SHOW columns FROM `kwc_shop_orders` LIKE 'confirm_mail_sent'"); | ||
if ($executed) return; | ||
|
||
$db->query("ALTER TABLE `kwc_shop_orders` ADD `confirm_mail_sent` DATETIME NULL"); | ||
} | ||
} |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
KwcShop/Kwc/Shop/Products/Directory/Update/20150309Shop28185.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE `kwc_shop_orders` CHANGE `status` `status` ENUM( 'cart', 'ordered', 'payed' ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; |
Oops, something went wrong.