SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

DROP TABLE IF EXISTS twistDataManager;
CREATE TABLE twistDataManager (
  actionBar tinyint(1) NOT NULL DEFAULT '0',
  actionBarBookmark tinyint(1) NOT NULL DEFAULT '0',
  actionBarBookmarkEntityRequest varchar(100) NOT NULL,
  actionBarCall tinyint(1) NOT NULL DEFAULT '0',
  actionBarCallEntityRequest varchar(100) NOT NULL,
  actionBarDelete tinyint(1) NOT NULL DEFAULT '0',
  actionBarDeleteEntityRequest varchar(100) NOT NULL,
  actionBarHelp tinyint(1) NOT NULL DEFAULT '0',
  actionBarHelpEntityRequest varchar(100) NOT NULL,
  actionBarLinkAdd tinyint(1) NOT NULL DEFAULT '0',
  actionBarLinkAddEntityRequest varchar(100) NOT NULL,
  actionBarLinkShow tinyint(1) NOT NULL DEFAULT '0',
  actionBarLinkShowEntityRequest varchar(100) NOT NULL,
  actionBarMessage tinyint(1) NOT NULL DEFAULT '0',
  actionBarMessageEntityRequest varchar(100) NOT NULL,
  actionBarNote tinyint(1) NOT NULL DEFAULT '0',
  actionBarNoteEntityRequest varchar(100) NOT NULL,
  actionBarReport tinyint(1) NOT NULL DEFAULT '0',
  actionBarReportEntityRequest varchar(100) NOT NULL,
  actionBarRow tinyint(1) NOT NULL DEFAULT '0',
  actionBarRowEntityRequest varchar(100) NOT NULL,
  actionBarRowFirst tinyint(1) NOT NULL DEFAULT '0',
  actionBarRowFirstEntityRequest varchar(100) NOT NULL,
  actionBarRowLast tinyint(1) NOT NULL DEFAULT '0',
  actionBarRowLastEntityRequest varchar(100) NOT NULL,
  actionBarRowNext tinyint(1) NOT NULL DEFAULT '0',
  actionBarRowNextEntityRequest varchar(100) NOT NULL,
  actionBarRowPrevious tinyint(1) NOT NULL DEFAULT '0',
  actionBarRowPreviousEntityRequest varchar(100) NOT NULL,
  actionBarSourceFileLocal tinyint(1) NOT NULL DEFAULT '0',
  actionBarSourceFileName varchar(100) NOT NULL,
  actionBarSourceFilePath varchar(200) NOT NULL,
  actionBarSourceLocal tinyint(1) NOT NULL DEFAULT '0',
  actionBarWorkflow tinyint(1) NOT NULL DEFAULT '0',
  actionBarWorkflowEntityRequest varchar(100) NOT NULL,
  appCode varchar(100) NOT NULL,
  contentAreaSourceFileLocal tinyint(1) NOT NULL DEFAULT '0',
  contentAreaSourceFileName varchar(100) NOT NULL,
  contentAreaSourceFilePath varchar(200) NOT NULL,
  contentAreaSourceLocal tinyint(1) NOT NULL DEFAULT '0',
  dataManagerCode varchar(100) NOT NULL,
  dataManagerID int(11) NOT NULL AUTO_INCREMENT,
  dataManagerName varchar(100) NOT NULL,
  dataManagerNamePublic varchar(100) NOT NULL,
  dataManagerOptionCodeDefault varchar(100) NOT NULL,
  dataManagerOverview varchar(1000) NOT NULL,
  dataManagerQueryCodeDefault varchar(100) NOT NULL,
  dataManagerShowLinks tinyint(1) NOT NULL DEFAULT '0',
  dataManagerUpdateSourceCode varchar(4000) NOT NULL,
  dataManagerUpdateSourceFileLocal tinyint(1) NOT NULL DEFAULT '0',
  dataManagerUpdateSourceCustom tinyint(1) NOT NULL DEFAULT '0',
  dataManagerUpdateSourceFileName varchar(100) NOT NULL,
  dataManagerUpdateSourceFilePath varchar(200) NOT NULL,
  dataManagerWebTemplateCode varchar(100) NOT NULL,
  deletedCondition varchar(200) NOT NULL,
  footerSection tinyint(1) NOT NULL DEFAULT '0',
  footerSectionSourceFileLocal tinyint(1) NOT NULL DEFAULT '0',
  footerSectionSourceFileName varchar(100) NOT NULL,
  footerSectionSourceFilePath varchar(200) NOT NULL,
  footerSectionSourceLocal tinyint(1) NOT NULL DEFAULT '0',
  headerSection tinyint(1) NOT NULL DEFAULT '0',
  headerSectionSourceFileLocal tinyint(1) NOT NULL DEFAULT '0',
  headerSectionSourceFileName varchar(100) NOT NULL,
  headerSectionSourceFilePath varchar(200) NOT NULL,
  headerSectionSourceLocal tinyint(1) NOT NULL DEFAULT '0',
  queryCode varchar(100) NOT NULL,
  tabMenu tinyint(1) NOT NULL DEFAULT '0',
  tabMenuSourceFileLocal tinyint(1) NOT NULL DEFAULT '0',
  tabMenuSourceFileName varchar(100) NOT NULL,
  tabMenuSourceFilePath varchar(200) NOT NULL,
  tabMenuSourceLocal tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (dataManagerID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS twistDataManagerOption;
CREATE TABLE twistDataManagerOption (
  actionBarSourceFileName varchar(100) NOT NULL,
  actionBarSourceFilePath varchar(200) NOT NULL,
  actionBarSourceLocal tinyint(1) NOT NULL DEFAULT '0',
  contentAreaSourceFileName varchar(100) NOT NULL,
  contentAreaSourceFilePath varchar(200) NOT NULL,
  contentAreaSourceLocal tinyint(1) NOT NULL DEFAULT '0',
  dataManagerCode varchar(100) NOT NULL,
  dataManagerOptionCode varchar(100) NOT NULL,
  dataManagerOptionCustom tinyint(1) NOT NULL DEFAULT '0',
  dataManagerOptionFormSelectSourceFileLocal tinyint(1) NOT NULL DEFAULT '0',
  dataManagerOptionFormSelectSourceFileName varchar(100) NOT NULL,
  dataManagerOptionFormSelectSourceFilePath varchar(200) NOT NULL,
  dataManagerOptionID int(11) NOT NULL AUTO_INCREMENT,
  dataManagerOptionName varchar(100) NOT NULL,
  dataManagerOptionNamePublic varchar(100) NOT NULL,
  dataManagerOptionOverview varchar(1000) NOT NULL,
  dataManagerOptionSourceFileName varchar(100) NOT NULL,
  dataManagerOptionSourceFilePath varchar(200) NOT NULL,
  dataManagerOptionSourceLocal tinyint(1) NOT NULL DEFAULT '0',
  entityRequestCode varchar(100) NOT NULL,
  footerSectionSourceFileName varchar(100) NOT NULL,
  footerSectionSourceFilePath varchar(200) NOT NULL,
  footerSectionSourceLocal tinyint(1) NOT NULL DEFAULT '0',
  headerSectionSourceFileName varchar(100) NOT NULL,
  headerSectionSourceFilePath varchar(200) NOT NULL,
  headerSectionSourceLocal tinyint(1) NOT NULL DEFAULT '0',
  sqlUpdatePrefix varchar(1000) NOT NULL,
  tabMenuSourceFileName varchar(100) NOT NULL,
  tabMenuSourceFilePath varchar(200) NOT NULL,
  tabMenuSourceLocal tinyint(1) NOT NULL DEFAULT '0',
  webTemplateCode varchar(100) NOT NULL,
  PRIMARY KEY (dataManagerOptionID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS twistDataManagerSection;
CREATE TABLE twistDataManagerSection (
  cssClass varchar(100) NOT NULL,
  cssClassSection varchar(100) NOT NULL,
  cssClassSectionContent varchar(100) NOT NULL,
  cssStyle varchar(500) NOT NULL,
  cssStyleSection varchar(500) NOT NULL,
  cssStyleSectionContent varchar(500) NOT NULL,
  dataManagerCode varchar(100) NOT NULL,
  dataManagerOptionCode varchar(100) DEFAULT NULL,
  dataManagerSectionCode varchar(100) NOT NULL,
  dataManagerSectionCustom tinyint(1) NOT NULL DEFAULT '0',
  dataManagerSectionFormSelectSourceFileLocal tinyint(1) NOT NULL DEFAULT '0',
  dataManagerSectionFormSelectSourceFileName varchar(100) NOT NULL,
  dataManagerSectionFormSelectSourceFilePath varchar(200) NOT NULL,
  dataManagerSectionID int(11) NOT NULL AUTO_INCREMENT,
  dataManagerSectionName varchar(100) NOT NULL,
  dataManagerSectionNamePublic varchar(100) NOT NULL,
  dataManagerSectionOverview varchar(1000) NOT NULL,
  dataManagerSectionSourceCode varchar(4000) NOT NULL,
  dataManagerSectionSourceCustom tinyint(1) NOT NULL DEFAULT '0',
  dataManagerSectionSourceFileName varchar(100) NOT NULL,
  dataManagerSectionSourceFilePath varchar(200) NOT NULL,
  dataManagerSectionType varchar(100) NOT NULL,
  displayOrder smallint(6) NOT NULL DEFAULT '0',
  domID varchar(100) NOT NULL,
  draggable tinyint(1) NOT NULL DEFAULT '0',
  formCode varchar(100) NOT NULL,
  nameVisible tinyint(1) NOT NULL DEFAULT '0',
  sectionLayout varchar(20) NOT NULL,
  sectionType varchar(20) NOT NULL,
  sectionVisible tinyint(1) NOT NULL DEFAULT '0',
  webTemplateCode varchar(100) NOT NULL,
  PRIMARY KEY (dataManagerSectionID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS twistEntityRequest;
CREATE TABLE twistEntityRequest (
  appCode varchar(100) NOT NULL,
  `client` tinyint(1) NOT NULL DEFAULT '0',
  clientDelete tinyint(1) NOT NULL DEFAULT '0',
  clientVisible tinyint(1) NOT NULL DEFAULT '0',
  entityRequestCode varchar(100) NOT NULL,
  entityRequestCustom tinyint(1) NOT NULL DEFAULT '0',
  entityRequestID int(11) NOT NULL AUTO_INCREMENT,
  entityRequestName varchar(100) NOT NULL,
  entityRequestNamePublic varchar(100) NOT NULL,
  entityRequestOverview varchar(500) NOT NULL,
  entityRequestSourceCode varchar(8000) NOT NULL,
  entityRequestSourceFileLocal tinyint(1) NOT NULL DEFAULT '0',
  entityRequestSourceFileName varchar(100) NOT NULL,
  entityRequestSourceFilePath varchar(200) NOT NULL,
  entityRequestSourceType varchar(20) NOT NULL,
  entityRequestStatusCode varchar(100) NOT NULL,
  entityRequestTitle varchar(100) NOT NULL,
  entityRequestTypeCode varchar(100) NOT NULL,
  entityRequestWebTemplateCode varchar(100) NOT NULL,
  initializedDateTime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  managerMemberID int(11) NOT NULL DEFAULT '0',
  parameter1Code varchar(50) NOT NULL,
  parameter1Value varchar(200) NOT NULL,
  parameter2Code varchar(50) NOT NULL,
  parameter2Value varchar(50) NOT NULL,
  parameter3Code varchar(50) NOT NULL,
  parameter3Value varchar(200) NOT NULL,
  parameter4Code varchar(50) NOT NULL,
  parameter4Value varchar(200) NOT NULL,
  parameter5Code varchar(50) NOT NULL,
  parameter5Value varchar(200) NOT NULL,
  parameter6Code varchar(50) NOT NULL,
  parameter6Value varchar(200) NOT NULL,
  parameter7Code varchar(50) NOT NULL,
  parameter7Value varchar(200) NOT NULL,
  parameter8Code varchar(50) NOT NULL,
  parameter8Value varchar(200) NOT NULL,
  parameter9Code varchar(50) NOT NULL,
  parameter9Value varchar(200) NOT NULL,
  roleCode varchar(100) NOT NULL,
  secure tinyint(1) NOT NULL DEFAULT '0',
  websiteCode varchar(100) NOT NULL,
  window tinyint(1) NOT NULL DEFAULT '0',
  windowCenterH tinyint(1) NOT NULL DEFAULT '0',
  windowCenterV tinyint(1) NOT NULL DEFAULT '0',
  windowCloseIcon tinyint(1) NOT NULL DEFAULT '1',
  windowDOMID varchar(100) NOT NULL,
  windowDraggable tinyint(1) NOT NULL DEFAULT '0',
  windowHeight smallint(6) NOT NULL DEFAULT '0',
  windowLeft smallint(6) NOT NULL DEFAULT '0',
  windowModal tinyint(1) NOT NULL DEFAULT '0',
  windowResizeable tinyint(1) NOT NULL DEFAULT '0',
  windowTemplateCode varchar(100) NOT NULL,
  windowTop smallint(6) NOT NULL DEFAULT '0',
  windowWidth smallint(6) NOT NULL DEFAULT '0',
  windowZIndex smallint(6) NOT NULL DEFAULT '0',
  PRIMARY KEY (entityRequestID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS twistForm;
CREATE TABLE twistForm (
  cssClass varchar(100) NOT NULL,
  cssStyle varchar(500) NOT NULL,
  entityRequestCodeSubmit varchar(100) NOT NULL,
  formCode varchar(100) NOT NULL,
  formID int(11) NOT NULL AUTO_INCREMENT,
  formName varchar(100) NOT NULL,
  formNamePublic varchar(100) NOT NULL,
  formOverview varchar(500) NOT NULL,
  formStatus varchar(20) NOT NULL,
  formType varchar(20) NOT NULL,
  PRIMARY KEY (formID)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS twistFormItem;
CREATE TABLE twistFormItem (
  actionBlurSource varchar(1000) NOT NULL,
  actionBlurTypeID tinyint(1) NOT NULL DEFAULT '0',
  actionClickSource varchar(1000) NOT NULL,
  actionClickTypeID tinyint(1) NOT NULL DEFAULT '0',
  actionFocusSource varchar(1000) NOT NULL,
  actionFocusTypeID tinyint(1) NOT NULL DEFAULT '0',
  actionHoverSource varchar(1000) NOT NULL,
  actionHoverTypeID tinyint(1) NOT NULL DEFAULT '0',
  cssDataClass varchar(100) NOT NULL,
  cssDataStyle varchar(200) NOT NULL,
  cssLabelClass varchar(100) NOT NULL,
  cssLabelStyle varchar(200) NOT NULL,
  custom tinyint(1) NOT NULL DEFAULT '0',
  dataClass varchar(100) NOT NULL,
  dataDOMID varchar(100) NOT NULL,
  dataEntryOrder int(11) NOT NULL DEFAULT '0',
  dataHide tinyint(1) NOT NULL DEFAULT '0',
  dataManagerSectionID int(11) NOT NULL DEFAULT '0',
  dataStyle varchar(500) NOT NULL,
  dataTitle varchar(100) NOT NULL,
  defaultValue varchar(500) NOT NULL,
  displayLogic varchar(1000) NOT NULL,
  displayOrder int(11) NOT NULL DEFAULT '0',
  draggable tinyint(1) NOT NULL DEFAULT '0',
  formCode varchar(100) NOT NULL,
  formItemCode varchar(100) NOT NULL,
  formItemID int(11) NOT NULL AUTO_INCREMENT,
  formItemJoinReadOnly tinyint(1) NOT NULL DEFAULT '0',
  formItemLinkManagerID int(11) NOT NULL DEFAULT '0',
  formItemLinkManagerCode varchar(100) NOT NULL,
  formItemName varchar(100) NOT NULL,
  formItemNamePublic varchar(100) NOT NULL,
  formItemOverview varchar(500) NOT NULL,
  formItemSourceFileLocal tinyint(1) NOT NULL DEFAULT '0',
  formItemSourceFileName varchar(100) NOT NULL,
  formItemSourceFilePath varchar(200) NOT NULL,
  formItemType varchar(50) NOT NULL,
  formItemWebPageSectionID int(11) NOT NULL DEFAULT '0',
  hotKey varchar(10) NOT NULL,
  inputClass varchar(100) NOT NULL,
  inputStyle varchar(200) NOT NULL,
  inputType varchar(20) NOT NULL,
  instructions varchar(100) NOT NULL,
  joinOutput varchar(500) NOT NULL,
  joinSelectSQLLimitClause varchar(100) NOT NULL,
  joinSelectSQLOptionDisplay varchar(100) NOT NULL,
  joinSelectSQLOptionSelected varchar(100) NOT NULL,
  joinSelectSQLOptionValue varchar(100) NOT NULL,
  joinSelectSQLOrderByClause varchar(500) NOT NULL,
  joinSelectSQLStatement varchar(500) NOT NULL,
  joinSelectSQLWhereClause varchar(500) NOT NULL,
  joinSource varchar(2000) NOT NULL,
  joinSourceFileLocal tinyint(1) NOT NULL DEFAULT '0',
  joinSourceFileName varchar(100) NOT NULL,
  joinSourceFilePath varchar(200) NOT NULL,
  joinSQLTableCode varchar(100) NOT NULL,
  labelOnly tinyint(1) NOT NULL DEFAULT '0',
  labelText varchar(100) NOT NULL,
  linKMatchSQLTableCode varchar(100) NOT NULL,
  linkSourceTableCode varchar(100) NOT NULL,
  linkTypeCode varchar(100) NOT NULL,
  linkUpdateEntityRequestCode varchar(100) NOT NULL,
  mask varchar(100) NOT NULL,
  nonDataClass varchar(100) NOT NULL,
  nonDataDOMID varchar(100) NOT NULL,
  nonDataHide tinyint(1) NOT NULL DEFAULT '0',
  nonDataStyle varchar(500) NOT NULL,
  nonDataTitle varchar(100) NOT NULL,
  onBlur varchar(100) NOT NULL,
  onClick varchar(100) NOT NULL,
  onFocus varchar(100) NOT NULL,
  pickListCode varchar(100) NOT NULL,
  placeholder varchar(100) NOT NULL,
  positionLeft int(11) NOT NULL DEFAULT '0',
  positionTop int(11) NOT NULL DEFAULT '0',
  readOnly tinyint(1) NOT NULL DEFAULT '0',
  relationSQLTableID int(11) NOT NULL DEFAULT '0',
  selectListAllowReset tinyint(1) NOT NULL DEFAULT '0',
  selectListCode varchar(100) NOT NULL,
  sqlColumnCode varchar(100) NOT NULL,
  sqlTableCode varchar(100) NOT NULL,
  tabIndex smallint(6) NOT NULL DEFAULT '0',
  title varchar(100) NOT NULL,
  updateLogic varchar(500) NOT NULL,
  validationLogic varchar(500) NOT NULL,
  validationSequence int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (formItemID)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS twistParameter;
CREATE TABLE twistParameter (
  appSpecific tinyint(1) NOT NULL DEFAULT '0',
  clientCustomMetadata tinyint(1) NOT NULL DEFAULT '0',
  clientCustomValue tinyint(1) NOT NULL DEFAULT '0',
  clientDelete tinyint(1) NOT NULL DEFAULT '0',
  clientVisible tinyint(1) NOT NULL DEFAULT '0',
  isColor tinyint(1) NOT NULL DEFAULT '0',
  isSkin tinyint(1) NOT NULL DEFAULT '0',
  memberCode varchar(100) NOT NULL,
  memberCustomizable tinyint(1) NOT NULL DEFAULT '0',
  memberID int(11) NOT NULL DEFAULT '0',
  memberSpecific tinyint(1) NOT NULL DEFAULT '0',
  parameterCode varchar(100) NOT NULL,
  parameterID int(11) NOT NULL AUTO_INCREMENT,
  parameterName varchar(100) NOT NULL,
  parameterNamePublic varchar(100) NOT NULL,
  parameterOverview varchar(500) NOT NULL,
  parameterRoleID int(11) NOT NULL DEFAULT '0',
  parameterStatusLookupID int(11) NOT NULL DEFAULT '0',
  parameterTypeLookupID int(11) NOT NULL DEFAULT '0',
  parameterValueDateTime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  parameterValueInt int(11) NOT NULL DEFAULT '0',
  parameterValueTinyInt tinyint(1) NOT NULL DEFAULT '0',
  parameterValueType varchar(20) NOT NULL,
  parameterValueVarchar varchar(500) NOT NULL,
  roleSpecific tinyint(1) NOT NULL DEFAULT '0',
  skinCode varchar(100) NOT NULL,
  skinID int(11) NOT NULL DEFAULT '0',
  twistVersionID int(11) NOT NULL DEFAULT '0',
  webPageCode varchar(100) NOT NULL,
  websiteCode varchar(100) NOT NULL,
  websiteID int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (parameterID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS twistQuery;
CREATE TABLE twistQuery (
  orderByClause varchar(1000) NOT NULL,
  orderByClauseBackup varchar(1000) NOT NULL,
  orderByClauseMasterQueryID int(11) NOT NULL DEFAULT '0',
  orderByClauseMasterQueryCode varchar(100) NOT NULL,
  pagination varchar(100) NOT NULL,
  queryAppCode varchar(100) NOT NULL,
  queryCode varchar(100) NOT NULL,
  queryID int(11) NOT NULL AUTO_INCREMENT,
  queryName varchar(100) NOT NULL,
  queryNamePublic varchar(100) NOT NULL,
  queryOverview varchar(500) NOT NULL,
  queryStatement varchar(2000) NOT NULL,
  queryStatementBackup varchar(1000) NOT NULL,
  queryStatementMasterQueryCode varchar(100) NOT NULL,
  queryTitle varchar(100) NOT NULL,
  queryTypeAppQuick tinyint(1) NOT NULL DEFAULT '0',
  queryTypeAppSearch tinyint(1) NOT NULL DEFAULT '0',
  queryTypeDataManager tinyint(1) NOT NULL DEFAULT '0',
  queryTypeDataManagerSelect tinyint(1) NOT NULL DEFAULT '0',
  queryTypeDefault tinyint(1) NOT NULL DEFAULT '0',
  queryTypeFormItem tinyint(1) NOT NULL DEFAULT '0',
  queryTypeFormSelect tinyint(1) NOT NULL DEFAULT '0',
  queryTypeGlobalQuick tinyint(1) NOT NULL DEFAULT '0',
  queryTypeGlobalSearch tinyint(1) NOT NULL DEFAULT '0',
  queryTypeMassUpdate tinyint(1) NOT NULL DEFAULT '0',
  queryTypeMaster tinyint(1) NOT NULL DEFAULT '0',
  queryTypeMessage tinyint(1) NOT NULL DEFAULT '0',
  queryTypeWeb tinyint(1) NOT NULL DEFAULT '0',
  queryTypeWorkflow tinyint(1) NOT NULL DEFAULT '0',
  queryViewCodeDefault varchar(100) NOT NULL,
  quickQuery tinyint(1) NOT NULL DEFAULT '0',
  quickSearchQuery tinyint(1) NOT NULL DEFAULT '0',
  whereClause varchar(2000) NOT NULL,
  whereClauseBackup varchar(1000) NOT NULL,
  whereClauseMasterQueryCode varchar(100) NOT NULL,
  PRIMARY KEY (queryID)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS twistQueryView;
CREATE TABLE twistQueryView (
  queryViewCode varchar(100) NOT NULL,
  queryViewContent varchar(4000) NOT NULL,
  queryViewID int(11) NOT NULL AUTO_INCREMENT,
  queryViewName varchar(100) NOT NULL,
  queryViewNamePublic varchar(100) NOT NULL,
  queryViewOverview varchar(500) NOT NULL,
  queryViewStatusID int(11) NOT NULL DEFAULT '0',
  queryViewTitle varchar(100) NOT NULL,
  queryViewType varchar(20) NOT NULL,
  queryViewTypeDefault tinyint(1) NOT NULL DEFAULT '0',
  queryViewTypeID int(11) NOT NULL DEFAULT '0',
  sqlTableCode varchar(100) NOT NULL,
  PRIMARY KEY (queryViewID)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS twistQueryViewItem;
CREATE TABLE twistQueryViewItem (
  cssClass varchar(100) NOT NULL,
  cssID varchar(100) NOT NULL,
  cssStyle varchar(500) NOT NULL,
  displayOrder smallint(10) NOT NULL,
  queryViewCode varchar(100) NOT NULL,
  queryViewItemCode varchar(100) NOT NULL,
  queryViewItemID int(11) NOT NULL AUTO_INCREMENT,
  queryViewItemName varchar(100) NOT NULL,
  queryViewItemNamePublic varchar(100) NOT NULL,
  queryViewItemOverview varchar(1000) NOT NULL,
  queryViewItemSourceCode varchar(4000) NOT NULL,
  queryViewItemStatusID int(11) NOT NULL DEFAULT '0',
  queryViewItemStyleData varchar(500) NOT NULL,
  queryViewItemStyleHeader varchar(500) NOT NULL,
  queryViewItemTitle varchar(100) NOT NULL,
  queryViewItemTypeID int(11) NOT NULL DEFAULT '0',
  sqlColumnCode varchar(100) NOT NULL,
  sqlColumnCodeCustom varchar(8000) NOT NULL,
  PRIMARY KEY (queryViewItemID)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS twistSelectList;
CREATE TABLE twistSelectList (
  selectListCode varchar(100) NOT NULL,
  selectListContentVersionIDPrimaryExtraLarge int(11) NOT NULL DEFAULT '0',
  selectListContentVersionIDPrimaryExtraSmall int(11) NOT NULL DEFAULT '0',
  selectListContentVersionIDPrimaryLarge int(11) NOT NULL DEFAULT '0',
  selectListContentVersionIDPrimaryMacro int(11) NOT NULL DEFAULT '0',
  selectListContentVersionIDPrimaryMedium int(11) NOT NULL DEFAULT '0',
  selectListContentVersionIDPrimaryMicro int(11) NOT NULL DEFAULT '0',
  selectListContentVersionIDPrimarySmall int(11) NOT NULL DEFAULT '0',
  selectListCSSClassListItem varchar(200) NOT NULL,
  selectListCSSClassSelect varchar(200) NOT NULL,
  selectListCSSID varchar(100) NOT NULL,
  selectListCSSStyleListItem varchar(200) NOT NULL,
  selectListCSSStyleSelect varchar(200) NOT NULL,
  selectListID int(11) NOT NULL AUTO_INCREMENT,
  selectListItemDisplayOrder varchar(20) NOT NULL,
  selectListInsertedDateTime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  selectListInsertedMemberID int(11) NOT NULL DEFAULT '0',
  selectListName varchar(100) NOT NULL,
  selectListNamePublic varchar(100) NOT NULL,
  selectListOverview varchar(500) NOT NULL,
  selectListSourceFileLocal tinyint(1) NOT NULL DEFAULT '0',
  selectListSourceFileName varchar(100) NOT NULL,
  selectListSourceFilePath varchar(200) NOT NULL,
	selectListUpdatedDateTime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  selectListUpdatedMemberID int(11) DEFAULT '0',
  PRIMARY KEY (selectListID)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS twistSelectListItem;
CREATE TABLE twistSelectListItem (
  selectListContentVersionIDPrimaryExtraLarge int(11) NOT NULL DEFAULT '0',
  selectListContentVersionIDPrimaryExtraSmall int(11) NOT NULL DEFAULT '0',
  selectListContentVersionIDPrimaryLarge int(11) NOT NULL DEFAULT '0',
  selectListContentVersionIDPrimaryMacro int(11) NOT NULL DEFAULT '0',
  selectListContentVersionIDPrimaryMedium int(11) NOT NULL DEFAULT '0',
  selectListContentVersionIDPrimaryMicro int(11) NOT NULL DEFAULT '0',
  selectListContentVersionIDPrimarySmall int(11) NOT NULL DEFAULT '0',
  selectListCode varchar(200) NOT NULL,
  selectListItemCode varchar(100) NOT NULL,
  selectListItemCSSClass varchar(200) NOT NULL,
  selectListItemCSSID varchar(100) NOT NULL,
  selectListItemCSSStyle varchar(200) NOT NULL,
  selectListItemDisplayOrder int(11) NOT NULL DEFAULT '0',
  selectListItemID int(11) NOT NULL AUTO_INCREMENT,
  selectListItemInsertedDateTime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  selectListItemInsertedMemberID int(11) NOT NULL DEFAULT '0',
  selectListItemName varchar(100) NOT NULL,
  selectListItemNamePublic varchar(100) NOT NULL,
  selectListItemOverview varchar(500) NOT NULL,
  selectListItemSourceFileLocal tinyint(1) NOT NULL DEFAULT '0',
  selectListItemSourceFileName varchar(100) NOT NULL,
  selectListItemSourceFilePath varchar(200) NOT NULL,
  PRIMARY KEY (selectListItemID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS twistSQLTable;
CREATE TABLE twistSQLTable (
  clientTable tinyint(1) NOT NULL DEFAULT '0',
  clientVisible tinyint(1) NOT NULL DEFAULT '0',
  customMetadata tinyint(1) NOT NULL DEFAULT '0',
  linkableTable tinyint(1) NOT NULL DEFAULT '0',
  linkDataSQLTableID int(11) NOT NULL DEFAULT '0',
  linkSourceSQLTableID int(11) NOT NULL DEFAULT '0',
  linkTable tinyint(1) NOT NULL DEFAULT '0',
  sqlDatabaseID int(11) NOT NULL DEFAULT '0',
  sqlTableAlias varchar(100) NOT NULL,
  sqlTableCode varchar(100) NOT NULL,
  sqlTableCodeLink varchar(100) NOT NULL,
  sqlTableCodeLinkTitleCase varchar(100) NOT NULL,
  sqlTableGlobalPurge tinyint(1) NOT NULL DEFAULT '0',
  sqlTableID int(11) NOT NULL AUTO_INCREMENT,
  sqlTableName varchar(100) NOT NULL,
  sqlTableNamePublic varchar(100) NOT NULL,
  sqlTableOverview varchar(500) NOT NULL,
  sqlTablePrimaryIDCode varchar(100) NOT NULL,
  twistVersion varchar(10) NOT NULL,
  PRIMARY KEY (sqlTableID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

