--* WCS Column Setup Script Version 1.0 *--

-- UPDATE CONFIG TABLE COLMUNS
ALTER TABLE `config` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Friendly_Name` `Friendly_Name` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Config` `Config` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Description` `Description` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Type` `Type` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL,
CHANGE `WJPS` `WJPS` TINYINT(1) NOT NULL DEFAULT '0'; 

-- UPDATE CONTACTFORM TABLE COLUMNS
ALTER TABLE `contactform` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Name` `Name` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Email` `Email` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `ContactType` `ContactType` INT(100) NOT NULL DEFAULT '0',
CHANGE `Title` `Title` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Body` `Body` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `Recieved` `Recieved` DATETIME NULL DEFAULT NULL,
CHANGE `Deleted` `Deleted` BIT(1) NOT NULL DEFAULT b'0';

-- UPDATE CONTACTS TABLE COLUMNS
ALTER TABLE `contacts` CHANGE `ContactIDLNK` `ContactIDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `SiteIDLNK` `SiteIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `PositionIDLNK` `PositionIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Name` `Name` VARCHAR(250) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Email` `Email` VARCHAR(250) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Telephone` `Telephone` VARCHAR(250) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0';

--UPDATE DC_AUDIT TABLE COLUMNS
ALTER TABLE `dc_audit` CHANGE `Audit_ID_LNK` `Audit_ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Audit_UserID_LNK` `Audit_UserID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Audit_Type` `Audit_Type` INT(11) NOT NULL DEFAULT '0',
CHANGE `Audit_Object_ID_LNK` `Audit_Object_ID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Audit_Details` `Audit_Details` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
CHANGE `Audit_DateTime` `Audit_DateTime` DATETIME NULL DEFAULT NULL,
CHANGE `Deleted` `Deleted` INT(1) NOT NULL DEFAULT '0'; 

-- UPDATE DC_ERRORS TABLE COLUMNS
ALTER TABLE `dc_errors` CHANGE `ID_LNK` `ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `ErrorID` `ErrorID` INT(11) NOT NULL DEFAULT '0',
CHANGE `ErrorDate` `ErrorDate` DATE NULL DEFAULT NULL,
CHANGE `Comment` `Comment` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
CHANGE `PotentialOutcomeID` `PotentialOutcomeID` INT(11) NOT NULL DEFAULT '0',
CHANGE `Product` `Product` INT(11) NOT NULL DEFAULT '0',
CHANGE `ProductDetails` `ProductDetails` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
CHANGE `LicensedStatus` `LicensedStatus` INT(11) NOT NULL DEFAULT '0',
CHANGE `ProductStage` `ProductStage` INT(11) NOT NULL DEFAULT '0',
CHANGE `ErrorType` `ErrorType` INT(11) NOT NULL DEFAULT '0',
CHANGE `ErrorStage` `ErrorStage` INT(11) NOT NULL DEFAULT '0',
CHANGE `Factor` `Factor` INT(11) NOT NULL DEFAULT '0',
CHANGE `Severity` `Severity` INT(11) NOT NULL DEFAULT '0',
CHANGE `Created` `Created` INT(11) NOT NULL DEFAULT '0',
CHANGE `CreatedText` `CreatedText` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '',
CHANGE `SiteID_LNK` `SiteID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(1) NOT NULL DEFAULT '0';

-- UPDATE DC_GROUPS TABLE COLUMNS
ALTER TABLE `dc_group` CHANGE `ID_LNK` `ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `GroupName` `GroupName` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` INT(1) NOT NULL DEFAULT '0'; 

-- UPDATE DC_SITES TABLE COLUMNS
ALTER TABLE `dc_sites` CHANGE `ID_LNK` `ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `SiteName` `SiteName` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
CHANGE `TrustID` `TrustID` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(1) NOT NULL DEFAULT '0'; 

-- UPDATE DC_SITE_ITEMS TABLE COLUMNS
ALTER TABLE `dc_site_items` CHANGE `ID_LNK` `ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `SiteID_LNK` `SiteID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Month` `Month` DATE NULL,
CHANGE `NoofItems` `NoofItems` INT(11) NOT NULL DEFAULT '0',
CHANGE `OutsourcedItems` `OutsourcedItems` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(1) NOT NULL DEFAULT '0'; 

-- UPDATE DC_TRUSTGROUP TABLE COLUMNS
ALTER TABLE `dc_trustgroup` CHANGE `ID_LNK` `ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `GroupID_LNK` `GroupID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `TrustID_LNK` `TrustID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(1) NOT NULL DEFAULT '0'; 

