Skip to content

Instantly share code, notes, and snippets.

@mattlevine
Forked from eballisty/rebuild.cfm
Last active May 27, 2018 20:12
Show Gist options
  • Save mattlevine/cfd3bd8d274cfd5c8c0c482823f40817 to your computer and use it in GitHub Desktop.
Save mattlevine/cfd3bd8d274cfd5c8c0c482823f40817 to your computer and use it in GitHub Desktop.
Rebuild Mura's default database indexes
<cfscript>
dbUtility.setTable('tcontent')
.addPrimaryKey('TContent_ID')
.addIndex('ContentID')
.addIndex('ContentHistID')
.addIndex('SiteID')
.addIndex('ParentID')
.addIndex('RemoteID')
.addIndex('ModuleID')
.addIndex('changesetID')
.addIndex('mobileExclude')
dbUtility.setTable('tcontentstats')
.addPrimaryKey('contentID,siteID')
dbUtility.setTable('tcontentassignments')
.addPrimaryKey('contentID,contentHistID,siteID,userID')
dbUtility.setTable('tcontentcategories')
.addPrimaryKey('categoryID')
.addIndex('siteID')
dbUtility.setTable('tcontentcategoryassign')
.addPrimaryKey('contentHistID,categoryID')
dbUtility.setTable('tcontentcomments')
.addPrimaryKey('commentid')
.addIndex('contentid')
dbUtility.setTable('tcontentfeedadvancedparams')
.addPrimaryKey('paramID')
dbUtility.setTable('tcontentfeeds')
.addPrimaryKey('feedID')
.addIndex('siteID')
dbUtility.setTable('tcontentobjects')
.addPrimaryKey('ContentHistID,ObjectID,Object,ColumnID')
.addIndex('SiteID')
dbUtility.setTable('tcontentratings')
.addPrimaryKey('contentID,userID,siteID')
.addIndex('entered')
dbUtility.setTable('tcontentrelated')
.addPrimaryKey('contentHistID,relatedID,contentID,siteID')
dbUtility.setTable('temails')
.addPrimaryKey('EmailID')
.addIndex('siteid')
dbUtility.setTable('tfiles')
.addPrimaryKey('fileID')
dbUtility.setTable('tformresponsepackets')
.addPrimaryKey('ResponseID')
.addIndex('FormID,SiteID')
dbUtility.setTable('tredirects')
.addPrimaryKey('redirectID')
dbUtility.setTable('tsessiontracking')
.addPrimaryKey('trackingID')
.addIndex('entered')
.addIndex('siteID')
.addIndex('contentID')
.addIndex('urlToken')
.addIndex('userID')
dbUtility.setTable('tuseraddresses')
.addPrimaryKey('addressID')
.addIndex('longitude')
.addIndex('latitude')
.addIndex('userID')
dbUtility.setTable('tusers')
.addPrimaryKey('userID')
dbUtility.setTable('tusersfavorites')
.addPrimaryKey('favoriteID')
dbUtility.setTable('tusersinterests')
.addPrimaryKey('userID,categoryID')
dbUtility.setTable('tusersmemb')
.addPrimaryKey('UserID,GroupID')
dbUtility.setTable('tcontentpublicsubmissionapprovals')
.addPrimaryKey('contentID,siteID')
dbUtility.setTable('tcontenttags')
.addPrimaryKey('tagID')
.addIndex('contentHistID')
.addIndex('siteID')
.addIndex('contentID')
.addIndex('tag')
dbUtility.setTable('tuserstags')
.addPrimaryKey('tagID')
.addIndex('userID')
.addIndex('siteID')
.addIndex('tag')
dbUtility.setTable('tclassextenddatauseractivity')
.addPrimaryKey('dataID')
.addIndex('baseID')
.addIndex('attributeID')
dbUtility.setTable('tclassextenddata')
.addPrimaryKey('dataID')
.addIndex('baseID')
.addIndex('attributeID')
dbUtility.setTable('tclassextend')
.addPrimaryKey('subTypeID')
dbUtility.setTable('tclassextendattributes')
.addPrimaryKey('attributeID')
.addIndex('extendSetID')
dbUtility.setTable('tclassextendsets')
.addPrimaryKey('extendSetID')
.addIndex('subTypeID')
dbUtility.setTable('tcontentfeeditems')
.addPrimaryKey('feedID,itemID');
dbUtility.setTable('tformresponsequestions')
.addPrimaryKey('responseID,formID,formfield');
dbUtility.setTable('tpermissions')
.addPrimaryKey('ContentID,GroupID,SiteID,Type');
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment