diff --git a/specifyweb/specify/migrations/0042_add_indexes.py b/specifyweb/specify/migrations/0042_add_indexes.py new file mode 100644 index 00000000000..5db1d8bac30 --- /dev/null +++ b/specifyweb/specify/migrations/0042_add_indexes.py @@ -0,0 +1,735 @@ +# -*- coding: utf-8 -*- +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('specify', '0041_add_missing_schema_after_reorganization'), + ] + + operations = [ + # AgentIdentifier + migrations.AddIndex( + model_name='agentidentifier', + index=models.Index( + fields=['identifier'], + name='agentidentifier_identifier_idx', + ), + ), + migrations.AddIndex( + model_name='agentidentifier', + index=models.Index( + fields=['identifierType'], + name='agentidentifier_identifiertype_idx', + ), + ), + + # AgentSpecialty + migrations.AddIndex( + model_name='agentspecialty', + index=models.Index( + fields=['orderNumber'], + name='agentspecialty_ordernumber_idx', + ), + ), + migrations.AddIndex( + model_name='agentspecialty', + index=models.Index( + fields=['specialtyName'], + name='agentspecialty_specialtyname_idx', + ), + ), + + # AgentVariant + migrations.AddIndex( + model_name='agentvariant', + index=models.Index( + fields=['name'], + name='agentvariant_name_idx', + ), + ), + + # Attachment + migrations.AddIndex( + model_name='attachment', + index=models.Index( + fields=['origFilename'], + name='attachment_origfilename_idx', + ), + ), + + # Spdataset (attachmentdataset) + migrations.AddIndex( + model_name='spdataset', + index=models.Index( + fields=['name'], + name='spdataset_name_idx', + ), + ), + + # AttachmentMetadata + migrations.AddIndex( + model_name='attachmentmetadata', + index=models.Index( + fields=['name'], + name='attachmentmetadata_name_idx', + ), + ), + + # Author + migrations.AddIndex( + model_name='author', + index=models.Index( + fields=['orderNumber'], + name='author_ordernumber_idx', + ), + ), + + # CollectionObject + migrations.AddIndex( + model_name='collectionobject', + index=models.Index( + fields=['name'], + name='collectionobject_name_idx', + ), + ), + migrations.AddIndex( + model_name='collectionobject', + index=models.Index( + fields=['projectNumber'], + name='collectionobject_projectnumber_idx', + ), + ), + + # CollectionObjectGroup + migrations.AddIndex( + model_name='collectionobjectgroup', + index=models.Index( + fields=['guid'], + name='collectionobjectgroup_guid_idx', + ), + ), + migrations.AddIndex( + model_name='collectionobjectgroup', + index=models.Index( + fields=['name'], + name='collectionobjectgroup_name_idx', + ), + ), + + # CollectionObjectGroupType + migrations.AddIndex( + model_name='collectionobjectgrouptype', + index=models.Index( + fields=['name'], + name='collectionobjectgroupt_name_idx', + ), + ), + + # CollectionObjectProperty + migrations.AddIndex( + model_name='collectionobjectproperty', + index=models.Index( + fields=['guid'], + name='collectionobjectprop_guid_idx', + ), + ), + + # CollectionObjectType + migrations.AddIndex( + model_name='collectionobjecttype', + index=models.Index( + fields=['name'], + name='collectionobjecttype_name_idx', + ), + ), + + # CollectionRelType + migrations.AddIndex( + model_name='collectionreltype', + index=models.Index( + fields=['name'], + name='collectionreltype_name_idx', + ), + ), + + # ExchangeIn + migrations.AddIndex( + model_name='exchangein', + index=models.Index( + fields=['exchangeInNumber'], + name='exchangein_exchangeinnumber_idx', + ), + ), + + # ExsiccataItem + migrations.AddIndex( + model_name='exsiccataitem', + index=models.Index( + fields=['number'], + name='exsiccataitem_number_idx', + ), + ), + + # Geography + migrations.AddIndex( + model_name='geography', + index=models.Index( + fields=['commonName'], + name='geography_commonname_idx', + ), + ), + migrations.AddIndex( + model_name='geography', + index=models.Index( + fields=['guid'], + name='geography_guid_idx', + ), + ), + migrations.AddIndex( + model_name='geography', + index=models.Index( + fields=['highestChildNodeNumber'], + name='geography_highchildnodenumb_idx', + ), + ), + migrations.AddIndex( + model_name='geography', + index=models.Index( + fields=['nodeNumber'], + name='geography_nodenumber_idx', + ), + ), + + # GeographyTreeDef + migrations.AddIndex( + model_name='geographytreedef', + index=models.Index( + fields=['name'], + name='geographytreedef_name_idx', + ), + ), + + # GeographyTreeDefItem + migrations.AddIndex( + model_name='geographytreedefitem', + index=models.Index( + fields=['name'], + name='geogtreedefitem_name_idx', + ), + ), + + # GeologicTimePeriod + migrations.AddIndex( + model_name='geologictimeperiod', + index=models.Index( + fields=['highestChildNodeNumber'], + name='geotime_highchildnodenumb_idx', + ), + ), + migrations.AddIndex( + model_name='geologictimeperiod', + index=models.Index( + fields=['nodeNumber'], + name='geotime_nodenumber_idx', + ), + ), + + # GeologicTimePeriodTreeDef + migrations.AddIndex( + model_name='geologictimeperiodtreedef', + index=models.Index( + fields=['name'], + name='geotimetreedef_name_idx', + ), + ), + + # GeologicTimePeriodTreeDefItem + migrations.AddIndex( + model_name='geologictimeperiodtreedefitem', + index=models.Index( + fields=['name'], + name='geotimetreedefitem_name_idx', + ), + ), + + # InstitutionNetwork + migrations.AddIndex( + model_name='institutionnetwork', + index=models.Index( + fields=['altName'], + name='institutionnetwork_altname_idx', + ), + ), + + # LatLonPolygon + migrations.AddIndex( + model_name='latlonpolygon', + index=models.Index( + fields=['name'], + name='latlonpolygon_name_idx', + ), + ), + + # LithoStrat + migrations.AddIndex( + model_name='lithostrat', + index=models.Index( + fields=['highestChildNodeNumber'], + name='lithostrat_highchildnodenumb_idx', + ), + ), + migrations.AddIndex( + model_name='lithostrat', + index=models.Index( + fields=['nodeNumber'], + name='lithostrat_nodenumber_idx', + ), + ), + + # LithoStratTreeDef + migrations.AddIndex( + model_name='lithostrattreedef', + index=models.Index( + fields=['name'], + name='lithostratdef_name_idx', + ), + ), + + # LithoStratTreeDefItem + migrations.AddIndex( + model_name='lithostrattreedefitem', + index=models.Index( + fields=['name'], + name='lithostratdefitem_name_idx', + ), + ), + + # Locality + migrations.AddIndex( + model_name='locality', + index=models.Index( + fields=['guid'], + name='locality_guid_idx', + ), + ), + + # LocalityUpdateRowResult + migrations.AddIndex( + model_name='localityupdaterowresult', + index=models.Index( + fields=['rownumber'], + name='locupdaterow_rownumber_idx', + ), + ), + + # MaterialSample + migrations.AddIndex( + model_name='materialsample', + index=models.Index( + fields=['guid'], + name='materialsample_guid_idx', + ), + ), + + # MorphBankView + migrations.AddIndex( + model_name='morphbankview', + index=models.Index( + fields=['viewName'], + name='morphbankview_viewname_idx', + ), + ), + + # OtherIdentifier + migrations.AddIndex( + model_name='otheridentifier', + index=models.Index( + fields=['identifier'], + name='otheridentifier_identifier_idx', + ), + ), + + # PickList + migrations.AddIndex( + model_name='picklist', + index=models.Index( + fields=['fieldName'], + name='picklist_fieldname_idx', + ), + ), + migrations.AddIndex( + model_name='picklist', + index=models.Index( + fields=['filterFieldName'], + name='picklist_filterfieldname_idx', + ), + ), + migrations.AddIndex( + model_name='picklist', + index=models.Index( + fields=['tableName'], + name='picklist_tablename_idx', + ), + ), + + # PreparationProperty + migrations.AddIndex( + model_name='preparationproperty', + index=models.Index( + fields=['guid'], + name='preparationprop_guid_idx', + ), + ), + + # PrepType + migrations.AddIndex( + model_name='preptype', + index=models.Index( + fields=['name'], + name='preptype_name_idx', + ), + ), + + # ReferenceWork + migrations.AddIndex( + model_name='referencework', + index=models.Index( + fields=['libraryNumber'], + name='referencework_librarynumber_idx', + ), + ), + + # RelativeAge + migrations.AddIndex( + model_name='relativeage', + index=models.Index( + fields=['verbatimName'], + name='relativeage_verbatimname_idx', + ), + ), + + # SpAuditLogField + migrations.AddIndex( + model_name='spauditlogfield', + index=models.Index( + fields=['fieldName'], + name='spauditlogfield_fieldname_idx', + ), + ), + + # Spdataset (again; same as above, safe but redundant if both kept) + # (Kept single index definition above.) + + # SpecifyUser + migrations.AddIndex( + model_name='specifyuser', + index=models.Index( + fields=['name'], + name='specifyuser_name_idx', + ), + ), + + # SpExportSchema + migrations.AddIndex( + model_name='spexportschema', + index=models.Index( + fields=['schemaName'], + name='spexportschema_schemaname_idx', + ), + ), + + # SpExportSchemaItem + migrations.AddIndex( + model_name='spexportschemaitem', + index=models.Index( + fields=['fieldName'], + name='spexpschemaitem_fieldname_idx', + ), + ), + + # SpExportSchemaItemMapping + migrations.AddIndex( + model_name='spexportschemaitemmapping', + index=models.Index( + fields=['exportedFieldName'], + name='spexpschemaitemmap_expfield_idx', + ), + ), + + # SpExportSchemaMapping + migrations.AddIndex( + model_name='spexportschemamapping', + index=models.Index( + fields=['mappingName'], + name='spexpschemamap_mappingname_idx', + ), + ), + + # SpFieldValueDefault + migrations.AddIndex( + model_name='spfieldvaluedefault', + index=models.Index( + fields=['fieldName'], + name='spfieldvaluedef_fieldname_idx', + ), + ), + migrations.AddIndex( + model_name='spfieldvaluedefault', + index=models.Index( + fields=['tableName'], + name='spfieldvaluedef_tablename_idx', + ), + ), + + # LibraryRole (splibraryrole) + migrations.AddIndex( + model_name='libraryrole', + index=models.Index( + fields=['name'], + name='libraryrole_name_idx', + ), + ), + + # SpLocaleContainer + migrations.AddIndex( + model_name='splocalecontainer', + index=models.Index( + fields=['pickListName'], + name='splocalecont_picklistname_idx', + ), + ), + + # SpLocaleContainerItem + migrations.AddIndex( + model_name='splocalecontaineritem', + index=models.Index( + fields=['pickListName'], + name='splocalecontitem_picklist_idx', + ), + ), + migrations.AddIndex( + model_name='splocalecontaineritem', + index=models.Index( + fields=['webLinkName'], + name='splocalecontitem_weblink_idx', + ), + ), + + # SpMerging + migrations.AddIndex( + model_name='spmerging', + index=models.Index( + fields=['name'], + name='spmerging_name_idx', + ), + ), + + # SpPermission + migrations.AddIndex( + model_name='sppermission', + index=models.Index( + fields=['name'], + name='sppermission_name_idx', + ), + ), + + # SpPrincipal + migrations.AddIndex( + model_name='spprincipal', + index=models.Index( + fields=['name'], + name='spprincipal_name_idx', + ), + ), + + # SpQuery + migrations.AddIndex( + model_name='spquery', + index=models.Index( + fields=['contextName'], + name='spquery_contextname_idx', + ), + ), + + # SpQueryField + migrations.AddIndex( + model_name='spqueryfield', + index=models.Index( + fields=['fieldName'], + name='spqueryfield_fieldname_idx', + ), + ), + migrations.AddIndex( + model_name='spqueryfield', + index=models.Index( + fields=['formatName'], + name='spqueryfield_formatname_idx', + ), + ), + + # Role (sprole) + migrations.AddIndex( + model_name='role', + index=models.Index( + fields=['name'], + name='role_name_idx', + ), + ), + + # SpViewSetObj + migrations.AddIndex( + model_name='spviewsetobj', + index=models.Index( + fields=['fileName'], + name='spviewsetobj_filename_idx', + ), + ), + + # Storage + migrations.AddIndex( + model_name='storage', + index=models.Index( + fields=['highestChildNodeNumber'], + name='storage_highchildnodenumb_idx', + ), + ), + migrations.AddIndex( + model_name='storage', + index=models.Index( + fields=['nodeNumber'], + name='storage_nodenumber_idx', + ), + ), + + # StorageTreeDef + migrations.AddIndex( + model_name='storagetreedef', + index=models.Index( + fields=['name'], + name='storagetreedef_name_idx', + ), + ), + + # StorageTreeDefItem + migrations.AddIndex( + model_name='storagetreedefitem', + index=models.Index( + fields=['name'], + name='storagetreedefitem_name_idx', + ), + ), + + # Taxon + migrations.AddIndex( + model_name='taxon', + index=models.Index( + fields=['cultivarName'], + name='taxon_cultivarname_idx', + ), + ), + migrations.AddIndex( + model_name='taxon', + index=models.Index( + fields=['groupNumber'], + name='taxon_groupnumber_idx', + ), + ), + migrations.AddIndex( + model_name='taxon', + index=models.Index( + fields=['highestChildNodeNumber'], + name='taxon_highchildnodenumb_idx', + ), + ), + migrations.AddIndex( + model_name='taxon', + index=models.Index( + fields=['nodeNumber'], + name='taxon_nodenumber_idx', + ), + ), + + # TaxonTreeDef + migrations.AddIndex( + model_name='taxontreedef', + index=models.Index( + fields=['name'], + name='taxontreedef_name_idx', + ), + ), + + # TaxonTreeDefItem + migrations.AddIndex( + model_name='taxontreedefitem', + index=models.Index( + fields=['name'], + name='taxontreedefitem_name_idx', + ), + ), + + # TectonicUnit + migrations.AddIndex( + model_name='tectonicunit', + index=models.Index( + fields=['fullName'], + name='tectonicunit_fullname_idx', + ), + ), + migrations.AddIndex( + model_name='tectonicunit', + index=models.Index( + fields=['guid'], + name='tectonicunit_guid_idx', + ), + ), + migrations.AddIndex( + model_name='tectonicunit', + index=models.Index( + fields=['highestChildNodeNumber'], + name='tectonicunit_highchildnumb_idx', + ), + ), + migrations.AddIndex( + model_name='tectonicunit', + index=models.Index( + fields=['name'], + name='tectonicunit_name_idx', + ), + ), + migrations.AddIndex( + model_name='tectonicunit', + index=models.Index( + fields=['nodeNumber'], + name='tectonicunit_nodenumber_idx', + ), + ), + + # TectonicUnitTreeDef + migrations.AddIndex( + model_name='tectonicunittreedef', + index=models.Index( + fields=['name'], + name='tectunitdef_name_idx', + ), + ), + + # TectonicUnitTreeDefItem + migrations.AddIndex( + model_name='tectonicunittreedefitem', + index=models.Index( + fields=['name'], + name='tectunitdefitem_name_idx', + ), + ), + + # VoucherRelationship + migrations.AddIndex( + model_name='voucherrelationship', + index=models.Index( + fields=['voucherNumber'], + name='voucherrel_vouchernumber_idx', + ), + ), + ] \ No newline at end of file diff --git a/specifyweb/specify/models.py b/specifyweb/specify/models.py index 4e991d02ecb..86c27d935a4 100644 --- a/specifyweb/specify/models.py +++ b/specifyweb/specify/models.py @@ -431,6 +431,10 @@ class Agentidentifier(models.Model): class Meta: db_table = 'agentidentifier' ordering = () + indexes = [ + models.Index(fields=['identifier'], name='agentidentifier_identifier_idx'), + models.Index(fields=['identifiertype'], name='agentidentifier_identifiertype_idx'), + ] save = partialmethod(custom_save) @@ -457,6 +461,10 @@ class Meta: db_table = 'agentspecialty' ordering = () unique_together = (('agent', 'ordernumber'),) + indexes = [ + models.Index(fields=['ordernumber'], name='agentspecialty_ordernumber_idx'), + models.Index(fields=['specialtyname'], name='agentspecialty_specialtyname_idx'), + ] save = partialmethod(custom_save) @@ -485,6 +493,9 @@ class Agentvariant(models.Model): class Meta: db_table = 'agentvariant' ordering = () + indexes = [ + models.Index(fields=['name'], name='agentvariant_name_idx'), + ] save = partialmethod(custom_save) @@ -572,7 +583,8 @@ class Meta: models.Index(fields=['dateimaged'], name='DateImagedIDX'), models.Index(fields=['scopeid'], name='AttchScopeIDIDX'), models.Index(fields=['scopetype'], name='AttchScopeTypeIDX'), - models.Index(fields=['guid'], name='AttchmentGuidIDX') + models.Index(fields=['guid'], name='AttchmentGuidIDX'), + models.Index(fields=['origfilename'], name='attachment_origfilename_idx'), ] @@ -639,6 +651,9 @@ class Attachmentmetadata(models.Model): class Meta: db_table = 'attachmentmetadata' ordering = () + indexes = [ + models.Index(fields=['name'], name='attachmentmetadata_name_idx'), + ] save = partialmethod(custom_save) @@ -717,6 +732,9 @@ class Meta: db_table = 'author' ordering = ('ordernumber',) unique_together = (('referencework', 'agent'),) + indexes = [ + models.Index(fields=['ordernumber'], name='author_ordernumber_idx'), + ] save = partialmethod(custom_save) @@ -1490,7 +1508,9 @@ class Meta: models.Index(fields=['uniqueidentifier'], name='COUniqueIdentifierIDX'), models.Index(fields=['altcatalognumber'], name='AltCatalogNumberIDX'), models.Index(fields=['guid'], name='ColObjGuidIDX'), - models.Index(fields=['collectionmemberid'], name='COColMemIDX') + models.Index(fields=['collectionmemberid'], name='COColMemIDX'), + models.Index(fields=['name'], name='collectionobject_name_idx'), + models.Index(fields=['projectnumber'], name='collectionobject_projectnumber_idx'), ] @@ -1921,7 +1941,8 @@ class Meta: db_table = 'collectionobjectproperty' ordering = () indexes = [ - models.Index(fields=['collectionmemberid'], name='COLOBJPROPColMemIDX') + models.Index(fields=['collectionmemberid'], name='COLOBJPROPColMemIDX'), + models.Index(fields=['guid'], name='collectionobjectprop_guid_idx'), ] @@ -1949,6 +1970,9 @@ class Collectionreltype(models.Model): class Meta: db_table = 'collectionreltype' ordering = () + indexes = [ + models.Index(fields=['name'], name='collectionreltype_name_idx'), + ] save = partialmethod(custom_save) @@ -3096,7 +3120,8 @@ class Meta: ordering = () indexes = [ models.Index(fields=['exchangedate'], name='ExchangeDateIDX'), - models.Index(fields=['descriptionofmaterial'], name='DescriptionOfMaterialIDX') + models.Index(fields=['descriptionofmaterial'], name='DescriptionOfMaterialIDX'), + models.Index(fields=['exchangeinnumber'], name='exchangein_exchangeinnumber_idx'), ] @@ -3316,6 +3341,9 @@ class Exsiccataitem(models.Model): class Meta: db_table = 'exsiccataitem' ordering = () + indexes = [ + models.Index(fields=['number'], name='exsiccataitem_number_idx'), + ] save = partialmethod(custom_save) @@ -3668,7 +3696,11 @@ class Meta: ordering = () indexes = [ models.Index(fields=['name'], name='GeoNameIDX'), - models.Index(fields=['fullname'], name='GeoFullNameIDX') + models.Index(fields=['fullname'], name='GeoFullNameIDX'), + models.Index(fields=['commonname'], name='geography_commonname_idx'), + models.Index(fields=['guid'], name='geography_guid_idx'), + models.Index(fields=['highestchildnodenumber'], name='geography_highchildnodenumb_idx'), + models.Index(fields=['nodenumber'], name='geography_nodenumber_idx'), ] @@ -3696,6 +3728,9 @@ class Geographytreedef(models.Model): class Meta: db_table = 'geographytreedef' ordering = () + indexes = [ + models.Index(fields=['name'], name='geographytreedef_name_idx'), + ] save = partialmethod(custom_save) @@ -3729,6 +3764,9 @@ class Geographytreedefitem(model_extras.Geographytreedefitem): class Meta: db_table = 'geographytreedefitem' ordering = () + indexes = [ + models.Index(fields=['name'], name='geogtreedefitem_name_idx'), + ] save = partialmethod(custom_save) @@ -3774,7 +3812,9 @@ class Meta: indexes = [ models.Index(fields=['name'], name='GTPNameIDX'), models.Index(fields=['fullname'], name='GTPFullNameIDX'), - models.Index(fields=['guid'], name='GTPGuidIDX') + models.Index(fields=['guid'], name='GTPGuidIDX'), + models.Index(fields=['highestchildnodenumber'], name='geotime_highchildnodenumb_idx'), + models.Index(fields=['nodenumber'], name='geotime_nodenumber_idx'), ] @@ -3802,6 +3842,9 @@ class Geologictimeperiodtreedef(models.Model): class Meta: db_table = 'geologictimeperiodtreedef' ordering = () + indexes = [ + models.Index(fields=['name'], name='geotimetreedef_name_idx'), + ] save = partialmethod(custom_save) @@ -3835,6 +3878,9 @@ class Geologictimeperiodtreedefitem(model_extras.Geologictimeperiodtreedefitem): class Meta: db_table = 'geologictimeperiodtreedefitem' ordering = () + indexes = [ + models.Index(fields=['name'], name='geotimetreedefitem_name_idx'), + ] save = partialmethod(custom_save) @@ -4147,7 +4193,8 @@ class Meta: db_table = 'institutionnetwork' ordering = () indexes = [ - models.Index(fields=['name'], name='InstNetworkNameIDX') + models.Index(fields=['name'], name='InstNetworkNameIDX'), + models.Index(fields=['altname'], name='institutionnetwork_altname_idx'), ] @@ -4209,6 +4256,9 @@ class Latlonpolygon(models.Model): class Meta: db_table = 'latlonpolygon' ordering = () + indexes = [ + models.Index(fields=['name'], name='latlonpolygon_name_idx'), + ] save = partialmethod(custom_save) @@ -4273,7 +4323,9 @@ class Meta: indexes = [ models.Index(fields=['name'], name='LithoNameIDX'), models.Index(fields=['fullname'], name='LithoFullNameIDX'), - models.Index(fields=['guid'], name='LithoGuidIDX') + models.Index(fields=['guid'], name='LithoGuidIDX'), + models.Index(fields=['highestchildnodenumber'], name='lithostrat_highchildnodenumb_idx'), + models.Index(fields=['nodenumber'], name='lithostrat_nodenumber_idx'), ] @@ -4301,6 +4353,9 @@ class Lithostrattreedef(models.Model): class Meta: db_table = 'lithostrattreedef' ordering = () + indexes = [ + models.Index(fields=['name'], name='lithostratdef_name_idx'), + ] save = partialmethod(custom_save) @@ -4334,6 +4389,9 @@ class Lithostrattreedefitem(model_extras.Lithostrattreedefitem): class Meta: db_table = 'lithostrattreedefitem' ordering = () + indexes = [ + models.Index(fields=['name'], name='lithostratdefitem_name_idx'), + ] save = partialmethod(custom_save) @@ -4603,7 +4661,8 @@ class Meta: models.Index(fields=['discipline'], name='LocalityDisciplineIDX'), models.Index(fields=['namedplace'], name='NamedPlaceIDX'), models.Index(fields=['uniqueidentifier'], name='LocalityUniqueIdentifierIDX'), - models.Index(fields=['relationtonamedplace'], name='RelationToNamedPlaceIDX') + models.Index(fields=['relationtonamedplace'], name='RelationToNamedPlaceIDX'), + models.Index(fields=['guid'], name='locality_guid_idx'), ] @@ -4829,7 +4888,8 @@ class Meta: db_table = 'materialsample' ordering = () indexes = [ - models.Index(fields=['ggbn_sampledesignation'], name='DesignationIDX') + models.Index(fields=['ggbn_sampledesignation'], name='DesignationIDX'), + models.Index(fields=['guid'], name='materialsample_guid_idx'), ] @@ -4862,6 +4922,9 @@ class Morphbankview(models.Model): class Meta: db_table = 'morphbankview' ordering = () + indexes = [ + models.Index(fields=['viewname'], name='morphbankview_viewname_idx'), + ] save = partialmethod(custom_save) @@ -4905,6 +4968,9 @@ class Otheridentifier(models.Model): class Meta: db_table = 'otheridentifier' ordering = () + indexes = [ + models.Index(fields=['identifier'], name='otheridentifier_identifier_idx'), + ] indexes = [ models.Index(fields=['collectionmemberid'], name='OthIdColMemIDX') ] @@ -5101,7 +5167,10 @@ class Meta: db_table = 'picklist' ordering = () indexes = [ - models.Index(fields=['name'], name='PickListNameIDX') + models.Index(fields=['name'], name='PickListNameIDX'), + models.Index(fields=['fieldname'], name='picklist_fieldname_idx'), + models.Index(fields=['filterfieldname'], name='picklist_filterfieldname_idx'), + models.Index(fields=['tablename'], name='picklist_tablename_idx'), ] @@ -5154,6 +5223,9 @@ class Preptype(models.Model): class Meta: db_table = 'preptype' ordering = () + indexes = [ + models.Index(fields=['name'], name='preptype_name_idx'), + ] save = partialmethod(custom_save) @@ -5545,7 +5617,8 @@ class Meta: db_table = 'preparationproperty' ordering = () indexes = [ - models.Index(fields=['collectionmemberid'], name='PREPPROPColMemIDX') + models.Index(fields=['collectionmemberid'], name='PREPPROPColMemIDX'), + models.Index(fields=['guid'], name='preparationprop_guid_idx'), ] @@ -5695,7 +5768,8 @@ class Meta: models.Index(fields=['title'], name='RefWrkTitleIDX'), models.Index(fields=['publisher'], name='RefWrkPublisherIDX'), models.Index(fields=['guid'], name='RefWrkGuidIDX'), - models.Index(fields=['isbn'], name='ISBNIDX') + models.Index(fields=['isbn'], name='ISBNIDX'), + models.Index(fields=['librarynumber'], name='referencework_librarynumber_idx'), ] @@ -6019,6 +6093,9 @@ class Spauditlogfield(models.Model): class Meta: db_table = 'spauditlogfield' ordering = () + indexes = [ + models.Index(fields=['fieldname'], name='spauditlogfield_fieldname_idx'), + ] save = partialmethod(custom_save) @@ -6045,6 +6122,9 @@ class Spexportschema(models.Model): class Meta: db_table = 'spexportschema' ordering = () + indexes = [ + models.Index(fields=['schemaname'], name='spexportschema_schemaname_idx'), + ] save = partialmethod(custom_save) @@ -6073,6 +6153,9 @@ class Spexportschemaitem(models.Model): class Meta: db_table = 'spexportschemaitem' ordering = () + indexes = [ + models.Index(fields=['fieldname'], name='spexpschemaitem_fieldname_idx'), + ] save = partialmethod(custom_save) @@ -6102,6 +6185,9 @@ class Spexportschemaitemmapping(models.Model): class Meta: db_table = 'spexportschemaitemmapping' ordering = () + indexes = [ + models.Index(fields=['exportedfieldname'], name='spexpschemaitemmap_expfield_idx'), + ] save = partialmethod(custom_save) @@ -6129,7 +6215,8 @@ class Meta: db_table = 'spexportschemamapping' ordering = () indexes = [ - models.Index(fields=['collectionmemberid'], name='SPEXPSCHMMAPColMemIDX') + models.Index(fields=['collectionmemberid'], name='SPEXPSCHMMAPColMemIDX'), + models.Index(fields=['mappingname'], name='spexpschemamap_mappingname_idx'), ] @@ -6159,7 +6246,9 @@ class Meta: db_table = 'spfieldvaluedefault' ordering = () indexes = [ - models.Index(fields=['collectionmemberid'], name='SpFieldValueDefaultColMemIDX') + models.Index(fields=['collectionmemberid'], name='SpFieldValueDefaultColMemIDX'), + models.Index(fields=['fieldname'], name='spfieldvaluedef_fieldname_idx'), + models.Index(fields=['tablename'], name='spfieldvaluedef_tablename_idx'), ] @@ -6195,7 +6284,8 @@ class Meta: db_table = 'splocalecontainer' ordering = () indexes = [ - models.Index(fields=['name'], name='SpLocaleContainerNameIDX') + models.Index(fields=['name'], name='SpLocaleContainerNameIDX'), + models.Index(fields=['picklistname'], name='splocalecont_picklistname_idx'), ] @@ -6230,7 +6320,9 @@ class Meta: db_table = 'splocalecontaineritem' ordering = () indexes = [ - models.Index(fields=['name'], name='SpLocaleContainerItemNameIDX') + models.Index(fields=['name'], name='SpLocaleContainerItemNameIDX'), + models.Index(fields=['picklistname'], name='splocalecontitem_picklist_idx'), + models.Index(fields=['weblinkname'], name='splocalecontitem_weblink_idx'), ] @@ -6285,6 +6377,9 @@ class Sppermission(models.Model): class Meta: db_table = 'sppermission' ordering = () + indexes = [ + models.Index(fields=['name'], name='sppermission_name_idx'), + ] save = partialmethod(custom_save) @@ -6312,6 +6407,9 @@ class Spprincipal(models.Model): class Meta: db_table = 'spprincipal' ordering = () + indexes = [ + models.Index(fields=['name'], name='spprincipal_name_idx'), + ] save = partialmethod(custom_save) @@ -6348,7 +6446,8 @@ class Meta: db_table = 'spquery' ordering = () indexes = [ - models.Index(fields=['name'], name='SpQueryNameIDX') + models.Index(fields=['name'], name='SpQueryNameIDX'), + models.Index(fields=['contextname'], name='spquery_contextname_idx'), ] @@ -6392,6 +6491,10 @@ class Spqueryfield(models.Model): class Meta: db_table = 'spqueryfield' ordering = ('position',) + indexes = [ + models.Index(fields=['fieldname'], name='spqueryfield_fieldname_idx'), + models.Index(fields=['formatname'], name='spqueryfield_formatname_idx'), + ] save = partialmethod(custom_save) @@ -6550,7 +6653,8 @@ class Meta: db_table = 'spviewsetobj' ordering = () indexes = [ - models.Index(fields=['name'], name='SpViewObjNameIDX') + models.Index(fields=['name'], name='SpViewObjNameIDX'), + models.Index(fields=['filename'], name='spviewsetobj_filename_idx'), ] @@ -6612,6 +6716,9 @@ class Specifyuser(model_extras.Specifyuser): class Meta: db_table = 'specifyuser' ordering = () + indexes = [ + models.Index(fields=['name'], name='specifyuser_name_idx'), + ] # save = partialmethod(custom_save) @@ -6654,7 +6761,9 @@ class Meta: ordering = () indexes = [ models.Index(fields=['name'], name='StorNameIDX'), - models.Index(fields=['fullname'], name='StorFullNameIDX') + models.Index(fields=['fullname'], name='StorFullNameIDX'), + models.Index(fields=['highestchildnodenumber'], name='storage_highchildnodenumb_idx'), + models.Index(fields=['nodenumber'], name='storage_nodenumber_idx'), ] @@ -6708,6 +6817,9 @@ class Storagetreedef(models.Model): class Meta: db_table = 'storagetreedef' ordering = () + indexes = [ + models.Index(fields=['name'], name='storagetreedef_name_idx'), + ] save = partialmethod(custom_save) @@ -6741,6 +6853,9 @@ class Storagetreedefitem(model_extras.Storagetreedefitem): class Meta: db_table = 'storagetreedefitem' ordering = () + indexes = [ + models.Index(fields=['name'], name='storagetreedefitem_name_idx'), + ] save = partialmethod(custom_save) @@ -6859,7 +6974,11 @@ class Meta: models.Index(fields=['commonname'], name='TaxonCommonNameIDX'), models.Index(fields=['name'], name='TaxonNameIDX'), models.Index(fields=['fullname'], name='TaxonFullNameIDX'), - models.Index(fields=['environmentalprotectionstatus'], name='EPSIDX') # Avoid error: The index name 'EnvironmentalProtectionStatusIDX' cannot be longer than 30 characters. + models.Index(fields=['environmentalprotectionstatus'], name='EPSIDX'), # Avoid error: The index name 'EnvironmentalProtectionStatusIDX' cannot be longer than 30 characters. + models.Index(fields=['cultivarname'], name='taxon_cultivarname_idx'), + models.Index(fields=['groupnumber'], name='taxon_groupnumber_idx'), + models.Index(fields=['highestchildnodenumber'], name='taxon_highchildnodenumb_idx'), + models.Index(fields=['nodenumber'], name='taxon_nodenumber_idx'), ] @@ -7136,6 +7255,9 @@ class Taxontreedef(models.Model): class Meta: db_table = 'taxontreedef' ordering = () + indexes = [ + models.Index(fields=['name'], name='taxontreedef_name_idx'), + ] save = partialmethod(custom_save) @@ -7170,6 +7292,9 @@ class Taxontreedefitem(model_extras.Taxontreedefitem): class Meta: db_table = 'taxontreedefitem' ordering = () + indexes = [ + models.Index(fields=['name'], name='taxontreedefitem_name_idx'), + ] save = partialmethod(custom_save) @@ -7295,6 +7420,9 @@ class Voucherrelationship(models.Model): class Meta: db_table = 'voucherrelationship' ordering = () + indexes = [ + models.Index(fields=['vouchernumber'], name='voucherrel_vouchernumber_idx'), + ] indexes = [ models.Index(fields=['collectionmemberid'], name='VRXDATColMemIDX') ] @@ -7595,6 +7723,9 @@ class Collectionobjecttype(models.Model): class Meta: db_table = 'collectionobjecttype' ordering = () + indexes = [ + models.Index(fields=['name'], name='collectionobjecttype_name_idx'), + ] save = partialmethod(custom_save) @@ -7619,6 +7750,9 @@ class Collectionobjectgrouptype(models.Model): class Meta: db_table = 'collectionobjectgrouptype' ordering = () + indexes = [ + models.Index(fields=['name'], name='collectionobjectgroupt_name_idx'), + ] save = partialmethod(custom_save) @@ -7658,6 +7792,10 @@ class Collectionobjectgroup(models.Model): # aka. Cog class Meta: db_table = 'collectionobjectgroup' ordering = () + indexes = [ + models.Index(fields=['guid'], name='collectionobjectgroup_guid_idx'), + models.Index(fields=['name'], name='collectionobjectgroup_name_idx'), + ] save = partialmethod(custom_save) @@ -7781,6 +7919,9 @@ class Relativeage(models.Model): class Meta: db_table = 'relativeage' ordering = () + indexes = [ + models.Index(fields=['verbatimname'], name='relativeage_verbatimname_idx'), + ] save = partialmethod(custom_save) @@ -7916,6 +8057,9 @@ class Tectonicunittreedef(models.Model): class Meta: db_table = 'tectonicunittreedef' ordering = () + indexes = [ + models.Index(fields=['name'], name='tectunitdef_name_idx'), + ] save = partialmethod(custom_save) @@ -7948,6 +8092,9 @@ class Tectonicunittreedefitem(model_extras.Tectonicunittreedefitem): class Meta: db_table = 'tectonicunittreedefitem' ordering = () + indexes = [ + models.Index(fields=['name'], name='tectunitdefitem_name_idx'), + ] save = partialmethod(custom_save) @@ -7987,5 +8134,12 @@ class Tectonicunit(model_extras.Tectonicunit): class Meta: db_table = 'tectonicunit' ordering = () + indexes = [ + models.Index(fields=['fullname'], name='tectonicunit_fullname_idx'), + models.Index(fields=['guid'], name='tectonicunit_guid_idx'), + models.Index(fields=['highestchildnodenumber'], name='tectonicunit_highchildnumb_idx'), + models.Index(fields=['name'], name='tectonicunit_name_idx'), + models.Index(fields=['nodenumber'], name='tectonicunit_nodenumber_idx'), + ] - save = partialmethod(custom_save) \ No newline at end of file + save = partialmethod(custom_save)