-- UPDATE DC_TRUSTS TABLE COLUMNS
ALTER TABLE `dc_trusts` CHANGE `ID_LNK` `ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `TrustName` `TrustName` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` INT(1) NOT NULL DEFAULT '0'; 

-- UPDATE DOCUMENTMESSAGES TABLE COLUMNS
ALTER TABLE `documentmessages` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Document_IDLNK` `Document_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Parent_IDLNK` `Parent_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `User_IDLNK` `User_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Message` `Message` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `DateTime` `DateTime` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- UPDATE DOCUMENTORDER TABLE COLUMNS
ALTER TABLE `documentorder` CHANGE `Document_Order_IDLNK` `Document_Order_IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Document_IDLNK` `Document_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Section_IDLNK` `Section_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Document_Order` `Document_Order` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- UPDATE DOCUMENTS TABLE COLUMNS
ALTER TABLE `documents` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `SectionIDLNK` `SectionIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Filename` `Filename` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `URL` `URL` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `DateCreated` `DateCreated` VARCHAR(12) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `CreatedByIDLNK` `CreatedByIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `DateModified` `DateModified` VARCHAR(12) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `ModifiedByIDLNK` `ModifiedByIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `FileSize` `FileSize` INT(50) NOT NULL DEFAULT '0',
CHANGE `FileType` `FileType` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `FileMime` `FileMime` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Public` `Public` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `Parent` `Parent` INT(11) NOT NULL DEFAULT '0',
CHANGE `Archived` `Archived` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `NoShare` `NoShare` INT(1) NOT NULL DEFAULT '0',
CHANGE `DocumentOrder` `DocumentOrder` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(1) NOT NULL DEFAULT '0',
CHANGE `Description` `Description` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL;

-- UPDATE DOCUMENTSECIONORDER TABLE COLUMNS
ALTER TABLE `documentsectionorder` CHANGE `DocumentSectionOrder_IDLNK` `DocumentSectionOrder_IDLNK` INT(99) NOT NULL AUTO_INCREMENT,
CHANGE `Document_IDLNK` `Document_IDLNK` INT(99) NOT NULL DEFAULT '0',
CHANGE `Document_Order` `Document_Order` INT(99) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(1) NOT NULL DEFAULT '0'; 

-- UPDATE DOCUMENTTAGS TABLE COLUMNS
ALTER TABLE `documenttags` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `DocumentIDLNK` `DocumentIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `TagIDLNK` `TagIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- UPDATE DOCUMENTUSERCATEGORYS TABLE COLUMNS
ALTER TABLE `documentusercategorys` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `DocumentIDLNK` `DocumentIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `UserCategoryIDLNK` `UserCategoryIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- UPDATE DSDRUGS TABLE COLUMNS
ALTER TABLE `dsdrugs` CHANGE `ID_LNK` `ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `VPPID` `VPPID` BIGINT(18) NOT NULL DEFAULT '0',
CHANGE `Product` `Product` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Form` `Form` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Strength` `Strength` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Pack_Size` `Pack_Size` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Brand` `Brand` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Distributer` `Distributer` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `On_Contract` `On_Contract` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` TINYINT(1) NOT NULL DEFAULT '0'; 

-- UPDATE DSNOTES TABLE COLUMNS
ALTER TABLE `dsnotes` CHANGE `ID_LNK` `ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Shortage_ID_LNK` `Shortage_ID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `User_ID_LNK` `User_ID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Note_Time` `Note_Time` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `Title` `Title` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Content` `Content` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `Updated_User_ID_LNK` `Updated_User_ID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Updated_Time` `Updated_Time` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT 0

-- UPDATE DSSHORTAGES TABLE COLUMNS
ALTER TABLE `dsshortages` CHANGE `ID_LNK` `ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Drug_ID_LNK` `Drug_ID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Expected_Delivery_Date` `Expected_Delivery_Date` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Recorded_By_ID_LNK` `Recorded_By_ID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Recorded_Date` `Recorded_Date` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `GeneralSupplierCommunication` `GeneralSupplierCommunication` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `Closed_By_ID_LNK` `Closed_By_ID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Archived` `Archived` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0';

-- UPDATE DSSHORTAGESNOTIFICATION TABLE COLUMNS
ALTER TABLE `dsshortagesnotification` CHANGE `ID_LNK` `ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `User_IDLNK` `User_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Shortage_IDLNK` `Shortage_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- UPDATE EMAILS TABLE COLUMNS
ALTER TABLE `emails` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `subject` `subject` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `DateSent` `DateSent` DATETIME NULL DEFAULT NULL,
CHANGE `failed` `failed` BIT(1) NOT NULL DEFAULT b'0',
CHANGE `Status` `Status` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` BIT(1) NOT NULL DEFAULT b'0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE EVENTS TABLE COLUMNS
ALTER TABLE `events` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Title` `Title` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Details` `Details` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `Location` `Location` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `DateAdded` `DateAdded` VARCHAR(12) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Type_IDLNK` `Type_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0',
CHANGE `StartDate` `StartDate` VARCHAR(16) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `EndDate` `EndDate` VARCHAR(16) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `StartDateSQL` `StartDateSQL` DATETIME NULL DEFAULT NULL,
CHANGE `EndDateSQL` `EndDateSQL` DATETIME NULL DEFAULT NULL,
CHANGE `Public` `Public` TINYINT(1) NOT NULL DEFAULT '0';

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE EVENTSCATEGORYS TABLE COLUMNS
ALTER TABLE `eventscategorys` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `EventIDLNK` `EventIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `CategoryIDLNK` `CategoryIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- UPDATE EVENTTYPE TABLE COLUMNS
ALTER TABLE `eventtype` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Name` `Name` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Color` `Color` VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` TINYINT(1) NOT NULL DEFAULT '0'; 

-- UPDATE FLOWCHART TABLE COLUMNS
ALTER TABLE `flowchart` CHANGE `ID` `ID` INT(1) NOT NULL AUTO_INCREMENT,
CHANGE `Title` `Title` VARCHAR(99) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Content` `Content` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- UPDATE FLOWCHARTDATA TABLE COLUMNS
ALTER TABLE `flowchartdata` CHANGE `ID` `ID` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Deleted` `Deleted` INT(1) NOT NULL DEFAULT '0'; 

-- UPDATE FOLDER TABLE COLUMNS
ALTER TABLE `folders` CHANGE `IDLNK` `IDLNK` INT(255) NOT NULL AUTO_INCREMENT,
CHANGE `Name` `Name` VARCHAR(999) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Description` `Description` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `ParentID` `ParentID` INT(255) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` BIT(1) NOT NULL DEFAULT b'0',
CHANGE `FolderOrder` `FolderOrder` INT(11) NOT NULL DEFAULT '0'; 

-- UPDATE FOLDERUSERCATEGORYS TABLE COLUMNS
ALTER TABLE `folderusercategorys` CHANGE `IDLNK` `IDLNK` INT(255) NOT NULL AUTO_INCREMENT,
CHANGE `FolderIDLNK` `FolderIDLNK` INT(255) NOT NULL DEFAULT '0',
CHANGE `UserCategoryIDLNK` `UserCategoryIDLNK` INT(255) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` BIT(1) NOT NULL DEFAULT b'0'; 

-- UPDATE GALLARYIMAGES TABLE COLUMNS
ALTER TABLE `gallaryimages` CHANGE `IDLNK` `IDLNK` INT(255) NOT NULL AUTO_INCREMENT,
CHANGE `GallaryID` `GallaryID` INT(255) NOT NULL DEFAULT '0',
CHANGE `URL` `URL` VARCHAR(999) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Info` `Info` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `Title` `Title` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `GallaryOrder` `GallaryOrder` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` TINYINT(1) NOT NULL DEFAULT '0'; 

-- UPDATE GALLARYS TABLE COLUMNS
ALTER TABLE `gallarys` CHANGE `IDLNK` `IDLNK` INT(255) NOT NULL AUTO_INCREMENT,
CHANGE `Name` `Name` VARCHAR(999) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` BIT(1) NOT NULL DEFAULT b'0'; 

-- UPDATE GROUPS TABLE COLUMS
ALTER TABLE `groups` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `GroupName` `GroupName` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Description` `Description` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `TenderGroup` `TenderGroup` INT(11) NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- UPDATE GROUPUSERCATEGORYS TABLE COLUMNS
ALTER TABLE `groupusercategorys` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `GroupIDLNK` `GroupIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `UserCategoryIDLNK` `UserCategoryIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- UPDATE GROWTHLANDER TABLE COLUMNS
ALTER TABLE `growthlander` CHANGE `ID` `ID` INT(1) NOT NULL AUTO_INCREMENT,
CHANGE `Content` `Content` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL; 

-- UDPATE GROWTHS TABLE COLUMNS
ALTER TABLE `growths` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Title` `Title` VARCHAR(999) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `DateReviewed` `DateReviewed` VARCHAR(99) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Description` `Description` VARCHAR(9999) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Published` `Published` INT(1) NOT NULL DEFAULT '0',
CHANGE `DateUpdated` `DateUpdated` VARCHAR(99) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `UpdatedBy` `UpdatedBy` VARCHAR(99) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `ParentID` `ParentID` INT(99) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(1) NOT NULL DEFAULT '0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE LINKS TABLE COLUMNS
ALTER TABLE `links` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Title` `Title` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `URL` `URL` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- UPDATE MESSAGEREACTIONS TABLE COLUMNS
ALTER TABLE `messagereactions` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Value` `Value` INT(255) NOT NULL DEFAULT '0',
CHANGE `MessageID` `MessageID` INT(255) NOT NULL DEFAULT '0',
CHANGE `UserID` `UserID` INT(255) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` BIT(1) NOT NULL DEFAULT b'0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE MESSAGES TABLE COLUMNS
ALTER TABLE `messages` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Title` `Title` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Message` `Message` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `FolderIDLNK` `FolderIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `ParentIDLNK` `ParentIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `DateAdded` `DateAdded` VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `TimeAdded` `TimeAdded` VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `PostedByIDLNK` `PostedByIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Type_IDLNK` `Type_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE MESSAGECATEGORYS TABLE COLUMNS
ALTER TABLE `messagescategorys` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `MessageIDLNK` `MessageIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `CategoryIDLNK` `CategoryIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE MESSAGESFOLDERS TABLE COLUMNS
ALTER TABLE `messagesfolders` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Title` `Title` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Description` `Description` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `Public` `Public` BIT(1) NOT NULL DEFAULT b'0',
CHANGE `Enabled` `Enabled` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Type` `Type` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE MESSAGESFOLDERSUSERCATEGORYS TABLE COLUMNS
ALTER TABLE `messagesfoldersusercategorys` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `MessageFolderIDLNK` `MessageFolderIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `CategoryIDLNK` `CategoryIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- UPDATE MESSAGETAGS TABLE COLUMNS
ALTER TABLE `messagetags` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `MessageIDLNK` `MessageIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `TagIDLNK` `TagIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- UPDATE MESSAGETYPE TABLE COLUMNS
ALTER TABLE `messagetype` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `MTName` `MTName` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` TINYINT(1) NOT NULL DEFAULT '0'; 

-- UPDATE NEWS TABLE COLUMNS
ALTER TABLE `news` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Title` `Title` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `URL` `URL` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Tags` `Tags` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Content` `Content` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `Published` `Published` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `PublishedDate` `PublishedDate` TIMESTAMP NULL DEFAULT NULL,
CHANGE `EditedDate` `EditedDate` TIMESTAMP on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE `PublishedByIDLNK` `PublishedByIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Public` `Public` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `ExpiryDate` `ExpiryDate` TIMESTAMP on update CURRENT_TIMESTAMP NULL DEFAULT NULL;
CHANGE `NewsletterSent` `NewsletterSent` INT(11) NOT NULL DEFAULT '0';

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE NOTICES TABLE COLUMNS
ALTER TABLE `notices` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Title` `Title` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Notice` `Notice` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `DateAdded` `DateAdded` VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `PostedByIDLNK` `PostedByIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE NOTICESCATEGORYS TABLE COLUMNS
ALTER TABLE `noticescategorys` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `NoticeIDLNK` `NoticeIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `CategoryIDLNK` `CategoryIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE ORGANISATION TABLE COLUMNS
ALTER TABLE `organisation` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Organisation` `Organisation` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- UPDATE PAGES TABLE COLUMNS
ALTER TABLE `pages` CHANGE `PageID` `PageID` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `MenuTitle` `MenuTitle` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `PageTitle` `PageTitle` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `URL` `URL` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Tags` `Tags` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `ParentPageID` `ParentPageID` INT(11) NOT NULL DEFAULT '0',
CHANGE `PageOrder` `PageOrder` INT(11) NOT NULL DEFAULT '0',
CHANGE `ShowHeader` `ShowHeader` INT(1) NOT NULL DEFAULT '0',
CHANGE `ExternalLink` `ExternalLink` TINYINT(1) NULL DEFAULT NULL,
CHANGE `News` `News` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `SnippetFooterID` `SnippetFooterID` INT(11) NOT NULL DEFAULT '0',
CHANGE `Published` `Published` TINYINT(4) NOT NULL DEFAULT '0',
CHANGE `Hidden` `Hidden` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `Private` `Private` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `Template` `Template` INT(11) NOT NULL DEFAULT '0',
CHANGE `SubHomepage` `SubHomepage` TINYINT(4) NOT NULL DEFAULT '0',
CHANGE `Updated` `Updated` DATETIME NULL DEFAULT NULL,
CHANGE `UpdatedByIDLNK` `UpdatedByIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `VersionIDLNK` `VersionIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `AllowOldVersions` `AllowOldVersions` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` TINYINT(1) NOT NULL DEFAULT '0';

-- UPDATE PAGESUSERCATEGORYS TABLE COLUMNS
ALTER TABLE `pagesusercategorys` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `PageIDLNK` `PageIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `UserCategoryIDLNK` `UserCategoryIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- UPDATE PAGESVERSION TABLE COLUMNS
ALTER TABLE `pagesversion` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `PageIDLNK` `PageIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `MenuTitle` `MenuTitle` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `VersionNumberMajor` `VersionNumberMajor` INT(11) NOT NULL DEFAULT '0',
CHANGE `VersionNumberMinor` `VersionNumberMinor` INT(11) NOT NULL DEFAULT '0',
CHANGE `Updated` `Updated` DATETIME NULL DEFAULT NULL,
CHANGE `UpdatedByIDLNK` `UpdatedByIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE PEOPLE TABLE COLUMNS
ALTER TABLE `people` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Image` `Image` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Name` `Name` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `OrgID` `OrgID` INT(11) NOT NULL DEFAULT '0',
CHANGE `JobTitle` `JobTitle` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Description` `Description` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `Address` `Address` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Postcode` `Postcode` VARCHAR(11) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Telephone` `Telephone` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Email` `Email` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `PeopleOrder` `PeopleOrder` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- UPDATE POPUPS TABLE COLUMNS
ALTER TABLE `popups` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE POSITIONS TABLE COLUMNS
ALTER TABLE `positions` CHANGE `PositionIDLNK` `PositionIDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Position` `Position` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `DisplayOrder` `DisplayOrder` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- UPDATE READLIST TABLE COLUMNS
ALTER TABLE `readlist` CHANGE `Readlist_ID_LNK` `Readlist_ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Readlist_Doc_ID_LNK` `Readlist_Doc_ID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Readlist_User_ID_LNK` `Readlist_User_ID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Readlist_Date` `Readlist_Date` VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Readlist_Deleted` `Readlist_Deleted` TINYINT(1) NOT NULL DEFAULT '0'; 

-- UPDATE SECTIONORDER TABLE COLUMNS
ALTER TABLE `sectionorder` CHANGE `Section_Order_IDLNK` `Section_Order_IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Section_IDLNK` `Section_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Section_Order` `Section_Order` INT(11) NOT NULL DEFAULT '0',
CHANGE `Section_Group_IDLNK` `Section_Group_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE SECTIONS TABLE COLUMNS
ALTER TABLE `sections` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `GroupIDLNK` `GroupIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Section` `Section` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Description` `Description` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `Initial_Order` `Initial_Order` INT(11) NOT NULL DEFAULT '0',
CHANGE `Order_Direction` `Order_Direction` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- UPDATE SECTIONUSERCATEGORYS TABLE COLUMNS
ALTER TABLE `sectionusercategorys` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `SectionIDLNK` `SectionIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `UserCategoryIDLNK` `UserCategoryIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- UPDATE SHOWCLASSENTRIES TABLE COLUMNS
ALTER TABLE `showclassentries` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `EntryIDLNK` `EntryIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `ClassIDLNK` `ClassIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Result` `Result` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` TINYINT(1) NOT NULL DEFAULT '0'; 

-- UPDATE SHOWCLASSES TABLE COLUMNS
ALTER TABLE `showclasses` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `ClassNumber` `ClassNumber` VARCHAR(5) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Name` `Name` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `ChildrensClass` `ChildrensClass` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `Section_IDLNK` `Section_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` TINYINT(1) NOT NULL DEFAULT '0'; 

