ALTER TABLE Orders ADD COLUMN `IsRecurringBilling` tinyint(4) NOT NULL default '0', ADD COLUMN `NextCharge` int(10) unsigned default NULL, ADD COLUMN `GroupId` int(10) unsigned NOT NULL default '0', ADD COLUMN `ChargeOnNextApprove` tinyint(4) NOT NULL default '0';

ALTER TABLE Products ADD COLUMN `IsRecurringBilling` tinyint(3) unsigned NOT NULL default '0'

INSERT INTO ConfigurationAdmin VALUES ('Comm_RecurringChargeInverval', 'la_Text_Orders', 'la_RecurringChargeInverval', 'text', NULL, NULL, 6, 0);
INSERT INTO ConfigurationAdmin VALUES ('Comm_AutoProcessRecurringOrders', 'la_Text_Orders', 'la_AutoProcessRecurringOrders', 'checkbox', NULL, NULL, 6, 0);

INSERT INTO ConfigurationValues VALUES ('Comm_RecurringChargeInverval', '1', 'In-Commerce', 'in-commerce:general');
INSERT INTO ConfigurationValues VALUES ('Comm_AutoProcessRecurringOrders', '1', 'In-Commerce', 'in-commerce:general');

INSERT INTO Events VALUES (NULL , 'ORDER.RECURRING.PROCESSED', '1', '0', 'In-Commerce', 'la_RecurringOrderProcessed', '0');
INSERT INTO Events VALUES (NULL , 'ORDER.RECURRING.PROCESSED', '1', '0', 'In-Commerce', 'la_RecurringOrderProcessed', '1');
INSERT INTO Events VALUES (NULL , 'ORDER.RECURRING.DENIED', '1', '0', 'In-Commerce', 'la_RecurringOrderDenied', '0');
INSERT INTO Events VALUES (NULL , 'ORDER.RECURRING.DENIED', '1', '0', 'In-Commerce', 'la_RecurringOrderDenied', '1');

INSERT INTO Currencies VALUES (NULL, 'AFN', '', 0, 'la_AFN', 0.02, 1120641028, 0, 0, 0);

ALTER TABLE Addresses ADD IsProfileAddress TINYINT NOT NULL;

UPDATE Addresses SET LastUsedAsBilling = 0, LastUsedAsShipping = 0;
INSERT INTO Addresses (PortalUserId, `To`, Company, Phone, Fax, Email, Address1, Address2, City, State, Zip, Country, LastUsedAsBilling, LastUsedAsShipping, IsProfileAddress) SELECT PortalUserId, CONCAT(FirstName, ' ', LastName) AS `To`, Company, Phone, Fax, Email, Street AS Address1, Street2 AS Address2, City, State, Zip, Country, 1 AS LastUsedAsBilling, 1 AS LastUsedAsShipping, 1 AS IsProfileAddress FROM PortalUser;

UPDATE Modules SET Version = '1.0.6' WHERE Name = 'In-Commerce';