-- generator on mysql select concat( 'create ', if(s.NON_UNIQUE = 0, 'unique ', ''), 'index [', if(s.NON_UNIQUE = 0, 'UQ__', 'IDX__'), s.TABLE_NAME, '__', s.INDEX_NAME, '] on [', s.TABLE_NAME, '](', group_concat(concat('[', s.COLUMN_NAME, ']') order by s.SEQ_IN_INDEX separator ', '), ')', if( s.NON_UNIQUE = 0, concat( ' where ', group_concat(concat('[', s.COLUMN_NAME, '] is not null') order by s.SEQ_IN_INDEX separator ' and ') ), '' ), ';' ) from INFORMATION_SCHEMA.STATISTICS s where s.TABLE_SCHEMA = 'prj_carleyfoundry_import' and s.INDEX_NAME != 'PRIMARY' group by s.TABLE_SCHEMA, s.TABLE_NAME, s.INDEX_NAME -- generated on mssql /* create index [IDX__cf_AclResource__sorter] on [cf_AclResource]([sorter]); create unique index [UQ__cf_AclResource2Role__idAclResource] on [cf_AclResource2Role]([idAclResource], [idAclRole]) where [idAclResource] is not null and [idAclRole] is not null; create unique index [UQ__cf_AclResourcePrivilege__idAclResource] on [cf_AclResourcePrivilege]([idAclResource], [name]) where [idAclResource] is not null and [name] is not null; create index [IDX__cf_AclResourcePrivilege__sorter] on [cf_AclResourcePrivilege]([sorter]); create index [IDX__cf_AclRule__idAclResource] on [cf_AclRule]([idAclResource]); create index [IDX__cf_AclRule__idAclRole] on [cf_AclRule]([idAclRole]); create index [IDX__cf_AclRule__idRole] on [cf_AclRule]([idRole]); create index [IDX__cf_AclRule__sorter] on [cf_AclRule]([sorter]); create unique index [UQ__cf_Client__number] on [cf_Client]([number]) where [number] is not null; create index [IDX__cf_Department__name] on [cf_Department]([name]); create index [IDX__cf_Department__name_2] on [cf_Department]([name]); create unique index [UQ__cf_DepartmentAndProcessSorter__departmentId] on [cf_DepartmentAndProcessSorter]([departmentId], [processId]) where [departmentId] is not null and [processId] is not null; create index [IDX__cf_FormElement__formId] on [cf_FormElement]([formId]); create unique index [UQ__cf_FormElementProperty__alias] on [cf_FormElementProperty]([elementTypeId], [alias]) where [elementTypeId] is not null and [alias] is not null; create index [IDX__cf_FormElementPropertyValue__elementId] on [cf_FormElementPropertyValue]([elementId]); create index [IDX__cf_FormSubmission__idForm] on [cf_FormSubmission]([formId]); create index [IDX__cf_FormSubmissionValue__elementId] on [cf_FormSubmissionValue]([elementId]); create index [IDX__cf_FormSubmissionValue__submissionId] on [cf_FormSubmissionValue]([submissionId]); create index [IDX__cf_Media__partId] on [cf_Media]([partId]); create index [IDX__cf_Media__processId] on [cf_Media]([processId]); create index [IDX__cf_Part__currentVersion] on [cf_Part]([currentVersion]); create index [IDX__cf_Part2PartData__partId] on [cf_Part2PartData]([partId]); create index [IDX__cf_Part2Process__partId] on [cf_Part2Process]([partId]); create index [IDX__cf_Part2Process__processId] on [cf_Part2Process]([processId]); create index [IDX__cf_Part2ProcessData__partId] on [cf_Part2ProcessData]([processId]); create index [IDX__cf_Part2ProcessData__processId] on [cf_Part2ProcessData]([processId], [versionId], [setId]); create index [IDX__cf_PartVersion__partId] on [cf_PartVersion]([partId]); create index [IDX__cf_Process__name] on [cf_Process]([name]); create index [IDX__cf_Process__name_10] on [cf_Process]([name]); create index [IDX__cf_Process__name_11] on [cf_Process]([name]); create index [IDX__cf_Process__name_2] on [cf_Process]([name]); create index [IDX__cf_Process__name_3] on [cf_Process]([name]); create index [IDX__cf_Process__name_4] on [cf_Process]([name]); create index [IDX__cf_Process__name_5] on [cf_Process]([name]); create index [IDX__cf_Process__name_6] on [cf_Process]([name]); create index [IDX__cf_Process__name_7] on [cf_Process]([name]); create index [IDX__cf_Process__name_8] on [cf_Process]([name]); create index [IDX__cf_Process__name_9] on [cf_Process]([name]); create index [IDX__cf_Process2User__processId] on [cf_Process2User]([processId], [userId]); create index [IDX__cf_User__autologinCode] on [cf_User]([autologinCode]); create unique index [UQ__cf_User__email] on [cf_User]([email]) where [email] is not null; create unique index [UQ__cf_User__recoverCode] on [cf_User]([recoverCode]) where [recoverCode] is not null; create index [IDX__cf_User2Department__departmentId] on [cf_User2Department]([departmentId]); create index [IDX__cf_User2Department__userId] on [cf_User2Department]([userId]); create index [IDX__cf_User2Permission__permissionId] on [cf_User2Permission]([permissionId]); create index [IDX__cf_User2Permission__userId] on [cf_User2Permission]([userId]); create unique index [UQ__cf_zz_Admin__autologinCode] on [cf_zz_Admin]([autologinCode]) where [autologinCode] is not null; create unique index [UQ__cf_zz_Admin__email] on [cf_zz_Admin]([email]) where [email] is not null; create unique index [UQ__cf_zz_Admin__login] on [cf_zz_Admin]([login]) where [login] is not null; create index [IDX__cf_zz_Admin__remoteAuthEnabled] on [cf_zz_Admin]([remoteAuthEnabled]); create index [IDX__cf_zz_DLanguage__enabled] on [cf_zz_DLanguage]([enabled]); create unique index [UQ__cf_zz_DPageItemType__type] on [cf_zz_DPageItemType]([type]) where [type] is not null; create index [IDX__cf_zz_DPageOption__name] on [cf_zz_DPageOption]([name], [value]); create index [IDX__cf_zz_DraftHtmlBlockContent__id_block] on [cf_zz_DraftHtmlBlockContent]([idBlock]); create index [IDX__cf_zz_DraftPage__system] on [cf_zz_DraftPage]([system]); create index [IDX__cf_zz_DraftPageContent__id_page] on [cf_zz_DraftPageContent]([idPage]); create index [IDX__cf_zz_DraftPageItem__id_doc] on [cf_zz_DraftPageItem]([idPage]); create unique index [UQ__cf_zz_DraftPageItem__id_page] on [cf_zz_DraftPageItem]([idPage], [idGroup], [type], [number], [name]) where [idPage] is not null and [idGroup] is not null and [type] is not null and [number] is not null and [name] is not null; create index [IDX__cf_zz_DraftPageItemConfig__idItem] on [cf_zz_DraftPageItemConfig]([idItem]); create unique index [UQ__cf_zz_DraftPageItemConfig__idItem_2] on [cf_zz_DraftPageItemConfig]([idItem], [name]) where [idItem] is not null and [name] is not null; create unique index [UQ__cf_zz_DraftPageOption__idPage] on [cf_zz_DraftPageOption]([idPage], [name], [value]) where [idPage] is not null and [name] is not null and [value] is not null; create unique index [UQ__cf_zz_File__nameFs] on [cf_zz_File]([nameFs]) where [nameFs] is not null; create index [IDX__cf_zz_HtmlBlockContent__id_block] on [cf_zz_HtmlBlockContent]([idBlock]); create index [IDX__cf_zz_Log__added] on [cf_zz_Log]([added]); create index [IDX__cf_zz_Log__id_session] on [cf_zz_Log]([idSession]); create index [IDX__cf_zz_Log__ip] on [cf_zz_Log]([ip]); create index [IDX__cf_zz_Log__priority] on [cf_zz_Log]([priority]); create index [IDX__cf_zz_Log__server_name] on [cf_zz_Log]([serverName]); create index [IDX__cf_zz_Page__display_in_sitemap] on [cf_zz_Page]([showInSiteMap]); create unique index [UQ__cf_zz_Page__id_parent] on [cf_zz_Page]([idParent], [alias]) where [idParent] is not null and [alias] is not null; create index [IDX__cf_zz_Page__system] on [cf_zz_Page]([system]); create index [IDX__cf_zz_PageContent__id_doc] on [cf_zz_PageContent]([idPage]); create unique index [UQ__cf_zz_PageIndex__url] on [cf_zz_PageIndex]([url]) where [url] is not null; create index [IDX__cf_zz_PageItem__id_doc] on [cf_zz_PageItem]([idPage]); create unique index [UQ__cf_zz_PageItem__id_page] on [cf_zz_PageItem]([idPage], [idGroup], [type], [number], [name]) where [idPage] is not null and [idGroup] is not null and [type] is not null and [number] is not null and [name] is not null; create index [IDX__cf_zz_PageItemConfig__idItem] on [cf_zz_PageItemConfig]([idItem]); create unique index [UQ__cf_zz_PageItemConfig__idItem_2] on [cf_zz_PageItemConfig]([idItem], [name]) where [idItem] is not null and [name] is not null; create unique index [UQ__cf_zz_PageOption__idPage] on [cf_zz_PageOption]([idPage], [name], [value]) where [idPage] is not null and [name] is not null and [value] is not null; create index [IDX__cf_zz_SettingsOptions__name] on [cf_zz_SettingsOptions]([name]); */