-- UPDATE SHOWCLASSSECTIONS TABLE COLUMNS
ALTER TABLE `showclasssections` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Name` `Name` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Description` `Description` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `Year_IDLNK` `Year_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` TINYINT(1) NOT NULL DEFAULT '0'; 

-- UPDATE SHOWENTRIES TABLE COLUMNS
ALTER TABLE `showentries` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Name` `Name` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Age` `Age` VARCHAR(4) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Email` `Email` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Year_IDLNK` `Year_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` TINYINT(1) NOT NULL DEFAULT '0'; 

-- UPDATE SHOWYEAR TABLE COLUMNS
ALTER TABLE `showyear` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Title` `Title` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Year` `Year` VARCHAR(4) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `ShowDate` `ShowDate` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `CoverPage` `CoverPage` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `BackPage` `BackPage` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `DefaultShow` `DefaultShow` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` TINYINT(1) NOT NULL DEFAULT '0';

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE SITES TABLE COLUMNS
ALTER TABLE `sites` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `TrustIDLNK` `TrustIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Name` `Name` VARCHAR(250) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `AddressLine1` `AddressLine1` VARCHAR(250) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `AddressLine2` `AddressLine2` VARCHAR(250) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Town` `Town` VARCHAR(250) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Postcode` `Postcode` VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Telephone` `Telephone` VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Fax` `Fax` VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE SLIDERS TABLE COLUMNS
ALTER TABLE `sliders` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Title` `Title` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Text` `Text` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `LinkTitle` `LinkTitle` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `LinkUrl` `LinkUrl` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Image` `Image` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Background` `Background` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Published` `Published` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0',
CHANGE `SliderOrder` `SliderOrder` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0';

-- UPDATE SNIPPETGROUPLINKS TABLE COLUMNS
ALTER TABLE `snippetgrouplinks` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Snippet_ID_LNK` `Snippet_ID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Snippet_Group_ID_LNK` `Snippet_Group_ID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` TINYINT(4) NOT NULL DEFAULT '0'; 

-- UPDATE SNIPPETGROUPS TABLE COLUMNS
ALTER TABLE `snippetgroups` CHANGE `SnippetGroup_ID_LNK` `SnippetGroup_ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `SnippetGroup_Name` `SnippetGroup_Name` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `SnippetGroup_Type` `SnippetGroup_Type` TINYINT(4) NOT NULL DEFAULT '0',
CHANGE `SnippetGroup_Deleted` `SnippetGroup_Deleted` TINYINT(1) NOT NULL DEFAULT '0'; 

-- UPDATE SNIPPETS TABLE COLUMNS
ALTER TABLE `snippets` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `SnippetGroup` `SnippetGroup` INT(50) NOT NULL DEFAULT '0',
CHANGE `Title` `Title` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Content` `Content` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `Header` `Header` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- UPDATE TAGS TABLE COLUMNS
ALTER TABLE `tags` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Title` `Title` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` BIT(1) NOT NULL DEFAULT b'0'; 

-- UPDATE TASKS TABLE COLUMNS
ALTER TABLE `tasks` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Title` `Title` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `User_ID_LNK` `User_ID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Description` `Description` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `TargetDate` `TargetDate` VARCHAR(18) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Completed` `Completed` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `Owner_ID_LNK` `Owner_ID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Archived` `Archived` TINYINT(4) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` TINYINT(1) NOT NULL DEFAULT '0';

