From e529301db04df8c66b7abe037a2db7990c747747 Mon Sep 17 00:00:00 2001 From: MuchQuak Date: Tue, 24 Sep 2024 19:18:10 -0700 Subject: [PATCH] add Symbiota 3.0 migrations and Skeleton Seeders --- composer.json | 1 + composer.lock | 79 +++++++- .../2014_10_12_000000_create_users_table.php | 48 ----- ...9_24_194122_create_actionrequest_table.php | 38 ++++ ..._194122_create_actionrequesttype_table.php | 29 +++ ..._09_24_194122_create_adminconfig_table.php | 34 ++++ ..._24_194122_create_adminlanguages_table.php | 32 +++ ...4_09_24_194122_create_adminstats_table.php | 36 ++++ ...22_create_agentdeterminationlink_table.php | 34 ++++ ...4_09_24_194122_create_agentlinks_table.php | 35 ++++ ...4_09_24_194122_create_agentnames_table.php | 36 ++++ ...194122_create_agentnumberpattern_table.php | 34 ++++ ...94122_create_agentoccurrencelink_table.php | 34 ++++ ..._24_194122_create_agentrelations_table.php | 34 ++++ .../2024_09_24_194122_create_agents_table.php | 55 ++++++ ..._24_194122_create_agentsfulltext_table.php | 34 ++++ ...4_09_24_194122_create_agentteams_table.php | 29 +++ ...09_24_194122_create_chotomouskey_table.php | 32 +++ ...4_09_24_194122_create_configpage_table.php | 35 ++++ ...4122_create_configpageattributes_table.php | 39 ++++ ..._24_194122_create_ctcontrolvocab_table.php | 45 +++++ ...194122_create_ctcontrolvocabterm_table.php | 44 +++++ ..._09_24_194122_create_ctnametypes_table.php | 26 +++ ...94122_create_ctrelationshiptypes_table.php | 28 +++ ...09_24_194122_create_failed_jobs_table.php} | 2 +- ...09_24_194122_create_fmchecklists_table.php | 60 ++++++ ...4_194122_create_fmchklstchildren_table.php | 32 +++ ...94122_create_fmchklstcoordinates_table.php | 38 ++++ ...4_194122_create_fmchklstprojlink_table.php | 34 ++++ ...4_194122_create_fmchklsttaxalink_table.php | 43 +++++ ...94122_create_fmdynamicchecklists_table.php | 33 ++++ ...24_194122_create_fmdyncltaxalink_table.php | 30 +++ ...94122_create_fmprojectcategories_table.php | 36 ++++ ...4_09_24_194122_create_fmprojects_table.php | 40 ++++ ...4_09_24_194122_create_fmvouchers_table.php | 36 ++++ ..._194122_create_geographicpolygon_table.php | 32 +++ ...94122_create_geographicthesaurus_table.php | 42 ++++ ...024_09_24_194122_create_glossary_table.php | 41 ++++ ...4_194122_create_glossarycategory_table.php | 37 ++++ ...4122_create_glossarycategorylink_table.php | 29 +++ ..._24_194122_create_glossaryimages_table.php | 35 ++++ ...24_194122_create_glossarysources_table.php | 31 +++ ...4_194122_create_glossarytaxalink_table.php | 30 +++ ...4_194122_create_glossarytermlink_table.php | 32 +++ ...4_09_24_194122_create_guidimages_table.php | 31 +++ ...2_create_guidoccurdeterminations_table.php | 31 +++ ...24_194122_create_guidoccurrences_table.php | 31 +++ ...4_194122_create_igsnverification_table.php | 31 +++ ...4_194122_create_imageannotations_table.php | 32 +++ ...9_24_194122_create_imagekeywords_table.php | 30 +++ ...4_194122_create_imageprojectlink_table.php | 30 +++ ...9_24_194122_create_imageprojects_table.php | 36 ++++ .../2024_09_24_194122_create_images_table.php | 59 ++++++ ...024_09_24_194122_create_imagetag_table.php | 33 ++++ ...9_24_194122_create_imagetaggroup_table.php | 33 ++++ ..._09_24_194122_create_imagetagkey_table.php | 34 ++++ ...09_24_194122_create_institutions_table.php | 44 +++++ ...24_194122_create_kmcharacterlang_table.php | 35 ++++ ...09_24_194122_create_kmcharacters_table.php | 41 ++++ ...4_194122_create_kmchardependance_table.php | 32 +++ ...9_24_194122_create_kmcharheading_table.php | 35 ++++ ..._194122_create_kmcharheadinglang_table.php | 32 +++ ..._24_194122_create_kmchartaxalink_table.php | 34 ++++ .../2024_09_24_194122_create_kmcs_table.php | 40 ++++ ...4_09_24_194122_create_kmcsimages_table.php | 35 ++++ ...024_09_24_194122_create_kmcslang_table.php | 35 ++++ ...2024_09_24_194122_create_kmdescr_table.php | 41 ++++ ...4_194122_create_kmdescrdeletions_table.php | 39 ++++ ..._09_24_194122_create_lkupcountry_table.php | 31 +++ ...4_09_24_194122_create_lkupcounty_table.php | 31 +++ ...4_194122_create_lkupmunicipality_table.php | 31 +++ ..._194122_create_lkupstateprovince_table.php | 32 +++ .../2024_09_24_194122_create_media_table.php | 61 ++++++ ...4_194122_create_omcollcategories_table.php | 34 ++++ ...9_24_194122_create_omcollcatlink_table.php | 32 +++ ...9_24_194122_create_omcollections_table.php | 65 +++++++ ..._194122_create_omcollectionstats_table.php | 36 ++++ ...4_194122_create_omcollproperties_table.php | 34 ++++ ...194122_create_omcollpublications_table.php | 36 ++++ ...194122_create_omcollpuboccurlink_table.php | 32 +++ ...24_194122_create_omcollsecondary_table.php | 42 ++++ ...4122_create_omcrowdsourcecentral_table.php | 34 ++++ ...4122_create_omcrowdsourceproject_table.php | 36 ++++ ...194122_create_omcrowdsourcequeue_table.php | 39 ++++ ...194122_create_omexsiccatinumbers_table.php | 32 +++ ...194122_create_omexsiccatiocclink_table.php | 33 ++++ ..._194122_create_omexsiccatititles_table.php | 38 ++++ ...4_194122_create_ommaterialsample_table.php | 43 +++++ ...9_24_194122_create_omoccuraccess_table.php | 32 +++ ..._194122_create_omoccuraccesslink_table.php | 30 +++ ...4122_create_omoccuraccesssummary_table.php | 35 ++++ ..._create_omoccuraccesssummarylink_table.php | 30 +++ ..._24_194122_create_omoccurarchive_table.php | 35 ++++ ...94122_create_omoccurassociations_table.php | 57 ++++++ ...24_194122_create_omoccurcomments_table.php | 32 +++ ...194122_create_omoccurdatasetlink_table.php | 31 +++ ...24_194122_create_omoccurdatasets_table.php | 41 ++++ ...122_create_omoccurdeterminations_table.php | 63 ++++++ ...4122_create_omoccurduplicatelink_table.php | 33 ++++ ..._194122_create_omoccurduplicates_table.php | 31 +++ ...4_194122_create_omoccureditlocks_table.php | 29 +++ ...09_24_194122_create_omoccuredits_table.php | 39 ++++ ...24_194122_create_omoccurexchange_table.php | 46 +++++ ..._24_194122_create_omoccurgenetic_table.php | 36 ++++ ...24_194122_create_omoccurgeoindex_table.php | 31 +++ ...194122_create_omoccuridentifiers_table.php | 36 ++++ ...09_24_194122_create_omoccurloans_table.php | 57 ++++++ ...22_create_omoccurloansattachment_table.php | 32 +++ ...4_194122_create_omoccurloanslink_table.php | 32 +++ ...24_194122_create_omoccurloanuser_table.php | 33 ++++ ...09_24_194122_create_omoccurpaleo_table.php | 53 +++++ ...24_194122_create_omoccurpaleogts_table.php | 33 ++++ ...9_24_194122_create_omoccurpoints_table.php | 33 ++++ ...9_24_194122_create_omoccurrences_table.php | 145 ++++++++++++++ ...122_create_omoccurrencesfulltext_table.php | 28 +++ ..._194122_create_omoccurrencetypes_table.php | 39 ++++ ...24_194122_create_omoccurresource_table.php | 36 ++++ ...4_194122_create_omoccurrevisions_table.php | 38 ++++ ...94122_create_omoccurverification_table.php | 36 ++++ ...22_create_password_reset_tokens_table.php} | 0 ...2_create_personal_access_tokens_table.php} | 7 +- ..._09_24_194122_create_portalindex_table.php | 39 ++++ ..._194122_create_portaloccurrences_table.php | 34 ++++ ...194122_create_portalpublications_table.php | 40 ++++ ...94122_create_referenceagentlinks_table.php | 31 +++ ...94122_create_referenceauthorlink_table.php | 30 +++ ...4_194122_create_referenceauthors_table.php | 32 +++ ...22_create_referencechecklistlink_table.php | 30 +++ ...2_create_referencechklsttaxalink_table.php | 32 +++ ...2_create_referencecollectionlink_table.php | 30 +++ ...4122_create_referencedatasetlink_table.php | 31 +++ ...24_194122_create_referenceobject_table.php | 54 ++++++ ...194122_create_referenceoccurlink_table.php | 30 +++ ..._194122_create_referencetaxalink_table.php | 30 +++ ...9_24_194122_create_referencetype_table.php | 47 +++++ ..._24_194122_create_salixwordstats_table.php | 42 ++++ ...9_24_194122_create_schemaversion_table.php | 28 +++ ...122_create_specprocessorprojects_table.php | 52 +++++ ...22_create_specprocessorrawlabels_table.php | 35 ++++ ...e_specprocessorrawlabelsfulltext_table.php | 28 +++ ..._09_24_194122_create_specprocnlp_table.php | 32 +++ ...24_194122_create_specprocnlpfrag_table.php | 32 +++ ...194122_create_specprocnlpversion_table.php | 34 ++++ ...24_194122_create_specprococrfrag_table.php | 32 +++ ..._24_194122_create_specprocstatus_table.php | 32 +++ .../2024_09_24_194122_create_taxa_table.php | 53 +++++ ..._24_194122_create_taxadescrblock_table.php | 37 ++++ ...4_194122_create_taxadescrprofile_table.php | 40 ++++ ..._24_194122_create_taxadescrstmts_table.php | 33 ++++ ...09_24_194122_create_taxaenumtree_table.php | 31 +++ ...24_09_24_194122_create_taxalinks_table.php | 38 ++++ ...024_09_24_194122_create_taxamaps_table.php | 30 +++ ..._24_194122_create_taxanestedtree_table.php | 32 +++ ...22_create_taxaprofilepubdesclink_table.php | 33 ++++ ...2_create_taxaprofilepubimagelink_table.php | 33 ++++ ...122_create_taxaprofilepubmaplink_table.php | 33 ++++ ...24_194122_create_taxaprofilepubs_table.php | 39 ++++ ..._194122_create_taxaresourcelinks_table.php | 36 ++++ ...09_24_194122_create_taxauthority_table.php | 36 ++++ ...24_194122_create_taxavernaculars_table.php | 38 ++++ ...4_09_24_194122_create_taxonunits_table.php | 37 ++++ ...24_09_24_194122_create_taxstatus_table.php | 41 ++++ ...09_24_194122_create_tmattributes_table.php | 40 ++++ ...024_09_24_194122_create_tmstates_table.php | 39 ++++ ...94122_create_tmtraitdependencies_table.php | 30 +++ ...024_09_24_194122_create_tmtraits_table.php | 40 ++++ ...24_194122_create_tmtraittaxalink_table.php | 31 +++ ...24_194122_create_unknowncomments_table.php | 30 +++ ...9_24_194122_create_unknownimages_table.php | 30 +++ ...024_09_24_194122_create_unknowns_table.php | 36 ++++ ...4_194122_create_uploaddetermtemp_table.php | 52 +++++ ..._24_194122_create_uploadglossary_table.php | 38 ++++ ...24_194122_create_uploadimagetemp_table.php | 50 +++++ ...9_24_194122_create_uploadspecmap_table.php | 33 ++++ ...4122_create_uploadspecparameters_table.php | 46 +++++ ..._24_194122_create_uploadspectemp_table.php | 182 ++++++++++++++++++ ...4_09_24_194122_create_uploadtaxa_table.php | 59 ++++++ ...4_194122_create_useraccesstokens_table.php | 31 +++ ...24_09_24_194122_create_userlogin_table.php | 31 +++ ...24_09_24_194122_create_userroles_table.php | 37 ++++ .../2024_09_24_194122_create_users_table.php | 57 ++++++ ...09_24_194122_create_usertaxonomy_table.php | 37 ++++ ...24_create_insertGeographicPolygon_proc.php | 26 +++ ...24_create_updateGeographicPolygon_proc.php | 26 +++ ...dd_foreign_keys_to_actionrequest_table.php | 32 +++ ..._add_foreign_keys_to_adminconfig_table.php | 28 +++ ...5_add_foreign_keys_to_adminstats_table.php | 30 +++ ...n_keys_to_agentdeterminationlink_table.php | 34 ++++ ...5_add_foreign_keys_to_agentlinks_table.php | 32 +++ ...5_add_foreign_keys_to_agentnames_table.php | 28 +++ ...reign_keys_to_agentnumberpattern_table.php | 28 +++ ...eign_keys_to_agentoccurrencelink_table.php | 34 ++++ ...d_foreign_keys_to_agentrelations_table.php | 36 ++++ ...94125_add_foreign_keys_to_agents_table.php | 32 +++ ...5_add_foreign_keys_to_agentteams_table.php | 30 +++ ...add_foreign_keys_to_chotomouskey_table.php | 28 +++ ...ign_keys_to_configpageattributes_table.php | 28 +++ ...d_foreign_keys_to_ctcontrolvocab_table.php | 32 +++ ...reign_keys_to_ctcontrolvocabterm_table.php | 34 ++++ ...add_foreign_keys_to_fmchecklists_table.php | 28 +++ ...foreign_keys_to_fmchklstchildren_table.php | 30 +++ ...eign_keys_to_fmchklstcoordinates_table.php | 30 +++ ...foreign_keys_to_fmchklstprojlink_table.php | 30 +++ ...foreign_keys_to_fmchklsttaxalink_table.php | 30 +++ ..._foreign_keys_to_fmdyncltaxalink_table.php | 30 +++ ...eign_keys_to_fmprojectcategories_table.php | 28 +++ ...5_add_foreign_keys_to_fmprojects_table.php | 28 +++ ...5_add_foreign_keys_to_fmvouchers_table.php | 28 +++ ...eign_keys_to_geographicthesaurus_table.php | 30 +++ ...125_add_foreign_keys_to_glossary_table.php | 28 +++ ...foreign_keys_to_glossarycategory_table.php | 32 +++ ...ign_keys_to_glossarycategorylink_table.php | 30 +++ ...d_foreign_keys_to_glossaryimages_table.php | 30 +++ ...foreign_keys_to_glossarytaxalink_table.php | 30 +++ ...foreign_keys_to_glossarytermlink_table.php | 30 +++ ...foreign_keys_to_igsnverification_table.php | 28 +++ ...foreign_keys_to_imageannotations_table.php | 30 +++ ...dd_foreign_keys_to_imagekeywords_table.php | 30 +++ ...foreign_keys_to_imageprojectlink_table.php | 30 +++ ...dd_foreign_keys_to_imageprojects_table.php | 30 +++ ...94125_add_foreign_keys_to_images_table.php | 32 +++ ...125_add_foreign_keys_to_imagetag_table.php | 30 +++ ..._add_foreign_keys_to_imagetagkey_table.php | 28 +++ ...add_foreign_keys_to_institutions_table.php | 28 +++ ..._foreign_keys_to_kmcharacterlang_table.php | 30 +++ ...add_foreign_keys_to_kmcharacters_table.php | 30 +++ ...foreign_keys_to_kmchardependance_table.php | 30 +++ ...dd_foreign_keys_to_kmcharheading_table.php | 28 +++ ...oreign_keys_to_kmcharheadinglang_table.php | 30 +++ ...d_foreign_keys_to_kmchartaxalink_table.php | 30 +++ ..._194125_add_foreign_keys_to_kmcs_table.php | 30 +++ ...5_add_foreign_keys_to_kmcsimages_table.php | 28 +++ ...125_add_foreign_keys_to_kmcslang_table.php | 30 +++ ...4125_add_foreign_keys_to_kmdescr_table.php | 30 +++ ...5_add_foreign_keys_to_lkupcounty_table.php | 28 +++ ...foreign_keys_to_lkupmunicipality_table.php | 28 +++ ...oreign_keys_to_lkupstateprovince_table.php | 28 +++ ...194125_add_foreign_keys_to_media_table.php | 32 +++ ...dd_foreign_keys_to_omcollcatlink_table.php | 30 +++ ...dd_foreign_keys_to_omcollections_table.php | 28 +++ ...oreign_keys_to_omcollectionstats_table.php | 28 +++ ...foreign_keys_to_omcollproperties_table.php | 30 +++ ...reign_keys_to_omcollpublications_table.php | 28 +++ ...reign_keys_to_omcollpuboccurlink_table.php | 30 +++ ..._foreign_keys_to_omcollsecondary_table.php | 28 +++ ...ign_keys_to_omcrowdsourcecentral_table.php | 28 +++ ...ign_keys_to_omcrowdsourceproject_table.php | 28 +++ ...reign_keys_to_omcrowdsourcequeue_table.php | 32 +++ ...reign_keys_to_omexsiccatinumbers_table.php | 28 +++ ...reign_keys_to_omexsiccatiocclink_table.php | 30 +++ ...foreign_keys_to_ommaterialsample_table.php | 30 +++ ...keys_to_omoccuraccesssummarylink_table.php | 30 +++ ...d_foreign_keys_to_omoccurarchive_table.php | 28 +++ ...eign_keys_to_omoccurassociations_table.php | 36 ++++ ..._foreign_keys_to_omoccurcomments_table.php | 30 +++ ...reign_keys_to_omoccurdatasetlink_table.php | 30 +++ ..._foreign_keys_to_omoccurdatasets_table.php | 32 +++ ...gn_keys_to_omoccurdeterminations_table.php | 34 ++++ ...ign_keys_to_omoccurduplicatelink_table.php | 30 +++ ...add_foreign_keys_to_omoccuredits_table.php | 30 +++ ..._foreign_keys_to_omoccurexchange_table.php | 28 +++ ...d_foreign_keys_to_omoccurgenetic_table.php | 28 +++ ..._foreign_keys_to_omoccurgeoindex_table.php | 28 +++ ...reign_keys_to_omoccuridentifiers_table.php | 28 +++ ...add_foreign_keys_to_omoccurloans_table.php | 34 ++++ ...n_keys_to_omoccurloansattachment_table.php | 30 +++ ...foreign_keys_to_omoccurloanslink_table.php | 30 +++ ..._foreign_keys_to_omoccurloanuser_table.php | 32 +++ ...add_foreign_keys_to_omoccurpaleo_table.php | 28 +++ ..._foreign_keys_to_omoccurpaleogts_table.php | 28 +++ ...dd_foreign_keys_to_omoccurrences_table.php | 28 +++ ..._foreign_keys_to_omoccurresource_table.php | 32 +++ ...eign_keys_to_omoccurverification_table.php | 30 +++ ...oreign_keys_to_portaloccurrences_table.php | 30 +++ ...reign_keys_to_portalpublications_table.php | 32 +++ ...eign_keys_to_referenceauthorlink_table.php | 30 +++ ...n_keys_to_referencechecklistlink_table.php | 30 +++ ..._keys_to_referencechklsttaxalink_table.php | 30 +++ ..._keys_to_referencecollectionlink_table.php | 30 +++ ...ign_keys_to_referencedatasetlink_table.php | 32 +++ ..._foreign_keys_to_referenceobject_table.php | 30 +++ ...reign_keys_to_referenceoccurlink_table.php | 30 +++ ...oreign_keys_to_referencetaxalink_table.php | 30 +++ ...gn_keys_to_specprocessorprojects_table.php | 30 +++ ...n_keys_to_specprocessorrawlabels_table.php | 30 +++ ..._add_foreign_keys_to_specprocnlp_table.php | 28 +++ ..._foreign_keys_to_specprocnlpfrag_table.php | 28 +++ ...reign_keys_to_specprocnlpversion_table.php | 28 +++ ..._foreign_keys_to_specprococrfrag_table.php | 28 +++ ...d_foreign_keys_to_specprocstatus_table.php | 30 +++ ..._194125_add_foreign_keys_to_taxa_table.php | 28 +++ ...d_foreign_keys_to_taxadescrblock_table.php | 32 +++ ...foreign_keys_to_taxadescrprofile_table.php | 30 +++ ...d_foreign_keys_to_taxadescrstmts_table.php | 28 +++ ...add_foreign_keys_to_taxaenumtree_table.php | 32 +++ ...25_add_foreign_keys_to_taxalinks_table.php | 28 +++ ...125_add_foreign_keys_to_taxamaps_table.php | 28 +++ ...d_foreign_keys_to_taxanestedtree_table.php | 30 +++ ...n_keys_to_taxaprofilepubdesclink_table.php | 30 +++ ..._keys_to_taxaprofilepubimagelink_table.php | 30 +++ ...gn_keys_to_taxaprofilepubmaplink_table.php | 30 +++ ..._foreign_keys_to_taxaprofilepubs_table.php | 28 +++ ...oreign_keys_to_taxaresourcelinks_table.php | 28 +++ ..._foreign_keys_to_taxavernaculars_table.php | 30 +++ ...25_add_foreign_keys_to_taxstatus_table.php | 36 ++++ ..._foreign_keys_to_unknowncomments_table.php | 28 +++ ...dd_foreign_keys_to_unknownimages_table.php | 28 +++ ...125_add_foreign_keys_to_unknowns_table.php | 30 +++ ...dd_foreign_keys_to_uploadspecmap_table.php | 28 +++ ...ign_keys_to_uploadspecparameters_table.php | 30 +++ ...d_foreign_keys_to_uploadspectemp_table.php | 28 +++ ...25_add_foreign_keys_to_userlogin_table.php | 28 +++ ...25_add_foreign_keys_to_userroles_table.php | 30 +++ ...add_foreign_keys_to_usertaxonomy_table.php | 32 +++ database/seeders/ChecklistSeeder.php | 17 ++ database/seeders/CollectionSeeder.php | 17 ++ database/seeders/DatabaseSeeder.php | 19 +- database/seeders/OccurrenceSeeder.php | 17 ++ database/seeders/TaxonomySeeder.php | 117 +++++++++++ database/seeders/UserSeeder.php | 17 ++ 320 files changed, 10893 insertions(+), 62 deletions(-) delete mode 100644 database/migrations/2014_10_12_000000_create_users_table.php create mode 100644 database/migrations/2024_09_24_194122_create_actionrequest_table.php create mode 100644 database/migrations/2024_09_24_194122_create_actionrequesttype_table.php create mode 100644 database/migrations/2024_09_24_194122_create_adminconfig_table.php create mode 100644 database/migrations/2024_09_24_194122_create_adminlanguages_table.php create mode 100644 database/migrations/2024_09_24_194122_create_adminstats_table.php create mode 100644 database/migrations/2024_09_24_194122_create_agentdeterminationlink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_agentlinks_table.php create mode 100644 database/migrations/2024_09_24_194122_create_agentnames_table.php create mode 100644 database/migrations/2024_09_24_194122_create_agentnumberpattern_table.php create mode 100644 database/migrations/2024_09_24_194122_create_agentoccurrencelink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_agentrelations_table.php create mode 100644 database/migrations/2024_09_24_194122_create_agents_table.php create mode 100644 database/migrations/2024_09_24_194122_create_agentsfulltext_table.php create mode 100644 database/migrations/2024_09_24_194122_create_agentteams_table.php create mode 100644 database/migrations/2024_09_24_194122_create_chotomouskey_table.php create mode 100644 database/migrations/2024_09_24_194122_create_configpage_table.php create mode 100644 database/migrations/2024_09_24_194122_create_configpageattributes_table.php create mode 100644 database/migrations/2024_09_24_194122_create_ctcontrolvocab_table.php create mode 100644 database/migrations/2024_09_24_194122_create_ctcontrolvocabterm_table.php create mode 100644 database/migrations/2024_09_24_194122_create_ctnametypes_table.php create mode 100644 database/migrations/2024_09_24_194122_create_ctrelationshiptypes_table.php rename database/migrations/{2019_08_19_000000_create_failed_jobs_table.php => 2024_09_24_194122_create_failed_jobs_table.php} (94%) create mode 100644 database/migrations/2024_09_24_194122_create_fmchecklists_table.php create mode 100644 database/migrations/2024_09_24_194122_create_fmchklstchildren_table.php create mode 100644 database/migrations/2024_09_24_194122_create_fmchklstcoordinates_table.php create mode 100644 database/migrations/2024_09_24_194122_create_fmchklstprojlink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_fmchklsttaxalink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_fmdynamicchecklists_table.php create mode 100644 database/migrations/2024_09_24_194122_create_fmdyncltaxalink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_fmprojectcategories_table.php create mode 100644 database/migrations/2024_09_24_194122_create_fmprojects_table.php create mode 100644 database/migrations/2024_09_24_194122_create_fmvouchers_table.php create mode 100644 database/migrations/2024_09_24_194122_create_geographicpolygon_table.php create mode 100644 database/migrations/2024_09_24_194122_create_geographicthesaurus_table.php create mode 100644 database/migrations/2024_09_24_194122_create_glossary_table.php create mode 100644 database/migrations/2024_09_24_194122_create_glossarycategory_table.php create mode 100644 database/migrations/2024_09_24_194122_create_glossarycategorylink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_glossaryimages_table.php create mode 100644 database/migrations/2024_09_24_194122_create_glossarysources_table.php create mode 100644 database/migrations/2024_09_24_194122_create_glossarytaxalink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_glossarytermlink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_guidimages_table.php create mode 100644 database/migrations/2024_09_24_194122_create_guidoccurdeterminations_table.php create mode 100644 database/migrations/2024_09_24_194122_create_guidoccurrences_table.php create mode 100644 database/migrations/2024_09_24_194122_create_igsnverification_table.php create mode 100644 database/migrations/2024_09_24_194122_create_imageannotations_table.php create mode 100644 database/migrations/2024_09_24_194122_create_imagekeywords_table.php create mode 100644 database/migrations/2024_09_24_194122_create_imageprojectlink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_imageprojects_table.php create mode 100644 database/migrations/2024_09_24_194122_create_images_table.php create mode 100644 database/migrations/2024_09_24_194122_create_imagetag_table.php create mode 100644 database/migrations/2024_09_24_194122_create_imagetaggroup_table.php create mode 100644 database/migrations/2024_09_24_194122_create_imagetagkey_table.php create mode 100644 database/migrations/2024_09_24_194122_create_institutions_table.php create mode 100644 database/migrations/2024_09_24_194122_create_kmcharacterlang_table.php create mode 100644 database/migrations/2024_09_24_194122_create_kmcharacters_table.php create mode 100644 database/migrations/2024_09_24_194122_create_kmchardependance_table.php create mode 100644 database/migrations/2024_09_24_194122_create_kmcharheading_table.php create mode 100644 database/migrations/2024_09_24_194122_create_kmcharheadinglang_table.php create mode 100644 database/migrations/2024_09_24_194122_create_kmchartaxalink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_kmcs_table.php create mode 100644 database/migrations/2024_09_24_194122_create_kmcsimages_table.php create mode 100644 database/migrations/2024_09_24_194122_create_kmcslang_table.php create mode 100644 database/migrations/2024_09_24_194122_create_kmdescr_table.php create mode 100644 database/migrations/2024_09_24_194122_create_kmdescrdeletions_table.php create mode 100644 database/migrations/2024_09_24_194122_create_lkupcountry_table.php create mode 100644 database/migrations/2024_09_24_194122_create_lkupcounty_table.php create mode 100644 database/migrations/2024_09_24_194122_create_lkupmunicipality_table.php create mode 100644 database/migrations/2024_09_24_194122_create_lkupstateprovince_table.php create mode 100644 database/migrations/2024_09_24_194122_create_media_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omcollcategories_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omcollcatlink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omcollections_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omcollectionstats_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omcollproperties_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omcollpublications_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omcollpuboccurlink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omcollsecondary_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omcrowdsourcecentral_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omcrowdsourceproject_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omcrowdsourcequeue_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omexsiccatinumbers_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omexsiccatiocclink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omexsiccatititles_table.php create mode 100644 database/migrations/2024_09_24_194122_create_ommaterialsample_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccuraccess_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccuraccesslink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccuraccesssummary_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccuraccesssummarylink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurarchive_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurassociations_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurcomments_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurdatasetlink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurdatasets_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurdeterminations_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurduplicatelink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurduplicates_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccureditlocks_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccuredits_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurexchange_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurgenetic_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurgeoindex_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccuridentifiers_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurloans_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurloansattachment_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurloanslink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurloanuser_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurpaleo_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurpaleogts_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurpoints_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurrences_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurrencesfulltext_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurrencetypes_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurresource_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurrevisions_table.php create mode 100644 database/migrations/2024_09_24_194122_create_omoccurverification_table.php rename database/migrations/{2014_10_12_100000_create_password_reset_tokens_table.php => 2024_09_24_194122_create_password_reset_tokens_table.php} (100%) rename database/migrations/{2019_12_14_000001_create_personal_access_tokens_table.php => 2024_09_24_194122_create_personal_access_tokens_table.php} (79%) create mode 100644 database/migrations/2024_09_24_194122_create_portalindex_table.php create mode 100644 database/migrations/2024_09_24_194122_create_portaloccurrences_table.php create mode 100644 database/migrations/2024_09_24_194122_create_portalpublications_table.php create mode 100644 database/migrations/2024_09_24_194122_create_referenceagentlinks_table.php create mode 100644 database/migrations/2024_09_24_194122_create_referenceauthorlink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_referenceauthors_table.php create mode 100644 database/migrations/2024_09_24_194122_create_referencechecklistlink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_referencechklsttaxalink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_referencecollectionlink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_referencedatasetlink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_referenceobject_table.php create mode 100644 database/migrations/2024_09_24_194122_create_referenceoccurlink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_referencetaxalink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_referencetype_table.php create mode 100644 database/migrations/2024_09_24_194122_create_salixwordstats_table.php create mode 100644 database/migrations/2024_09_24_194122_create_schemaversion_table.php create mode 100644 database/migrations/2024_09_24_194122_create_specprocessorprojects_table.php create mode 100644 database/migrations/2024_09_24_194122_create_specprocessorrawlabels_table.php create mode 100644 database/migrations/2024_09_24_194122_create_specprocessorrawlabelsfulltext_table.php create mode 100644 database/migrations/2024_09_24_194122_create_specprocnlp_table.php create mode 100644 database/migrations/2024_09_24_194122_create_specprocnlpfrag_table.php create mode 100644 database/migrations/2024_09_24_194122_create_specprocnlpversion_table.php create mode 100644 database/migrations/2024_09_24_194122_create_specprococrfrag_table.php create mode 100644 database/migrations/2024_09_24_194122_create_specprocstatus_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxa_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxadescrblock_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxadescrprofile_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxadescrstmts_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxaenumtree_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxalinks_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxamaps_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxanestedtree_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxaprofilepubdesclink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxaprofilepubimagelink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxaprofilepubmaplink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxaprofilepubs_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxaresourcelinks_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxauthority_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxavernaculars_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxonunits_table.php create mode 100644 database/migrations/2024_09_24_194122_create_taxstatus_table.php create mode 100644 database/migrations/2024_09_24_194122_create_tmattributes_table.php create mode 100644 database/migrations/2024_09_24_194122_create_tmstates_table.php create mode 100644 database/migrations/2024_09_24_194122_create_tmtraitdependencies_table.php create mode 100644 database/migrations/2024_09_24_194122_create_tmtraits_table.php create mode 100644 database/migrations/2024_09_24_194122_create_tmtraittaxalink_table.php create mode 100644 database/migrations/2024_09_24_194122_create_unknowncomments_table.php create mode 100644 database/migrations/2024_09_24_194122_create_unknownimages_table.php create mode 100644 database/migrations/2024_09_24_194122_create_unknowns_table.php create mode 100644 database/migrations/2024_09_24_194122_create_uploaddetermtemp_table.php create mode 100644 database/migrations/2024_09_24_194122_create_uploadglossary_table.php create mode 100644 database/migrations/2024_09_24_194122_create_uploadimagetemp_table.php create mode 100644 database/migrations/2024_09_24_194122_create_uploadspecmap_table.php create mode 100644 database/migrations/2024_09_24_194122_create_uploadspecparameters_table.php create mode 100644 database/migrations/2024_09_24_194122_create_uploadspectemp_table.php create mode 100644 database/migrations/2024_09_24_194122_create_uploadtaxa_table.php create mode 100644 database/migrations/2024_09_24_194122_create_useraccesstokens_table.php create mode 100644 database/migrations/2024_09_24_194122_create_userlogin_table.php create mode 100644 database/migrations/2024_09_24_194122_create_userroles_table.php create mode 100644 database/migrations/2024_09_24_194122_create_users_table.php create mode 100644 database/migrations/2024_09_24_194122_create_usertaxonomy_table.php create mode 100644 database/migrations/2024_09_24_194124_create_insertGeographicPolygon_proc.php create mode 100644 database/migrations/2024_09_24_194124_create_updateGeographicPolygon_proc.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_actionrequest_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_adminconfig_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_adminstats_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_agentdeterminationlink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_agentlinks_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnames_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnumberpattern_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_agentoccurrencelink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_agentrelations_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_agents_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_agentteams_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_chotomouskey_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_configpageattributes_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocab_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocabterm_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchecklists_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstchildren_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstcoordinates_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstprojlink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklsttaxalink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_fmdyncltaxalink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojectcategories_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojects_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_fmvouchers_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_geographicthesaurus_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_glossary_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategory_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategorylink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_glossaryimages_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytaxalink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytermlink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_igsnverification_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_imageannotations_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_imagekeywords_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojectlink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojects_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_images_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetag_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetagkey_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_institutions_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacterlang_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacters_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchardependance_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheading_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheadinglang_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchartaxalink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcs_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcsimages_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcslang_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_kmdescr_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupcounty_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupmunicipality_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupstateprovince_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_media_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollcatlink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollections_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollectionstats_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollproperties_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpublications_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpuboccurlink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollsecondary_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcecentral_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourceproject_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcequeue_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatinumbers_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatiocclink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_ommaterialsample_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuraccesssummarylink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurarchive_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurassociations_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurcomments_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasetlink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasets_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdeterminations_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurduplicatelink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuredits_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurexchange_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgenetic_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgeoindex_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuridentifiers_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloans_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloansattachment_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanslink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanuser_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleo_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleogts_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurrences_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurresource_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurverification_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_portaloccurrences_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_portalpublications_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceauthorlink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechecklistlink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechklsttaxalink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_referencecollectionlink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_referencedatasetlink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceobject_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceoccurlink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_referencetaxalink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorprojects_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorrawlabels_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlp_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpfrag_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpversion_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_specprococrfrag_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocstatus_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxa_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrblock_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrprofile_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrstmts_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaenumtree_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxalinks_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxamaps_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxanestedtree_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubdesclink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubimagelink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubmaplink_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubs_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaresourcelinks_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxavernaculars_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_taxstatus_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowncomments_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_unknownimages_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowns_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecmap_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecparameters_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspectemp_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_userlogin_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_userroles_table.php create mode 100644 database/migrations/2024_09_24_194125_add_foreign_keys_to_usertaxonomy_table.php create mode 100644 database/seeders/ChecklistSeeder.php create mode 100644 database/seeders/CollectionSeeder.php create mode 100644 database/seeders/OccurrenceSeeder.php create mode 100644 database/seeders/TaxonomySeeder.php create mode 100644 database/seeders/UserSeeder.php diff --git a/composer.json b/composer.json index 2d87d98..5e90c72 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,7 @@ }, "require-dev": { "fakerphp/faker": "^1.9.1", + "kitloong/laravel-migrations-generator": "^7.0", "laravel/pint": "^1.0", "laravel/sail": "^1.32", "mockery/mockery": "^1.4.4", diff --git a/composer.lock b/composer.lock index 0411cd1..f035c6e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5ff2ceb7c33845e1bf834abeed2dc06a", + "content-hash": "d888ad52f663e9b7b68e4c602044b10a", "packages": [ { "name": "brick/math", @@ -6459,6 +6459,83 @@ }, "time": "2020-07-09T08:09:16+00:00" }, + { + "name": "kitloong/laravel-migrations-generator", + "version": "v7.0.5", + "source": { + "type": "git", + "url": "https://github.com/kitloong/laravel-migrations-generator.git", + "reference": "8b3575285bc3d65a084085fb20d7c1ba5f903c4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kitloong/laravel-migrations-generator/zipball/8b3575285bc3d65a084085fb20d7c1ba5f903c4e", + "reference": "8b3575285bc3d65a084085fb20d7c1ba5f903c4e", + "shasum": "" + }, + "require": { + "ext-pdo": "*", + "illuminate/support": "^10.43|^11.0", + "php": "^8.1" + }, + "require-dev": { + "barryvdh/laravel-ide-helper": "^2.0|^3.0", + "friendsofphp/php-cs-fixer": "^3.1", + "larastan/larastan": "^1.0|^2.0", + "mockery/mockery": "^1.0", + "orchestra/testbench": "^8.0|^9.0", + "phpmd/phpmd": "^2.10", + "slevomat/coding-standard": "^8.0", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "KitLoong\\MigrationsGenerator\\MigrationsGeneratorServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "KitLoong\\MigrationsGenerator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kit Loong", + "email": "kitloong1008@gmail.com" + } + ], + "description": "Generates Laravel Migrations from an existing database", + "keywords": [ + "artisan", + "generator", + "laravel", + "lumen", + "migration", + "migrations" + ], + "support": { + "issues": "https://github.com/kitloong/laravel-migrations-generator/issues", + "source": "https://github.com/kitloong/laravel-migrations-generator/tree/v7.0.5" + }, + "funding": [ + { + "url": "https://www.buymeacoffee.com/kitloong", + "type": "buy_me_a_coffee" + }, + { + "url": "https://github.com/kitloong", + "type": "github" + } + ], + "time": "2024-08-06T13:18:32+00:00" + }, { "name": "laravel/pint", "version": "v1.17.3", diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php deleted file mode 100644 index eab17e6..0000000 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ /dev/null @@ -1,48 +0,0 @@ -string('name'); - $table->string('old_password'); - $table->string('password', 255)->change(); - $table->timestamp('email_verified_at')->nullable(); - }); - - // Popluate New Columns with old data - DB::statement('UPDATE users set old_password = password, name = TRIM(CONCAT(last_name," ", first_name)), email_verified_at = now()'); - } else { - // create user table - // user table already exists so need to port that table defintion here first - } - } - - /** - * Reverse the migrations. - */ - public function down(): void { - DB::statement('UPDATE users set password = old_password where old_password IS NOT null'); - - Schema::table('users', function (Blueprint $table) { - $table->dropColumn('name'); - $table->dropColumn('old_password'); - $table->dropColumn('email_verified_at'); - - // Could truncate password if old is null and new is 255 - // So gonna leave out for now - // $table->string('password', 45)->change(); - }); - } -}; diff --git a/database/migrations/2024_09_24_194122_create_actionrequest_table.php b/database/migrations/2024_09_24_194122_create_actionrequest_table.php new file mode 100644 index 0000000..dbb7a33 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_actionrequest_table.php @@ -0,0 +1,38 @@ +bigInteger('actionrequestid', true); + $table->integer('fk'); + $table->string('tablename')->nullable(); + $table->string('requesttype', 30)->index('fk_actionreq_type_idx'); + $table->unsignedInteger('uid_requestor')->index('fk_actionreq_uid1_idx'); + $table->timestamp('requestdate')->useCurrentOnUpdate()->useCurrent(); + $table->string('requestremarks', 900)->nullable(); + $table->integer('priority')->nullable(); + $table->unsignedInteger('uid_fullfillor')->index('fk_actionreq_uid2_idx'); + $table->string('state', 12)->nullable(); + $table->string('resolution', 12)->nullable(); + $table->dateTime('statesetdate')->nullable(); + $table->string('resolutionremarks', 900)->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('actionrequest'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_actionrequesttype_table.php b/database/migrations/2024_09_24_194122_create_actionrequesttype_table.php new file mode 100644 index 0000000..005df87 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_actionrequesttype_table.php @@ -0,0 +1,29 @@ +string('requesttype', 30)->primary(); + $table->string('context')->nullable(); + $table->string('description')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('actionrequesttype'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_adminconfig_table.php b/database/migrations/2024_09_24_194122_create_adminconfig_table.php new file mode 100644 index 0000000..ff7168d --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_adminconfig_table.php @@ -0,0 +1,34 @@ +integer('configID', true); + $table->string('category', 45)->nullable(); + $table->string('attributeName', 45)->unique('uq_adminconfig_name'); + $table->string('attributeValue', 1000); + $table->text('dynamicProperties')->nullable(); + $table->string('notes', 45)->nullable(); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_adminconfig_uid_idx'); + $table->dateTime('modifiedTimestamp')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('adminconfig'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_adminlanguages_table.php b/database/migrations/2024_09_24_194122_create_adminlanguages_table.php new file mode 100644 index 0000000..1356891 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_adminlanguages_table.php @@ -0,0 +1,32 @@ +integer('langid', true); + $table->string('langname', 45)->unique('index_langname_unique'); + $table->string('iso639_1', 10)->nullable(); + $table->string('iso639_2', 10)->nullable(); + $table->string('ISO 639-3', 3)->nullable(); + $table->string('notes', 45)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('adminlanguages'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_adminstats_table.php b/database/migrations/2024_09_24_194122_create_adminstats_table.php new file mode 100644 index 0000000..b450802 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_adminstats_table.php @@ -0,0 +1,36 @@ +increments('idadminstats'); + $table->string('category', 45)->index('index_category'); + $table->string('statname', 45); + $table->integer('statvalue')->nullable(); + $table->integer('statpercentage')->nullable(); + $table->text('dynamicProperties')->nullable(); + $table->integer('groupid'); + $table->unsignedInteger('collid')->nullable()->index('fk_adminstats_collid_idx'); + $table->unsignedInteger('uid')->nullable()->index('fk_adminstats_uid_idx'); + $table->string('note', 250)->nullable(); + $table->timestamp('initialtimestamp')->nullable()->useCurrent()->index('index_adminstats_ts'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('adminstats'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_agentdeterminationlink_table.php b/database/migrations/2024_09_24_194122_create_agentdeterminationlink_table.php new file mode 100644 index 0000000..1f19d15 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_agentdeterminationlink_table.php @@ -0,0 +1,34 @@ +bigInteger('agentID'); + $table->unsignedInteger('detID')->index('fk_agentdetlink_detid_idx'); + $table->string('role', 45)->default('')->index('ix_agentdetlink_role'); + $table->unsignedInteger('createdUid')->nullable()->index('fk_agentdetlink_created_idx'); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_agentdetlink_modified_idx'); + $table->dateTime('dateLastModified')->nullable(); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + + $table->primary(['agentID', 'detID', 'role']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('agentdeterminationlink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_agentlinks_table.php b/database/migrations/2024_09_24_194122_create_agentlinks_table.php new file mode 100644 index 0000000..061d2e1 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_agentlinks_table.php @@ -0,0 +1,35 @@ +bigInteger('agentLinksID', true); + $table->bigInteger('agentID')->index('fk_agentlinks_agentid_idx'); + $table->string('type', 50)->nullable(); + $table->string('link', 900)->nullable(); + $table->boolean('isPrimaryTopicOf')->default(true); + $table->string('text', 50)->nullable(); + $table->unsignedInteger('createdUid')->nullable()->index('fk_agentlinks_createduid_idx'); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_agentlinks_moduid_idx'); + $table->dateTime('dateLastModified')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('agentlinks'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_agentnames_table.php b/database/migrations/2024_09_24_194122_create_agentnames_table.php new file mode 100644 index 0000000..f82f250 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_agentnames_table.php @@ -0,0 +1,36 @@ +bigInteger('agentNamesID')->primary(); + $table->bigInteger('agentID'); + $table->string('nameType', 32)->default('Full Name'); + $table->string('agentName')->index('ix_agentnames_name'); + $table->string('language', 6)->nullable()->default('en_us'); + $table->integer('createdUid')->nullable(); + $table->integer('modifiedUid')->nullable(); + $table->dateTime('dateLastModified')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + + $table->unique(['agentID', 'nameType', 'agentName'], 'uq_agentnames_unique'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('agentnames'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_agentnumberpattern_table.php b/database/migrations/2024_09_24_194122_create_agentnumberpattern_table.php new file mode 100644 index 0000000..255a681 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_agentnumberpattern_table.php @@ -0,0 +1,34 @@ +bigInteger('agentNumberPatternID')->primary(); + $table->bigInteger('agentID')->index('ix_agentnumberpattern_agentid'); + $table->string('numberType', 50)->nullable()->default('Collector number'); + $table->string('numberPattern')->nullable(); + $table->string('numberPatternDescription', 900)->nullable(); + $table->integer('startYear')->nullable(); + $table->integer('endYear')->nullable(); + $table->integer('integerIncrement')->nullable(); + $table->text('notes')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('agentnumberpattern'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_agentoccurrencelink_table.php b/database/migrations/2024_09_24_194122_create_agentoccurrencelink_table.php new file mode 100644 index 0000000..c0eb3a2 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_agentoccurrencelink_table.php @@ -0,0 +1,34 @@ +bigInteger('agentID'); + $table->unsignedInteger('occid')->index('fk_agentoccurlink_occid_idx'); + $table->string('role', 45)->default('')->index('fk_agentoccurlink_role'); + $table->unsignedInteger('createdUid')->nullable()->index('fk_agentoccurlink_created_idx'); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_agentoccurlink_modified_idx'); + $table->dateTime('dateLastModified')->nullable(); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + + $table->primary(['agentID', 'occid', 'role']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('agentoccurrencelink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_agentrelations_table.php b/database/migrations/2024_09_24_194122_create_agentrelations_table.php new file mode 100644 index 0000000..f80d3c3 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_agentrelations_table.php @@ -0,0 +1,34 @@ +bigInteger('agentRelationsID', true); + $table->bigInteger('fromAgentID')->index('fk_agentrelations_fromagentid_idx'); + $table->bigInteger('toAgentID')->index('fk_agentrelations_toagentid_idx'); + $table->string('relationship', 50)->index('fk_agentrelations_relationship_idx'); + $table->string('notes', 900)->nullable(); + $table->unsignedInteger('createdUid')->nullable()->index('fk_agentrelations_createuid_idx'); + $table->dateTime('dateLastModified')->nullable(); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_agentrelations_moduid_idx'); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('agentrelations'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_agents_table.php b/database/migrations/2024_09_24_194122_create_agents_table.php new file mode 100644 index 0000000..c61e0d4 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_agents_table.php @@ -0,0 +1,55 @@ +bigInteger('agentID', true); + $table->string('familyName', 45)->index('ix_agents_familyname'); + $table->string('firstName', 45)->nullable()->index('ix_agents_firstname'); + $table->string('middleName', 45)->nullable(); + $table->integer('startYearActive')->nullable(); + $table->integer('endYearActive')->nullable(); + $table->string('notes')->nullable(); + $table->integer('rating')->nullable()->default(10); + $table->string('guid', 900)->nullable()->unique('uq_agents_guid'); + $table->bigInteger('preferredRecByID')->nullable()->index('fk_agents_preferred_recby_idx'); + $table->text('biography')->nullable(); + $table->string('taxonomicGroups', 900)->nullable(); + $table->string('collectionsAt', 900)->nullable(); + $table->boolean('curated')->nullable()->default(false); + $table->boolean('nototherwisespecified')->nullable()->default(false); + $table->enum('type', ['Individual', 'Team', 'Organization'])->nullable(); + $table->string('prefix', 32)->nullable(); + $table->string('suffix', 32)->nullable(); + $table->text('nameString')->nullable(); + $table->char('mboxSha1Sum', 40)->nullable(); + $table->integer('yearOfBirth')->nullable(); + $table->string('yearOfBirthModifier', 12)->nullable()->default(''); + $table->integer('yearOfDeath')->nullable(); + $table->string('yearOfDeathModifier', 12)->nullable()->default(''); + $table->enum('living', ['Y', 'N', '?'])->default('?'); + $table->char('recordID', 43)->nullable(); + $table->dateTime('dateLastModified')->nullable(); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_agents_moduid_idx'); + $table->unsignedInteger('createdUid')->nullable()->index('fk_agents_createduid_idx'); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('agents'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_agentsfulltext_table.php b/database/migrations/2024_09_24_194122_create_agentsfulltext_table.php new file mode 100644 index 0000000..9cae0f9 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_agentsfulltext_table.php @@ -0,0 +1,34 @@ +bigInteger('agentsFulltextID', true); + $table->integer('agentID'); + $table->text('biography')->nullable(); + $table->text('taxonomicGroups')->nullable(); + $table->text('collectionsAt')->nullable(); + $table->text('notes')->nullable(); + $table->text('name')->nullable(); + + $table->fullText(['biography', 'taxonomicGroups', 'collectionsAt', 'notes', 'name'], 'ft_collectorbio'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('agentsfulltext'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_agentteams_table.php b/database/migrations/2024_09_24_194122_create_agentteams_table.php new file mode 100644 index 0000000..01e01e4 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_agentteams_table.php @@ -0,0 +1,29 @@ +bigInteger('agentTeamID', true); + $table->bigInteger('teamAgentID')->index('fk_agentteams_teamagentid_idx'); + $table->bigInteger('memberAgentID')->index('fk_agentteams_memberagentid_idx'); + $table->integer('ordinal')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('agentteams'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_chotomouskey_table.php b/database/migrations/2024_09_24_194122_create_chotomouskey_table.php new file mode 100644 index 0000000..0e7eea7 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_chotomouskey_table.php @@ -0,0 +1,32 @@ +increments('stmtid'); + $table->string('statement', 300); + $table->unsignedInteger('nodeid'); + $table->unsignedInteger('parentid'); + $table->unsignedInteger('tid')->nullable()->index('fk_chotomouskey_taxa'); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('chotomouskey'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_configpage_table.php b/database/migrations/2024_09_24_194122_create_configpage_table.php new file mode 100644 index 0000000..c11d19c --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_configpage_table.php @@ -0,0 +1,35 @@ +integer('configpageid', true); + $table->string('pagename', 45); + $table->string('title', 150); + $table->string('cssname', 45)->nullable(); + $table->string('language', 45)->default('english'); + $table->integer('displaymode')->nullable(); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('modifiedUid'); + $table->dateTime('modifiedtimestamp')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('configpage'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_configpageattributes_table.php b/database/migrations/2024_09_24_194122_create_configpageattributes_table.php new file mode 100644 index 0000000..b2a7ba9 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_configpageattributes_table.php @@ -0,0 +1,39 @@ +integer('attributeid', true); + $table->integer('configpageid')->index('fk_configpageattributes_id_idx'); + $table->string('objid', 45)->nullable(); + $table->string('objname', 45); + $table->string('value', 45)->nullable(); + $table->string('type', 45)->nullable()->comment('text, submit, div'); + $table->integer('width')->nullable(); + $table->integer('top')->nullable(); + $table->integer('left')->nullable(); + $table->string('stylestr', 45)->nullable(); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('modifiedUid'); + $table->dateTime('modifiedtimestamp')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('configpageattributes'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_ctcontrolvocab_table.php b/database/migrations/2024_09_24_194122_create_ctcontrolvocab_table.php new file mode 100644 index 0000000..7171314 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_ctcontrolvocab_table.php @@ -0,0 +1,45 @@ +integer('cvID', true); + $table->unsignedInteger('collid')->nullable()->index('fk_ctcontrolvocab_collid_idx'); + $table->string('title', 45); + $table->string('definition', 250)->nullable(); + $table->string('authors', 150)->nullable(); + $table->string('tableName', 45); + $table->string('fieldName', 45); + $table->string('filterVariable', 150)->default(''); + $table->string('resourceUrl', 150)->nullable(); + $table->string('ontologyClass', 150)->nullable(); + $table->string('ontologyUrl', 150)->nullable(); + $table->integer('limitToList')->nullable()->default(0); + $table->text('dynamicProperties')->nullable(); + $table->string('notes', 45)->nullable(); + $table->unsignedInteger('createdUid')->nullable()->index('fk_ctcontrolvocab_createuid_idx'); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_ctcontrolvocab_moduid_idx'); + $table->dateTime('modifiedTimestamp')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['title', 'tableName', 'fieldName', 'filterVariable'], 'uq_ctcontrolvocab'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('ctcontrolvocab'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_ctcontrolvocabterm_table.php b/database/migrations/2024_09_24_194122_create_ctcontrolvocabterm_table.php new file mode 100644 index 0000000..e9a9acc --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_ctcontrolvocabterm_table.php @@ -0,0 +1,44 @@ +integer('cvTermID', true); + $table->integer('cvID')->index('fk_ctcontrolvocabterm_cvid_idx'); + $table->integer('parentCvTermID')->nullable()->index('fk_ctcontrolvocabterm_cvtermid'); + $table->string('term', 45)->index('ix_controlvocabterm_term'); + $table->string('termDisplay', 75)->nullable(); + $table->string('inverseRelationship', 45)->nullable(); + $table->string('collective', 45)->nullable(); + $table->string('definition', 250)->nullable(); + $table->string('resourceUrl', 150)->nullable(); + $table->string('ontologyClass', 150)->nullable(); + $table->string('ontologyUrl', 150)->nullable(); + $table->integer('activeStatus')->nullable()->default(1); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('createdUid')->nullable()->index('fk_ctcontrolvocabterm_createuid_idx'); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_ctcontrolvocabterm_moduid_idx'); + $table->dateTime('modifiedTimestamp')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + + $table->unique(['cvID', 'term'], 'uq_controlvocabterm'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('ctcontrolvocabterm'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_ctnametypes_table.php b/database/migrations/2024_09_24_194122_create_ctnametypes_table.php new file mode 100644 index 0000000..f009985 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_ctnametypes_table.php @@ -0,0 +1,26 @@ +string('type', 32)->primary(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('ctnametypes'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_ctrelationshiptypes_table.php b/database/migrations/2024_09_24_194122_create_ctrelationshiptypes_table.php new file mode 100644 index 0000000..277b93b --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_ctrelationshiptypes_table.php @@ -0,0 +1,28 @@ +string('relationship', 50)->primary(); + $table->string('inverse', 50)->nullable(); + $table->string('collective', 50)->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('ctrelationshiptypes'); + } +}; diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/database/migrations/2024_09_24_194122_create_failed_jobs_table.php similarity index 94% rename from database/migrations/2019_08_19_000000_create_failed_jobs_table.php rename to database/migrations/2024_09_24_194122_create_failed_jobs_table.php index 249da81..08606bd 100644 --- a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php +++ b/database/migrations/2024_09_24_194122_create_failed_jobs_table.php @@ -12,7 +12,7 @@ public function up(): void { Schema::create('failed_jobs', function (Blueprint $table) { - $table->id(); + $table->bigIncrements('id'); $table->string('uuid')->unique(); $table->text('connection'); $table->text('queue'); diff --git a/database/migrations/2024_09_24_194122_create_fmchecklists_table.php b/database/migrations/2024_09_24_194122_create_fmchecklists_table.php new file mode 100644 index 0000000..d3af5e6 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_fmchecklists_table.php @@ -0,0 +1,60 @@ +increments('clid'); + $table->string('name', 100); + $table->string('title', 150)->nullable(); + $table->string('locality', 500)->nullable(); + $table->string('publication', 500)->nullable(); + $table->text('abstract')->nullable(); + $table->string('authors', 250)->nullable(); + $table->string('type', 50)->nullable()->default('static'); + $table->string('politicalDivision', 45)->nullable(); + $table->string('dynamicSql', 500)->nullable(); + $table->string('parent', 50)->nullable(); + $table->unsignedInteger('parentClid')->nullable(); + $table->string('notes', 500)->nullable(); + $table->double('latCentroid')->nullable(); + $table->double('longCentroid')->nullable(); + $table->unsignedInteger('pointRadiusMeters')->nullable(); + $table->text('footprintWkt')->nullable(); + $table->integer('percentEffort')->nullable(); + $table->string('access', 45)->nullable()->default('private'); + $table->string('cidKeyLimits', 250)->nullable(); + $table->string('defaultSettings', 250)->nullable(); + $table->string('iconUrl', 150)->nullable(); + $table->string('headerUrl', 150)->nullable(); + $table->text('dynamicProperties')->nullable(); + $table->unsignedInteger('uid')->nullable()->index('fk_checklists_uid'); + $table->unsignedInteger('sortSequence')->default(50); + $table->unsignedInteger('expiration')->nullable(); + $table->string('guid', 45)->nullable(); + $table->string('recordID', 45)->nullable(); + $table->unsignedInteger('modifiedUid')->nullable(); + $table->dateTime('dateLastModified')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + $table->text('footprintGeoJson')->nullable(); + + $table->index(['name', 'type'], 'name'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('fmchecklists'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_fmchklstchildren_table.php b/database/migrations/2024_09_24_194122_create_fmchklstchildren_table.php new file mode 100644 index 0000000..035874f --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_fmchklstchildren_table.php @@ -0,0 +1,32 @@ +unsignedInteger('clid')->index('fk_fmchklstchild_clid_idx'); + $table->unsignedInteger('clidchild')->index('fk_fmchklstchild_child_idx'); + $table->unsignedInteger('modifiedUid'); + $table->dateTime('modifiedtimestamp')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['clid', 'clidchild']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('fmchklstchildren'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_fmchklstcoordinates_table.php b/database/migrations/2024_09_24_194122_create_fmchklstcoordinates_table.php new file mode 100644 index 0000000..df0d9b1 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_fmchklstcoordinates_table.php @@ -0,0 +1,38 @@ +integer('clCoordID', true); + $table->unsignedInteger('clid')->index('ix_checklistcoord_clid'); + $table->unsignedInteger('tid')->index('ix_checklistcoord_tid'); + $table->double('decimalLatitude'); + $table->double('decimalLongitude'); + $table->string('sourceName', 75)->nullable(); + $table->string('sourceIdentifier', 45)->nullable(); + $table->string('referenceUrl', 250)->nullable(); + $table->string('notes', 250)->nullable(); + $table->text('dynamicProperties')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + + $table->unique(['clid', 'tid', 'decimalLatitude', 'decimalLongitude'], 'uq_checklistcoord_unique'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('fmchklstcoordinates'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_fmchklstprojlink_table.php b/database/migrations/2024_09_24_194122_create_fmchklstprojlink_table.php new file mode 100644 index 0000000..e091bcb --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_fmchklstprojlink_table.php @@ -0,0 +1,34 @@ +unsignedInteger('pid'); + $table->unsignedInteger('clid')->index('fk_chklst'); + $table->string('clNameOverride', 100)->nullable(); + $table->smallInteger('mapChecklist')->nullable()->default(1); + $table->integer('sortSequence')->nullable(); + $table->string('notes', 250)->nullable(); + $table->timestamp('InitialTimeStamp')->useCurrent(); + + $table->primary(['pid', 'clid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('fmchklstprojlink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_fmchklsttaxalink_table.php b/database/migrations/2024_09_24_194122_create_fmchklsttaxalink_table.php new file mode 100644 index 0000000..0875006 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_fmchklsttaxalink_table.php @@ -0,0 +1,43 @@ +increments('clTaxaID'); + $table->unsignedInteger('tid')->index('fk_chklsttaxalink_tid'); + $table->unsignedInteger('clid')->index('fk_chklsttaxalink_cid'); + $table->string('morphoSpecies', 45)->nullable()->default(''); + $table->string('familyOverride', 50)->nullable(); + $table->string('habitat', 250)->nullable(); + $table->string('abundance', 50)->nullable(); + $table->string('notes', 2000)->nullable(); + $table->smallInteger('explicitExclude')->nullable(); + $table->string('source', 250)->nullable(); + $table->string('nativity', 50)->nullable()->comment('native, introducted'); + $table->string('endemic', 45)->nullable(); + $table->string('invasive', 45)->nullable(); + $table->string('internalNotes', 250)->nullable(); + $table->text('dynamicProperties')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + + $table->unique(['clid', 'tid', 'morphoSpecies'], 'uq_chklsttaxalink'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('fmchklsttaxalink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_fmdynamicchecklists_table.php b/database/migrations/2024_09_24_194122_create_fmdynamicchecklists_table.php new file mode 100644 index 0000000..50c916a --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_fmdynamicchecklists_table.php @@ -0,0 +1,33 @@ +increments('dynclid'); + $table->string('name', 50)->nullable(); + $table->string('details', 250)->nullable(); + $table->string('uid', 45)->nullable(); + $table->string('type', 45)->default('DynamicList'); + $table->string('notes', 250)->nullable(); + $table->dateTime('expiration'); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('fmdynamicchecklists'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_fmdyncltaxalink_table.php b/database/migrations/2024_09_24_194122_create_fmdyncltaxalink_table.php new file mode 100644 index 0000000..92e0391 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_fmdyncltaxalink_table.php @@ -0,0 +1,30 @@ +unsignedInteger('dynclid'); + $table->unsignedInteger('tid')->index('fk_dyncltaxalink_taxa'); + $table->timestamp('initialtimestamp')->useCurrentOnUpdate()->useCurrent(); + + $table->primary(['dynclid', 'tid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('fmdyncltaxalink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_fmprojectcategories_table.php b/database/migrations/2024_09_24_194122_create_fmprojectcategories_table.php new file mode 100644 index 0000000..9538a2e --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_fmprojectcategories_table.php @@ -0,0 +1,36 @@ +increments('projcatid'); + $table->unsignedInteger('pid')->index('fk_fmprojcat_pid_idx'); + $table->string('categoryname', 150); + $table->string('managers', 100)->nullable(); + $table->string('description', 250)->nullable(); + $table->integer('parentpid')->nullable(); + $table->integer('occurrencesearch')->nullable()->default(0); + $table->integer('ispublic')->nullable()->default(1); + $table->string('notes', 250)->nullable(); + $table->integer('sortsequence')->nullable(); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('fmprojectcategories'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_fmprojects_table.php b/database/migrations/2024_09_24_194122_create_fmprojects_table.php new file mode 100644 index 0000000..9225e99 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_fmprojects_table.php @@ -0,0 +1,40 @@ +increments('pid'); + $table->string('projname', 75); + $table->string('displayname', 150)->nullable(); + $table->string('managers', 150)->nullable(); + $table->string('briefdescription', 300)->nullable(); + $table->string('fulldescription', 5000)->nullable(); + $table->string('notes', 250)->nullable(); + $table->string('iconUrl', 150)->nullable(); + $table->string('headerUrl', 150)->nullable(); + $table->unsignedInteger('occurrencesearch')->default(0); + $table->unsignedInteger('ispublic')->default(0); + $table->text('dynamicProperties')->nullable(); + $table->unsignedInteger('parentpid')->nullable()->index('fk_parentpid_proj'); + $table->unsignedInteger('SortSequence')->default(50); + $table->timestamp('InitialTimeStamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('fmprojects'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_fmvouchers_table.php b/database/migrations/2024_09_24_194122_create_fmvouchers_table.php new file mode 100644 index 0000000..4794888 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_fmvouchers_table.php @@ -0,0 +1,36 @@ +increments('voucherID'); + $table->unsignedInteger('clTaxaID')->index('fk_fmvouchers_tidclid_idx'); + $table->unsignedInteger('TID')->nullable(); + $table->unsignedInteger('CLID')->nullable(); + $table->unsignedInteger('occid')->index('fk_fmvouchers_occ_idx'); + $table->string('editornotes', 50)->nullable(); + $table->integer('preferredImage')->nullable()->default(0); + $table->string('Notes', 250)->nullable(); + $table->timestamp('InitialTimeStamp')->useCurrent(); + + $table->unique(['clTaxaID', 'occid'], 'uq_fmvouchers_cltaxaid_occid'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('fmvouchers'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_geographicpolygon_table.php b/database/migrations/2024_09_24_194122_create_geographicpolygon_table.php new file mode 100644 index 0000000..18458cf --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_geographicpolygon_table.php @@ -0,0 +1,32 @@ +integer('geoThesID')->primary(); + $table->geometry('footprintPolygon'); + $table->longText('footprintWKT')->nullable(); + $table->longText('geoJSON')->nullable(); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + + $table->spatialIndex(['footprintPolygon'], 'ix_geopoly_polygon'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('geographicpolygon'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_geographicthesaurus_table.php b/database/migrations/2024_09_24_194122_create_geographicthesaurus_table.php new file mode 100644 index 0000000..7083277 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_geographicthesaurus_table.php @@ -0,0 +1,42 @@ +integer('geoThesID', true); + $table->string('geoterm', 100)->nullable()->index('ix_geothes_termname'); + $table->string('abbreviation', 45)->nullable()->index('ix_geothes_abbreviation'); + $table->string('iso2', 45)->nullable()->index('ix_geothes_iso2'); + $table->string('iso3', 45)->nullable()->index('ix_geothes_iso3'); + $table->integer('numcode')->nullable(); + $table->string('category', 45)->nullable(); + $table->integer('geoLevel'); + $table->integer('termstatus')->nullable(); + $table->integer('acceptedID')->nullable()->index('fk_geothes_acceptedid_idx'); + $table->integer('parentID')->nullable()->index('fk_geothes_parentid_idx'); + $table->string('notes', 250)->nullable(); + $table->text('dynamicProps')->nullable(); + $table->text('footprintWKT')->nullable(); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + + $table->unique(['geoterm', 'parentID'], 'uq_geothes'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('geographicthesaurus'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_glossary_table.php b/database/migrations/2024_09_24_194122_create_glossary_table.php new file mode 100644 index 0000000..5e52020 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_glossary_table.php @@ -0,0 +1,41 @@ +increments('glossid'); + $table->string('term', 150)->index('index_term'); + $table->string('plural', 150)->nullable()->index('ix_gloassary_plural'); + $table->string('termType', 45)->nullable(); + $table->string('definition', 2000)->nullable(); + $table->string('language', 45)->default('English')->index('index_glossary_lang'); + $table->unsignedInteger('langid')->nullable(); + $table->string('origin', 45)->nullable(); + $table->string('source', 1000)->nullable(); + $table->string('translator', 250)->nullable(); + $table->string('author', 250)->nullable(); + $table->string('notes', 250)->nullable(); + $table->string('notesInternal', 250)->nullable(); + $table->string('resourceUrl', 600)->nullable(); + $table->unsignedInteger('uid')->nullable()->index('fk_glossary_uid_idx'); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('glossary'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_glossarycategory_table.php b/database/migrations/2024_09_24_194122_create_glossarycategory_table.php new file mode 100644 index 0000000..2cace2d --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_glossarycategory_table.php @@ -0,0 +1,37 @@ +integer('glossCatID', true); + $table->string('category', 45)->nullable()->index('ix_glossarycategory_cat'); + $table->integer('rankID')->nullable()->default(10); + $table->integer('langID')->nullable()->index('fk_glossarycategory_lang_idx'); + $table->integer('parentCatID')->nullable()->index('fk_glossarycategory_parentcatid_idx'); + $table->integer('translationCatID')->nullable()->index('fk_glossarycategory_transcatid_idx'); + $table->string('notes', 150)->nullable(); + $table->unsignedInteger('modifiedUid')->nullable(); + $table->timestamp('modifiedTimestamp')->nullable(); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + + $table->unique(['category', 'langID', 'rankID'], 'uq_glossary_category_term'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('glossarycategory'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_glossarycategorylink_table.php b/database/migrations/2024_09_24_194122_create_glossarycategorylink_table.php new file mode 100644 index 0000000..8415841 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_glossarycategorylink_table.php @@ -0,0 +1,29 @@ +integer('glossCatLinkID', true); + $table->unsignedInteger('glossID')->index('fk_glosscatlink_glossid_idx'); + $table->integer('glossCatID')->index('fk_glosscatlink_glosscatid_idx'); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('glossarycategorylink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_glossaryimages_table.php b/database/migrations/2024_09_24_194122_create_glossaryimages_table.php new file mode 100644 index 0000000..794677d --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_glossaryimages_table.php @@ -0,0 +1,35 @@ +increments('glimgid'); + $table->unsignedInteger('glossid')->index('fk_glossaryimages_gloss'); + $table->string('url'); + $table->string('thumbnailurl')->nullable(); + $table->string('structures', 150)->nullable(); + $table->integer('sortSequence')->nullable(); + $table->string('notes', 250)->nullable(); + $table->string('createdBy', 250)->nullable(); + $table->unsignedInteger('uid')->nullable()->index('fk_glossaryimages_uid_idx'); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('glossaryimages'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_glossarysources_table.php b/database/migrations/2024_09_24_194122_create_glossarysources_table.php new file mode 100644 index 0000000..61b23ca --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_glossarysources_table.php @@ -0,0 +1,31 @@ +unsignedInteger('tid')->primary(); + $table->string('contributorTerm', 1000)->nullable(); + $table->string('contributorImage', 1000)->nullable(); + $table->string('translator', 1000)->nullable(); + $table->string('additionalSources', 1000)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('glossarysources'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_glossarytaxalink_table.php b/database/migrations/2024_09_24_194122_create_glossarytaxalink_table.php new file mode 100644 index 0000000..280404b --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_glossarytaxalink_table.php @@ -0,0 +1,30 @@ +unsignedInteger('glossid'); + $table->unsignedInteger('tid')->index('glossarytaxalink_ibfk_1'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['glossid', 'tid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('glossarytaxalink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_glossarytermlink_table.php b/database/migrations/2024_09_24_194122_create_glossarytermlink_table.php new file mode 100644 index 0000000..d6e58b4 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_glossarytermlink_table.php @@ -0,0 +1,32 @@ +integer('gltlinkid', true); + $table->unsignedInteger('glossgrpid'); + $table->unsignedInteger('glossid')->index('glossarytermlink_ibfk_1'); + $table->string('relationshipType', 45)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['glossgrpid', 'glossid'], 'unique_termkeys'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('glossarytermlink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_guidimages_table.php b/database/migrations/2024_09_24_194122_create_guidimages_table.php new file mode 100644 index 0000000..8618dbc --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_guidimages_table.php @@ -0,0 +1,31 @@ +string('guid', 45)->primary(); + $table->unsignedInteger('imgid')->nullable()->unique(); + $table->integer('archivestatus')->default(0); + $table->text('archiveobj')->nullable(); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('guidimages'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_guidoccurdeterminations_table.php b/database/migrations/2024_09_24_194122_create_guidoccurdeterminations_table.php new file mode 100644 index 0000000..cac166c --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_guidoccurdeterminations_table.php @@ -0,0 +1,31 @@ +string('guid', 45)->primary(); + $table->unsignedInteger('detid')->nullable()->unique('guidoccurdet_detid_unique'); + $table->integer('archivestatus')->default(0); + $table->text('archiveobj')->nullable(); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('guidoccurdeterminations'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_guidoccurrences_table.php b/database/migrations/2024_09_24_194122_create_guidoccurrences_table.php new file mode 100644 index 0000000..17cfdc1 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_guidoccurrences_table.php @@ -0,0 +1,31 @@ +string('guid', 45)->primary(); + $table->unsignedInteger('occid')->nullable()->unique(); + $table->integer('archivestatus')->default(0); + $table->text('archiveobj')->nullable(); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('guidoccurrences'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_igsnverification_table.php b/database/migrations/2024_09_24_194122_create_igsnverification_table.php new file mode 100644 index 0000000..5b20c8d --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_igsnverification_table.php @@ -0,0 +1,31 @@ +string('igsn', 15)->index('index_igsn'); + $table->unsignedInteger('occidInPortal')->nullable()->index('fk_igsn_occid_idx'); + $table->unsignedInteger('occidInSesar')->nullable(); + $table->string('catalogNumber', 45)->nullable(); + $table->string('syncStatus', 45)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('igsnverification'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_imageannotations_table.php b/database/migrations/2024_09_24_194122_create_imageannotations_table.php new file mode 100644 index 0000000..33db631 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_imageannotations_table.php @@ -0,0 +1,32 @@ +unsignedInteger('tid')->nullable()->index('tid'); + $table->unsignedInteger('imgid')->default(0); + $table->dateTime('AnnDate')->useCurrent(); + $table->string('Annotator', 100)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['imgid', 'AnnDate']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('imageannotations'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_imagekeywords_table.php b/database/migrations/2024_09_24_194122_create_imagekeywords_table.php new file mode 100644 index 0000000..10dab53 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_imagekeywords_table.php @@ -0,0 +1,30 @@ +integer('imgkeywordid', true); + $table->unsignedInteger('imgid')->index('fk_imagekeywords_imgid_idx'); + $table->string('keyword', 45)->index('index_imagekeyword'); + $table->unsignedInteger('uidassignedby')->nullable()->index('fk_imagekeyword_uid_idx'); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('imagekeywords'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_imageprojectlink_table.php b/database/migrations/2024_09_24_194122_create_imageprojectlink_table.php new file mode 100644 index 0000000..3727ce6 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_imageprojectlink_table.php @@ -0,0 +1,30 @@ +unsignedInteger('imgid'); + $table->integer('imgprojid')->index('fk_imageprojlink_imgprojid_idx'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['imgid', 'imgprojid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('imageprojectlink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_imageprojects_table.php b/database/migrations/2024_09_24_194122_create_imageprojects_table.php new file mode 100644 index 0000000..5b299d5 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_imageprojects_table.php @@ -0,0 +1,36 @@ +integer('imgprojid', true); + $table->string('projectname', 75); + $table->string('managers', 150)->nullable(); + $table->string('description', 1000)->nullable(); + $table->string('projectType', 45)->nullable(); + $table->unsignedInteger('collid')->nullable()->index('fk_imageproject_collid_idx'); + $table->integer('ispublic')->default(1); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('uidcreated')->nullable()->index('fk_imageproject_uid_idx'); + $table->integer('sortsequence')->nullable()->default(50); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('imageprojects'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_images_table.php b/database/migrations/2024_09_24_194122_create_images_table.php new file mode 100644 index 0000000..ecd0b49 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_images_table.php @@ -0,0 +1,59 @@ +increments('imgid'); + $table->unsignedInteger('tid')->nullable()->index('index_tid'); + $table->string('url')->nullable(); + $table->string('thumbnailUrl')->nullable(); + $table->string('originalUrl')->nullable(); + $table->string('archiveUrl')->nullable(); + $table->string('photographer', 100)->nullable(); + $table->unsignedInteger('photographerUid')->nullable()->index('fk_photographeruid'); + $table->string('imageType', 50)->nullable(); + $table->string('format', 45)->nullable(); + $table->string('caption', 100)->nullable(); + $table->string('owner', 250)->nullable(); + $table->string('sourceUrl')->nullable(); + $table->string('referenceUrl')->nullable(); + $table->string('copyright')->nullable(); + $table->string('rights')->nullable(); + $table->string('accessRights')->nullable(); + $table->string('locality', 250)->nullable(); + $table->unsignedInteger('occid')->nullable()->index('fk_images_occ'); + $table->string('notes', 350)->nullable(); + $table->string('anatomy', 100)->nullable(); + $table->string('username', 45)->nullable(); + $table->string('sourceIdentifier', 150)->nullable(); + $table->string('hashFunction', 45)->nullable(); + $table->string('hashValue', 45)->nullable(); + $table->string('mediaMD5', 45)->nullable(); + $table->integer('pixelYDimension')->nullable(); + $table->integer('pixelXDimension')->nullable(); + $table->text('dynamicProperties')->nullable(); + $table->integer('defaultDisplay')->nullable(); + $table->string('recordID', 45)->nullable()->index('ix_images_recordid'); + $table->unsignedInteger('sortSequence')->default(50); + $table->integer('sortOccurrence')->nullable()->default(5); + $table->timestamp('initialTimestamp')->useCurrent()->index('index_images_datelastmod'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('images'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_imagetag_table.php b/database/migrations/2024_09_24_194122_create_imagetag_table.php new file mode 100644 index 0000000..135a0a1 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_imagetag_table.php @@ -0,0 +1,33 @@ +bigInteger('imagetagid', true); + $table->unsignedInteger('imgid')->index('fk_imagetag_imgid_idx'); + $table->string('keyvalue', 30)->index('keyvalue'); + $table->string('imageBoundingBox', 45)->nullable(); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['imgid', 'keyvalue'], 'imgid'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('imagetag'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_imagetaggroup_table.php b/database/migrations/2024_09_24_194122_create_imagetaggroup_table.php new file mode 100644 index 0000000..99a90f7 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_imagetaggroup_table.php @@ -0,0 +1,33 @@ +integer('imgTagGroupID', true); + $table->string('groupName', 45)->index('ix_imagetaggroup'); + $table->string('category', 45)->nullable(); + $table->string('resourceUrl', 150)->nullable(); + $table->string('audubonCoreTarget', 45)->nullable(); + $table->string('controlType', 45)->nullable(); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('imagetaggroup'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_imagetagkey_table.php b/database/migrations/2024_09_24_194122_create_imagetagkey_table.php new file mode 100644 index 0000000..667a18c --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_imagetagkey_table.php @@ -0,0 +1,34 @@ +string('tagkey', 30)->primary(); + $table->integer('imgTagGroupID')->nullable()->index('fk_imagetagkey_imgtaggroupid_idx'); + $table->string('shortlabel', 30); + $table->string('description_en'); + $table->string('tagDescription'); + $table->string('resourceLink', 250)->nullable(); + $table->string('audubonCoreTarget', 45)->nullable(); + $table->integer('sortorder')->index('sortorder'); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('imagetagkey'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_institutions_table.php b/database/migrations/2024_09_24_194122_create_institutions_table.php new file mode 100644 index 0000000..564697a --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_institutions_table.php @@ -0,0 +1,44 @@ +increments('iid'); + $table->string('institutionID', 45)->nullable(); + $table->string('InstitutionCode', 45); + $table->string('InstitutionName', 150); + $table->string('InstitutionName2')->nullable(); + $table->string('Address1', 150)->nullable(); + $table->string('Address2', 150)->nullable(); + $table->string('City', 45)->nullable(); + $table->string('StateProvince', 45)->nullable(); + $table->string('PostalCode', 45)->nullable(); + $table->string('Country', 45)->nullable(); + $table->string('Phone', 100)->nullable(); + $table->string('Contact')->nullable(); + $table->string('Email')->nullable(); + $table->string('Url', 250)->nullable(); + $table->text('Notes')->nullable(); + $table->unsignedInteger('modifieduid')->nullable()->index('fk_inst_uid_idx'); + $table->dateTime('modifiedTimeStamp')->nullable(); + $table->timestamp('IntialTimeStamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('institutions'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_kmcharacterlang_table.php b/database/migrations/2024_09_24_194122_create_kmcharacterlang_table.php new file mode 100644 index 0000000..b525c6c --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_kmcharacterlang_table.php @@ -0,0 +1,35 @@ +unsignedInteger('cid'); + $table->string('charname', 150); + $table->string('language', 45)->nullable(); + $table->integer('langid')->index('fk_charlang_lang_idx'); + $table->string('notes')->nullable(); + $table->string('description')->nullable(); + $table->string('helpurl', 500)->nullable(); + $table->timestamp('InitialTimeStamp')->useCurrent(); + + $table->primary(['cid', 'langid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kmcharacterlang'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_kmcharacters_table.php b/database/migrations/2024_09_24_194122_create_kmcharacters_table.php new file mode 100644 index 0000000..6bd9faa --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_kmcharacters_table.php @@ -0,0 +1,41 @@ +increments('cid'); + $table->string('charname', 150)->index('index_charname'); + $table->string('chartype', 2)->default('UM'); + $table->string('defaultlang', 45)->default('English'); + $table->unsignedSmallInteger('difficultyrank')->default(1); + $table->unsignedInteger('hid')->nullable()->index('fk_charheading_idx'); + $table->string('units', 45)->nullable(); + $table->string('description')->nullable(); + $table->unsignedInteger('glossid')->nullable()->index('fk_kmchar_glossary_idx'); + $table->string('helpurl', 500)->nullable(); + $table->string('referenceUrl', 250)->nullable(); + $table->string('notes')->nullable(); + $table->integer('activationCode')->nullable(); + $table->unsignedInteger('sortsequence')->nullable()->index('index_sort'); + $table->string('enteredby', 45)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kmcharacters'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_kmchardependance_table.php b/database/migrations/2024_09_24_194122_create_kmchardependance_table.php new file mode 100644 index 0000000..067cd2d --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_kmchardependance_table.php @@ -0,0 +1,32 @@ +unsignedInteger('CID')->index('fk_chardependance_cid_idx'); + $table->unsignedInteger('CIDDependance'); + $table->string('CSDependance', 16); + $table->timestamp('InitialTimeStamp')->useCurrent(); + + $table->index(['CIDDependance', 'CSDependance'], 'fk_chardependance_cs_idx'); + $table->primary(['CSDependance', 'CIDDependance', 'CID']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kmchardependance'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_kmcharheading_table.php b/database/migrations/2024_09_24_194122_create_kmcharheading_table.php new file mode 100644 index 0000000..2c90b58 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_kmcharheading_table.php @@ -0,0 +1,35 @@ +increments('hid'); + $table->string('headingname')->index('headingname'); + $table->string('language', 45)->nullable()->default('English'); + $table->integer('langid')->index('fk_kmcharheading_lang_idx'); + $table->longText('notes')->nullable(); + $table->integer('sortsequence')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['hid', 'langid']); + $table->unique(['headingname', 'langid'], 'unique_kmcharheading'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kmcharheading'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_kmcharheadinglang_table.php b/database/migrations/2024_09_24_194122_create_kmcharheadinglang_table.php new file mode 100644 index 0000000..67e567b --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_kmcharheadinglang_table.php @@ -0,0 +1,32 @@ +unsignedInteger('hid'); + $table->integer('langid')->index('fk_kmcharheadinglang_langid'); + $table->string('headingname', 100); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + + $table->primary(['hid', 'langid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kmcharheadinglang'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_kmchartaxalink_table.php b/database/migrations/2024_09_24_194122_create_kmchartaxalink_table.php new file mode 100644 index 0000000..e40cf33 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_kmchartaxalink_table.php @@ -0,0 +1,34 @@ +unsignedInteger('CID')->default(0); + $table->unsignedInteger('TID')->default(0)->index('fk_chartaxalink-tid'); + $table->string('Status', 50)->nullable(); + $table->string('Notes')->nullable(); + $table->string('Relation', 45)->default('include'); + $table->boolean('EditabilityInherited')->nullable(); + $table->timestamp('timestamp')->useCurrent(); + + $table->primary(['CID', 'TID']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kmchartaxalink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_kmcs_table.php b/database/migrations/2024_09_24_194122_create_kmcs_table.php new file mode 100644 index 0000000..b6f03c2 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_kmcs_table.php @@ -0,0 +1,40 @@ +unsignedInteger('cid')->default(0)->index('fk_cs_chars'); + $table->string('cs', 16); + $table->string('CharStateName')->nullable(); + $table->boolean('Implicit')->default(false); + $table->longText('Notes')->nullable(); + $table->string('Description')->nullable(); + $table->string('IllustrationUrl', 250)->nullable(); + $table->string('referenceUrl', 250)->nullable(); + $table->unsignedInteger('glossid')->nullable()->index('fk_kmcs_glossid_idx'); + $table->unsignedInteger('StateID')->nullable(); + $table->unsignedInteger('SortSequence')->nullable(); + $table->timestamp('InitialTimeStamp')->useCurrent(); + $table->string('EnteredBy', 45)->nullable(); + + $table->primary(['cs', 'cid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kmcs'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_kmcsimages_table.php b/database/migrations/2024_09_24_194122_create_kmcsimages_table.php new file mode 100644 index 0000000..927ce59 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_kmcsimages_table.php @@ -0,0 +1,35 @@ +increments('csimgid'); + $table->unsignedInteger('cid'); + $table->string('cs', 16); + $table->string('url'); + $table->string('notes', 250)->nullable(); + $table->string('sortsequence', 45)->default('50'); + $table->string('username', 45)->nullable(); + $table->timestamp('initialtimestamp')->useCurrentOnUpdate()->useCurrent(); + + $table->index(['cid', 'cs'], 'fk_kscsimages_kscs_idx'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kmcsimages'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_kmcslang_table.php b/database/migrations/2024_09_24_194122_create_kmcslang_table.php new file mode 100644 index 0000000..8a99067 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_kmcslang_table.php @@ -0,0 +1,35 @@ +unsignedInteger('cid'); + $table->string('cs', 16); + $table->string('charstatename', 150); + $table->string('language', 45); + $table->integer('langid')->index('fk_cslang_lang_idx'); + $table->string('description')->nullable(); + $table->string('notes')->nullable(); + $table->timestamp('intialtimestamp')->useCurrent(); + + $table->primary(['cid', 'cs', 'langid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kmcslang'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_kmdescr_table.php b/database/migrations/2024_09_24_194122_create_kmdescr_table.php new file mode 100644 index 0000000..b9ab84f --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_kmdescr_table.php @@ -0,0 +1,41 @@ +unsignedInteger('TID')->default(0); + $table->unsignedInteger('CID')->default(0); + $table->string('Modifier')->nullable(); + $table->string('CS', 16); + $table->double('X')->nullable(); + $table->longText('TXT')->nullable(); + $table->unsignedInteger('PseudoTrait')->nullable()->default(0); + $table->unsignedInteger('Frequency')->default(5)->comment('Frequency of occurrence; 1 = rare... 5 = common'); + $table->string('Inherited', 50)->nullable(); + $table->string('Source', 100)->nullable(); + $table->integer('Seq')->nullable(); + $table->longText('Notes')->nullable(); + $table->timestamp('DateEntered')->useCurrent(); + + $table->index(['CID', 'CS'], 'csdescr'); + $table->primary(['TID', 'CID', 'CS']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kmdescr'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_kmdescrdeletions_table.php b/database/migrations/2024_09_24_194122_create_kmdescrdeletions_table.php new file mode 100644 index 0000000..04a32e8 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_kmdescrdeletions_table.php @@ -0,0 +1,39 @@ +unsignedInteger('TID'); + $table->unsignedInteger('CID'); + $table->string('CS', 16); + $table->string('Modifier')->nullable(); + $table->double('X')->nullable(); + $table->longText('TXT')->nullable(); + $table->string('Inherited', 50)->nullable(); + $table->string('Source', 100)->nullable(); + $table->unsignedInteger('Seq')->nullable(); + $table->longText('Notes')->nullable(); + $table->dateTime('InitialTimeStamp')->nullable(); + $table->string('DeletedBy', 100); + $table->timestamp('DeletedTimeStamp')->useCurrent(); + $table->increments('PK'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kmdescrdeletions'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_lkupcountry_table.php b/database/migrations/2024_09_24_194122_create_lkupcountry_table.php new file mode 100644 index 0000000..60f79ff --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_lkupcountry_table.php @@ -0,0 +1,31 @@ +integer('countryId', true); + $table->string('countryName', 100)->unique('country_unique'); + $table->string('iso', 2)->nullable()->index('index_lkupcountry_iso'); + $table->string('iso3', 3)->nullable()->index('index_lkupcountry_iso3'); + $table->integer('numcode')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('lkupcountry'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_lkupcounty_table.php b/database/migrations/2024_09_24_194122_create_lkupcounty_table.php new file mode 100644 index 0000000..413fb67 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_lkupcounty_table.php @@ -0,0 +1,31 @@ +integer('countyId', true); + $table->integer('stateId')->index('fk_stateprovince'); + $table->string('countyName', 100)->index('index_countyname'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['stateId', 'countyName'], 'unique_county'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('lkupcounty'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_lkupmunicipality_table.php b/database/migrations/2024_09_24_194122_create_lkupmunicipality_table.php new file mode 100644 index 0000000..dda1c50 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_lkupmunicipality_table.php @@ -0,0 +1,31 @@ +integer('municipalityId', true); + $table->integer('stateId')->index('fk_stateprovince'); + $table->string('municipalityName', 100)->index('index_municipalityname'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['stateId', 'municipalityName'], 'unique_municipality'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('lkupmunicipality'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_lkupstateprovince_table.php b/database/migrations/2024_09_24_194122_create_lkupstateprovince_table.php new file mode 100644 index 0000000..cf5d846 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_lkupstateprovince_table.php @@ -0,0 +1,32 @@ +integer('stateId', true); + $table->integer('countryId')->index('fk_country'); + $table->string('stateName', 100)->index('index_statename'); + $table->string('abbrev', 3)->nullable()->index('index_lkupstate_abbr'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['stateName', 'countryId'], 'state_index'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('lkupstateprovince'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_media_table.php b/database/migrations/2024_09_24_194122_create_media_table.php new file mode 100644 index 0000000..3a4a971 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_media_table.php @@ -0,0 +1,61 @@ +increments('media_id'); + $table->unsignedInteger('tid')->nullable()->index('fk_media_taxa'); + $table->unsignedInteger('occid')->nullable()->index('fk_media_occid'); + $table->string('url', 250)->nullable(); + $table->string('thumbnailUrl')->nullable(); + $table->string('originalUrl')->nullable(); + $table->string('archiveUrl')->nullable(); + $table->string('sourceurl', 250)->nullable(); + $table->string('referenceUrl')->nullable(); + $table->string('caption', 250)->nullable(); + $table->unsignedInteger('creatoruid')->nullable()->index('fk_creator_uid'); + $table->string('creator', 45)->nullable(); + $table->string('media_type', 45)->nullable(); + $table->string('imageType', 50)->nullable(); + $table->string('format', 45)->nullable(); + $table->string('owner', 250)->nullable(); + $table->string('locality', 250)->nullable(); + $table->string('description', 1000)->nullable(); + $table->string('notes', 350)->nullable(); + $table->string('mediaMD5', 45)->nullable(); + $table->string('anatomy', 100)->nullable(); + $table->string('username', 45)->nullable(); + $table->string('sourceIdentifier', 150)->nullable(); + $table->string('hashFunction', 45)->nullable(); + $table->string('hashValue', 45)->nullable(); + $table->integer('pixelYDimension')->nullable(); + $table->integer('pixelXDimension')->nullable(); + $table->text('dynamicProperties')->nullable(); + $table->integer('defaultDisplay')->nullable(); + $table->string('recordID', 45)->nullable(); + $table->string('copyright')->nullable(); + $table->string('rights')->nullable(); + $table->string('accessRights')->nullable(); + $table->integer('sortsequence')->nullable(); + $table->integer('sortOccurrence')->nullable()->default(5); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('media'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omcollcategories_table.php b/database/migrations/2024_09_24_194122_create_omcollcategories_table.php new file mode 100644 index 0000000..e3e1e2e --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omcollcategories_table.php @@ -0,0 +1,34 @@ +increments('ccpk'); + $table->string('category', 75); + $table->string('icon', 250)->nullable(); + $table->string('acronym', 45)->nullable(); + $table->string('url', 250)->nullable(); + $table->integer('inclusive')->nullable()->default(1); + $table->string('notes', 250)->nullable(); + $table->integer('sortsequence')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omcollcategories'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omcollcatlink_table.php b/database/migrations/2024_09_24_194122_create_omcollcatlink_table.php new file mode 100644 index 0000000..ac9b180 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omcollcatlink_table.php @@ -0,0 +1,32 @@ +unsignedInteger('ccpk'); + $table->unsignedInteger('collid')->index('fk_collcatlink_coll'); + $table->boolean('isPrimary')->nullable()->default(true); + $table->integer('sortsequence')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['ccpk', 'collid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omcollcatlink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omcollections_table.php b/database/migrations/2024_09_24_194122_create_omcollections_table.php new file mode 100644 index 0000000..7caa6d1 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omcollections_table.php @@ -0,0 +1,65 @@ +increments('collID'); + $table->string('institutionCode', 45); + $table->string('collectionCode', 45)->nullable(); + $table->string('collectionName', 150); + $table->string('collectionID', 100)->nullable(); + $table->string('datasetID', 250)->nullable(); + $table->string('datasetName', 100)->nullable(); + $table->unsignedInteger('iid')->nullable()->index('fk_collid_iid_idx'); + $table->string('fullDescription', 2000)->nullable(); + $table->string('homepage', 250)->nullable(); + $table->longText('resourceJson')->nullable(); + $table->string('individualUrl', 500)->nullable(); + $table->string('Contact', 250)->nullable(); + $table->string('email', 45)->nullable(); + $table->longText('contactJson')->nullable(); + $table->double('latitudeDecimal')->nullable(); + $table->double('longitudeDecimal')->nullable(); + $table->string('icon', 250)->nullable(); + $table->string('collType', 45)->default('Preserved Specimens')->comment('Preserved Specimens, General Observations, Observations'); + $table->string('managementType', 45)->nullable()->default('Snapshot')->comment('Snapshot, Live Data'); + $table->unsignedInteger('publicEdits')->default(1); + $table->string('collectionGuid', 45)->nullable(); + $table->string('securityKey', 45)->nullable(); + $table->string('guidTarget', 45)->nullable(); + $table->string('rightsHolder', 250)->nullable(); + $table->string('rights', 250)->nullable(); + $table->string('usageTerm', 250)->nullable(); + $table->integer('publishToGbif')->nullable(); + $table->integer('publishToIdigbio')->nullable(); + $table->string('aggKeysStr', 1000)->nullable(); + $table->text('dwcTermJson')->nullable(); + $table->string('recordID', 45)->nullable(); + $table->string('dwcaUrl', 250)->nullable(); + $table->string('bibliographicCitation', 1000)->nullable(); + $table->string('accessRights', 1000)->nullable(); + $table->text('dynamicProperties')->nullable(); + $table->unsignedInteger('sortSeq')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + + $table->unique(['institutionCode', 'collectionCode'], 'index_inst'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omcollections'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omcollectionstats_table.php b/database/migrations/2024_09_24_194122_create_omcollectionstats_table.php new file mode 100644 index 0000000..a51305c --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omcollectionstats_table.php @@ -0,0 +1,36 @@ +unsignedInteger('collid')->primary(); + $table->unsignedInteger('recordcnt')->default(0); + $table->unsignedInteger('georefcnt')->nullable(); + $table->unsignedInteger('familycnt')->nullable(); + $table->unsignedInteger('genuscnt')->nullable(); + $table->unsignedInteger('speciescnt')->nullable(); + $table->dateTime('uploaddate')->nullable(); + $table->dateTime('datelastmodified')->nullable(); + $table->string('uploadedby', 45)->nullable(); + $table->longText('dynamicProperties')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omcollectionstats'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omcollproperties_table.php b/database/migrations/2024_09_24_194122_create_omcollproperties_table.php new file mode 100644 index 0000000..d0de267 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omcollproperties_table.php @@ -0,0 +1,34 @@ +increments('collPropID'); + $table->unsignedInteger('collid')->index('fk_omcollproperties_collid_idx'); + $table->string('propCategory', 45); + $table->string('propTitle', 45); + $table->longText('propJson')->nullable(); + $table->string('notes')->nullable(); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_omcollproperties_uid_idx'); + $table->dateTime('modifiedTimestamp')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omcollproperties'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omcollpublications_table.php b/database/migrations/2024_09_24_194122_create_omcollpublications_table.php new file mode 100644 index 0000000..daa7258 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omcollpublications_table.php @@ -0,0 +1,36 @@ +increments('pubid'); + $table->unsignedInteger('collid')->index('fk_adminpub_collid_idx'); + $table->string('targeturl', 250); + $table->string('securityguid', 45); + $table->string('criteriajson', 250)->nullable(); + $table->integer('includedeterminations')->nullable()->default(1); + $table->integer('includeimages')->nullable()->default(1); + $table->integer('autoupdate')->nullable()->default(0); + $table->dateTime('lastdateupdate')->nullable(); + $table->integer('updateinterval')->nullable(); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omcollpublications'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omcollpuboccurlink_table.php b/database/migrations/2024_09_24_194122_create_omcollpuboccurlink_table.php new file mode 100644 index 0000000..ba8d0e2 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omcollpuboccurlink_table.php @@ -0,0 +1,32 @@ +unsignedInteger('pubid'); + $table->unsignedInteger('occid')->index('fk_ompuboccid_idx'); + $table->integer('verification')->default(0); + $table->dateTime('refreshtimestamp'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['pubid', 'occid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omcollpuboccurlink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omcollsecondary_table.php b/database/migrations/2024_09_24_194122_create_omcollsecondary_table.php new file mode 100644 index 0000000..d9087e2 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omcollsecondary_table.php @@ -0,0 +1,42 @@ +increments('ocsid'); + $table->unsignedInteger('collid')->index('fk_omcollsecondary_coll'); + $table->string('InstitutionCode', 45); + $table->string('CollectionCode', 45)->nullable(); + $table->string('CollectionName', 150); + $table->string('BriefDescription', 300)->nullable(); + $table->string('FullDescription', 1000)->nullable(); + $table->string('Homepage', 250)->nullable(); + $table->string('IndividualUrl', 500)->nullable(); + $table->string('Contact', 45)->nullable(); + $table->string('Email', 45)->nullable(); + $table->double('LatitudeDecimal')->nullable(); + $table->double('LongitudeDecimal')->nullable(); + $table->string('icon', 250)->nullable(); + $table->string('CollType', 45)->nullable(); + $table->unsignedInteger('SortSeq')->nullable(); + $table->timestamp('InitialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omcollsecondary'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omcrowdsourcecentral_table.php b/database/migrations/2024_09_24_194122_create_omcrowdsourcecentral_table.php new file mode 100644 index 0000000..91e1cb8 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omcrowdsourcecentral_table.php @@ -0,0 +1,34 @@ +integer('omcsid', true); + $table->unsignedInteger('collid')->index('fk_omcrowdsourcecentral_collid'); + $table->text('instructions')->nullable(); + $table->string('trainingurl', 500)->nullable(); + $table->integer('editorlevel')->default(0)->comment('0=public, 1=public limited, 2=private'); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['collid'], 'index_omcrowdsourcecentral_collid'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omcrowdsourcecentral'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omcrowdsourceproject_table.php b/database/migrations/2024_09_24_194122_create_omcrowdsourceproject_table.php new file mode 100644 index 0000000..93a53cb --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omcrowdsourceproject_table.php @@ -0,0 +1,36 @@ +integer('csProjID', true); + $table->string('title', 45); + $table->string('description', 250)->nullable(); + $table->text('instructions')->nullable(); + $table->string('trainingurl', 250)->nullable(); + $table->string('managers', 150)->nullable(); + $table->string('criteria', 1500)->nullable(); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_croudsourceproj_uid_idx'); + $table->dateTime('modifiedTimestamp')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omcrowdsourceproject'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omcrowdsourcequeue_table.php b/database/migrations/2024_09_24_194122_create_omcrowdsourcequeue_table.php new file mode 100644 index 0000000..24f72e4 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omcrowdsourcequeue_table.php @@ -0,0 +1,39 @@ +integer('idomcrowdsourcequeue', true); + $table->integer('omcsid'); + $table->integer('csProjID')->nullable()->index('fk_omcrowdsourcequeue_csprojid_idx'); + $table->unsignedInteger('occid')->index('fk_omcrowdsourcequeue_occid'); + $table->integer('reviewstatus')->default(0)->comment('0=open,5=pending review, 10=closed'); + $table->unsignedInteger('uidprocessor')->nullable()->index('fk_omcrowdsourcequeue_uid'); + $table->integer('points')->nullable()->comment('0=fail, 1=minor edits, 2=no edits , 3=excelled'); + $table->integer('isvolunteer')->default(1); + $table->dateTime('dateProcessed')->nullable(); + $table->dateTime('dateReviewed')->nullable(); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['occid'], 'index_omcrowdsource_occid'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omcrowdsourcequeue'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omexsiccatinumbers_table.php b/database/migrations/2024_09_24_194122_create_omexsiccatinumbers_table.php new file mode 100644 index 0000000..a51bfff --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omexsiccatinumbers_table.php @@ -0,0 +1,32 @@ +increments('omenid'); + $table->string('exsnumber', 45); + $table->unsignedInteger('ometid')->index('fk_exsiccatititlenumber'); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['exsnumber', 'ometid'], 'index_omexsiccatinumbers_unique'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omexsiccatinumbers'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omexsiccatiocclink_table.php b/database/migrations/2024_09_24_194122_create_omexsiccatiocclink_table.php new file mode 100644 index 0000000..3abbe0b --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omexsiccatiocclink_table.php @@ -0,0 +1,33 @@ +unsignedInteger('omenid')->index('fkexsiccatinumocclink1'); + $table->unsignedInteger('occid')->index('fkexsiccatinumocclink2'); + $table->integer('ranking')->default(50); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['omenid', 'occid']); + $table->unique(['occid'], 'uniqueomexsiccatiocclink'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omexsiccatiocclink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omexsiccatititles_table.php b/database/migrations/2024_09_24_194122_create_omexsiccatititles_table.php new file mode 100644 index 0000000..76d113c --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omexsiccatititles_table.php @@ -0,0 +1,38 @@ +increments('ometid'); + $table->string('title', 150)->index('index_exsiccatititle'); + $table->string('abbreviation', 100)->nullable(); + $table->string('editor', 150)->nullable(); + $table->string('exsrange', 45)->nullable(); + $table->string('startdate', 45)->nullable(); + $table->string('enddate', 45)->nullable(); + $table->string('source', 250)->nullable(); + $table->string('sourceIdentifier', 150)->nullable(); + $table->string('notes', 2000)->nullable(); + $table->string('lasteditedby', 45)->nullable(); + $table->string('recordID', 45)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omexsiccatititles'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_ommaterialsample_table.php b/database/migrations/2024_09_24_194122_create_ommaterialsample_table.php new file mode 100644 index 0000000..a715a4b --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_ommaterialsample_table.php @@ -0,0 +1,43 @@ +increments('matSampleID'); + $table->unsignedInteger('occid')->index('fk_ommatsample_occid_idx'); + $table->string('sampleType', 45)->index('ix_ommatsample_sampletype'); + $table->string('catalogNumber', 45)->nullable(); + $table->string('guid', 150)->nullable(); + $table->string('sampleCondition', 45)->nullable(); + $table->string('disposition', 45)->nullable(); + $table->string('preservationType', 45)->nullable(); + $table->string('preparationDetails', 250)->nullable(); + $table->date('preparationDate')->nullable(); + $table->unsignedInteger('preparedByUid')->nullable()->index('fk_ommatsample_prepuid_idx'); + $table->string('individualCount', 45)->nullable(); + $table->string('sampleSize', 45)->nullable(); + $table->string('storageLocation', 45)->nullable(); + $table->string('remarks', 250)->nullable(); + $table->json('dynamicFields')->nullable(); + $table->string('recordID', 45)->nullable()->unique('uq_ommatsample_recordid'); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('ommaterialsample'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccuraccess_table.php b/database/migrations/2024_09_24_194122_create_omoccuraccess_table.php new file mode 100644 index 0000000..f992c43 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccuraccess_table.php @@ -0,0 +1,32 @@ +bigIncrements('occurAccessID'); + $table->string('ipaddress', 45); + $table->string('accessType', 45); + $table->text('queryStr')->nullable(); + $table->text('userAgent')->nullable(); + $table->string('frontendGuid', 45)->nullable(); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccuraccess'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccuraccesslink_table.php b/database/migrations/2024_09_24_194122_create_omoccuraccesslink_table.php new file mode 100644 index 0000000..7a8a2d9 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccuraccesslink_table.php @@ -0,0 +1,30 @@ +unsignedBigInteger('occurAccessID'); + $table->unsignedInteger('occid'); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + + $table->primary(['occurAccessID', 'occid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccuraccesslink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccuraccesssummary_table.php b/database/migrations/2024_09_24_194122_create_omoccuraccesssummary_table.php new file mode 100644 index 0000000..f1af7b3 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccuraccesssummary_table.php @@ -0,0 +1,35 @@ +bigIncrements('oasid'); + $table->string('ipaddress', 45); + $table->date('accessDate'); + $table->unsignedInteger('cnt'); + $table->string('accessType', 45); + $table->text('queryStr')->nullable(); + $table->text('userAgent')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + + $table->unique(['ipaddress', 'accessDate', 'accessType'], 'unique_occuraccess'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccuraccesssummary'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccuraccesssummarylink_table.php b/database/migrations/2024_09_24_194122_create_omoccuraccesssummarylink_table.php new file mode 100644 index 0000000..5ed1771 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccuraccesssummarylink_table.php @@ -0,0 +1,30 @@ +unsignedBigInteger('oasid'); + $table->unsignedInteger('occid')->index('omoccuraccesssummarylink_occid_idx'); + $table->timestamp('initialTimestamp')->useCurrent(); + + $table->primary(['oasid', 'occid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccuraccesssummarylink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurarchive_table.php b/database/migrations/2024_09_24_194122_create_omoccurarchive_table.php new file mode 100644 index 0000000..7308952 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurarchive_table.php @@ -0,0 +1,35 @@ +increments('archiveID'); + $table->text('archiveObj'); + $table->unsignedInteger('occid')->nullable()->unique('uq_occurarchive_occid'); + $table->string('catalogNumber', 45)->nullable()->index('ix_occurarchive_catnum'); + $table->string('occurrenceID')->nullable()->index('ix_occurarchive_occurrenceid'); + $table->string('recordID', 45)->nullable()->index('ix_occurarchive_recordid'); + $table->string('archiveReason', 45)->nullable(); + $table->string('remarks', 150)->nullable(); + $table->unsignedInteger('createdUid')->nullable()->index('fk_occurarchive_uid_idx'); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurarchive'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurassociations_table.php b/database/migrations/2024_09_24_194122_create_omoccurassociations_table.php new file mode 100644 index 0000000..055d9ad --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurassociations_table.php @@ -0,0 +1,57 @@ +increments('associd'); + $table->unsignedInteger('occid')->index('ix_ossococcur_occid'); + $table->string('associationType', 45); + $table->unsignedInteger('occidAssociate')->nullable()->index('ix_ossococcur_occidassoc'); + $table->string('relationship', 150)->comment('dwc:relationshipOfResource'); + $table->string('relationshipID', 45)->nullable()->comment('dwc:relationshipOfResourceID (e.g. ontology link)'); + $table->string('subType', 45)->nullable(); + $table->string('objectID', 250)->nullable()->comment('dwc:relatedResourceID (object identifier)'); + $table->string('identifier', 250)->nullable()->index('ix_occurassoc_identifier')->comment('Deprecated field'); + $table->string('basisOfRecord', 45)->nullable(); + $table->string('resourceUrl', 250)->nullable()->comment('link to resource'); + $table->string('verbatimSciname', 250)->nullable()->index('ix_occurassoc_verbatimsciname'); + $table->unsignedInteger('tid')->nullable()->index('fk_occurassoc_tid_idx'); + $table->string('locationOnHost', 250)->nullable(); + $table->string('conditionOfAssociate', 250)->nullable(); + $table->dateTime('establishedDate')->nullable()->comment('dwc:relationshipEstablishedDate'); + $table->text('imageMapJSON')->nullable(); + $table->text('dynamicProperties')->nullable(); + $table->string('notes', 250)->nullable()->comment('dwc:relationshipRemarks'); + $table->string('accordingTo', 45)->nullable()->comment('dwc:relationshipAccordingTo (verbatim text)'); + $table->string('instanceID', 45)->nullable()->comment('dwc:resourceRelationshipID, if association was defined externally '); + $table->string('sourceIdentifier', 45)->nullable()->comment('deprecated field'); + $table->string('recordID', 45)->nullable()->index('ix_occurassoc_recordid')->comment('dwc:resourceRelationshipID, if association was defined internally '); + $table->unsignedInteger('createdUid')->nullable()->index('fk_occurassoc_uidcreated_idx'); + $table->dateTime('modifiedTimestamp')->nullable(); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_occurassoc_uidmodified_idx'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['occid', 'relationship', 'resourceUrl'], 'uq_omoccurassoc_external'); + $table->unique(['occid', 'identifier'], 'uq_omoccurassoc_identifier'); + $table->unique(['occid', 'occidAssociate', 'relationship'], 'uq_omoccurassoc_occid'); + $table->unique(['occid', 'verbatimSciname', 'associationType'], 'uq_omoccurassoc_sciname'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurassociations'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurcomments_table.php b/database/migrations/2024_09_24_194122_create_omoccurcomments_table.php new file mode 100644 index 0000000..5525c8b --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurcomments_table.php @@ -0,0 +1,32 @@ +integer('comid', true); + $table->unsignedInteger('occid')->index('fk_omoccurcomments_occid'); + $table->text('comment'); + $table->unsignedInteger('uid')->index('fk_omoccurcomments_uid'); + $table->unsignedInteger('reviewstatus')->default(0); + $table->unsignedInteger('parentcomid')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurcomments'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurdatasetlink_table.php b/database/migrations/2024_09_24_194122_create_omoccurdatasetlink_table.php new file mode 100644 index 0000000..58a2eb9 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurdatasetlink_table.php @@ -0,0 +1,31 @@ +unsignedInteger('occid')->index('fk_omoccurdatasetlink_occid'); + $table->unsignedInteger('datasetid')->index('fk_omoccurdatasetlink_datasetid'); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['occid', 'datasetid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurdatasetlink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurdatasets_table.php b/database/migrations/2024_09_24_194122_create_omoccurdatasets_table.php new file mode 100644 index 0000000..1162b22 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurdatasets_table.php @@ -0,0 +1,41 @@ +increments('datasetID'); + $table->string('datasetName', 150)->nullable(); + $table->string('bibliographicCitation', 500)->nullable(); + $table->string('name', 100); + $table->string('category', 45)->nullable(); + $table->integer('isPublic')->nullable(); + $table->unsignedInteger('parentDatasetID')->nullable()->index('fk_omoccurdatasets_parent_idx'); + $table->integer('includeInSearch')->nullable(); + $table->text('description')->nullable(); + $table->string('datasetIdentifier', 150)->nullable(); + $table->string('notes', 250)->nullable(); + $table->text('dynamicProperties')->nullable(); + $table->integer('sortSequence')->nullable(); + $table->unsignedInteger('uid')->nullable()->index('fk_omoccurdatasets_uid_idx'); + $table->unsignedInteger('collid')->nullable()->index('fk_omcollections_collid_idx'); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurdatasets'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurdeterminations_table.php b/database/migrations/2024_09_24_194122_create_omoccurdeterminations_table.php new file mode 100644 index 0000000..84d47ee --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurdeterminations_table.php @@ -0,0 +1,63 @@ +increments('detid'); + $table->unsignedInteger('occid'); + $table->string('identifiedBy')->default(''); + $table->bigInteger('identifiedByAgentID')->nullable()->index('fk_omoccurdets_agentid_idx'); + $table->string('identifiedByID', 45)->nullable(); + $table->string('dateIdentified', 45)->default(''); + $table->date('dateIdentifiedInterpreted')->nullable()->index('ix_omoccurdets_dateidinterpreted'); + $table->string('higherClassification', 150)->nullable(); + $table->string('family')->nullable()->index('ix_omoccurdets_family'); + $table->string('sciname')->index('ix_omoccurdets_sciname'); + $table->string('verbatimIdentification', 250)->nullable(); + $table->string('scientificNameAuthorship')->nullable(); + $table->unsignedInteger('tidInterpreted')->nullable()->index('fk_omoccurdets_tid'); + $table->string('identificationQualifier')->nullable(); + $table->string('genus', 45)->nullable(); + $table->string('specificEpithet', 45)->nullable(); + $table->string('verbatimTaxonRank', 45)->nullable(); + $table->string('taxonRank', 45)->nullable(); + $table->string('infraSpecificEpithet', 45)->nullable(); + $table->integer('isCurrent')->nullable()->default(0)->index('ix_omoccurdets_iscurrent'); + $table->integer('printQueue')->nullable()->default(0); + $table->integer('appliedStatus')->nullable()->default(1); + $table->integer('securityStatus')->default(0); + $table->string('securityStatusReason', 100)->nullable(); + $table->string('detType', 45)->nullable(); + $table->string('identificationReferences', 2000)->nullable(); + $table->string('identificationRemarks', 2000)->nullable(); + $table->string('taxonRemarks', 2000)->nullable(); + $table->string('identificationVerificationStatus', 45)->nullable(); + $table->string('taxonConceptID', 45)->nullable(); + $table->string('sourceIdentifier', 45)->nullable(); + $table->unsignedInteger('sortSequence')->nullable()->default(10); + $table->string('recordID', 45)->nullable()->index('ix_omoccurdets_recordid'); + $table->unsignedInteger('enteredByUid')->nullable()->index('fk_omoccurdets_uid_idx'); + $table->timestamp('dateLastModified')->nullable()->index('fk_omoccurdets_datemodified'); + $table->timestamp('initialTimestamp')->useCurrent()->index('fk_omoccurdets_initialtimestamp'); + + $table->unique(['occid', 'dateIdentified', 'identifiedBy', 'sciname'], 'uq_omoccurdets_unique'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurdeterminations'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurduplicatelink_table.php b/database/migrations/2024_09_24_194122_create_omoccurduplicatelink_table.php new file mode 100644 index 0000000..6ab6544 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurduplicatelink_table.php @@ -0,0 +1,33 @@ +unsignedInteger('occid')->index('fk_omoccurdupelink_occid_idx'); + $table->integer('duplicateid')->index('fk_omoccurdupelink_dupeid_idx'); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('modifiedUid')->nullable(); + $table->dateTime('modifiedtimestamp')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['occid', 'duplicateid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurduplicatelink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurduplicates_table.php b/database/migrations/2024_09_24_194122_create_omoccurduplicates_table.php new file mode 100644 index 0000000..e1e40e9 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurduplicates_table.php @@ -0,0 +1,31 @@ +integer('duplicateid', true); + $table->string('title', 50); + $table->string('description')->nullable(); + $table->string('notes')->nullable(); + $table->string('dupeType', 45)->default('Exact Duplicate'); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurduplicates'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccureditlocks_table.php b/database/migrations/2024_09_24_194122_create_omoccureditlocks_table.php new file mode 100644 index 0000000..5c6b667 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccureditlocks_table.php @@ -0,0 +1,29 @@ +unsignedInteger('occid')->primary(); + $table->integer('uid'); + $table->integer('ts'); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccureditlocks'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccuredits_table.php b/database/migrations/2024_09_24_194122_create_omoccuredits_table.php new file mode 100644 index 0000000..1cff535 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccuredits_table.php @@ -0,0 +1,39 @@ +integer('ocedid', true); + $table->unsignedInteger('occid')->index('fk_omoccuredits_occid'); + $table->string('tableName', 45)->nullable()->index('fk_omoccuredits_tablename'); + $table->string('fieldName', 45)->index('fk_omoccuredits_fieldname'); + $table->text('fieldValueNew'); + $table->text('fieldValueOld'); + $table->integer('reviewStatus')->default(1)->index('fk_omoccuredits_reviewedstatus')->comment('1=Open;2=Pending;3=Closed'); + $table->integer('appliedStatus')->default(0)->index('fk_omoccuredits_appliedstatus')->comment('0=Not Applied;1=Applied'); + $table->integer('editType')->nullable()->default(0)->comment('0 = general edit, 1 = batch edit'); + $table->integer('isActive')->nullable()->comment('0 = not the value applied within the active field, 1 = valued applied within active field'); + $table->integer('reapply')->nullable()->comment('0 = do not reapply edit; 1 = reapply edit when snapshot is refreshed, if edit isActive and snapshot value still matches old value '); + $table->string('guid', 45)->nullable()->unique('guid_unique'); + $table->unsignedInteger('uid')->index('fk_omoccuredits_uid'); + $table->timestamp('initialTimestamp')->useCurrent()->index('ix_omoccuredits_timestamp'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccuredits'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurexchange_table.php b/database/migrations/2024_09_24_194122_create_omoccurexchange_table.php new file mode 100644 index 0000000..d129c55 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurexchange_table.php @@ -0,0 +1,46 @@ +increments('exchangeid'); + $table->string('identifier', 30)->nullable(); + $table->unsignedInteger('collid')->nullable()->index('fk_occexch_coll'); + $table->unsignedInteger('iid')->nullable(); + $table->string('transactionType', 10)->nullable(); + $table->string('in_out', 3)->nullable(); + $table->date('dateSent')->nullable(); + $table->date('dateReceived')->nullable(); + $table->integer('totalBoxes')->nullable(); + $table->string('shippingMethod', 50)->nullable(); + $table->integer('totalExMounted')->nullable(); + $table->integer('totalExUnmounted')->nullable(); + $table->integer('totalGift')->nullable(); + $table->integer('totalGiftDet')->nullable(); + $table->integer('adjustment')->nullable(); + $table->integer('invoiceBalance')->nullable(); + $table->string('invoiceMessage', 500)->nullable(); + $table->string('description', 1000)->nullable(); + $table->string('notes', 500)->nullable(); + $table->string('createdBy', 20)->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurexchange'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurgenetic_table.php b/database/migrations/2024_09_24_194122_create_omoccurgenetic_table.php new file mode 100644 index 0000000..3e21422 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurgenetic_table.php @@ -0,0 +1,36 @@ +integer('idoccurgenetic', true); + $table->unsignedInteger('occid')->index('fk_omoccurgenetic'); + $table->string('identifier', 150)->nullable(); + $table->string('resourcename', 150)->index('index_omoccurgenetic_name'); + $table->string('title', 150)->nullable(); + $table->string('locus', 500)->nullable(); + $table->string('resourceurl', 500)->nullable(); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + + $table->unique(['occid', 'resourceurl'], 'unique_omoccurgenetic'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurgenetic'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurgeoindex_table.php b/database/migrations/2024_09_24_194122_create_omoccurgeoindex_table.php new file mode 100644 index 0000000..bdbdb18 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurgeoindex_table.php @@ -0,0 +1,31 @@ +unsignedInteger('tid'); + $table->double('decimallatitude'); + $table->double('decimallongitude'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['tid', 'decimallatitude', 'decimallongitude']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurgeoindex'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccuridentifiers_table.php b/database/migrations/2024_09_24_194122_create_omoccuridentifiers_table.php new file mode 100644 index 0000000..f053f64 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccuridentifiers_table.php @@ -0,0 +1,36 @@ +integer('idomoccuridentifiers', true); + $table->unsignedInteger('occid')->index('fk_omoccuridentifiers_occid_idx'); + $table->string('identifiervalue', 45)->index('ix_omoccuridentifiers_value'); + $table->string('identifiername', 45)->default('')->comment('barcode, accession number, old catalog number, NPS, etc'); + $table->string('notes', 250)->nullable(); + $table->integer('sortBy')->nullable(); + $table->unsignedInteger('modifiedUid'); + $table->dateTime('modifiedtimestamp')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['occid', 'identifiervalue', 'identifiername'], 'uq_omoccuridentifiers'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccuridentifiers'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurloans_table.php b/database/migrations/2024_09_24_194122_create_omoccurloans_table.php new file mode 100644 index 0000000..f04289b --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurloans_table.php @@ -0,0 +1,57 @@ +increments('loanid'); + $table->string('loanIdentifierOwn', 30)->nullable(); + $table->string('loanIdentifierBorr', 30)->nullable(); + $table->unsignedInteger('collidOwn')->nullable()->index('fk_occurloans_owncoll'); + $table->unsignedInteger('collidBorr')->nullable()->index('fk_occurloans_borrcoll'); + $table->unsignedInteger('iidOwner')->nullable()->index('fk_occurloans_owninst'); + $table->unsignedInteger('iidBorrower')->nullable()->index('fk_occurloans_borrinst'); + $table->date('dateSent')->nullable(); + $table->date('dateSentReturn')->nullable(); + $table->string('receivedStatus', 250)->nullable(); + $table->integer('totalBoxes')->nullable(); + $table->integer('totalBoxesReturned')->nullable(); + $table->integer('numSpecimens')->nullable(); + $table->string('shippingMethod', 50)->nullable(); + $table->string('shippingMethodReturn', 50)->nullable(); + $table->date('dateDue')->nullable(); + $table->date('dateReceivedOwn')->nullable(); + $table->date('dateReceivedBorr')->nullable(); + $table->date('dateClosed')->nullable(); + $table->string('forWhom', 50)->nullable(); + $table->string('description', 1000)->nullable(); + $table->string('invoiceMessageOwn', 500)->nullable(); + $table->string('invoiceMessageBorr', 500)->nullable(); + $table->string('notes', 500)->nullable(); + $table->string('createdByOwn', 30)->nullable(); + $table->string('createdByBorr', 30)->nullable(); + $table->unsignedInteger('processingStatus')->nullable()->default(1); + $table->string('processedByOwn', 30)->nullable(); + $table->string('processedByBorr', 30)->nullable(); + $table->string('processedByReturnOwn', 30)->nullable(); + $table->string('processedByReturnBorr', 30)->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurloans'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurloansattachment_table.php b/database/migrations/2024_09_24_194122_create_omoccurloansattachment_table.php new file mode 100644 index 0000000..f6d8af8 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurloansattachment_table.php @@ -0,0 +1,32 @@ +increments('attachmentid'); + $table->unsignedInteger('loanid')->nullable()->index('fk_occurloansattachment_loanid_idx'); + $table->unsignedInteger('exchangeid')->nullable()->index('fk_occurloansattachment_exchangeid_idx'); + $table->string('title', 80); + $table->string('path'); + $table->string('filename'); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurloansattachment'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurloanslink_table.php b/database/migrations/2024_09_24_194122_create_omoccurloanslink_table.php new file mode 100644 index 0000000..562e329 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurloanslink_table.php @@ -0,0 +1,32 @@ +unsignedInteger('loanid')->index('fk_occurloanlink_loanid'); + $table->unsignedInteger('occid')->index('fk_occurloanlink_occid'); + $table->date('returndate')->nullable(); + $table->string('notes')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + + $table->primary(['loanid', 'occid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurloanslink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurloanuser_table.php b/database/migrations/2024_09_24_194122_create_omoccurloanuser_table.php new file mode 100644 index 0000000..c283592 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurloanuser_table.php @@ -0,0 +1,33 @@ +unsignedInteger('loanid'); + $table->unsignedInteger('uid')->index('fk_occurloan_uid_idx'); + $table->string('accessType', 45); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('modifiedByUid')->nullable()->index('fk_occurloan_modifiedbyuid_idx'); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + + $table->primary(['loanid', 'uid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurloanuser'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurpaleo_table.php b/database/migrations/2024_09_24_194122_create_omoccurpaleo_table.php new file mode 100644 index 0000000..9f33dd4 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurpaleo_table.php @@ -0,0 +1,53 @@ +comment('Occurrence Paleo tables'); + $table->increments('paleoID'); + $table->unsignedInteger('occid')->index('fk_paleo_occid_idx'); + $table->string('eon', 65)->nullable(); + $table->string('era', 65)->nullable(); + $table->string('period', 65)->nullable(); + $table->string('epoch', 65)->nullable(); + $table->string('earlyInterval', 65)->nullable(); + $table->string('lateInterval', 65)->nullable(); + $table->string('absoluteAge', 65)->nullable(); + $table->string('storageAge', 65)->nullable(); + $table->string('stage', 65)->nullable(); + $table->string('localStage', 65)->nullable(); + $table->string('biota', 65)->nullable()->comment('Flora or Fanua'); + $table->string('biostratigraphy', 65)->nullable()->comment('Biozone'); + $table->string('taxonEnvironment', 65)->nullable()->comment('Marine or not'); + $table->string('lithogroup', 65)->nullable(); + $table->string('formation', 65)->nullable(); + $table->string('member', 65)->nullable(); + $table->string('bed', 65)->nullable(); + $table->string('lithology', 250)->nullable(); + $table->string('stratRemarks', 250)->nullable(); + $table->string('element', 250)->nullable(); + $table->string('slideProperties', 1000)->nullable(); + $table->string('geologicalContextID', 45)->nullable(); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + + $table->unique(['occid'], 'unique_occid'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurpaleo'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurpaleogts_table.php b/database/migrations/2024_09_24_194122_create_omoccurpaleogts_table.php new file mode 100644 index 0000000..f4590ad --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurpaleogts_table.php @@ -0,0 +1,33 @@ +increments('gtsid'); + $table->string('gtsterm', 45); + $table->integer('rankid'); + $table->string('rankname', 45)->nullable(); + $table->unsignedInteger('parentgtsid')->nullable()->index('fk_gtsparent_idx'); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + + $table->unique(['gtsid'], 'unique_gtsterm'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurpaleogts'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurpoints_table.php b/database/migrations/2024_09_24_194122_create_omoccurpoints_table.php new file mode 100644 index 0000000..9447ddb --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurpoints_table.php @@ -0,0 +1,33 @@ +integer('geoID', true); + $table->integer('occid')->unique('occid'); + $table->geometry('point'); + $table->geometry('errradiuspoly', 'polygon')->nullable(); + $table->geometry('footprintpoly', 'polygon')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->spatialIndex(['point'], 'point'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurpoints'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurrences_table.php b/database/migrations/2024_09_24_194122_create_omoccurrences_table.php new file mode 100644 index 0000000..9d8602a --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurrences_table.php @@ -0,0 +1,145 @@ +increments('occid'); + $table->unsignedInteger('collid'); + $table->string('dbpk', 150)->nullable(); + $table->string('basisOfRecord', 32)->nullable()->default('PreservedSpecimen')->comment('PreservedSpecimen, LivingSpecimen, HumanObservation'); + $table->string('occurrenceID')->nullable()->unique('index_gui')->comment('UniqueGlobalIdentifier'); + $table->string('catalogNumber', 32)->nullable()->index('index_catalognumber'); + $table->string('otherCatalogNumbers')->nullable()->index('index_othercatalognumbers'); + $table->string('ownerInstitutionCode', 32)->nullable()->index('index_ownerinst'); + $table->string('institutionID')->nullable(); + $table->string('collectionID')->nullable(); + $table->string('datasetID')->nullable(); + $table->string('organismID', 150)->nullable(); + $table->string('institutionCode', 64)->nullable(); + $table->string('collectionCode', 64)->nullable(); + $table->string('family')->nullable()->index('index_family'); + $table->string('scientificName')->nullable(); + $table->string('sciname')->nullable()->index('index_sciname'); + $table->unsignedInteger('tidInterpreted')->nullable()->index('fk_omoccurrences_tid'); + $table->string('genus')->nullable(); + $table->string('specificEpithet')->nullable(); + $table->string('taxonRank', 32)->nullable(); + $table->string('infraspecificEpithet')->nullable(); + $table->string('scientificNameAuthorship')->nullable(); + $table->text('taxonRemarks')->nullable(); + $table->string('identifiedBy')->nullable(); + $table->string('dateIdentified', 45)->nullable(); + $table->text('identificationReferences')->nullable(); + $table->text('identificationRemarks')->nullable(); + $table->string('identificationQualifier')->nullable()->comment('cf, aff, etc'); + $table->string('typeStatus')->nullable()->index('index_occurrences_typestatus'); + $table->string('recordedBy')->nullable()->index('index_collector')->comment('Collector(s)'); + $table->string('recordNumber', 45)->nullable()->index('index_collnum')->comment('Collector Number'); + $table->string('associatedCollectors')->nullable()->comment('not DwC'); + $table->date('eventDate')->nullable()->index('index_eventdate'); + $table->date('eventDate2')->nullable()->index('ix_omoccur_eventdate2'); + $table->integer('year')->nullable(); + $table->integer('month')->nullable(); + $table->integer('day')->nullable(); + $table->integer('startDayOfYear')->nullable(); + $table->integer('endDayOfYear')->nullable(); + $table->string('verbatimEventDate')->nullable(); + $table->string('eventTime', 45)->nullable(); + $table->text('habitat')->nullable()->comment('Habitat, substrait, etc'); + $table->string('substrate', 500)->nullable(); + $table->text('fieldNotes')->nullable(); + $table->string('fieldNumber', 45)->nullable(); + $table->string('eventID', 150)->nullable()->index('index_eventid'); + $table->text('occurrenceRemarks')->nullable()->comment('General Notes'); + $table->string('informationWithheld', 250)->nullable(); + $table->string('dataGeneralizations', 250)->nullable(); + $table->text('associatedOccurrences')->nullable(); + $table->text('associatedTaxa')->nullable()->comment('Associated Species'); + $table->text('dynamicProperties')->nullable(); + $table->text('verbatimAttributes')->nullable(); + $table->string('behavior', 500)->nullable(); + $table->string('vitality', 150)->nullable(); + $table->string('reproductiveCondition')->nullable()->comment('Phenology: flowers, fruit, sterile'); + $table->integer('cultivationStatus')->nullable()->index('index_occurrences_cult')->comment('0 = wild, 1 = cultivated'); + $table->string('establishmentMeans', 150)->nullable(); + $table->string('lifeStage', 45)->nullable(); + $table->string('sex', 45)->nullable(); + $table->string('individualCount', 45)->nullable(); + $table->string('samplingProtocol', 100)->nullable(); + $table->string('samplingEffort', 200)->nullable(); + $table->string('preparations', 100)->nullable(); + $table->string('locationID', 150)->nullable()->index('index_locationid'); + $table->string('continent', 45)->nullable(); + $table->string('waterBody', 75)->nullable(); + $table->string('parentLocationID', 150)->nullable(); + $table->string('islandGroup', 75)->nullable(); + $table->string('island', 75)->nullable(); + $table->string('countryCode', 5)->nullable(); + $table->string('country', 64)->nullable()->index('index_country'); + $table->string('stateProvince')->nullable()->index('index_state'); + $table->string('county')->nullable()->index('index_county'); + $table->string('municipality')->nullable()->index('index_municipality'); + $table->text('locality')->nullable()->index('index_locality'); + $table->integer('localitySecurity')->nullable()->default(0)->index('index_occur_localitysecurity')->comment('0 = no security; 1 = hidden locality'); + $table->string('localitySecurityReason', 100)->nullable(); + $table->double('decimalLatitude')->nullable()->index('ix_occurrences_lat'); + $table->double('decimalLongitude')->nullable()->index('ix_occurrences_lng'); + $table->string('geodeticDatum')->nullable(); + $table->unsignedInteger('coordinateUncertaintyInMeters')->nullable(); + $table->text('footprintWKT')->nullable(); + $table->decimal('coordinatePrecision', 9, 7)->nullable(); + $table->text('locationRemarks')->nullable(); + $table->string('verbatimCoordinates')->nullable(); + $table->string('verbatimCoordinateSystem')->nullable(); + $table->string('georeferencedBy')->nullable(); + $table->dateTime('georeferencedDate')->nullable(); + $table->string('georeferenceProtocol')->nullable(); + $table->string('georeferenceSources')->nullable(); + $table->string('georeferenceVerificationStatus', 32)->nullable(); + $table->string('georeferenceRemarks', 500)->nullable(); + $table->integer('minimumElevationInMeters')->nullable()->index('occelevmin'); + $table->integer('maximumElevationInMeters')->nullable()->index('occelevmax'); + $table->string('verbatimElevation')->nullable(); + $table->integer('minimumDepthInMeters')->nullable(); + $table->integer('maximumDepthInMeters')->nullable(); + $table->string('verbatimDepth', 50)->nullable(); + $table->text('previousIdentifications')->nullable(); + $table->integer('availability')->nullable(); + $table->string('disposition', 250)->nullable(); + $table->string('storageLocation', 100)->nullable(); + $table->string('genericColumn1', 100)->nullable(); + $table->string('genericColumn2', 100)->nullable(); + $table->dateTime('modified')->nullable()->comment('DateLastModified'); + $table->string('language', 20)->nullable(); + $table->unsignedInteger('observerUid')->nullable()->index('fk_omoccurrences_uid'); + $table->string('processingStatus', 45)->nullable()->index('index_occurrences_procstatus'); + $table->string('recordEnteredBy', 250)->nullable()->index('index_occurrecordenteredby'); + $table->unsignedInteger('duplicateQuantity')->nullable(); + $table->string('labelProject', 250)->nullable(); + $table->text('dynamicFields')->nullable(); + $table->string('recordID', 45)->nullable()->index('ix_omoccurrences_recordid'); + $table->dateTime('dateEntered')->nullable()->index('index_occurdateentered'); + $table->timestamp('dateLastModified')->useCurrentOnUpdate()->useCurrent()->index('index_occurdatelastmodifed'); + + $table->unique(['collid', 'dbpk'], 'index_collid'); + $table->unique(['occurrenceID'], 'unique_occurrenceid'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurrences'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurrencesfulltext_table.php b/database/migrations/2024_09_24_194122_create_omoccurrencesfulltext_table.php new file mode 100644 index 0000000..a9f427c --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurrencesfulltext_table.php @@ -0,0 +1,28 @@ +integer('occid')->primary(); + $table->text('locality')->nullable()->fulltext('ft_occur_locality'); + $table->string('recordedby')->nullable()->fulltext('ft_occur_recordedby'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurrencesfulltext'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurrencetypes_table.php b/database/migrations/2024_09_24_194122_create_omoccurrencetypes_table.php new file mode 100644 index 0000000..e72f1f7 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurrencetypes_table.php @@ -0,0 +1,39 @@ +increments('occurtypeid'); + $table->unsignedInteger('occid')->nullable()->index('fk_occurtype_occid_idx'); + $table->string('typestatus', 45)->nullable(); + $table->string('typeDesignationType', 45)->nullable(); + $table->string('typeDesignatedBy', 45)->nullable(); + $table->string('scientificName', 250)->nullable(); + $table->string('scientificNameAuthorship', 45)->nullable(); + $table->unsignedInteger('tidinterpreted')->nullable()->index('fk_occurtype_tid_idx'); + $table->string('basionym', 250)->nullable(); + $table->integer('refid')->nullable()->index('fk_occurtype_refid_idx'); + $table->string('bibliographicCitation', 250)->nullable(); + $table->string('dynamicProperties', 250)->nullable(); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurrencetypes'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurresource_table.php b/database/migrations/2024_09_24_194122_create_omoccurresource_table.php new file mode 100644 index 0000000..11ee9e5 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurresource_table.php @@ -0,0 +1,36 @@ +increments('resourceID'); + $table->unsignedInteger('occid')->index('fk_omoccurresource_occid_idx'); + $table->string('reourceTitle', 45); + $table->string('resourceType', 45); + $table->string('uri', 250); + $table->string('source', 45)->nullable(); + $table->string('resourceIdentifier', 45)->nullable(); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_omoccurresource_moduid_idx'); + $table->unsignedInteger('createdUid')->nullable()->index('fk_omoccurresource_createduid_idx'); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurresource'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurrevisions_table.php b/database/migrations/2024_09_24_194122_create_omoccurrevisions_table.php new file mode 100644 index 0000000..3c6c138 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurrevisions_table.php @@ -0,0 +1,38 @@ +integer('orid', true); + $table->unsignedInteger('occid')->index('fk_omrevisions_occid_idx'); + $table->text('oldValues')->nullable(); + $table->text('newValues')->nullable(); + $table->string('externalSource', 45)->nullable()->index('index_omrevisions_source'); + $table->string('externalEditor', 100)->nullable()->index('index_omrevisions_editor'); + $table->string('guid', 45)->nullable()->unique('guid_unique'); + $table->integer('reviewStatus')->nullable()->index('index_omrevisions_reviewed'); + $table->integer('appliedStatus')->nullable()->index('index_omrevisions_applied'); + $table->string('errorMessage', 500)->nullable(); + $table->unsignedInteger('uid')->nullable()->index('fk_omrevisions_uid_idx'); + $table->dateTime('externalTimestamp')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurrevisions'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_omoccurverification_table.php b/database/migrations/2024_09_24_194122_create_omoccurverification_table.php new file mode 100644 index 0000000..335e6f2 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_omoccurverification_table.php @@ -0,0 +1,36 @@ +integer('ovsid', true); + $table->unsignedInteger('occid')->index('fk_omoccurverification_occid_idx'); + $table->string('category', 45); + $table->integer('ranking'); + $table->string('protocol', 100)->nullable(); + $table->string('source', 45)->nullable(); + $table->unsignedInteger('uid')->nullable()->index('fk_omoccurverification_uid_idx'); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + + $table->unique(['occid', 'category'], 'unique_omoccurverification'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('omoccurverification'); + } +}; diff --git a/database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php b/database/migrations/2024_09_24_194122_create_password_reset_tokens_table.php similarity index 100% rename from database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php rename to database/migrations/2024_09_24_194122_create_password_reset_tokens_table.php diff --git a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php b/database/migrations/2024_09_24_194122_create_personal_access_tokens_table.php similarity index 79% rename from database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php rename to database/migrations/2024_09_24_194122_create_personal_access_tokens_table.php index e828ad8..2978f38 100644 --- a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php +++ b/database/migrations/2024_09_24_194122_create_personal_access_tokens_table.php @@ -12,14 +12,17 @@ public function up(): void { Schema::create('personal_access_tokens', function (Blueprint $table) { - $table->id(); - $table->morphs('tokenable'); + $table->bigIncrements('id'); + $table->string('tokenable_type'); + $table->unsignedBigInteger('tokenable_id'); $table->string('name'); $table->string('token', 64)->unique(); $table->text('abilities')->nullable(); $table->timestamp('last_used_at')->nullable(); $table->timestamp('expires_at')->nullable(); $table->timestamps(); + + $table->index(['tokenable_type', 'tokenable_id']); }); } diff --git a/database/migrations/2024_09_24_194122_create_portalindex_table.php b/database/migrations/2024_09_24_194122_create_portalindex_table.php new file mode 100644 index 0000000..e43f47c --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_portalindex_table.php @@ -0,0 +1,39 @@ +integer('portalID', true); + $table->string('portalName', 150); + $table->string('acronym', 45)->nullable(); + $table->string('portalDescription', 250)->nullable(); + $table->string('urlRoot', 150); + $table->string('securityKey', 45)->nullable(); + $table->string('symbiotaVersion', 45)->nullable(); + $table->string('guid', 45)->nullable()->unique('uq_portalindex_guid'); + $table->string('manager', 45)->nullable(); + $table->string('managerEmail', 45)->nullable(); + $table->string('primaryLead', 45)->nullable(); + $table->string('primaryLeadEmail', 45)->nullable(); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('portalindex'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_portaloccurrences_table.php b/database/migrations/2024_09_24_194122_create_portaloccurrences_table.php new file mode 100644 index 0000000..66421c4 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_portaloccurrences_table.php @@ -0,0 +1,34 @@ +increments('portalOccurrencesID'); + $table->unsignedInteger('occid')->index('fk_portaloccur_occid_idx'); + $table->unsignedInteger('pubid')->index('fk_portaloccur_pubid_idx'); + $table->integer('remoteOccid')->nullable(); + $table->integer('verification')->default(0); + $table->dateTime('refreshTimestamp'); + $table->timestamp('initialTimestamp')->useCurrent(); + + $table->unique(['occid', 'pubid'], 'uq_portaloccur_occid_pubid'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('portaloccurrences'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_portalpublications_table.php b/database/migrations/2024_09_24_194122_create_portalpublications_table.php new file mode 100644 index 0000000..4c07369 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_portalpublications_table.php @@ -0,0 +1,40 @@ +increments('pubid'); + $table->string('pubTitle', 45); + $table->string('description', 250)->nullable(); + $table->string('guid', 45)->nullable()->unique('uq_portalpub_guid'); + $table->unsignedInteger('collid')->nullable()->index('fk_portalpub_collid_idx'); + $table->integer('portalID')->index('fk_portalpub_portalid_idx'); + $table->string('direction', 45); + $table->text('criteriaJson')->nullable(); + $table->integer('includeDeterminations')->nullable()->default(1); + $table->integer('includeImages')->nullable()->default(1); + $table->integer('autoUpdate')->nullable()->default(0); + $table->dateTime('lastDateUpdate')->nullable(); + $table->integer('updateInterval')->nullable(); + $table->unsignedInteger('createdUid')->nullable()->index('fk_portalpub_uid_idx'); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('portalpublications'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_referenceagentlinks_table.php b/database/migrations/2024_09_24_194122_create_referenceagentlinks_table.php new file mode 100644 index 0000000..6c8044e --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_referenceagentlinks_table.php @@ -0,0 +1,31 @@ +integer('refid'); + $table->integer('agentid'); + $table->timestamp('initialtimestamp')->useCurrent(); + $table->integer('createdbyid'); + + $table->primary(['refid', 'agentid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('referenceagentlinks'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_referenceauthorlink_table.php b/database/migrations/2024_09_24_194122_create_referenceauthorlink_table.php new file mode 100644 index 0000000..cb5412c --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_referenceauthorlink_table.php @@ -0,0 +1,30 @@ +integer('refid')->index('fk_refauthlink_refid_idx'); + $table->integer('refauthid')->index('fk_refauthlink_refauthid_idx'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['refid', 'refauthid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('referenceauthorlink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_referenceauthors_table.php b/database/migrations/2024_09_24_194122_create_referenceauthors_table.php new file mode 100644 index 0000000..3e9f96f --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_referenceauthors_table.php @@ -0,0 +1,32 @@ +integer('refauthorid', true); + $table->string('lastname', 100)->index('index_refauthlastname'); + $table->string('firstname', 100)->nullable(); + $table->string('middlename', 100)->nullable(); + $table->unsignedInteger('modifieduid')->nullable(); + $table->dateTime('modifiedtimestamp')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('referenceauthors'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_referencechecklistlink_table.php b/database/migrations/2024_09_24_194122_create_referencechecklistlink_table.php new file mode 100644 index 0000000..c9a9a02 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_referencechecklistlink_table.php @@ -0,0 +1,30 @@ +integer('refid')->index('fk_refcheckllistlink_refid_idx'); + $table->unsignedInteger('clid')->index('fk_refcheckllistlink_clid_idx'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['refid', 'clid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('referencechecklistlink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_referencechklsttaxalink_table.php b/database/migrations/2024_09_24_194122_create_referencechklsttaxalink_table.php new file mode 100644 index 0000000..edeaa0a --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_referencechklsttaxalink_table.php @@ -0,0 +1,32 @@ +integer('refid'); + $table->unsignedInteger('clid'); + $table->unsignedInteger('tid'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->index(['clid', 'tid'], 'fk_refchktaxalink_clidtid_idx'); + $table->primary(['refid', 'clid', 'tid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('referencechklsttaxalink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_referencecollectionlink_table.php b/database/migrations/2024_09_24_194122_create_referencecollectionlink_table.php new file mode 100644 index 0000000..3531918 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_referencecollectionlink_table.php @@ -0,0 +1,30 @@ +integer('refid'); + $table->unsignedInteger('collid')->index('fk_refcollectionlink_collid_idx'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['refid', 'collid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('referencecollectionlink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_referencedatasetlink_table.php b/database/migrations/2024_09_24_194122_create_referencedatasetlink_table.php new file mode 100644 index 0000000..10e772f --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_referencedatasetlink_table.php @@ -0,0 +1,31 @@ +integer('refid'); + $table->unsignedInteger('datasetid')->index('fk_refdataset_datasetid_idx'); + $table->unsignedInteger('createdUid')->nullable()->index('fk_refdataset_uid_idx'); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + + $table->primary(['refid', 'datasetid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('referencedatasetlink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_referenceobject_table.php b/database/migrations/2024_09_24_194122_create_referenceobject_table.php new file mode 100644 index 0000000..8e9e002 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_referenceobject_table.php @@ -0,0 +1,54 @@ +integer('refid', true); + $table->integer('parentRefId')->nullable()->index('fk_refobj_parentrefid_idx'); + $table->integer('ReferenceTypeId')->nullable()->index('fk_refobj_typeid_idx'); + $table->string('title', 150)->index('index_refobj_title'); + $table->string('secondarytitle', 250)->nullable(); + $table->string('shorttitle', 250)->nullable(); + $table->string('tertiarytitle', 250)->nullable(); + $table->string('alternativetitle', 250)->nullable(); + $table->string('typework', 150)->nullable(); + $table->string('figures', 150)->nullable(); + $table->string('pubdate', 45)->nullable(); + $table->string('edition', 45)->nullable(); + $table->string('volume', 45)->nullable(); + $table->string('numbervolumnes', 45)->nullable(); + $table->string('number', 45)->nullable(); + $table->string('pages', 45)->nullable(); + $table->string('section', 45)->nullable(); + $table->string('placeofpublication', 45)->nullable(); + $table->string('publisher', 150)->nullable(); + $table->string('isbn_issn', 45)->nullable(); + $table->string('url', 150)->nullable(); + $table->string('guid', 45)->nullable(); + $table->string('ispublished', 45)->nullable(); + $table->string('notes', 45)->nullable(); + $table->string('cheatauthors', 400)->nullable(); + $table->string('cheatcitation', 500)->nullable(); + $table->unsignedInteger('modifieduid')->nullable(); + $table->dateTime('modifiedtimestamp')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('referenceobject'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_referenceoccurlink_table.php b/database/migrations/2024_09_24_194122_create_referenceoccurlink_table.php new file mode 100644 index 0000000..126e7be --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_referenceoccurlink_table.php @@ -0,0 +1,30 @@ +integer('refid')->index('fk_refoccurlink_refid_idx'); + $table->unsignedInteger('occid')->index('fk_refoccurlink_occid_idx'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['refid', 'occid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('referenceoccurlink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_referencetaxalink_table.php b/database/migrations/2024_09_24_194122_create_referencetaxalink_table.php new file mode 100644 index 0000000..e272c75 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_referencetaxalink_table.php @@ -0,0 +1,30 @@ +integer('refid')->index('fk_reftaxalink_refid_idx'); + $table->unsignedInteger('tid')->index('fk_reftaxalink_tid_idx'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['refid', 'tid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('referencetaxalink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_referencetype_table.php b/database/migrations/2024_09_24_194122_create_referencetype_table.php new file mode 100644 index 0000000..10cad10 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_referencetype_table.php @@ -0,0 +1,47 @@ +integer('ReferenceTypeId', true); + $table->string('ReferenceType', 45)->unique('referencetype_unique'); + $table->integer('IsParent')->nullable(); + $table->string('Title', 45)->nullable(); + $table->string('SecondaryTitle', 45)->nullable(); + $table->string('PlacePublished', 45)->nullable(); + $table->string('Publisher', 45)->nullable(); + $table->string('Volume', 45)->nullable(); + $table->string('NumberVolumes', 45)->nullable(); + $table->string('Number', 45)->nullable(); + $table->string('Pages', 45)->nullable(); + $table->string('Section', 45)->nullable(); + $table->string('TertiaryTitle', 45)->nullable(); + $table->string('Edition', 45)->nullable(); + $table->string('Date', 45)->nullable(); + $table->string('TypeWork', 45)->nullable(); + $table->string('ShortTitle', 45)->nullable(); + $table->string('AlternativeTitle', 45)->nullable(); + $table->string('ISBN_ISSN', 45)->nullable(); + $table->string('Figures', 45)->nullable(); + $table->integer('addedByUid')->nullable(); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('referencetype'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_salixwordstats_table.php b/database/migrations/2024_09_24_194122_create_salixwordstats_table.php new file mode 100644 index 0000000..5ee03fd --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_salixwordstats_table.php @@ -0,0 +1,42 @@ +integer('swsid', true); + $table->string('firstword', 45); + $table->string('secondword', 45)->nullable()->index('index_secondword'); + $table->integer('locality')->default(0); + $table->integer('localityFreq')->default(0); + $table->integer('habitat')->default(0); + $table->integer('habitatFreq')->default(0); + $table->integer('substrate')->default(0); + $table->integer('substrateFreq')->default(0); + $table->integer('verbatimAttributes')->default(0); + $table->integer('verbatimAttributesFreq')->default(0); + $table->integer('occurrenceRemarks')->default(0); + $table->integer('occurrenceRemarksFreq')->default(0); + $table->integer('totalcount')->default(0); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + + $table->unique(['firstword', 'secondword'], 'index_unique'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('salixwordstats'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_schemaversion_table.php b/database/migrations/2024_09_24_194122_create_schemaversion_table.php new file mode 100644 index 0000000..da39b17 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_schemaversion_table.php @@ -0,0 +1,28 @@ +integer('id', true); + $table->string('versionnumber', 20)->unique('versionnumber_unique'); + $table->timestamp('dateapplied')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('schemaversion'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_specprocessorprojects_table.php b/database/migrations/2024_09_24_194122_create_specprocessorprojects_table.php new file mode 100644 index 0000000..f7a3bba --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_specprocessorprojects_table.php @@ -0,0 +1,52 @@ +increments('spprid'); + $table->unsignedInteger('collid')->index('fk_specprocessorprojects_coll'); + $table->string('title', 100); + $table->string('projectType', 45)->nullable(); + $table->string('specKeyPattern', 45)->nullable(); + $table->string('patternReplace', 45)->nullable(); + $table->string('replaceStr', 45)->nullable(); + $table->string('specKeyRetrieval', 45)->nullable(); + $table->unsignedInteger('coordX1')->nullable(); + $table->unsignedInteger('coordX2')->nullable(); + $table->unsignedInteger('coordY1')->nullable(); + $table->unsignedInteger('coordY2')->nullable(); + $table->string('sourcePath', 250)->nullable(); + $table->string('targetPath', 250)->nullable(); + $table->string('imgUrl', 250)->nullable(); + $table->unsignedInteger('webPixWidth')->nullable()->default(1200); + $table->unsignedInteger('tnPixWidth')->nullable()->default(130); + $table->unsignedInteger('lgPixWidth')->nullable()->default(2400); + $table->integer('jpgcompression')->nullable()->default(70); + $table->unsignedInteger('createTnImg')->nullable()->default(1); + $table->unsignedInteger('createLgImg')->nullable()->default(1); + $table->text('additionalOptions')->nullable(); + $table->string('source', 45)->nullable(); + $table->integer('processingCode')->nullable(); + $table->date('lastRunDate')->nullable(); + $table->unsignedInteger('createdByUid')->nullable()->index('fk_specprocprojects_uid_idx'); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('specprocessorprojects'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_specprocessorrawlabels_table.php b/database/migrations/2024_09_24_194122_create_specprocessorrawlabels_table.php new file mode 100644 index 0000000..ffd4fa4 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_specprocessorrawlabels_table.php @@ -0,0 +1,35 @@ +increments('prlid'); + $table->unsignedInteger('imgid')->nullable()->index('fk_specproc_images'); + $table->unsignedInteger('occid')->nullable()->index('fk_specproc_occid'); + $table->text('rawstr'); + $table->string('processingvariables', 250)->nullable(); + $table->integer('score')->nullable(); + $table->string('notes')->nullable(); + $table->string('source', 150)->nullable(); + $table->integer('sortsequence')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('specprocessorrawlabels'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_specprocessorrawlabelsfulltext_table.php b/database/migrations/2024_09_24_194122_create_specprocessorrawlabelsfulltext_table.php new file mode 100644 index 0000000..dd6f482 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_specprocessorrawlabelsfulltext_table.php @@ -0,0 +1,28 @@ +integer('prlid')->primary(); + $table->integer('imgid')->index('index_ocr_imgid'); + $table->text('rawstr')->fulltext('index_ocr_fulltext'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('specprocessorrawlabelsfulltext'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_specprocnlp_table.php b/database/migrations/2024_09_24_194122_create_specprocnlp_table.php new file mode 100644 index 0000000..3c63fc0 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_specprocnlp_table.php @@ -0,0 +1,32 @@ +integer('spnlpid', true); + $table->string('title', 45); + $table->string('sqlfrag', 250); + $table->string('patternmatch', 250)->nullable(); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('collid')->index('fk_specprocnlp_collid'); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('specprocnlp'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_specprocnlpfrag_table.php b/database/migrations/2024_09_24_194122_create_specprocnlpfrag_table.php new file mode 100644 index 0000000..3c0161c --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_specprocnlpfrag_table.php @@ -0,0 +1,32 @@ +integer('spnlpfragid', true); + $table->integer('spnlpid')->index('fk_specprocnlpfrag_spnlpid'); + $table->string('fieldname', 45); + $table->string('patternmatch', 250); + $table->string('notes', 250)->nullable(); + $table->integer('sortseq')->nullable()->default(50); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('specprocnlpfrag'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_specprocnlpversion_table.php b/database/migrations/2024_09_24_194122_create_specprocnlpversion_table.php new file mode 100644 index 0000000..676529e --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_specprocnlpversion_table.php @@ -0,0 +1,34 @@ +comment('Archives field name - value pairs of NLP results loading int'); + $table->integer('nlpverid', true); + $table->unsignedInteger('prlid')->index('fk_specprocnlpver_rawtext_idx'); + $table->text('archivestr'); + $table->string('processingvariables', 250)->nullable(); + $table->integer('score')->nullable(); + $table->string('source', 150)->nullable(); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('specprocnlpversion'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_specprococrfrag_table.php b/database/migrations/2024_09_24_194122_create_specprococrfrag_table.php new file mode 100644 index 0000000..c8fdc4c --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_specprococrfrag_table.php @@ -0,0 +1,32 @@ +increments('ocrfragid'); + $table->unsignedInteger('prlid')->index('fk_specprococrfrag_prlid_idx'); + $table->string('firstword', 45); + $table->string('secondword', 45)->nullable(); + $table->string('keyterm', 45)->nullable()->index('index_keyterm'); + $table->integer('wordorder')->nullable(); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('specprococrfrag'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_specprocstatus_table.php b/database/migrations/2024_09_24_194122_create_specprocstatus_table.php new file mode 100644 index 0000000..abab9dc --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_specprocstatus_table.php @@ -0,0 +1,32 @@ +increments('spsID'); + $table->unsignedInteger('occid')->index('specprocstatus_occid_idx'); + $table->string('processName', 45); + $table->string('result', 45)->nullable(); + $table->string('processVariables', 150); + $table->unsignedInteger('processorUid')->nullable()->index('specprocstatus_uid_idx'); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('specprocstatus'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxa_table.php b/database/migrations/2024_09_24_194122_create_taxa_table.php new file mode 100644 index 0000000..c357a58 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxa_table.php @@ -0,0 +1,53 @@ +increments('tid'); + $table->string('kingdomName', 45)->default(''); + $table->unsignedSmallInteger('rankID')->default(0)->index('rankid_index'); + $table->string('sciName', 250)->index('sciname_index'); + $table->string('unitInd1', 1)->nullable(); + $table->string('unitName1', 50); + $table->string('unitInd2', 1)->nullable(); + $table->string('unitName2', 50)->nullable()->default('t'); + $table->string('unitInd3', 45)->nullable(); + $table->string('unitName3', 35)->nullable(); + $table->string('author', 150)->default(''); + $table->unsignedTinyInteger('phyloSortSequence')->nullable(); + $table->integer('reviewStatus')->nullable(); + $table->integer('displayStatus')->nullable(); + $table->integer('isLegitimate')->nullable(); + $table->string('nomenclaturalStatus', 45)->nullable(); + $table->string('nomenclaturalCode', 45)->nullable(); + $table->string('statusNotes', 50)->nullable(); + $table->string('source', 250)->nullable(); + $table->string('notes', 250)->nullable(); + $table->string('hybrid', 50)->nullable(); + $table->unsignedInteger('securityStatus')->default(0)->comment('0 = no security; 1 = hidden locality'); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_taxa_uid_idx'); + $table->dateTime('modifiedTimeStamp')->nullable(); + $table->timestamp('InitialTimeStamp')->useCurrent()->index('idx_taxacreated'); + + $table->index(['unitName1', 'unitName2'], 'unitname1_index'); + $table->unique(['sciName', 'rankID', 'kingdomName'], 'uq_taxa_sciname'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxa'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxadescrblock_table.php b/database/migrations/2024_09_24_194122_create_taxadescrblock_table.php new file mode 100644 index 0000000..644f44c --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxadescrblock_table.php @@ -0,0 +1,37 @@ +increments('tdbid'); + $table->unsignedInteger('tdProfileID')->index('fk_taxadescrblock_tdprofileid_idx'); + $table->unsignedInteger('tid')->index('fk_taxadescrblock_tid_idx'); + $table->string('caption', 40)->nullable(); + $table->string('source', 250)->nullable(); + $table->string('sourceurl', 250)->nullable(); + $table->string('language', 45)->nullable()->default('English'); + $table->integer('langid')->nullable()->index('fk_taxadesc_lang_idx'); + $table->unsignedInteger('displaylevel')->default(1)->comment('1 = short descr, 2 = intermediate descr'); + $table->unsignedInteger('uid'); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxadescrblock'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxadescrprofile_table.php b/database/migrations/2024_09_24_194122_create_taxadescrprofile_table.php new file mode 100644 index 0000000..db32a1a --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxadescrprofile_table.php @@ -0,0 +1,40 @@ +increments('tdProfileID'); + $table->string('title', 150); + $table->string('authors', 100)->nullable(); + $table->string('caption', 40); + $table->string('projectDescription', 500)->nullable(); + $table->text('abstract')->nullable(); + $table->string('publication', 500)->nullable(); + $table->string('urlTemplate', 250)->nullable(); + $table->string('internalNotes', 250)->nullable(); + $table->integer('langid')->nullable()->default(1)->index('fk_taxadescrprofile_langid_idx'); + $table->integer('defaultDisplayLevel')->nullable()->default(1); + $table->text('dynamicProperties')->nullable(); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_taxadescrprofile_uid_idx'); + $table->timestamp('modifiedTimestamp')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxadescrprofile'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxadescrstmts_table.php b/database/migrations/2024_09_24_194122_create_taxadescrstmts_table.php new file mode 100644 index 0000000..3be99f8 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxadescrstmts_table.php @@ -0,0 +1,33 @@ +increments('tdsid'); + $table->unsignedInteger('tdbid')->index('fk_taxadescrstmts_tblock'); + $table->string('heading', 75)->nullable(); + $table->text('statement'); + $table->unsignedInteger('displayheader')->default(1); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('sortsequence')->default(89); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxadescrstmts'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxaenumtree_table.php b/database/migrations/2024_09_24_194122_create_taxaenumtree_table.php new file mode 100644 index 0000000..7cea5d6 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxaenumtree_table.php @@ -0,0 +1,31 @@ +unsignedInteger('tid')->index('fk_tet_taxa'); + $table->unsignedInteger('taxauthid')->index('fk_tet_taxauth'); + $table->unsignedInteger('parenttid')->index('fk_tet_taxa2'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['tid', 'taxauthid', 'parenttid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxaenumtree'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxalinks_table.php b/database/migrations/2024_09_24_194122_create_taxalinks_table.php new file mode 100644 index 0000000..b68fbc6 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxalinks_table.php @@ -0,0 +1,38 @@ +increments('tlid'); + $table->unsignedInteger('tid')->index('fk_taxalinks_tid'); + $table->string('url', 500); + $table->string('title', 100); + $table->string('sourceIdentifier', 45)->nullable(); + $table->string('owner', 100)->nullable(); + $table->string('icon', 45)->nullable(); + $table->integer('inherit')->nullable()->default(1); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('sortsequence')->default(50); + $table->timestamp('initialTimestamp')->useCurrentOnUpdate()->useCurrent(); + + $table->unique(['tid', 'url'], 'uq_taxalinks_tid_url'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxalinks'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxamaps_table.php b/database/migrations/2024_09_24_194122_create_taxamaps_table.php new file mode 100644 index 0000000..24e5954 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxamaps_table.php @@ -0,0 +1,30 @@ +increments('mid'); + $table->unsignedInteger('tid')->index('fk_tid_idx'); + $table->string('url'); + $table->string('title', 100)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxamaps'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxanestedtree_table.php b/database/migrations/2024_09_24_194122_create_taxanestedtree_table.php new file mode 100644 index 0000000..5cdaffc --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxanestedtree_table.php @@ -0,0 +1,32 @@ +unsignedInteger('tid')->index('fk_tnt_taxa'); + $table->unsignedInteger('taxauthid')->index('fk_tnt_taxauth'); + $table->unsignedInteger('leftindex')->index('leftindex'); + $table->unsignedInteger('rightindex')->index('rightindex'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['tid', 'taxauthid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxanestedtree'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxaprofilepubdesclink_table.php b/database/migrations/2024_09_24_194122_create_taxaprofilepubdesclink_table.php new file mode 100644 index 0000000..850029a --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxaprofilepubdesclink_table.php @@ -0,0 +1,33 @@ +unsignedInteger('tdbid'); + $table->integer('tppid')->index('fk_tppubdesclink_id_idx'); + $table->string('caption', 45)->nullable(); + $table->string('editornotes', 250)->nullable(); + $table->integer('sortsequence')->nullable(); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + + $table->primary(['tdbid', 'tppid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxaprofilepubdesclink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxaprofilepubimagelink_table.php b/database/migrations/2024_09_24_194122_create_taxaprofilepubimagelink_table.php new file mode 100644 index 0000000..0f7e62d --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxaprofilepubimagelink_table.php @@ -0,0 +1,33 @@ +unsignedInteger('imgid'); + $table->integer('tppid')->index('fk_tppubimagelink_id_idx'); + $table->string('caption', 45)->nullable(); + $table->string('editornotes', 250)->nullable(); + $table->integer('sortsequence')->nullable(); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + + $table->primary(['imgid', 'tppid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxaprofilepubimagelink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxaprofilepubmaplink_table.php b/database/migrations/2024_09_24_194122_create_taxaprofilepubmaplink_table.php new file mode 100644 index 0000000..4d2ea7c --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxaprofilepubmaplink_table.php @@ -0,0 +1,33 @@ +unsignedInteger('mid'); + $table->integer('tppid')->index('fk_tppubmaplink_id_idx'); + $table->string('caption', 45)->nullable(); + $table->string('editornotes', 250)->nullable(); + $table->integer('sortsequence')->nullable(); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + + $table->primary(['mid', 'tppid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxaprofilepubmaplink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxaprofilepubs_table.php b/database/migrations/2024_09_24_194122_create_taxaprofilepubs_table.php new file mode 100644 index 0000000..381c9d1 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxaprofilepubs_table.php @@ -0,0 +1,39 @@ +integer('tppid', true); + $table->string('pubtitle', 150)->index('index_taxaprofilepubs_title'); + $table->string('authors', 150)->nullable(); + $table->string('description', 500)->nullable(); + $table->text('abstract')->nullable(); + $table->unsignedInteger('uidowner')->nullable()->index('fk_taxaprofilepubs_uid_idx'); + $table->string('externalurl', 250)->nullable(); + $table->string('rights', 250)->nullable(); + $table->string('usageterm', 250)->nullable(); + $table->string('accessrights', 250)->nullable(); + $table->integer('ispublic')->nullable(); + $table->integer('inclusive')->nullable(); + $table->text('dynamicProperties')->nullable(); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxaprofilepubs'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxaresourcelinks_table.php b/database/migrations/2024_09_24_194122_create_taxaresourcelinks_table.php new file mode 100644 index 0000000..b617dbf --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxaresourcelinks_table.php @@ -0,0 +1,36 @@ +integer('taxaresourceid', true); + $table->unsignedInteger('tid')->index('fk_taxaresource_tid_idx'); + $table->string('sourcename', 150)->index('taxaresource_name'); + $table->string('sourceidentifier', 45)->nullable(); + $table->string('sourceguid', 150)->nullable(); + $table->string('url', 250)->nullable(); + $table->string('notes', 250)->nullable(); + $table->integer('ranking')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['tid', 'sourcename'], 'unique_taxaresource'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxaresourcelinks'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxauthority_table.php b/database/migrations/2024_09_24_194122_create_taxauthority_table.php new file mode 100644 index 0000000..9616f59 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxauthority_table.php @@ -0,0 +1,36 @@ +increments('taxauthid'); + $table->unsignedInteger('isprimary')->default(0); + $table->string('name', 45); + $table->string('description', 250)->nullable(); + $table->string('editors', 150)->nullable(); + $table->string('contact', 45)->nullable(); + $table->string('email', 100)->nullable(); + $table->string('url', 150)->nullable(); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('isactive')->default(1); + $table->timestamp('initialtimestamp')->useCurrentOnUpdate()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxauthority'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxavernaculars_table.php b/database/migrations/2024_09_24_194122_create_taxavernaculars_table.php new file mode 100644 index 0000000..7b44df6 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxavernaculars_table.php @@ -0,0 +1,38 @@ +unsignedInteger('TID')->default(0)->index('tid1'); + $table->string('VernacularName', 80)->index('vernacularsnames'); + $table->string('Language', 15)->nullable(); + $table->integer('langid')->nullable()->index('fk_vern_lang_idx'); + $table->string('Source', 50)->nullable(); + $table->string('notes', 250)->nullable(); + $table->string('username', 45)->nullable(); + $table->integer('isupperterm')->nullable()->default(0); + $table->integer('SortSequence')->nullable()->default(50); + $table->integer('VID', true); + $table->timestamp('InitialTimeStamp')->useCurrent(); + + $table->unique(['VernacularName', 'TID', 'langid'], 'unique-key'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxavernaculars'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxonunits_table.php b/database/migrations/2024_09_24_194122_create_taxonunits_table.php new file mode 100644 index 0000000..7670a90 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxonunits_table.php @@ -0,0 +1,37 @@ +integer('taxonunitid', true); + $table->string('kingdomName', 45)->default('Organism'); + $table->unsignedSmallInteger('rankid')->default(0); + $table->string('rankname', 15); + $table->string('suffix', 45)->nullable(); + $table->smallInteger('dirparentrankid'); + $table->smallInteger('reqparentrankid')->nullable(); + $table->string('modifiedby', 45)->nullable(); + $table->dateTime('modifiedtimestamp')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['kingdomName', 'rankid'], 'unique_taxonunits'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxonunits'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_taxstatus_table.php b/database/migrations/2024_09_24_194122_create_taxstatus_table.php new file mode 100644 index 0000000..3890eca --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_taxstatus_table.php @@ -0,0 +1,41 @@ +unsignedInteger('tid')->index('index_tid'); + $table->unsignedInteger('tidaccepted')->index('fk_taxstatus_tidacc'); + $table->unsignedInteger('taxauthid')->index('fk_taxstatus_taid')->comment('taxon authority id'); + $table->unsignedInteger('parenttid')->nullable()->index('index_parenttid'); + $table->string('family', 50)->nullable()->index('index_ts_family'); + $table->string('taxonomicStatus', 45)->nullable(); + $table->string('taxonomicSource', 500)->nullable(); + $table->string('sourceIdentifier', 150)->nullable(); + $table->string('UnacceptabilityReason', 250)->nullable(); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('SortSequence')->nullable()->default(50); + $table->unsignedInteger('modifiedUid')->nullable()->index('fk_taxstatus_uid_idx'); + $table->dateTime('modifiedTimestamp')->nullable(); + $table->timestamp('initialtimestamp')->useCurrentOnUpdate()->useCurrent(); + + $table->primary(['tid', 'tidaccepted', 'taxauthid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('taxstatus'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_tmattributes_table.php b/database/migrations/2024_09_24_194122_create_tmattributes_table.php new file mode 100644 index 0000000..99a7a9c --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_tmattributes_table.php @@ -0,0 +1,40 @@ +unsignedInteger('stateid')->index('fk_tmattr_stateid_idx'); + $table->unsignedInteger('occid')->index('fk_tmattr_occid_idx'); + $table->string('modifier', 100)->nullable(); + $table->double('xvalue')->nullable(); + $table->unsignedInteger('imgid')->nullable()->index('fk_tmattr_imgid_idx'); + $table->string('imagecoordinates', 45)->nullable(); + $table->string('source', 250)->nullable(); + $table->string('notes', 250)->nullable(); + $table->tinyInteger('statuscode')->nullable(); + $table->unsignedInteger('modifieduid')->nullable()->index('fk_tmattr_uidmodified_idx'); + $table->dateTime('datelastmodified')->nullable(); + $table->unsignedInteger('createduid')->nullable()->index('fk_attr_uidcreate_idx'); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + + $table->primary(['stateid', 'occid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('tmattributes'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_tmstates_table.php b/database/migrations/2024_09_24_194122_create_tmstates_table.php new file mode 100644 index 0000000..f462132 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_tmstates_table.php @@ -0,0 +1,39 @@ +increments('stateid'); + $table->unsignedInteger('traitid'); + $table->string('statecode', 2); + $table->string('statename', 75); + $table->string('description', 250)->nullable(); + $table->string('refurl', 250)->nullable(); + $table->string('notes', 250)->nullable(); + $table->integer('sortseq')->nullable(); + $table->unsignedInteger('modifieduid')->nullable()->index('fk_tmstate_uidmodified_idx'); + $table->dateTime('datelastmodified')->nullable(); + $table->unsignedInteger('createduid')->nullable()->index('fk_tmstate_uidcreated_idx'); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + + $table->unique(['traitid', 'statecode'], 'traitid_code_unique'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('tmstates'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_tmtraitdependencies_table.php b/database/migrations/2024_09_24_194122_create_tmtraitdependencies_table.php new file mode 100644 index 0000000..0574d84 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_tmtraitdependencies_table.php @@ -0,0 +1,30 @@ +unsignedInteger('traitid')->index('fk_tmdepend_traitid_idx'); + $table->unsignedInteger('parentstateid')->index('fk_tmdepend_stateid_idx'); + $table->timestamp('initialtimestamp')->nullable()->useCurrent(); + + $table->primary(['traitid', 'parentstateid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('tmtraitdependencies'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_tmtraits_table.php b/database/migrations/2024_09_24_194122_create_tmtraits_table.php new file mode 100644 index 0000000..8230597 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_tmtraits_table.php @@ -0,0 +1,40 @@ +increments('traitid'); + $table->string('traitname', 100)->index('traitsname'); + $table->string('traittype', 2)->default('UM'); + $table->string('units', 45)->nullable(); + $table->string('description', 250)->nullable(); + $table->string('refurl', 250)->nullable(); + $table->string('notes', 250)->nullable(); + $table->string('projectGroup', 45)->nullable(); + $table->integer('isPublic')->nullable()->default(1); + $table->integer('includeInSearch')->nullable(); + $table->text('dynamicProperties')->nullable(); + $table->unsignedInteger('modifieduid')->nullable()->index('fk_traits_uidmodified_idx'); + $table->dateTime('datelastmodified')->nullable(); + $table->unsignedInteger('createduid')->nullable()->index('fk_traits_uidcreated_idx'); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('tmtraits'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_tmtraittaxalink_table.php b/database/migrations/2024_09_24_194122_create_tmtraittaxalink_table.php new file mode 100644 index 0000000..1622e31 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_tmtraittaxalink_table.php @@ -0,0 +1,31 @@ +unsignedInteger('traitid')->index('fk_traittaxalink_traitid_idx'); + $table->unsignedInteger('tid')->index('fk_traittaxalink_tid_idx'); + $table->string('relation', 45)->default('include'); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->primary(['traitid', 'tid']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('tmtraittaxalink'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_unknowncomments_table.php b/database/migrations/2024_09_24_194122_create_unknowncomments_table.php new file mode 100644 index 0000000..5a31f74 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_unknowncomments_table.php @@ -0,0 +1,30 @@ +increments('unkcomid'); + $table->unsignedInteger('unkid')->index('fk_unknowncomments'); + $table->string('comment', 500); + $table->string('username', 45); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('unknowncomments'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_unknownimages_table.php b/database/migrations/2024_09_24_194122_create_unknownimages_table.php new file mode 100644 index 0000000..a1c0b95 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_unknownimages_table.php @@ -0,0 +1,30 @@ +increments('unkimgid'); + $table->unsignedInteger('unkid')->index('fk_unknowns'); + $table->string('url'); + $table->string('notes', 250)->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('unknownimages'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_unknowns_table.php b/database/migrations/2024_09_24_194122_create_unknowns_table.php new file mode 100644 index 0000000..ccbfc80 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_unknowns_table.php @@ -0,0 +1,36 @@ +increments('unkid'); + $table->unsignedInteger('tid')->nullable()->index('fk_unknowns_tid'); + $table->string('photographer', 100)->nullable(); + $table->string('owner', 100)->nullable(); + $table->string('locality', 250)->nullable(); + $table->double('latdecimal')->nullable(); + $table->double('longdecimal')->nullable(); + $table->string('notes', 250)->nullable(); + $table->string('username', 45)->index('fk_unknowns_username'); + $table->string('idstatus', 45)->default('ID pending'); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('unknowns'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_uploaddetermtemp_table.php b/database/migrations/2024_09_24_194122_create_uploaddetermtemp_table.php new file mode 100644 index 0000000..6fe72a4 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_uploaddetermtemp_table.php @@ -0,0 +1,52 @@ +unsignedInteger('occid')->nullable()->index('index_uploaddet_occid'); + $table->unsignedInteger('collid')->nullable()->index('index_uploaddet_collid'); + $table->string('dbpk', 150)->nullable()->index('index_uploaddet_dbpk'); + $table->string('identifiedBy')->default(''); + $table->string('dateIdentified', 45)->default(''); + $table->date('dateIdentifiedInterpreted')->nullable(); + $table->string('higherClassification', 150)->nullable(); + $table->string('sciname'); + $table->string('verbatimIdentification', 250)->nullable(); + $table->string('scientificNameAuthorship', 100)->nullable(); + $table->string('identificationQualifier', 45)->nullable(); + $table->string('family')->nullable(); + $table->string('genus', 45)->nullable(); + $table->string('specificEpithet', 45)->nullable(); + $table->string('verbatimTaxonRank', 45)->nullable(); + $table->string('taxonRank', 45)->nullable(); + $table->string('infraSpecificEpithet', 45)->nullable(); + $table->integer('iscurrent')->nullable()->default(0); + $table->string('detType', 45)->nullable(); + $table->string('identificationReferences')->nullable(); + $table->string('identificationRemarks')->nullable(); + $table->string('taxonRemarks', 2000)->nullable(); + $table->string('identificationVerificationStatus', 45)->nullable(); + $table->string('taxonConceptID', 45)->nullable(); + $table->string('sourceIdentifier', 45)->nullable(); + $table->unsignedInteger('sortsequence')->nullable()->default(10); + $table->timestamp('initialtimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('uploaddetermtemp'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_uploadglossary_table.php b/database/migrations/2024_09_24_194122_create_uploadglossary_table.php new file mode 100644 index 0000000..8fbb2e7 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_uploadglossary_table.php @@ -0,0 +1,38 @@ +string('term', 150)->nullable()->index('term_index'); + $table->string('definition', 1000)->nullable(); + $table->string('language', 45)->nullable(); + $table->string('source', 1000)->nullable(); + $table->string('author', 250)->nullable(); + $table->string('translator', 250)->nullable(); + $table->string('notes', 250)->nullable(); + $table->string('resourceurl', 600)->nullable(); + $table->string('tidStr', 100)->nullable(); + $table->boolean('synonym')->nullable(); + $table->integer('newGroupId')->nullable()->index('relatedterm_index'); + $table->integer('currentGroupId')->nullable(); + $table->timestamp('InitialTimeStamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('uploadglossary'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_uploadimagetemp_table.php b/database/migrations/2024_09_24_194122_create_uploadimagetemp_table.php new file mode 100644 index 0000000..4c68c2e --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_uploadimagetemp_table.php @@ -0,0 +1,50 @@ +unsignedInteger('tid')->nullable(); + $table->string('url')->nullable(); + $table->string('thumbnailurl')->nullable(); + $table->string('originalurl')->nullable(); + $table->string('archiveurl')->nullable(); + $table->string('photographer', 100)->nullable(); + $table->unsignedInteger('photographeruid')->nullable(); + $table->string('imagetype', 50)->nullable(); + $table->string('format', 45)->nullable(); + $table->string('caption', 100)->nullable(); + $table->string('owner', 100)->nullable(); + $table->string('sourceUrl')->nullable(); + $table->string('referenceurl')->nullable(); + $table->string('copyright')->nullable(); + $table->string('accessrights')->nullable(); + $table->string('rights')->nullable(); + $table->string('locality', 250)->nullable(); + $table->unsignedInteger('occid')->nullable()->index('index_uploadimg_occid'); + $table->unsignedInteger('collid')->nullable()->index('index_uploadimg_collid'); + $table->string('dbpk', 150)->nullable()->index('index_uploadimg_dbpk'); + $table->string('sourceIdentifier', 150)->nullable(); + $table->string('notes')->nullable(); + $table->string('username', 45)->nullable(); + $table->unsignedInteger('sortsequence')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent()->index('index_uploadimg_ts'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('uploadimagetemp'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_uploadspecmap_table.php b/database/migrations/2024_09_24_194122_create_uploadspecmap_table.php new file mode 100644 index 0000000..477a501 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_uploadspecmap_table.php @@ -0,0 +1,33 @@ +increments('usmid'); + $table->unsignedInteger('uspid'); + $table->string('sourcefield', 45); + $table->string('symbdatatype', 45)->default('string')->comment('string, numeric, datetime'); + $table->string('symbspecfield', 45); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['uspid', 'symbspecfield', 'sourcefield'], 'index_unique'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('uploadspecmap'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_uploadspecparameters_table.php b/database/migrations/2024_09_24_194122_create_uploadspecparameters_table.php new file mode 100644 index 0000000..36ce987 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_uploadspecparameters_table.php @@ -0,0 +1,46 @@ +increments('uspid'); + $table->unsignedInteger('collid')->index('fk_uploadspecparameters_coll'); + $table->unsignedInteger('uploadType')->default(1)->comment('1 = Direct; 2 = DiGIR; 3 = File'); + $table->string('title', 45); + $table->string('platform', 45)->nullable()->default('1')->comment('1 = MySQL; 2 = MSSQL; 3 = ORACLE; 11 = MS Access; 12 = FileMaker'); + $table->string('server', 150)->nullable(); + $table->unsignedInteger('port')->nullable(); + $table->string('driver', 45)->nullable(); + $table->string('code', 45)->nullable(); + $table->string('path', 500)->nullable(); + $table->string('pkField', 45)->nullable(); + $table->string('username', 45)->nullable(); + $table->string('password', 45)->nullable(); + $table->string('schemaName', 150)->nullable(); + $table->string('internalQuery', 250)->nullable(); + $table->text('queryStr')->nullable(); + $table->string('cleanupSP', 45)->nullable(); + $table->integer('endpointPublic')->nullable(); + $table->unsignedInteger('dlmisvalid')->nullable()->default(0); + $table->unsignedInteger('createdUid')->nullable()->index('fk_uploadspecparameters_uid_idx'); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('uploadspecparameters'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_uploadspectemp_table.php b/database/migrations/2024_09_24_194122_create_uploadspectemp_table.php new file mode 100644 index 0000000..d5d05f7 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_uploadspectemp_table.php @@ -0,0 +1,182 @@ +unsignedInteger('collid')->index('fk_uploadspectemp_coll'); + $table->string('dbpk', 150)->nullable()->index('index_uploadspectemp_dbpk'); + $table->unsignedInteger('occid')->nullable()->index('index_uploadspectemp_occid'); + $table->string('basisOfRecord', 32)->nullable()->comment('PreservedSpecimen, LivingSpecimen, HumanObservation'); + $table->string('occurrenceID')->nullable()->comment('UniqueGlobalIdentifier'); + $table->string('catalogNumber', 32)->nullable()->index('index_uploadspec_catalognumber'); + $table->string('otherCatalogNumbers')->nullable()->index('index_uploadspec_othercatalognumbers'); + $table->string('ownerInstitutionCode', 32)->nullable(); + $table->string('institutionID')->nullable(); + $table->string('collectionID')->nullable(); + $table->string('datasetID')->nullable(); + $table->string('organismID', 150)->nullable(); + $table->string('institutionCode', 64)->nullable(); + $table->string('collectionCode', 64)->nullable(); + $table->string('family')->nullable(); + $table->string('scientificName')->nullable(); + $table->string('sciname')->nullable()->index('index_uploadspec_sciname'); + $table->unsignedInteger('tidinterpreted')->nullable(); + $table->string('genus')->nullable(); + $table->string('specificEpithet')->nullable(); + $table->string('taxonRank', 32)->nullable(); + $table->string('infraspecificEpithet')->nullable(); + $table->string('scientificNameAuthorship')->nullable(); + $table->text('taxonRemarks')->nullable(); + $table->string('identifiedBy')->nullable(); + $table->string('dateIdentified', 45)->nullable(); + $table->text('identificationReferences')->nullable(); + $table->text('identificationRemarks')->nullable(); + $table->string('identificationQualifier')->nullable()->comment('cf, aff, etc'); + $table->string('typeStatus')->nullable(); + $table->string('recordedBy')->nullable()->comment('Collector(s)'); + $table->string('recordNumberPrefix', 45)->nullable(); + $table->string('recordNumberSuffix', 45)->nullable(); + $table->string('recordNumber', 32)->nullable()->comment('Collector Number'); + $table->string('CollectorFamilyName')->nullable()->comment('not DwC'); + $table->string('CollectorInitials')->nullable()->comment('not DwC'); + $table->string('associatedCollectors')->nullable()->comment('not DwC'); + $table->date('eventDate')->nullable(); + $table->integer('year')->nullable(); + $table->integer('month')->nullable(); + $table->integer('day')->nullable(); + $table->integer('startDayOfYear')->nullable(); + $table->integer('endDayOfYear')->nullable(); + $table->date('LatestDateCollected')->nullable(); + $table->string('verbatimEventDate')->nullable(); + $table->text('habitat')->nullable()->comment('Habitat, substrait, etc'); + $table->string('substrate', 500)->nullable(); + $table->string('host', 250)->nullable(); + $table->text('fieldNotes')->nullable(); + $table->string('fieldnumber', 45)->nullable(); + $table->string('eventID', 45)->nullable(); + $table->text('occurrenceRemarks')->nullable()->comment('General Notes'); + $table->string('informationWithheld', 250)->nullable(); + $table->string('dataGeneralizations', 250)->nullable(); + $table->text('associatedOccurrences')->nullable(); + $table->text('associatedMedia')->nullable(); + $table->text('associatedReferences')->nullable(); + $table->text('associatedSequences')->nullable(); + $table->text('associatedTaxa')->nullable()->comment('Associated Species'); + $table->text('dynamicProperties')->nullable()->comment('Plant Description?'); + $table->text('verbatimAttributes')->nullable(); + $table->string('behavior', 500)->nullable(); + $table->string('reproductiveCondition')->nullable()->comment('Phenology: flowers, fruit, sterile'); + $table->integer('cultivationStatus')->nullable()->comment('0 = wild, 1 = cultivated'); + $table->string('establishmentMeans', 32)->nullable()->comment('cultivated, invasive, escaped from captivity, wild, native'); + $table->string('lifeStage', 45)->nullable(); + $table->string('sex', 45)->nullable(); + $table->string('individualCount', 45)->nullable(); + $table->string('samplingProtocol', 100)->nullable(); + $table->string('samplingEffort', 200)->nullable(); + $table->string('preparations', 100)->nullable(); + $table->string('locationID', 150)->nullable(); + $table->string('parentLocationID', 150)->nullable(); + $table->string('continent', 45)->nullable(); + $table->string('waterBody', 150)->nullable(); + $table->string('islandGroup', 75)->nullable(); + $table->string('island', 75)->nullable(); + $table->string('countryCode', 5)->nullable(); + $table->string('country', 64)->nullable(); + $table->string('stateProvince')->nullable(); + $table->string('county')->nullable(); + $table->string('municipality')->nullable(); + $table->text('locality')->nullable(); + $table->integer('localitySecurity')->nullable()->default(0)->comment('0 = display locality, 1 = hide locality'); + $table->string('localitySecurityReason', 100)->nullable(); + $table->double('decimalLatitude')->nullable(); + $table->double('decimalLongitude')->nullable(); + $table->string('geodeticDatum')->nullable(); + $table->unsignedInteger('coordinateUncertaintyInMeters')->nullable(); + $table->text('footprintWKT')->nullable(); + $table->decimal('coordinatePrecision', 9, 7)->nullable(); + $table->text('locationRemarks')->nullable(); + $table->string('verbatimCoordinates')->nullable(); + $table->string('verbatimCoordinateSystem')->nullable(); + $table->integer('latDeg')->nullable(); + $table->double('latMin')->nullable(); + $table->double('latSec')->nullable(); + $table->string('latNS', 3)->nullable(); + $table->integer('lngDeg')->nullable(); + $table->double('lngMin')->nullable(); + $table->double('lngSec')->nullable(); + $table->string('lngEW', 3)->nullable(); + $table->string('verbatimLatitude', 45)->nullable(); + $table->string('verbatimLongitude', 45)->nullable(); + $table->string('UtmNorthing', 45)->nullable(); + $table->string('UtmEasting', 45)->nullable(); + $table->string('UtmZoning', 45)->nullable(); + $table->string('trsTownship', 45)->nullable(); + $table->string('trsRange', 45)->nullable(); + $table->string('trsSection', 45)->nullable(); + $table->string('trsSectionDetails', 45)->nullable(); + $table->string('georeferencedBy')->nullable(); + $table->dateTime('georeferencedDate')->nullable(); + $table->string('georeferenceProtocol')->nullable(); + $table->string('georeferenceSources')->nullable(); + $table->string('georeferenceVerificationStatus', 32)->nullable(); + $table->string('georeferenceRemarks')->nullable(); + $table->integer('minimumElevationInMeters')->nullable(); + $table->integer('maximumElevationInMeters')->nullable(); + $table->string('elevationNumber', 45)->nullable(); + $table->string('elevationUnits', 45)->nullable(); + $table->string('verbatimElevation')->nullable(); + $table->integer('minimumDepthInMeters')->nullable(); + $table->integer('maximumDepthInMeters')->nullable(); + $table->string('verbatimDepth', 50)->nullable(); + $table->text('previousIdentifications')->nullable(); + $table->string('disposition', 32)->nullable()->comment('Dups to'); + $table->string('storageLocation', 100)->nullable(); + $table->string('genericcolumn1', 100)->nullable(); + $table->string('genericcolumn2', 100)->nullable(); + $table->integer('exsiccatiIdentifier')->nullable(); + $table->string('exsiccatiNumber', 45)->nullable(); + $table->string('exsiccatiNotes', 250)->nullable(); + $table->text('paleoJSON')->nullable(); + $table->text('materialSampleJSON')->nullable(); + $table->dateTime('modified')->nullable()->comment('DateLastModified'); + $table->string('language', 20)->nullable(); + $table->string('recordEnteredBy', 250)->nullable(); + $table->unsignedInteger('duplicateQuantity')->nullable(); + $table->string('labelProject', 45)->nullable(); + $table->string('processingStatus', 45)->nullable(); + $table->text('tempfield01')->nullable(); + $table->text('tempfield02')->nullable(); + $table->text('tempfield03')->nullable(); + $table->text('tempfield04')->nullable(); + $table->text('tempfield05')->nullable(); + $table->text('tempfield06')->nullable(); + $table->text('tempfield07')->nullable(); + $table->text('tempfield08')->nullable(); + $table->text('tempfield09')->nullable(); + $table->text('tempfield10')->nullable(); + $table->text('tempfield11')->nullable(); + $table->text('tempfield12')->nullable(); + $table->text('tempfield13')->nullable(); + $table->text('tempfield14')->nullable(); + $table->text('tempfield15')->nullable(); + $table->timestamp('initialTimestamp')->nullable()->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('uploadspectemp'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_uploadtaxa_table.php b/database/migrations/2024_09_24_194122_create_uploadtaxa_table.php new file mode 100644 index 0000000..cd9fd6d --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_uploadtaxa_table.php @@ -0,0 +1,59 @@ +unsignedInteger('TID')->nullable(); + $table->unsignedInteger('SourceId')->nullable()->index('sourceid_index'); + $table->string('Family', 50)->nullable(); + $table->smallInteger('RankId')->nullable(); + $table->string('RankName', 45)->nullable(); + $table->string('scinameinput', 250)->index('scinameinput_index'); + $table->string('SciName', 250)->nullable()->index('sciname_index'); + $table->string('UnitInd1', 1)->nullable(); + $table->string('UnitName1', 50)->nullable()->index('unitname1_index'); + $table->string('UnitInd2', 1)->nullable(); + $table->string('UnitName2', 50)->nullable(); + $table->string('UnitInd3', 45)->nullable(); + $table->string('UnitName3', 35)->nullable(); + $table->string('Author', 100)->nullable(); + $table->string('InfraAuthor', 100)->nullable(); + $table->string('taxonomicStatus', 45)->nullable(); + $table->unsignedInteger('Acceptance')->nullable()->default(1)->index('acceptance_index')->comment('0 = not accepted; 1 = accepted'); + $table->unsignedInteger('TidAccepted')->nullable(); + $table->string('AcceptedStr', 250)->nullable()->index('acceptedstr_index'); + $table->unsignedInteger('SourceAcceptedId')->nullable()->index('sourceacceptedid_index'); + $table->string('UnacceptabilityReason', 24)->nullable(); + $table->integer('ParentTid')->nullable(); + $table->string('ParentStr', 250)->nullable()->index('parentstr_index'); + $table->unsignedInteger('SourceParentId')->nullable()->index('sourceparentid_index'); + $table->unsignedInteger('SecurityStatus')->default(0)->comment('0 = no security; 1 = hidden locality'); + $table->string('Source', 250)->nullable(); + $table->string('Notes', 250)->nullable(); + $table->string('vernacular', 250)->nullable(); + $table->string('vernlang', 15)->nullable(); + $table->string('Hybrid', 50)->nullable(); + $table->string('ErrorStatus', 150)->nullable(); + $table->timestamp('InitialTimeStamp')->useCurrent(); + + $table->unique(['SciName', 'RankId', 'Author', 'AcceptedStr'], 'unique_sciname'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('uploadtaxa'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_useraccesstokens_table.php b/database/migrations/2024_09_24_194122_create_useraccesstokens_table.php new file mode 100644 index 0000000..ca0526d --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_useraccesstokens_table.php @@ -0,0 +1,31 @@ +integer('tokenID', true); + $table->unsignedInteger('uid')->index('fk_useraccesstokens_uid_idx'); + $table->string('token', 50); + $table->string('device', 50)->nullable(); + $table->dateTime('experationDate')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('useraccesstokens'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_userlogin_table.php b/database/migrations/2024_09_24_194122_create_userlogin_table.php new file mode 100644 index 0000000..796196e --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_userlogin_table.php @@ -0,0 +1,31 @@ +unsignedInteger('uid')->index('fk_login_user'); + $table->string('username', 45)->primary(); + $table->string('password', 45); + $table->string('alias', 45)->nullable()->unique('index_userlogin_unique'); + $table->dateTime('lastlogindate')->nullable(); + $table->timestamp('InitialTimeStamp')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('userlogin'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_userroles_table.php b/database/migrations/2024_09_24_194122_create_userroles_table.php new file mode 100644 index 0000000..951f825 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_userroles_table.php @@ -0,0 +1,37 @@ +increments('userRoleID'); + $table->unsignedInteger('uid')->index('fk_userroles_uid_idx'); + $table->string('role', 45); + $table->string('tableName', 45)->nullable(); + $table->integer('tablePK')->nullable(); + $table->string('secondaryVariable', 45)->nullable(); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('uidAssignedBy')->nullable()->index('fk_usrroles_uid2_idx'); + $table->timestamp('initialTimestamp')->useCurrent(); + + $table->index(['tableName', 'tablePK'], 'index_userroles_table'); + $table->unique(['uid', 'role', 'tableName', 'tablePK'], 'unique_userroles'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('userroles'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_users_table.php b/database/migrations/2024_09_24_194122_create_users_table.php new file mode 100644 index 0000000..f6bb6dc --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_users_table.php @@ -0,0 +1,57 @@ +increments('uid'); + $table->string('firstName', 45)->nullable(); + $table->string('lastName', 45); + $table->string('title', 150)->nullable(); + $table->string('institution', 200)->nullable(); + $table->string('department', 200)->nullable(); + $table->string('address')->nullable(); + $table->string('city', 100)->nullable(); + $table->string('state', 50)->nullable(); + $table->string('zip', 15)->nullable(); + $table->string('country', 50)->nullable(); + $table->string('phone', 45)->nullable(); + $table->string('email', 100); + $table->string('regionOfInterest', 45)->nullable(); + $table->string('url', 400)->nullable(); + $table->string('notes')->nullable(); + $table->string('rightsHolder', 250)->nullable(); + $table->string('rights', 250)->nullable(); + $table->string('accessrRights', 250)->nullable(); + $table->string('guid', 45)->nullable(); + $table->string('username', 45)->nullable()->unique('uq_users_username'); + $table->string('password')->nullable(); + $table->dateTime('lastLoginDate')->nullable(); + $table->dateTime('loginModified')->nullable(); + $table->integer('validated')->default(0); + $table->text('dynamicProperties')->nullable(); + $table->timestamp('initialTimestamp')->useCurrent(); + $table->string('old_password', 45)->nullable(); + $table->string('name')->nullable(); + $table->dateTime('updated_at')->nullable(); + + $table->index(['lastName', 'email'], 'ix_users_email'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('users'); + } +}; diff --git a/database/migrations/2024_09_24_194122_create_usertaxonomy_table.php b/database/migrations/2024_09_24_194122_create_usertaxonomy_table.php new file mode 100644 index 0000000..6d47fb7 --- /dev/null +++ b/database/migrations/2024_09_24_194122_create_usertaxonomy_table.php @@ -0,0 +1,37 @@ +integer('idusertaxonomy', true); + $table->unsignedInteger('uid')->index('fk_usertaxonomy_uid_idx'); + $table->unsignedInteger('tid')->index('fk_usertaxonomy_tid_idx'); + $table->unsignedInteger('taxauthid')->default(1)->index('fk_usertaxonomy_taxauthid_idx'); + $table->string('editorstatus', 45)->nullable(); + $table->string('geographicScope', 250)->nullable(); + $table->string('notes', 250)->nullable(); + $table->unsignedInteger('modifiedUid'); + $table->dateTime('modifiedtimestamp')->nullable(); + $table->timestamp('initialtimestamp')->useCurrent(); + + $table->unique(['uid', 'tid', 'taxauthid', 'editorstatus'], 'usertaxonomy_unique'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('usertaxonomy'); + } +}; diff --git a/database/migrations/2024_09_24_194124_create_insertGeographicPolygon_proc.php b/database/migrations/2024_09_24_194124_create_insertGeographicPolygon_proc.php new file mode 100644 index 0000000..313ab0d --- /dev/null +++ b/database/migrations/2024_09_24_194124_create_insertGeographicPolygon_proc.php @@ -0,0 +1,26 @@ +foreign(['requesttype'], 'FK_actionreq_type')->references(['requesttype'])->on('actionrequesttype')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['uid_requestor'], 'FK_actionreq_uid1')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['uid_fullfillor'], 'FK_actionreq_uid2')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('actionrequest', function (Blueprint $table) { + $table->dropForeign('FK_actionreq_type'); + $table->dropForeign('FK_actionreq_uid1'); + $table->dropForeign('FK_actionreq_uid2'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_adminconfig_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_adminconfig_table.php new file mode 100644 index 0000000..134b04f --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_adminconfig_table.php @@ -0,0 +1,28 @@ +foreign(['modifiedUid'], 'FK_adminConfig_uid')->references(['uid'])->on('users')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('adminconfig', function (Blueprint $table) { + $table->dropForeign('FK_adminConfig_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_adminstats_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_adminstats_table.php new file mode 100644 index 0000000..816f927 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_adminstats_table.php @@ -0,0 +1,30 @@ +foreign(['collid'], 'FK_adminstats_collid')->references(['CollID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['uid'], 'FK_adminstats_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('adminstats', function (Blueprint $table) { + $table->dropForeign('FK_adminstats_collid'); + $table->dropForeign('FK_adminstats_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentdeterminationlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentdeterminationlink_table.php new file mode 100644 index 0000000..537b629 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentdeterminationlink_table.php @@ -0,0 +1,34 @@ +foreign(['agentID'], 'FK_agentdetlink_agentID')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['createdUid'], 'FK_agentdetlink_created')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('restrict'); + $table->foreign(['detID'], 'FK_agentdetlink_detid')->references(['detid'])->on('omoccurdeterminations')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['modifiedUid'], 'FK_agentdetlink_modified')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('agentdeterminationlink', function (Blueprint $table) { + $table->dropForeign('FK_agentdetlink_agentID'); + $table->dropForeign('FK_agentdetlink_created'); + $table->dropForeign('FK_agentdetlink_detid'); + $table->dropForeign('FK_agentdetlink_modified'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentlinks_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentlinks_table.php new file mode 100644 index 0000000..05b5a95 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentlinks_table.php @@ -0,0 +1,32 @@ +foreign(['agentID'], 'FK_agentlinks_agentID')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['createdUid'], 'FK_agentlinks_createdUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['modifiedUid'], 'FK_agentlinks_modUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('agentlinks', function (Blueprint $table) { + $table->dropForeign('FK_agentlinks_agentID'); + $table->dropForeign('FK_agentlinks_createdUid'); + $table->dropForeign('FK_agentlinks_modUid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnames_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnames_table.php new file mode 100644 index 0000000..c250f26 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnames_table.php @@ -0,0 +1,28 @@ +foreign(['agentID'], 'FK_agentnames_agentID')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('agentnames', function (Blueprint $table) { + $table->dropForeign('FK_agentnames_agentID'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnumberpattern_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnumberpattern_table.php new file mode 100644 index 0000000..06aa82b --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnumberpattern_table.php @@ -0,0 +1,28 @@ +foreign(['agentID'], 'agentnumberpattern_ibfk_1')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('agentnumberpattern', function (Blueprint $table) { + $table->dropForeign('agentnumberpattern_ibfk_1'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentoccurrencelink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentoccurrencelink_table.php new file mode 100644 index 0000000..3b9d050 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentoccurrencelink_table.php @@ -0,0 +1,34 @@ +foreign(['agentID'], 'FK_agentoccurlink_agentID')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['createdUid'], 'FK_agentoccurlink_created')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('restrict'); + $table->foreign(['modifiedUid'], 'FK_agentoccurlink_modified')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('restrict'); + $table->foreign(['occid'], 'FK_agentoccurlink_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('agentoccurrencelink', function (Blueprint $table) { + $table->dropForeign('FK_agentoccurlink_agentID'); + $table->dropForeign('FK_agentoccurlink_created'); + $table->dropForeign('FK_agentoccurlink_modified'); + $table->dropForeign('FK_agentoccurlink_occid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentrelations_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentrelations_table.php new file mode 100644 index 0000000..43edcba --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentrelations_table.php @@ -0,0 +1,36 @@ +foreign(['createdUid'], 'FK_agentrelations_createUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['fromAgentID'], 'FK_agentrelations_ibfk_1')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['toAgentID'], 'FK_agentrelations_ibfk_2')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['relationship'], 'FK_agentrelations_ibfk_3')->references(['relationship'])->on('ctrelationshiptypes')->onUpdate('cascade')->onDelete('no action'); + $table->foreign(['modifiedUid'], 'FK_agentrelations_modUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('agentrelations', function (Blueprint $table) { + $table->dropForeign('FK_agentrelations_createUid'); + $table->dropForeign('FK_agentrelations_ibfk_1'); + $table->dropForeign('FK_agentrelations_ibfk_2'); + $table->dropForeign('FK_agentrelations_ibfk_3'); + $table->dropForeign('FK_agentrelations_modUid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agents_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agents_table.php new file mode 100644 index 0000000..efe0bc8 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agents_table.php @@ -0,0 +1,32 @@ +foreign(['createdUid'], 'FK_agents_createdUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['modifiedUid'], 'FK_agents_modUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['preferredRecByID'], 'FK_agents_preferred_recby')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('no action'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('agents', function (Blueprint $table) { + $table->dropForeign('FK_agents_createdUid'); + $table->dropForeign('FK_agents_modUid'); + $table->dropForeign('FK_agents_preferred_recby'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentteams_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentteams_table.php new file mode 100644 index 0000000..6eb773b --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentteams_table.php @@ -0,0 +1,30 @@ +foreign(['memberAgentID'], 'FK_agentteams_memberAgentID')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('no action'); + $table->foreign(['teamAgentID'], 'FK_agentteams_teamAgentID')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('no action'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('agentteams', function (Blueprint $table) { + $table->dropForeign('FK_agentteams_memberAgentID'); + $table->dropForeign('FK_agentteams_teamAgentID'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_chotomouskey_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_chotomouskey_table.php new file mode 100644 index 0000000..1652709 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_chotomouskey_table.php @@ -0,0 +1,28 @@ +foreign(['tid'], 'FK_chotomouskey_taxa')->references(['TID'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('chotomouskey', function (Blueprint $table) { + $table->dropForeign('FK_chotomouskey_taxa'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_configpageattributes_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_configpageattributes_table.php new file mode 100644 index 0000000..0d3ce18 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_configpageattributes_table.php @@ -0,0 +1,28 @@ +foreign(['configpageid'], 'FK_configpageattributes_id')->references(['configpageid'])->on('configpage')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('configpageattributes', function (Blueprint $table) { + $table->dropForeign('FK_configpageattributes_id'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocab_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocab_table.php new file mode 100644 index 0000000..64bf252 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocab_table.php @@ -0,0 +1,32 @@ +foreign(['collid'], 'FK_ctControlVocab_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['createdUid'], 'FK_ctControlVocab_createUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['modifiedUid'], 'FK_ctControlVocab_modUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('ctcontrolvocab', function (Blueprint $table) { + $table->dropForeign('FK_ctControlVocab_collid'); + $table->dropForeign('FK_ctControlVocab_createUid'); + $table->dropForeign('FK_ctControlVocab_modUid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocabterm_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocabterm_table.php new file mode 100644 index 0000000..608cc04 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocabterm_table.php @@ -0,0 +1,34 @@ +foreign(['createdUid'], 'FK_ctControlVocabTerm_createUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['cvID'], 'FK_ctControlVocabTerm_cvID')->references(['cvID'])->on('ctcontrolvocab')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['parentCvTermID'], 'FK_ctControlVocabTerm_cvTermID')->references(['cvTermID'])->on('ctcontrolvocabterm')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['modifiedUid'], 'FK_ctControlVocabTerm_modUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('ctcontrolvocabterm', function (Blueprint $table) { + $table->dropForeign('FK_ctControlVocabTerm_createUid'); + $table->dropForeign('FK_ctControlVocabTerm_cvID'); + $table->dropForeign('FK_ctControlVocabTerm_cvTermID'); + $table->dropForeign('FK_ctControlVocabTerm_modUid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchecklists_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchecklists_table.php new file mode 100644 index 0000000..3596722 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchecklists_table.php @@ -0,0 +1,28 @@ +foreign(['uid'], 'FK_checklists_uid')->references(['uid'])->on('users')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('fmchecklists', function (Blueprint $table) { + $table->dropForeign('FK_checklists_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstchildren_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstchildren_table.php new file mode 100644 index 0000000..7ea9c9f --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstchildren_table.php @@ -0,0 +1,30 @@ +foreign(['clidchild'], 'FK_fmchklstchild_child')->references(['clid'])->on('fmchecklists')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['clid'], 'FK_fmchklstchild_clid')->references(['clid'])->on('fmchecklists')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('fmchklstchildren', function (Blueprint $table) { + $table->dropForeign('FK_fmchklstchild_child'); + $table->dropForeign('FK_fmchklstchild_clid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstcoordinates_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstcoordinates_table.php new file mode 100644 index 0000000..37fe454 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstcoordinates_table.php @@ -0,0 +1,30 @@ +foreign(['clid'], 'FK_checklistCoord_clid')->references(['clid'])->on('fmchecklists')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['tid'], 'FK_checklistCoord_tid')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('fmchklstcoordinates', function (Blueprint $table) { + $table->dropForeign('FK_checklistCoord_clid'); + $table->dropForeign('FK_checklistCoord_tid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstprojlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstprojlink_table.php new file mode 100644 index 0000000..6347558 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstprojlink_table.php @@ -0,0 +1,30 @@ +foreign(['clid'], 'FK_chklstprojlink_clid')->references(['clid'])->on('fmchecklists')->onUpdate('restrict')->onDelete('restrict'); + $table->foreign(['pid'], 'FK_chklstprojlink_proj')->references(['pid'])->on('fmprojects')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('fmchklstprojlink', function (Blueprint $table) { + $table->dropForeign('FK_chklstprojlink_clid'); + $table->dropForeign('FK_chklstprojlink_proj'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklsttaxalink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklsttaxalink_table.php new file mode 100644 index 0000000..f79f577 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklsttaxalink_table.php @@ -0,0 +1,30 @@ +foreign(['clid'], 'FK_chklsttaxalink_cid')->references(['clid'])->on('fmchecklists')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['tid'], 'FK_chklsttaxalink_tid')->references(['TID'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('fmchklsttaxalink', function (Blueprint $table) { + $table->dropForeign('FK_chklsttaxalink_cid'); + $table->dropForeign('FK_chklsttaxalink_tid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmdyncltaxalink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmdyncltaxalink_table.php new file mode 100644 index 0000000..7ff2949 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmdyncltaxalink_table.php @@ -0,0 +1,30 @@ +foreign(['dynclid'], 'FK_dyncltaxalink_dynclid')->references(['dynclid'])->on('fmdynamicchecklists')->onUpdate('restrict')->onDelete('cascade'); + $table->foreign(['tid'], 'FK_dyncltaxalink_taxa')->references(['TID'])->on('taxa')->onUpdate('restrict')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('fmdyncltaxalink', function (Blueprint $table) { + $table->dropForeign('FK_dyncltaxalink_dynclid'); + $table->dropForeign('FK_dyncltaxalink_taxa'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojectcategories_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojectcategories_table.php new file mode 100644 index 0000000..b74640e --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojectcategories_table.php @@ -0,0 +1,28 @@ +foreign(['pid'], 'FK_fmprojcat_pid')->references(['pid'])->on('fmprojects')->onUpdate('no action')->onDelete('no action'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('fmprojectcategories', function (Blueprint $table) { + $table->dropForeign('FK_fmprojcat_pid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojects_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojects_table.php new file mode 100644 index 0000000..bb625d1 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojects_table.php @@ -0,0 +1,28 @@ +foreign(['parentpid'], 'FK_parentpid_proj')->references(['pid'])->on('fmprojects')->onUpdate('no action')->onDelete('no action'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('fmprojects', function (Blueprint $table) { + $table->dropForeign('FK_parentpid_proj'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmvouchers_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmvouchers_table.php new file mode 100644 index 0000000..f9e53c7 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmvouchers_table.php @@ -0,0 +1,28 @@ +foreign(['clTaxaID'], 'FK_fmvouchers_tidclid')->references(['clTaxaID'])->on('fmchklsttaxalink')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('fmvouchers', function (Blueprint $table) { + $table->dropForeign('FK_fmvouchers_tidclid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_geographicthesaurus_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_geographicthesaurus_table.php new file mode 100644 index 0000000..cf9b27e --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_geographicthesaurus_table.php @@ -0,0 +1,30 @@ +foreign(['acceptedID'], 'FK_geothes_acceptedID')->references(['geoThesID'])->on('geographicthesaurus')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['parentID'], 'FK_geothes_parentID')->references(['geoThesID'])->on('geographicthesaurus')->onUpdate('cascade')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('geographicthesaurus', function (Blueprint $table) { + $table->dropForeign('FK_geothes_acceptedID'); + $table->dropForeign('FK_geothes_parentID'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossary_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossary_table.php new file mode 100644 index 0000000..18c7f66 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossary_table.php @@ -0,0 +1,28 @@ +foreign(['uid'], 'FK_glossary_uid')->references(['uid'])->on('users')->onUpdate('set null')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('glossary', function (Blueprint $table) { + $table->dropForeign('FK_glossary_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategory_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategory_table.php new file mode 100644 index 0000000..34af517 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategory_table.php @@ -0,0 +1,32 @@ +foreign(['langID'], 'FK_glossarycategory_lang')->references(['langid'])->on('adminlanguages')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['parentCatID'], 'FK_glossarycategory_parentCatID')->references(['glossCatID'])->on('glossarycategory')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['translationCatID'], 'FK_glossarycategory_transCatID')->references(['glossCatID'])->on('glossarycategory')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('glossarycategory', function (Blueprint $table) { + $table->dropForeign('FK_glossarycategory_lang'); + $table->dropForeign('FK_glossarycategory_parentCatID'); + $table->dropForeign('FK_glossarycategory_transCatID'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategorylink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategorylink_table.php new file mode 100644 index 0000000..7de3a49 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategorylink_table.php @@ -0,0 +1,30 @@ +foreign(['glossCatID'], 'FK_glossCatLink_glossCatID')->references(['glossCatID'])->on('glossarycategory')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['glossID'], 'FK_glossCatLink_glossID')->references(['glossid'])->on('glossary')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('glossarycategorylink', function (Blueprint $table) { + $table->dropForeign('FK_glossCatLink_glossCatID'); + $table->dropForeign('FK_glossCatLink_glossID'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossaryimages_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossaryimages_table.php new file mode 100644 index 0000000..50fd6d8 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossaryimages_table.php @@ -0,0 +1,30 @@ +foreign(['glossid'], 'FK_glossaryimages_glossid')->references(['glossid'])->on('glossary')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['uid'], 'FK_glossaryimages_uid')->references(['uid'])->on('users')->onUpdate('set null')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('glossaryimages', function (Blueprint $table) { + $table->dropForeign('FK_glossaryimages_glossid'); + $table->dropForeign('FK_glossaryimages_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytaxalink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytaxalink_table.php new file mode 100644 index 0000000..eed0305 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytaxalink_table.php @@ -0,0 +1,30 @@ +foreign(['glossid'], 'FK_glossarytaxa_glossid')->references(['glossid'])->on('glossary')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['tid'], 'FK_glossarytaxa_tid')->references(['TID'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('glossarytaxalink', function (Blueprint $table) { + $table->dropForeign('FK_glossarytaxa_glossid'); + $table->dropForeign('FK_glossarytaxa_tid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytermlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytermlink_table.php new file mode 100644 index 0000000..3d2eaf4 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytermlink_table.php @@ -0,0 +1,30 @@ +foreign(['glossgrpid'], 'FK_glossarytermlink_glossgrpid')->references(['glossid'])->on('glossary')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['glossid'], 'FK_glossarytermlink_glossid')->references(['glossid'])->on('glossary')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('glossarytermlink', function (Blueprint $table) { + $table->dropForeign('FK_glossarytermlink_glossgrpid'); + $table->dropForeign('FK_glossarytermlink_glossid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_igsnverification_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_igsnverification_table.php new file mode 100644 index 0000000..e198233 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_igsnverification_table.php @@ -0,0 +1,28 @@ +foreign(['occidInPortal'], 'FK_igsn_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('igsnverification', function (Blueprint $table) { + $table->dropForeign('FK_igsn_occid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageannotations_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageannotations_table.php new file mode 100644 index 0000000..2005fcf --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageannotations_table.php @@ -0,0 +1,30 @@ +foreign(['imgid'], 'FK_resourceannotations_imgid')->references(['imgid'])->on('images')->onUpdate('restrict')->onDelete('restrict'); + $table->foreign(['tid'], 'FK_resourceannotations_tid')->references(['TID'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('imageannotations', function (Blueprint $table) { + $table->dropForeign('FK_resourceannotations_imgid'); + $table->dropForeign('FK_resourceannotations_tid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagekeywords_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagekeywords_table.php new file mode 100644 index 0000000..4bff312 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagekeywords_table.php @@ -0,0 +1,30 @@ +foreign(['imgid'], 'FK_imagekeywords_imgid')->references(['imgid'])->on('images')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['uidassignedby'], 'FK_imagekeyword_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('imagekeywords', function (Blueprint $table) { + $table->dropForeign('FK_imagekeywords_imgid'); + $table->dropForeign('FK_imagekeyword_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojectlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojectlink_table.php new file mode 100644 index 0000000..a84c73f --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojectlink_table.php @@ -0,0 +1,30 @@ +foreign(['imgid'], 'FK_imageprojectlink_imgid')->references(['imgid'])->on('images')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['imgprojid'], 'FK_imageprojlink_imgprojid')->references(['imgprojid'])->on('imageprojects')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('imageprojectlink', function (Blueprint $table) { + $table->dropForeign('FK_imageprojectlink_imgid'); + $table->dropForeign('FK_imageprojlink_imgprojid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojects_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojects_table.php new file mode 100644 index 0000000..40139fd --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojects_table.php @@ -0,0 +1,30 @@ +foreign(['collid'], 'FK_imageproject_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['uidcreated'], 'FK_imageproject_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('imageprojects', function (Blueprint $table) { + $table->dropForeign('FK_imageproject_collid'); + $table->dropForeign('FK_imageproject_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_images_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_images_table.php new file mode 100644 index 0000000..0781711 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_images_table.php @@ -0,0 +1,32 @@ +foreign(['occid'], 'FK_images_occ')->references(['occid'])->on('omoccurrences')->onUpdate('restrict')->onDelete('restrict'); + $table->foreign(['photographerUid'], 'FK_photographeruid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['tid'], 'FK_taxaimagestid')->references(['TID'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('images', function (Blueprint $table) { + $table->dropForeign('FK_images_occ'); + $table->dropForeign('FK_photographeruid'); + $table->dropForeign('FK_taxaimagestid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetag_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetag_table.php new file mode 100644 index 0000000..b860332 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetag_table.php @@ -0,0 +1,30 @@ +foreign(['keyvalue'], 'FK_imagetag_tagkey')->references(['tagkey'])->on('imagetagkey')->onUpdate('cascade')->onDelete('no action'); + $table->foreign(['imgid'], 'imagetag_ibfk_1')->references(['media_id'])->on('media')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('imagetag', function (Blueprint $table) { + $table->dropForeign('FK_imagetag_tagkey'); + $table->dropForeign('imagetag_ibfk_1'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetagkey_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetagkey_table.php new file mode 100644 index 0000000..5aea74d --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetagkey_table.php @@ -0,0 +1,28 @@ +foreign(['imgTagGroupID'], 'FK_imageTagKey_imgTagGroupID')->references(['imgTagGroupID'])->on('imagetaggroup')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('imagetagkey', function (Blueprint $table) { + $table->dropForeign('FK_imageTagKey_imgTagGroupID'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_institutions_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_institutions_table.php new file mode 100644 index 0000000..0bdc62e --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_institutions_table.php @@ -0,0 +1,28 @@ +foreign(['modifieduid'], 'FK_inst_uid')->references(['uid'])->on('users')->onUpdate('no action')->onDelete('no action'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('institutions', function (Blueprint $table) { + $table->dropForeign('FK_inst_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacterlang_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacterlang_table.php new file mode 100644 index 0000000..21d0702 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacterlang_table.php @@ -0,0 +1,30 @@ +foreign(['cid'], 'FK_characterlang_1')->references(['cid'])->on('kmcharacters')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['langid'], 'FK_charlang_lang')->references(['langid'])->on('adminlanguages')->onUpdate('no action')->onDelete('no action'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('kmcharacterlang', function (Blueprint $table) { + $table->dropForeign('FK_characterlang_1'); + $table->dropForeign('FK_charlang_lang'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacters_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacters_table.php new file mode 100644 index 0000000..937639f --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacters_table.php @@ -0,0 +1,30 @@ +foreign(['hid'], 'FK_charheading')->references(['hid'])->on('kmcharheading')->onUpdate('cascade')->onDelete('restrict'); + $table->foreign(['glossid'], 'FK_kmchar_glossary')->references(['glossid'])->on('glossary')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('kmcharacters', function (Blueprint $table) { + $table->dropForeign('FK_charheading'); + $table->dropForeign('FK_kmchar_glossary'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchardependance_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchardependance_table.php new file mode 100644 index 0000000..9e78a9f --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchardependance_table.php @@ -0,0 +1,30 @@ +foreign(['CID'], 'FK_chardependance_cid')->references(['cid'])->on('kmcharacters')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['CIDDependance', 'CSDependance'], 'FK_chardependance_cs')->references(['cid', 'cs'])->on('kmcs')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('kmchardependance', function (Blueprint $table) { + $table->dropForeign('FK_chardependance_cid'); + $table->dropForeign('FK_chardependance_cs'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheading_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheading_table.php new file mode 100644 index 0000000..6e35f5e --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheading_table.php @@ -0,0 +1,28 @@ +foreign(['langid'], 'FK_kmcharheading_lang')->references(['langid'])->on('adminlanguages')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('kmcharheading', function (Blueprint $table) { + $table->dropForeign('FK_kmcharheading_lang'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheadinglang_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheadinglang_table.php new file mode 100644 index 0000000..73bac1b --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheadinglang_table.php @@ -0,0 +1,30 @@ +foreign(['hid'], 'FK_kmcharheadinglang_hid')->references(['hid'])->on('kmcharheading')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['langid'], 'FK_kmcharheadinglang_langid')->references(['langid'])->on('adminlanguages')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('kmcharheadinglang', function (Blueprint $table) { + $table->dropForeign('FK_kmcharheadinglang_hid'); + $table->dropForeign('FK_kmcharheadinglang_langid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchartaxalink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchartaxalink_table.php new file mode 100644 index 0000000..9c5c321 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchartaxalink_table.php @@ -0,0 +1,30 @@ +foreign(['CID'], 'FK_chartaxalink_cid')->references(['cid'])->on('kmcharacters')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['TID'], 'FK_chartaxalink_tid')->references(['TID'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('kmchartaxalink', function (Blueprint $table) { + $table->dropForeign('FK_chartaxalink_cid'); + $table->dropForeign('FK_chartaxalink_tid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcs_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcs_table.php new file mode 100644 index 0000000..e13c6a1 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcs_table.php @@ -0,0 +1,30 @@ +foreign(['cid'], 'FK_cs_chars')->references(['cid'])->on('kmcharacters')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['glossid'], 'FK_kmcs_glossid')->references(['glossid'])->on('glossary')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('kmcs', function (Blueprint $table) { + $table->dropForeign('FK_cs_chars'); + $table->dropForeign('FK_kmcs_glossid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcsimages_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcsimages_table.php new file mode 100644 index 0000000..035aedc --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcsimages_table.php @@ -0,0 +1,28 @@ +foreign(['cid', 'cs'], 'FK_kscsimages_kscs')->references(['cid', 'cs'])->on('kmcs')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('kmcsimages', function (Blueprint $table) { + $table->dropForeign('FK_kscsimages_kscs'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcslang_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcslang_table.php new file mode 100644 index 0000000..26d25e7 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcslang_table.php @@ -0,0 +1,30 @@ +foreign(['cid', 'cs'], 'FK_cslang_1')->references(['cid', 'cs'])->on('kmcs')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['langid'], 'FK_cslang_lang')->references(['langid'])->on('adminlanguages')->onUpdate('no action')->onDelete('no action'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('kmcslang', function (Blueprint $table) { + $table->dropForeign('FK_cslang_1'); + $table->dropForeign('FK_cslang_lang'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmdescr_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmdescr_table.php new file mode 100644 index 0000000..1c53b87 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmdescr_table.php @@ -0,0 +1,30 @@ +foreign(['CID', 'CS'], 'FK_descr_cs')->references(['cid', 'cs'])->on('kmcs')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['TID'], 'FK_descr_tid')->references(['TID'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('kmdescr', function (Blueprint $table) { + $table->dropForeign('FK_descr_cs'); + $table->dropForeign('FK_descr_tid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupcounty_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupcounty_table.php new file mode 100644 index 0000000..b96450c --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupcounty_table.php @@ -0,0 +1,28 @@ +foreign(['stateId'], 'fk_stateprovince')->references(['stateId'])->on('lkupstateprovince')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('lkupcounty', function (Blueprint $table) { + $table->dropForeign('fk_stateprovince'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupmunicipality_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupmunicipality_table.php new file mode 100644 index 0000000..77c267f --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupmunicipality_table.php @@ -0,0 +1,28 @@ +foreign(['stateId'], 'lkupmunicipality_ibfk_1')->references(['stateId'])->on('lkupstateprovince')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('lkupmunicipality', function (Blueprint $table) { + $table->dropForeign('lkupmunicipality_ibfk_1'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupstateprovince_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupstateprovince_table.php new file mode 100644 index 0000000..6495382 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupstateprovince_table.php @@ -0,0 +1,28 @@ +foreign(['countryId'], 'fk_country')->references(['countryId'])->on('lkupcountry')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('lkupstateprovince', function (Blueprint $table) { + $table->dropForeign('fk_country'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_media_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_media_table.php new file mode 100644 index 0000000..ea907b4 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_media_table.php @@ -0,0 +1,32 @@ +foreign(['creatoruid'], 'FK_creator_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['occid'], 'FK_media_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['tid'], 'FK_media_taxa')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('media', function (Blueprint $table) { + $table->dropForeign('FK_creator_uid'); + $table->dropForeign('FK_media_occid'); + $table->dropForeign('FK_media_taxa'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollcatlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollcatlink_table.php new file mode 100644 index 0000000..79db079 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollcatlink_table.php @@ -0,0 +1,30 @@ +foreign(['ccpk'], 'FK_collcatlink_cat')->references(['ccpk'])->on('omcollcategories')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['collid'], 'FK_collcatlink_coll')->references(['CollID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omcollcatlink', function (Blueprint $table) { + $table->dropForeign('FK_collcatlink_cat'); + $table->dropForeign('FK_collcatlink_coll'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollections_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollections_table.php new file mode 100644 index 0000000..021d4b6 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollections_table.php @@ -0,0 +1,28 @@ +foreign(['iid'], 'FK_collid_iid')->references(['iid'])->on('institutions')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omcollections', function (Blueprint $table) { + $table->dropForeign('FK_collid_iid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollectionstats_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollectionstats_table.php new file mode 100644 index 0000000..dfccd88 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollectionstats_table.php @@ -0,0 +1,28 @@ +foreign(['collid'], 'FK_collectionstats_coll')->references(['collID'])->on('omcollections')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omcollectionstats', function (Blueprint $table) { + $table->dropForeign('FK_collectionstats_coll'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollproperties_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollproperties_table.php new file mode 100644 index 0000000..a8aaf34 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollproperties_table.php @@ -0,0 +1,30 @@ +foreign(['collid'], 'FK_omcollproperties_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['modifiedUid'], 'FK_omcollproperties_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omcollproperties', function (Blueprint $table) { + $table->dropForeign('FK_omcollproperties_collid'); + $table->dropForeign('FK_omcollproperties_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpublications_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpublications_table.php new file mode 100644 index 0000000..3c60ae0 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpublications_table.php @@ -0,0 +1,28 @@ +foreign(['collid'], 'FK_adminpub_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omcollpublications', function (Blueprint $table) { + $table->dropForeign('FK_adminpub_collid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpuboccurlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpuboccurlink_table.php new file mode 100644 index 0000000..db02e78 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpuboccurlink_table.php @@ -0,0 +1,30 @@ +foreign(['occid'], 'FK_ompuboccid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['pubid'], 'FK_ompubpubid')->references(['pubid'])->on('omcollpublications')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omcollpuboccurlink', function (Blueprint $table) { + $table->dropForeign('FK_ompuboccid'); + $table->dropForeign('FK_ompubpubid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollsecondary_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollsecondary_table.php new file mode 100644 index 0000000..bd48b43 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollsecondary_table.php @@ -0,0 +1,28 @@ +foreign(['collid'], 'FK_omcollsecondary_coll')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omcollsecondary', function (Blueprint $table) { + $table->dropForeign('FK_omcollsecondary_coll'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcecentral_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcecentral_table.php new file mode 100644 index 0000000..4588761 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcecentral_table.php @@ -0,0 +1,28 @@ +foreign(['collid'], 'FK_omcrowdsourcecentral_collid')->references(['collID'])->on('omcollections')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omcrowdsourcecentral', function (Blueprint $table) { + $table->dropForeign('FK_omcrowdsourcecentral_collid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourceproject_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourceproject_table.php new file mode 100644 index 0000000..6b3d8d3 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourceproject_table.php @@ -0,0 +1,28 @@ +foreign(['modifiedUid'], 'FK_croudsourceproj_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omcrowdsourceproject', function (Blueprint $table) { + $table->dropForeign('FK_croudsourceproj_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcequeue_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcequeue_table.php new file mode 100644 index 0000000..2914a22 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcequeue_table.php @@ -0,0 +1,32 @@ +foreign(['csProjID'], 'FK_omcrowdsourcequeue_csProjID')->references(['csProjID'])->on('omcrowdsourceproject')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['occid'], 'FK_omcrowdsourcequeue_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['uidprocessor'], 'FK_omcrowdsourcequeue_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('no action'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omcrowdsourcequeue', function (Blueprint $table) { + $table->dropForeign('FK_omcrowdsourcequeue_csProjID'); + $table->dropForeign('FK_omcrowdsourcequeue_occid'); + $table->dropForeign('FK_omcrowdsourcequeue_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatinumbers_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatinumbers_table.php new file mode 100644 index 0000000..c58a670 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatinumbers_table.php @@ -0,0 +1,28 @@ +foreign(['ometid'], 'FK_exsiccatiTitleNumber')->references(['ometid'])->on('omexsiccatititles')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omexsiccatinumbers', function (Blueprint $table) { + $table->dropForeign('FK_exsiccatiTitleNumber'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatiocclink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatiocclink_table.php new file mode 100644 index 0000000..fdc319f --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatiocclink_table.php @@ -0,0 +1,30 @@ +foreign(['omenid'], 'FKExsiccatiNumOccLink1')->references(['omenid'])->on('omexsiccatinumbers')->onUpdate('restrict')->onDelete('cascade'); + $table->foreign(['occid'], 'FKExsiccatiNumOccLink2')->references(['occid'])->on('omoccurrences')->onUpdate('restrict')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omexsiccatiocclink', function (Blueprint $table) { + $table->dropForeign('FKExsiccatiNumOccLink1'); + $table->dropForeign('FKExsiccatiNumOccLink2'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_ommaterialsample_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_ommaterialsample_table.php new file mode 100644 index 0000000..7306fb2 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_ommaterialsample_table.php @@ -0,0 +1,30 @@ +foreign(['occid'], 'FK_ommatsample_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['preparedByUid'], 'FK_ommatsample_prepUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('ommaterialsample', function (Blueprint $table) { + $table->dropForeign('FK_ommatsample_occid'); + $table->dropForeign('FK_ommatsample_prepUid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuraccesssummarylink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuraccesssummarylink_table.php new file mode 100644 index 0000000..bcad37b --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuraccesssummarylink_table.php @@ -0,0 +1,30 @@ +foreign(['oasid'], 'FK_omoccuraccesssummarylink_oasid')->references(['oasid'])->on('omoccuraccesssummary')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['occid'], 'FK_omoccuraccesssummarylink_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccuraccesssummarylink', function (Blueprint $table) { + $table->dropForeign('FK_omoccuraccesssummarylink_oasid'); + $table->dropForeign('FK_omoccuraccesssummarylink_occid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurarchive_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurarchive_table.php new file mode 100644 index 0000000..3432b1e --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurarchive_table.php @@ -0,0 +1,28 @@ +foreign(['createdUid'], 'FK_occurarchive_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurarchive', function (Blueprint $table) { + $table->dropForeign('FK_occurarchive_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurassociations_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurassociations_table.php new file mode 100644 index 0000000..885df03 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurassociations_table.php @@ -0,0 +1,36 @@ +foreign(['occid'], 'FK_occurassoc_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['occidAssociate'], 'FK_occurassoc_occidassoc')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['tid'], 'FK_occurassoc_tid')->references(['TID'])->on('taxa')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['createdUid'], 'FK_occurassoc_uidcreated')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['modifiedUid'], 'FK_occurassoc_uidmodified')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurassociations', function (Blueprint $table) { + $table->dropForeign('FK_occurassoc_occid'); + $table->dropForeign('FK_occurassoc_occidassoc'); + $table->dropForeign('FK_occurassoc_tid'); + $table->dropForeign('FK_occurassoc_uidcreated'); + $table->dropForeign('FK_occurassoc_uidmodified'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurcomments_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurcomments_table.php new file mode 100644 index 0000000..a1d3781 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurcomments_table.php @@ -0,0 +1,30 @@ +foreign(['occid'], 'fk_omoccurcomments_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['uid'], 'fk_omoccurcomments_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurcomments', function (Blueprint $table) { + $table->dropForeign('fk_omoccurcomments_occid'); + $table->dropForeign('fk_omoccurcomments_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasetlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasetlink_table.php new file mode 100644 index 0000000..8e9e8a5 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasetlink_table.php @@ -0,0 +1,30 @@ +foreign(['datasetid'], 'FK_omoccurdatasetlink_datasetid')->references(['datasetid'])->on('omoccurdatasets')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['occid'], 'FK_omoccurdatasetlink_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurdatasetlink', function (Blueprint $table) { + $table->dropForeign('FK_omoccurdatasetlink_datasetid'); + $table->dropForeign('FK_omoccurdatasetlink_occid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasets_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasets_table.php new file mode 100644 index 0000000..0dea7e5 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasets_table.php @@ -0,0 +1,32 @@ +foreign(['collid'], 'FK_omcollections_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['parentDatasetID'], 'FK_omoccurdatasets_parent')->references(['datasetID'])->on('omoccurdatasets')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['uid'], 'FK_omoccurdatasets_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurdatasets', function (Blueprint $table) { + $table->dropForeign('FK_omcollections_collid'); + $table->dropForeign('FK_omoccurdatasets_parent'); + $table->dropForeign('FK_omoccurdatasets_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdeterminations_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdeterminations_table.php new file mode 100644 index 0000000..14ee97a --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdeterminations_table.php @@ -0,0 +1,34 @@ +foreign(['identifiedByAgentID'], 'FK_omoccurdets_agentID')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['occid'], 'FK_omoccurdets_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['tidInterpreted'], 'FK_omoccurdets_tid')->references(['TID'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); + $table->foreign(['enteredByUid'], 'FK_omoccurdets_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurdeterminations', function (Blueprint $table) { + $table->dropForeign('FK_omoccurdets_agentID'); + $table->dropForeign('FK_omoccurdets_occid'); + $table->dropForeign('FK_omoccurdets_tid'); + $table->dropForeign('FK_omoccurdets_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurduplicatelink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurduplicatelink_table.php new file mode 100644 index 0000000..49b59ba --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurduplicatelink_table.php @@ -0,0 +1,30 @@ +foreign(['duplicateid'], 'FK_omoccurdupelink_dupeid')->references(['duplicateid'])->on('omoccurduplicates')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['occid'], 'FK_omoccurdupelink_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurduplicatelink', function (Blueprint $table) { + $table->dropForeign('FK_omoccurdupelink_dupeid'); + $table->dropForeign('FK_omoccurdupelink_occid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuredits_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuredits_table.php new file mode 100644 index 0000000..b48184f --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuredits_table.php @@ -0,0 +1,30 @@ +foreign(['occid'], 'fk_omoccuredits_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['uid'], 'fk_omoccuredits_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccuredits', function (Blueprint $table) { + $table->dropForeign('fk_omoccuredits_occid'); + $table->dropForeign('fk_omoccuredits_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurexchange_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurexchange_table.php new file mode 100644 index 0000000..96b65b8 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurexchange_table.php @@ -0,0 +1,28 @@ +foreign(['collid'], 'FK_occexch_coll')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurexchange', function (Blueprint $table) { + $table->dropForeign('FK_occexch_coll'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgenetic_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgenetic_table.php new file mode 100644 index 0000000..05e3d08 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgenetic_table.php @@ -0,0 +1,28 @@ +foreign(['occid'], 'FK_omoccurgenetic')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurgenetic', function (Blueprint $table) { + $table->dropForeign('FK_omoccurgenetic'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgeoindex_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgeoindex_table.php new file mode 100644 index 0000000..6872bed --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgeoindex_table.php @@ -0,0 +1,28 @@ +foreign(['tid'], 'FK_specgeoindex_taxa')->references(['TID'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurgeoindex', function (Blueprint $table) { + $table->dropForeign('FK_specgeoindex_taxa'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuridentifiers_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuridentifiers_table.php new file mode 100644 index 0000000..8dd9fd7 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuridentifiers_table.php @@ -0,0 +1,28 @@ +foreign(['occid'], 'FK_omoccuridentifiers_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccuridentifiers', function (Blueprint $table) { + $table->dropForeign('FK_omoccuridentifiers_occid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloans_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloans_table.php new file mode 100644 index 0000000..6e9ec08 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloans_table.php @@ -0,0 +1,34 @@ +foreign(['collidBorr'], 'FK_occurloans_borrcoll')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('restrict'); + $table->foreign(['iidBorrower'], 'FK_occurloans_borrinst')->references(['iid'])->on('institutions')->onUpdate('cascade')->onDelete('restrict'); + $table->foreign(['collidOwn'], 'FK_occurloans_owncoll')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('restrict'); + $table->foreign(['iidOwner'], 'FK_occurloans_owninst')->references(['iid'])->on('institutions')->onUpdate('cascade')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurloans', function (Blueprint $table) { + $table->dropForeign('FK_occurloans_borrcoll'); + $table->dropForeign('FK_occurloans_borrinst'); + $table->dropForeign('FK_occurloans_owncoll'); + $table->dropForeign('FK_occurloans_owninst'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloansattachment_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloansattachment_table.php new file mode 100644 index 0000000..177bd91 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloansattachment_table.php @@ -0,0 +1,30 @@ +foreign(['exchangeid'], 'FK_occurloansattachment_exchangeid')->references(['exchangeid'])->on('omoccurexchange')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['loanid'], 'FK_occurloansattachment_loanid')->references(['loanid'])->on('omoccurloans')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurloansattachment', function (Blueprint $table) { + $table->dropForeign('FK_occurloansattachment_exchangeid'); + $table->dropForeign('FK_occurloansattachment_loanid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanslink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanslink_table.php new file mode 100644 index 0000000..e396e2d --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanslink_table.php @@ -0,0 +1,30 @@ +foreign(['loanid'], 'FK_occurloanlink_loanid')->references(['loanid'])->on('omoccurloans')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['occid'], 'FK_occurloanlink_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurloanslink', function (Blueprint $table) { + $table->dropForeign('FK_occurloanlink_loanid'); + $table->dropForeign('FK_occurloanlink_occid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanuser_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanuser_table.php new file mode 100644 index 0000000..b7f295d --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanuser_table.php @@ -0,0 +1,32 @@ +foreign(['loanid'], 'FK_occurloan_loanid')->references(['loanid'])->on('omoccurloans')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['modifiedByUid'], 'FK_occurloan_modifiedByUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['uid'], 'FK_occurloan_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurloanuser', function (Blueprint $table) { + $table->dropForeign('FK_occurloan_loanid'); + $table->dropForeign('FK_occurloan_modifiedByUid'); + $table->dropForeign('FK_occurloan_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleo_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleo_table.php new file mode 100644 index 0000000..fb8b06e --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleo_table.php @@ -0,0 +1,28 @@ +foreign(['occid'], 'FK_paleo_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurpaleo', function (Blueprint $table) { + $table->dropForeign('FK_paleo_occid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleogts_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleogts_table.php new file mode 100644 index 0000000..d0db547 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleogts_table.php @@ -0,0 +1,28 @@ +foreign(['parentgtsid'], 'FK_gtsparent')->references(['gtsid'])->on('omoccurpaleogts')->onUpdate('cascade')->onDelete('no action'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurpaleogts', function (Blueprint $table) { + $table->dropForeign('FK_gtsparent'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurrences_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurrences_table.php new file mode 100644 index 0000000..c5978ff --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurrences_table.php @@ -0,0 +1,28 @@ +foreign(['collid'], 'FK_omoccurrences_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurrences', function (Blueprint $table) { + $table->dropForeign('FK_omoccurrences_collid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurresource_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurresource_table.php new file mode 100644 index 0000000..2905c39 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurresource_table.php @@ -0,0 +1,32 @@ +foreign(['createdUid'], 'FK_omoccurresource_createdUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['modifiedUid'], 'FK_omoccurresource_modUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['occid'], 'FK_omoccurresource_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurresource', function (Blueprint $table) { + $table->dropForeign('FK_omoccurresource_createdUid'); + $table->dropForeign('FK_omoccurresource_modUid'); + $table->dropForeign('FK_omoccurresource_occid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurverification_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurverification_table.php new file mode 100644 index 0000000..378a2b2 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurverification_table.php @@ -0,0 +1,30 @@ +foreign(['occid'], 'FK_omoccurverification_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['uid'], 'FK_omoccurverification_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('omoccurverification', function (Blueprint $table) { + $table->dropForeign('FK_omoccurverification_occid'); + $table->dropForeign('FK_omoccurverification_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_portaloccurrences_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_portaloccurrences_table.php new file mode 100644 index 0000000..23a2c0b --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_portaloccurrences_table.php @@ -0,0 +1,30 @@ +foreign(['occid'], 'FK_portalOccur_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['pubid'], 'FK_portalOccur_pubid')->references(['pubid'])->on('portalpublications')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('portaloccurrences', function (Blueprint $table) { + $table->dropForeign('FK_portalOccur_occid'); + $table->dropForeign('FK_portalOccur_pubid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_portalpublications_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_portalpublications_table.php new file mode 100644 index 0000000..e2c120c --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_portalpublications_table.php @@ -0,0 +1,32 @@ +foreign(['collid'], 'FK_portalpub_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['createdUid'], 'FK_portalpub_createdUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('restrict'); + $table->foreign(['portalID'], 'FK_portalpub_portalID')->references(['portalID'])->on('portalindex')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('portalpublications', function (Blueprint $table) { + $table->dropForeign('FK_portalpub_collid'); + $table->dropForeign('FK_portalpub_createdUid'); + $table->dropForeign('FK_portalpub_portalID'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceauthorlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceauthorlink_table.php new file mode 100644 index 0000000..604f3dc --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceauthorlink_table.php @@ -0,0 +1,30 @@ +foreign(['refauthid'], 'FK_refauthlink_refauthid')->references(['refauthorid'])->on('referenceauthors')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['refid'], 'FK_refauthlink_refid')->references(['refid'])->on('referenceobject')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('referenceauthorlink', function (Blueprint $table) { + $table->dropForeign('FK_refauthlink_refauthid'); + $table->dropForeign('FK_refauthlink_refid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechecklistlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechecklistlink_table.php new file mode 100644 index 0000000..ce74637 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechecklistlink_table.php @@ -0,0 +1,30 @@ +foreign(['clid'], 'FK_refchecklistlink_clid')->references(['clid'])->on('fmchecklists')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['refid'], 'FK_refchecklistlink_refid')->references(['refid'])->on('referenceobject')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('referencechecklistlink', function (Blueprint $table) { + $table->dropForeign('FK_refchecklistlink_clid'); + $table->dropForeign('FK_refchecklistlink_refid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechklsttaxalink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechklsttaxalink_table.php new file mode 100644 index 0000000..5dba070 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechklsttaxalink_table.php @@ -0,0 +1,30 @@ +foreign(['clid', 'tid'], 'FK_refchktaxalink_clidtid')->references(['clid', 'tid'])->on('fmchklsttaxalink')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['refid'], 'FK_refchktaxalink_ref')->references(['refid'])->on('referenceobject')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('referencechklsttaxalink', function (Blueprint $table) { + $table->dropForeign('FK_refchktaxalink_clidtid'); + $table->dropForeign('FK_refchktaxalink_ref'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencecollectionlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencecollectionlink_table.php new file mode 100644 index 0000000..db38197 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencecollectionlink_table.php @@ -0,0 +1,30 @@ +foreign(['collid'], 'FK_refcollectionlink_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['refid'], 'FK_refcollectionlink_refid')->references(['refid'])->on('referenceobject')->onUpdate('no action')->onDelete('no action'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('referencecollectionlink', function (Blueprint $table) { + $table->dropForeign('FK_refcollectionlink_collid'); + $table->dropForeign('FK_refcollectionlink_refid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencedatasetlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencedatasetlink_table.php new file mode 100644 index 0000000..a73771b --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencedatasetlink_table.php @@ -0,0 +1,32 @@ +foreign(['datasetid'], 'FK_refdataset_datasetid')->references(['datasetID'])->on('omoccurdatasets')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['refid'], 'FK_refdataset_refid')->references(['refid'])->on('referenceobject')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['createdUid'], 'FK_refdataset_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('referencedatasetlink', function (Blueprint $table) { + $table->dropForeign('FK_refdataset_datasetid'); + $table->dropForeign('FK_refdataset_refid'); + $table->dropForeign('FK_refdataset_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceobject_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceobject_table.php new file mode 100644 index 0000000..38be082 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceobject_table.php @@ -0,0 +1,30 @@ +foreign(['parentRefId'], 'FK_refobj_parentrefid')->references(['refid'])->on('referenceobject')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['ReferenceTypeId'], 'FK_refobj_reftypeid')->references(['ReferenceTypeId'])->on('referencetype')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('referenceobject', function (Blueprint $table) { + $table->dropForeign('FK_refobj_parentrefid'); + $table->dropForeign('FK_refobj_reftypeid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceoccurlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceoccurlink_table.php new file mode 100644 index 0000000..e7f82c2 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceoccurlink_table.php @@ -0,0 +1,30 @@ +foreign(['occid'], 'FK_refoccurlink_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['refid'], 'FK_refoccurlink_refid')->references(['refid'])->on('referenceobject')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('referenceoccurlink', function (Blueprint $table) { + $table->dropForeign('FK_refoccurlink_occid'); + $table->dropForeign('FK_refoccurlink_refid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencetaxalink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencetaxalink_table.php new file mode 100644 index 0000000..321b3cf --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencetaxalink_table.php @@ -0,0 +1,30 @@ +foreign(['refid'], 'FK_reftaxalink_refid')->references(['refid'])->on('referenceobject')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['tid'], 'FK_reftaxalink_tid')->references(['TID'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('referencetaxalink', function (Blueprint $table) { + $table->dropForeign('FK_reftaxalink_refid'); + $table->dropForeign('FK_reftaxalink_tid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorprojects_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorprojects_table.php new file mode 100644 index 0000000..35e9f8e --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorprojects_table.php @@ -0,0 +1,30 @@ +foreign(['collid'], 'FK_specprocessorprojects_coll')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['createdByUid'], 'FK_specprocprojects_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('specprocessorprojects', function (Blueprint $table) { + $table->dropForeign('FK_specprocessorprojects_coll'); + $table->dropForeign('FK_specprocprojects_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorrawlabels_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorrawlabels_table.php new file mode 100644 index 0000000..cd54381 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorrawlabels_table.php @@ -0,0 +1,30 @@ +foreign(['imgid'], 'FK_specproc_images')->references(['imgid'])->on('images')->onUpdate('cascade')->onDelete('restrict'); + $table->foreign(['occid'], 'FK_specproc_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('specprocessorrawlabels', function (Blueprint $table) { + $table->dropForeign('FK_specproc_images'); + $table->dropForeign('FK_specproc_occid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlp_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlp_table.php new file mode 100644 index 0000000..7faa5ef --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlp_table.php @@ -0,0 +1,28 @@ +foreign(['collid'], 'FK_specprocnlp_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('specprocnlp', function (Blueprint $table) { + $table->dropForeign('FK_specprocnlp_collid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpfrag_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpfrag_table.php new file mode 100644 index 0000000..9e5d502 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpfrag_table.php @@ -0,0 +1,28 @@ +foreign(['spnlpid'], 'FK_specprocnlpfrag_spnlpid')->references(['spnlpid'])->on('specprocnlp')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('specprocnlpfrag', function (Blueprint $table) { + $table->dropForeign('FK_specprocnlpfrag_spnlpid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpversion_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpversion_table.php new file mode 100644 index 0000000..a202cad --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpversion_table.php @@ -0,0 +1,28 @@ +foreign(['prlid'], 'FK_specprocnlpver_rawtext')->references(['prlid'])->on('specprocessorrawlabels')->onUpdate('cascade')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('specprocnlpversion', function (Blueprint $table) { + $table->dropForeign('FK_specprocnlpver_rawtext'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprococrfrag_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprococrfrag_table.php new file mode 100644 index 0000000..abd1abc --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprococrfrag_table.php @@ -0,0 +1,28 @@ +foreign(['prlid'], 'FK_specprococrfrag_prlid')->references(['prlid'])->on('specprocessorrawlabels')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('specprococrfrag', function (Blueprint $table) { + $table->dropForeign('FK_specprococrfrag_prlid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocstatus_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocstatus_table.php new file mode 100644 index 0000000..d9389df --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocstatus_table.php @@ -0,0 +1,30 @@ +foreign(['occid'], 'specprocstatus_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['processorUid'], 'specprocstatus_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('specprocstatus', function (Blueprint $table) { + $table->dropForeign('specprocstatus_occid'); + $table->dropForeign('specprocstatus_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxa_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxa_table.php new file mode 100644 index 0000000..2ac71d5 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxa_table.php @@ -0,0 +1,28 @@ +foreign(['modifiedUid'], 'FK_taxa_uid')->references(['uid'])->on('users')->onUpdate('restrict')->onDelete('no action'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxa', function (Blueprint $table) { + $table->dropForeign('FK_taxa_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrblock_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrblock_table.php new file mode 100644 index 0000000..10767a4 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrblock_table.php @@ -0,0 +1,32 @@ +foreign(['tdProfileID'], 'FK_taxadescrblock_tdProfileID')->references(['tdProfileID'])->on('taxadescrprofile')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['tid'], 'FK_taxadescrblock_tid')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('restrict'); + $table->foreign(['langid'], 'FK_taxadesc_lang')->references(['langid'])->on('adminlanguages')->onUpdate('no action')->onDelete('no action'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxadescrblock', function (Blueprint $table) { + $table->dropForeign('FK_taxadescrblock_tdProfileID'); + $table->dropForeign('FK_taxadescrblock_tid'); + $table->dropForeign('FK_taxadesc_lang'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrprofile_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrprofile_table.php new file mode 100644 index 0000000..b434edb --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrprofile_table.php @@ -0,0 +1,30 @@ +foreign(['langid'], 'FK_taxadescrprofile_langid')->references(['langid'])->on('adminlanguages')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['modifiedUid'], 'FK_taxadescrprofile_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxadescrprofile', function (Blueprint $table) { + $table->dropForeign('FK_taxadescrprofile_langid'); + $table->dropForeign('FK_taxadescrprofile_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrstmts_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrstmts_table.php new file mode 100644 index 0000000..d7589fd --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrstmts_table.php @@ -0,0 +1,28 @@ +foreign(['tdbid'], 'FK_taxadescrstmts_tblock')->references(['tdbid'])->on('taxadescrblock')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxadescrstmts', function (Blueprint $table) { + $table->dropForeign('FK_taxadescrstmts_tblock'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaenumtree_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaenumtree_table.php new file mode 100644 index 0000000..6894b68 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaenumtree_table.php @@ -0,0 +1,32 @@ +foreign(['tid'], 'FK_tet_taxa')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['parenttid'], 'FK_tet_taxa2')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['taxauthid'], 'FK_tet_taxauth')->references(['taxauthid'])->on('taxauthority')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxaenumtree', function (Blueprint $table) { + $table->dropForeign('FK_tet_taxa'); + $table->dropForeign('FK_tet_taxa2'); + $table->dropForeign('FK_tet_taxauth'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxalinks_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxalinks_table.php new file mode 100644 index 0000000..3834941 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxalinks_table.php @@ -0,0 +1,28 @@ +foreign(['tid'], 'FK_taxalinks_taxa')->references(['tid'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxalinks', function (Blueprint $table) { + $table->dropForeign('FK_taxalinks_taxa'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxamaps_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxamaps_table.php new file mode 100644 index 0000000..7b34c83 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxamaps_table.php @@ -0,0 +1,28 @@ +foreign(['tid'], 'FK_taxamaps_taxa')->references(['tid'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxamaps', function (Blueprint $table) { + $table->dropForeign('FK_taxamaps_taxa'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxanestedtree_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxanestedtree_table.php new file mode 100644 index 0000000..6b2a318 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxanestedtree_table.php @@ -0,0 +1,30 @@ +foreign(['tid'], 'FK_tnt_taxa')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['taxauthid'], 'FK_tnt_taxauth')->references(['taxauthid'])->on('taxauthority')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxanestedtree', function (Blueprint $table) { + $table->dropForeign('FK_tnt_taxa'); + $table->dropForeign('FK_tnt_taxauth'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubdesclink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubdesclink_table.php new file mode 100644 index 0000000..a3dd81d --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubdesclink_table.php @@ -0,0 +1,30 @@ +foreign(['tppid'], 'FK_tppubdesclink_id')->references(['tppid'])->on('taxaprofilepubs')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['tdbid'], 'FK_tppubdesclink_tdbid')->references(['tdbid'])->on('taxadescrblock')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxaprofilepubdesclink', function (Blueprint $table) { + $table->dropForeign('FK_tppubdesclink_id'); + $table->dropForeign('FK_tppubdesclink_tdbid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubimagelink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubimagelink_table.php new file mode 100644 index 0000000..4520d08 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubimagelink_table.php @@ -0,0 +1,30 @@ +foreign(['tppid'], 'FK_tppubimagelink_id')->references(['tppid'])->on('taxaprofilepubs')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['imgid'], 'FK_tppubimagelink_imgid')->references(['imgid'])->on('images')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxaprofilepubimagelink', function (Blueprint $table) { + $table->dropForeign('FK_tppubimagelink_id'); + $table->dropForeign('FK_tppubimagelink_imgid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubmaplink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubmaplink_table.php new file mode 100644 index 0000000..95a8ea5 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubmaplink_table.php @@ -0,0 +1,30 @@ +foreign(['tppid'], 'FK_tppubmaplink_id')->references(['tppid'])->on('taxaprofilepubs')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['mid'], 'FK_tppubmaplink_tdbid')->references(['mid'])->on('taxamaps')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxaprofilepubmaplink', function (Blueprint $table) { + $table->dropForeign('FK_tppubmaplink_id'); + $table->dropForeign('FK_tppubmaplink_tdbid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubs_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubs_table.php new file mode 100644 index 0000000..0a253c9 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubs_table.php @@ -0,0 +1,28 @@ +foreign(['uidowner'], 'FK_taxaprofilepubs_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxaprofilepubs', function (Blueprint $table) { + $table->dropForeign('FK_taxaprofilepubs_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaresourcelinks_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaresourcelinks_table.php new file mode 100644 index 0000000..0a1110d --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaresourcelinks_table.php @@ -0,0 +1,28 @@ +foreign(['tid'], 'FK_taxaresource_tid')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxaresourcelinks', function (Blueprint $table) { + $table->dropForeign('FK_taxaresource_tid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxavernaculars_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxavernaculars_table.php new file mode 100644 index 0000000..55728db --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxavernaculars_table.php @@ -0,0 +1,30 @@ +foreign(['TID'], 'FK_vernaculars_tid')->references(['tid'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); + $table->foreign(['langid'], 'FK_vern_lang')->references(['langid'])->on('adminlanguages')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxavernaculars', function (Blueprint $table) { + $table->dropForeign('FK_vernaculars_tid'); + $table->dropForeign('FK_vern_lang'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxstatus_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxstatus_table.php new file mode 100644 index 0000000..0d19d69 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxstatus_table.php @@ -0,0 +1,36 @@ +foreign(['parenttid'], 'FK_taxstatus_parent')->references(['tid'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); + $table->foreign(['taxauthid'], 'FK_taxstatus_taid')->references(['taxauthid'])->on('taxauthority')->onUpdate('cascade')->onDelete('restrict'); + $table->foreign(['tid'], 'FK_taxstatus_tid')->references(['tid'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); + $table->foreign(['tidaccepted'], 'FK_taxstatus_tidacc')->references(['tid'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); + $table->foreign(['modifiedUid'], 'FK_taxstatus_uid')->references(['uid'])->on('users')->onUpdate('set null')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('taxstatus', function (Blueprint $table) { + $table->dropForeign('FK_taxstatus_parent'); + $table->dropForeign('FK_taxstatus_taid'); + $table->dropForeign('FK_taxstatus_tid'); + $table->dropForeign('FK_taxstatus_tidacc'); + $table->dropForeign('FK_taxstatus_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowncomments_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowncomments_table.php new file mode 100644 index 0000000..ee3b8b8 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowncomments_table.php @@ -0,0 +1,28 @@ +foreign(['unkid'], 'FK_unknowncomments')->references(['unkid'])->on('unknowns')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('unknowncomments', function (Blueprint $table) { + $table->dropForeign('FK_unknowncomments'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknownimages_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknownimages_table.php new file mode 100644 index 0000000..2d59f94 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknownimages_table.php @@ -0,0 +1,28 @@ +foreign(['unkid'], 'FK_unknowns')->references(['unkid'])->on('unknowns')->onUpdate('restrict')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('unknownimages', function (Blueprint $table) { + $table->dropForeign('FK_unknowns'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowns_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowns_table.php new file mode 100644 index 0000000..17b077e --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowns_table.php @@ -0,0 +1,30 @@ +foreign(['tid'], 'FK_unknowns_tid')->references(['tid'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); + $table->foreign(['username'], 'FK_unknowns_username')->references(['username'])->on('userlogin')->onUpdate('restrict')->onDelete('restrict'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('unknowns', function (Blueprint $table) { + $table->dropForeign('FK_unknowns_tid'); + $table->dropForeign('FK_unknowns_username'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecmap_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecmap_table.php new file mode 100644 index 0000000..1ae0a6e --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecmap_table.php @@ -0,0 +1,28 @@ +foreign(['uspid'], 'FK_uploadspecmap_usp')->references(['uspid'])->on('uploadspecparameters')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('uploadspecmap', function (Blueprint $table) { + $table->dropForeign('FK_uploadspecmap_usp'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecparameters_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecparameters_table.php new file mode 100644 index 0000000..10b4ba7 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecparameters_table.php @@ -0,0 +1,30 @@ +foreign(['collid'], 'FK_uploadspecparameters_coll')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['createdUid'], 'FK_uploadspecparameters_uid')->references(['uid'])->on('users')->onUpdate('set null')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('uploadspecparameters', function (Blueprint $table) { + $table->dropForeign('FK_uploadspecparameters_coll'); + $table->dropForeign('FK_uploadspecparameters_uid'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspectemp_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspectemp_table.php new file mode 100644 index 0000000..ae9c76d --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspectemp_table.php @@ -0,0 +1,28 @@ +foreign(['collid'], 'FK_uploadspectemp_coll')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('uploadspectemp', function (Blueprint $table) { + $table->dropForeign('FK_uploadspectemp_coll'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_userlogin_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_userlogin_table.php new file mode 100644 index 0000000..e8f183f --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_userlogin_table.php @@ -0,0 +1,28 @@ +foreign(['uid'], 'FK_login_user')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('userlogin', function (Blueprint $table) { + $table->dropForeign('FK_login_user'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_userroles_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_userroles_table.php new file mode 100644 index 0000000..2c2d9cd --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_userroles_table.php @@ -0,0 +1,30 @@ +foreign(['uid'], 'FK_userrole_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['uidAssignedBy'], 'FK_userrole_uid_assigned')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('userroles', function (Blueprint $table) { + $table->dropForeign('FK_userrole_uid'); + $table->dropForeign('FK_userrole_uid_assigned'); + }); + } +}; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_usertaxonomy_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_usertaxonomy_table.php new file mode 100644 index 0000000..b530918 --- /dev/null +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_usertaxonomy_table.php @@ -0,0 +1,32 @@ +foreign(['taxauthid'], 'FK_usertaxonomy_taxauthid')->references(['taxauthid'])->on('taxauthority')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['tid'], 'FK_usertaxonomy_tid')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['uid'], 'FK_usertaxonomy_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('usertaxonomy', function (Blueprint $table) { + $table->dropForeign('FK_usertaxonomy_taxauthid'); + $table->dropForeign('FK_usertaxonomy_tid'); + $table->dropForeign('FK_usertaxonomy_uid'); + }); + } +}; diff --git a/database/seeders/ChecklistSeeder.php b/database/seeders/ChecklistSeeder.php new file mode 100644 index 0000000..408b607 --- /dev/null +++ b/database/seeders/ChecklistSeeder.php @@ -0,0 +1,17 @@ +create(); - - // \App\Models\User::factory()->create([ - // 'name' => 'Test User', - // 'email' => 'test@example.com', - // ]); + public function run(): void { + $this->call( + UserSeeder::class, + TaxonomySeeder::class, + CollectionSeeder::class, + OccurrenceSeeder::class, + ChecklistSeeder::class, + ); } } diff --git a/database/seeders/OccurrenceSeeder.php b/database/seeders/OccurrenceSeeder.php new file mode 100644 index 0000000..df843f5 --- /dev/null +++ b/database/seeders/OccurrenceSeeder.php @@ -0,0 +1,17 @@ + [1, 1, 1]], + ['Kingdom' => [10, 1, 1]], + ['Subkingdom' => [20, 10, 10]], + ['Division' => [30, 20, 10]], + ['Subdivision' => [40, 30, 30]], + ['Superclass' => [50, 40, 30]], + ['Class' => [60, 50, 30]], + ['Subclass' => [70, 60, 60]], + ['Order' => [100, 70, 60]], + ['Suborder' => [110,100, 100]], + ['Family' => [140, 110, 100]], + ['Subfamily' => [150, 140, 140]], + ['Tribe' => [160, 150, 140]], + ['Subtribe' => [170, 160, 140]], + ['Genus' => [180, 170, 140]], + ['Subgenus' => [190, 180, 180]], + ['Section' => [200, 190, 180]], + ['Subsection' => [210, 200, 180]], + ['Species' => [220, 210, 180]], + ['Subspecies' => [230,220, 180]], + ['Variety' => [240, 220, 180]], + ['Subvariety' => [250, 240, 180]], + ['Form' => [260, 220, 180]], + ['Subform' => [270, 260, 180]], + ['Cultivated' => [300, 220, 220]], + ]; + + // Note I (@Muchquak) am not a biologist as so this variable name is not correct + // [rank_name, [rank_id, dir_parent_id, reqparentrankid]] + private static $animals = [ + ['Organism' => [1, 1, 1]], + ['Kingdom' => [10, 1, 1]], + ['Subkingdom' => [20, 10, 10]], + ['Phylum' => [30, 20, 10]], + ['Subphylum' => [40, 30, 30]], + ['Class' => [60, 50, 30]], + ['Subclass' => [70, 60, 60]], + ['Order' => [100, 70, 60]], + ['Suborder' => [110, 100, 100]], + ['Family' => [140, 110, 100]], + ['Subfamily' => [150, 140, 140]], + ['Tribe' => [160, 150, 140]], + ['Subtribe' => [170, 160, 140]], + ['Genus' => [180, 170, 140]], + ['Subgenus' => [190, 180, 180]], + ['Species' => [220, 210, 180]], + ['Subspecies' => [230, 220, 180]], + ['Morph' => [240, 220, 180]], + ]; + + /** + * @param mixed $kingdom_names + * @param mixed $rank_tree + */ + private static function load_taxon_units($kingdom_names, $rank_tree): void { + foreach ($kingdom_names as $kingdom_name) { + foreach ($rank_tree as $rank_name => $rank_arr) { + DB::table('taxonunits')->insert([ + 'kingdomName' => $kingdom_name, + 'rankid' => $rank_arr[0], + 'rankname' => $rank_name, + 'dirparentrankid' => $rank_arr[1], + 'reqparentrankid' => $rank_arr[2], + ]); + } + } + + } + /** + * Run the database seeds. + */ + public function run(): void { + + /** + * Add Default Taxonomic Thesaurus + */ + DB::table('taxauthority')->insert([ + 'taxauthid' => 1, + 'isPrimary' => 1, + 'name' => 'Central Thesaurus', + 'isActive' => 1, + ]); + + self::load_taxon_units(['Organism', 'Plantae', 'Fungi'], self::$plants); + self::load_taxon_units(['Monera', 'Protista', 'Animalia'], self::$animals); + + + //Needs + //modifiedUid from users + DB::table('taxa')->insert([ + 'sciName' => 'Organism', + 'unitName1' => 'Organism', + ]); + + foreach (['Organism', 'Monera', 'Protista', 'Plantae', 'Fungi', 'Animalia'] as $kingdom) { + $rank_id = $kingdom === 'Organism'? 1: 10; + DB::table('taxa')->insert([ + 'rankID' => $rank_id, + 'sciName' => $kingdom, + 'unitName1' => $kingdom, + ]); + } + } +} diff --git a/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php new file mode 100644 index 0000000..9887e55 --- /dev/null +++ b/database/seeders/UserSeeder.php @@ -0,0 +1,17 @@ +