Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Schema Changes for Age & Stratigraphy #5178

Closed
grantfitzsimmons opened this issue Aug 5, 2024 · 0 comments · Fixed by #5274
Closed

Database Schema Changes for Age & Stratigraphy #5178

grantfitzsimmons opened this issue Aug 5, 2024 · 0 comments · Fixed by #5274
Assignees
Labels
1 - Request Improvements or extensions to existing behavior 2 - Database/Schema Issues that are related to the underlying database and schema geospecify
Milestone

Comments

@grantfitzsimmons
Copy link
Member

grantfitzsimmons commented Aug 5, 2024

New Tables

Tectonics:

These 'Tectonic' records use the exact same tree structure as other existing Specify trees. There is no special logic or requirements for this tree, and the default should simply be a root node and 5 simple ranks:

  • Superstructure
  • Tectonic domain
  • Tectonic subdomain
  • Tectonic unit
  • Tectonic subunit

TectonicUnit

  • TectonicID – int(11) NOT NULL – PK
  • FullName – varchar(255)
  • GUID – varchar(128)
  • HighestChildNodeNumber – int(11)
  • IsAccepted – bit(1) NOT NULL
  • Name – varchar(64) NOT NULL
  • NodeNumber – int(11)
  • Number1 – decimal(20,10)
  • Number2 – decimal(20,10)
  • RankID – int(11) NOT NULL
  • Remarks – text
  • Text1 – text
  • Text2 – text
  • TimestampCreated – datetime NOT NULL
  • TimestampModified – datetime
  • Version – int(11)
  • YesNo1 – bit(1)
  • YesNo2 – bit(1)

-- Relationships

  • AcceptedID – int(11) – FK to TectonicUnit, represents the record it was synonymized to
  • CreatedByAgentID – int(11) – FK to Agent
  • ModifiedByAgentID – int(11) – FK to Agent
  • ParentID – int(11) – FK to TectonicUnit parent record
  • TectonicTreeDefID – int(11) NOT NULL – FK to TectonicTreeDef
  • TectonicTreeDefItemID – int(11) NOT NULL – FK to TectonicTreeDefItem rank record

TectonicTreeDefItem

  • TectonicTreeDefItemID – int(11) NOT NULL – PK
  • FullNameSeparator – varchar(32)
  • IsEnforced – bit(1)
  • IsInFullName – bit(1)
  • Name – varchar(64) NOT NULL
  • RankID – int(11) NOT NULL
  • Remarks – text
  • TextAfter – varchar(64)
  • TextBefore – varchar(64)
  • TimestampCreated – datetime NOT NULL
  • TimestampModified – datetime
  • Title – varchar(64)
  • Version – int(11)

-- Relationship

  • CreatedByAgentID – int(11) – FK to Agent
  • ModifiedByAgentID – int(11) – FK to Agent
  • ParentItemID – int(11) – FK to TectonicTreeDefItem parent record
  • TectonicTreeDefID – int(11) – FK to TectonicTreeDef

TectonicTreeDef

  • TectonicTreeDefID – int(11) NOT NULL
  • FullNameDirection – int(11)
  • Name – varchar(64) NOT NULL
  • Remarks – text
  • TimestampCreated – datetime NOT NULL
  • TimestampModified – datetime
  • Version – int(11)

-- Relationship

  • CreatedByAgentID – int(11) – FK to Agent
  • DisciplineID – int(11) – FK to Discipline for scoping
  • ModifiedByAgentID – int(11) – FK to Agent

Age Tables:

Each ‘*Age’ record contains a FK to CollectionObject. There may be many AbsoluteAges and Relative Ages linked to one CO, functions as a one-to-many

Gray indicates these are free fields for users to assign any purpose. Other fields have an expected usage.