-- UPDATE TENDERS TABLE COLUMNS
ALTER TABLE `tenders` CHANGE `ID_LNK` `ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Reference` `Reference` VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Title` `Title` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `StartDate` `StartDate` VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `EndDate` `EndDate` VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Category` `Category` INT(11) NOT NULL DEFAULT '0',
CHANGE `Description` `Description` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
CHANGE `Owner` `Owner` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Stage` `Stage` INT(11) NOT NULL DEFAULT '0',
CHANGE `Archived` `Archived` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0';

-- UPDATE TENDERSECTIONS TABLE COLUMNS
ALTER TABLE `tendersections` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Tender_IDLNK` `Tender_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Section_IDLNK` `Section_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` TINYINT(1) NOT NULL DEFAULT '0'; 

-- UPDATE TENDERSTAGES TABLE COLUMNS
ALTER TABLE `tenderstages` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Stage_Number` `Stage_Number` INT(11) NOT NULL DEFAULT '0',
CHANGE `Name` `Name` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- UPDATE TENDERSUSERCATEGORYS TABLE COLUMNS
ALTER TABLE `tendersusercategorys` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Tender_IDLNK` `Tender_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `User_Category_IDLNK` `User_Category_IDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE TRUSTS TABLE COLUMNS
ALTER TABLE `trusts` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Trust` `Trust` VARCHAR(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- UPDATE USERAUDIT TABLE COLUMNS
ALTER TABLE `useraudit` CHANGE `User_Audit_ID_LNK` `User_Audit_ID_LNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `User_Audit_UserID_LNK` `User_Audit_UserID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `User_Audit_Type` `User_Audit_Type` INT(11) NOT NULL DEFAULT '0',
CHANGE `User_Audit_Object_ID_LNK` `User_Audit_Object_ID_LNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `User_Audit_Details` `User_Audit_Details` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
CHANGE `User_Audit_DateTime` `User_Audit_DateTime` DATETIME NULL DEFAULT NULL,
CHANGE `Deleted` `Deleted` INT(1) NOT NULL DEFAULT '0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE USERCATEGORYS TABLE COLUMNS
ALTER TABLE `usercategorys` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Title` `Title` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `SharedConnection` `SharedConnection` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `ErrorReporting` `ErrorReporting` INT(1) NOT NULL DEFAULT '0',
CHANGE `Premium` `Premium` INT(1) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 

-- UPDATE USERCONFIGFAVORITES TABLE COLUMNS
ALTER TABLE `userconfigfavorites` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `ConfigIDLNK` `ConfigIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `UserIDLNK` `UserIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` INT(11) NOT NULL DEFAULT '0'; 

-- UPDATE USERS TABLE COLUMNS
ALTER TABLE `users` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `Username` `Username` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Password` `Password` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Firstname` `Firstname` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Surname` `Surname` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Email` `Email` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Hospital` `Hospital` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `Userlevel` `Userlevel` INT(11) NOT NULL DEFAULT '0',
CHANGE `Enabled` `Enabled` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `Tasks` `Tasks` INT(11) NOT NULL DEFAULT '0',
CHANGE `ContactAdmin` `ContactAdmin` INT(11) NOT NULL DEFAULT '0',
CHANGE `Requested` `Requested` INT(11) NOT NULL DEFAULT '0',
CHANGE `Preferences` `Preferences` VARCHAR(11) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
CHANGE `LastLogin` `LastLogin` DATETIME NULL DEFAULT NULL,
CHANGE `PreviousLogin` `PreviousLogin` DATE NULL DEFAULT NULL,
CHANGE `WebSignup` `WebSignup` TINYINT(1) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` TINYINT(1) NOT NULL DEFAULT '0'; 

-- ! THIS TABLE'S DELETED COLUMN IS A VARCHAR?!?!?
-- UPDATE USERSCATEGORYS TABLE COLUMNS
ALTER TABLE `userscategorys` CHANGE `IDLNK` `IDLNK` INT(11) NOT NULL AUTO_INCREMENT,
CHANGE `UserIDLNK` `UserIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `CategoryIDLNK` `CategoryIDLNK` INT(11) NOT NULL DEFAULT '0',
CHANGE `Premium` `Premium` INT(1) NOT NULL DEFAULT '0',
CHANGE `Deleted` `Deleted` VARCHAR(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0'; 