AbsoluteAge:

  • AbsoluteAgeID – int(11) – PK
  • AbsoluteAge – decimal(20,10)
  • AgeType – varchar(64) (from control vocab (sedimentation, metamorphic, inclusion, original, fall,...)
  • AgeUncertainty – decimal(20,10)
  • CollectionDate – date
  • DatingMethod – varchar(64)
  • DatingMethodRemarks – text
  • Date1 – date
  • Date2 – date
  • Number1 – decimal(20,10)
  • Number2 – decimal(20,10)
  • Remarks – text
  • Text1 – text
  • Text2 – text
  • TimestampCreated – datetime (system field)
  • TimestampModified – datetime (system field)
  • YesNo1 – boolean
  • YesNo2 – boolean

-- Relationship

  • Agent1 – FK to agent
  • CollectionObjectID – FK to collectionobject
  • CreatedByAgent – FK to agent (system field)
  • ModifiedByAgent – FK to agent (system field)

RelativeAge:

  • RelativeAgeID – int(11) – PK
  • AgeType – varchar(64) (from control vocab (sedimentation, metamorphic, inclusion, original, fall,...)
  • AgeUncertainty – decimal(20,10)
  • CollectionDate – date
  • Date1 – date
  • Date2 – date
  • DatingMethod – varchar(64)
  • DatingMethodRemarks – text
  • Number1 – decimal(20,10)
  • Number2 – decimal(20,10)
  • RelativeAgePeriod – decimal(20,10)
  • Remarks – text
  • Text1 – text
  • Text2 – text
  • TimestampCreated – datetime (system field)
  • TimestampModified – datetime (system field)
  • VerbatimName – text
  • VerbatimPeriod – text
  • YesNo1 – boolean
  • YesNo2 – boolean

-- Relationship

  • AgeNameID – FK to geologictimeperiod (chronostrat tree)
  • Agent1 – FK to agent
  • Agent2 – FK to agent
  • CollectionObjectID – FK to collectionobject
  • CreatedByAgent – FK to agent

Age Attachment Tables

These tables allow us to link Specify attachment records directly to either type of age record. This follows the exact same format as the other ‘*Attachment’ records in Specify (e.g. CollectionObjectAttachment, AccessionAttachment, CollectingEventAttachment, etc.).

RelativeAgeAttachment

  • RelativeAgeAttachmentID – int(11) NOT NULL AUTO_INCREMENT – PK
  • Ordinal – int(11) NOT NULL
  • Remarks – text DEFAULT NULL
  • TimestampCreated – datetime NOT NULL
  • TimestampModified – datetime DEFAULT NULL
  • Version – int(11) DEFAULT NULL

-- Relationship

  • AttachmentID – int(11) NOT NULL – FK to attachment
  • CollectionMemberID – int(11) NOT NULL – FK to collection for scoping
  • CreatedByAgentID – int(11) DEFAULT NULL – FK to agent
  • ModifiedByAgentID – int(11) DEFAULT NULL – FK to agent
  • RelativeAgeID – int(11) NOT NULL – FK to relativeAge

AbsoluteAgeAttachment

  • AbsoluteAgeAttachmentID – int(11) NOT NULL AUTO_INCREMENT – PK
  • Ordinal – int(11) NOT NULL
  • Remarks – text DEFAULT NULL
  • TimestampCreated – datetime NOT NULL
  • TimestampModified – datetime DEFAULT NULL
  • Version – int(11) DEFAULT NULL

-- Relationship

  • AbsoluteAgeID – int(11) NOT NULL – FK to absoluteAge
  • AttachmentID – int(11) NOT NULL – FK to attachment
  • CollectionMemberID – int(11) NOT NULL – FK to collection for scoping
  • CreatedByAgentID – int(11) DEFAULT NULL – FK to agent
  • ModifiedByAgentID – int(11) DEFAULT NULL – FK to agent

Age Citation Tables

These tables allow us to link Specify ‘reference work’ records directly to either type of age record. This follows the exact same format as the other ‘*Citation records in Specify (e.g. CollectionObjectCitation, DeterminationCitation, TaxonCitation, etc.).

RelativeAgeCitation

  • RelativeAgeCitationID – int(11) NOT NULL AUTO_INCREMENT – PK
  • FigureNumber – varchar(50) DEFAULT NULL
  • IsFigured – bit(1) DEFAULT NULL
  • PageNumber – varchar(50) DEFAULT NULL
  • PlateNumber – varchar(50) DEFAULT NULL
  • Remarks – text DEFAULT NULL
  • TimestampCreated – datetime NOT NULL
  • TimestampModified – datetime DEFAULT NULL
  • Version – int(11) DEFAULT NULL

-- Relationship

  • CollectionMemberID – int(11) NOT NULL – FK to collection
  • CreatedByAgentID – int(11) DEFAULT NULL – FK to agent
  • ModifiedByAgentID – int(11) DEFAULT NULL – FK to agent
  • ReferenceWorkID – int(11) NOT NULL – FK to referenceWork
  • RelativeAgeID – int(11) NOT NULL – FK to relativeAge

AbsoluteAgeCitation

  • AbsoluteAgeCitationID – int(11) NOT NULL AUTO_INCREMENT – PK
  • FigureNumber – varchar(50) DEFAULT NULL
  • IsFigured – bit(1) DEFAULT NULL
  • PageNumber – varchar(50) DEFAULT NULL
  • PlateNumber – varchar(50) DEFAULT NULL
  • Remarks – text DEFAULT NULL
  • TimestampCreated – datetime NOT NULL
  • TimestampModified – datetime DEFAULT NULL
  • Version – int(11) DEFAULT NULL

-- Relationship

  • AbsoluteAgeID – int(11) NOT NULL – FK to relativeAge
  • CollectionMemberID – int(11) NOT NULL – FK to collection
  • CreatedByAgentID – int(11) DEFAULT NULL – FK to agent
  • ModifiedByAgentID – int(11) DEFAULT NULL – FK to agent
  • ReferenceWorkID – int(11) NOT NULL – FK to referenceWork

Modifications to Existing Tables

Paleo Context:

  • New Fields:
    • TectonicUnitID (FK to TectonicUnit record)
@grantfitzsimmons grantfitzsimmons added 1 - Request Improvements or extensions to existing behavior 2 - Database/Schema Issues that are related to the underlying database and schema geospecify labels Aug 5, 2024
@grantfitzsimmons grantfitzsimmons changed the title Schema changes for Stratigraphy and Age Schema Changes for Age & Stratigraphy 1 - Request geospecify Aug 5, 2024
@grantfitzsimmons grantfitzsimmons changed the title Schema Changes for Age & Stratigraphy 1 - Request geospecify Schema Changes for Age & Stratigraphy Aug 5, 2024
@grantfitzsimmons grantfitzsimmons changed the title Schema Changes for Age & Stratigraphy Database Schema Changes for Age & Stratigraphy Aug 5, 2024
@CarolineDenis CarolineDenis modified the milestones: 7.9.11, 7.9.10 Aug 6, 2024
CarolineDenis added a commit that referenced this issue Sep 12, 2024
@CarolineDenis CarolineDenis modified the milestones: 7.9.9, 7.9.8 Sep 19, 2024
@CarolineDenis CarolineDenis self-assigned this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - Request Improvements or extensions to existing behavior 2 - Database/Schema Issues that are related to the underlying database and schema geospecify
Projects
None yet
2 participants