Skip to main content

Project Relationship Tables

Overview

Project relationship tables manage associations between projects and other entities (members, schemas, templates, forms, reports, kanban boards), as well as project-level configuration and invitations.


project_members

Stores project team membership and role assignments.

Purpose

  • Manage project team members
  • Assign member roles within projects
  • Track membership and permissions

Fields

FieldTypeNullDefaultDescription
idbigIncrementsNOAutoPrimary key
project_idunsignedBigInteger(FK)NO-FK: projects.id (CASCADE)
user_idunsignedBigInteger(FK)NO-FK: users.id (CASCADE)
roleenumNOmemberBuilt-in role (member, admin, owner)
joined_attimestampNOCURRENTJoin timestamp
invited_byunsignedBigInteger(FK)YESNULLFK: users.id - Who invited this member
notestextYESNULLMember notes/assignment notes
created_attimestampNO-Creation timestamp
updated_attimestampNO-Last update timestamp

Indexes

  • Primary Key: id
  • Unique: (project_id, user_id) - User cannot be member twice
  • Composite: (project_id, role), (user_id, role)
  • Foreign Keys: project_id, user_id, invited_by

Relationships

  • Belongs To → Projects
  • Belongs To → Users (member)
  • Belongs To → Users (inviter)

Roles

  • member: Standard team member (read/write access)
  • admin: Project administrator (all access except delete)
  • owner: Project owner (full control including delete)

project_schemas

Manages schema associations with projects (linked/cloned/imported).

Purpose

  • Link database schemas to projects
  • Track association type (linked vs cloned)
  • Store schema alias for project context

Fields

FieldTypeNullDefaultDescription
idbigIncrementsNOAutoPrimary key
project_idunsignedBigInteger(FK)NO-FK: projects.id (CASCADE)
schema_idunsignedBigInteger(FK)NO-FK: schemas.id (CASCADE)
association_typeenumNOlinkedType (linked, cloned, imported)
aliasstring(100)YESNULLSchema alias in project context
created_attimestampNO-Creation timestamp
updated_attimestampNO-Last update timestamp

Indexes

  • Primary Key: id
  • Unique: (project_id, schema_id) - Each schema once per project
  • Foreign Keys: project_id, schema_id

Relationships

  • Belongs To → Projects
  • Belongs To → Schemas

Association Types

  • linked: Reference to original schema (changes sync)
  • cloned: Copy of schema (independent)
  • imported: Imported from database (read-only reference)

project_template_usage

Tracks template usage within projects.

Purpose

  • Record which templates are used in projects
  • Store template usage configuration
  • Track multiple template usage in same project

Fields

FieldTypeNullDefaultDescription
idbigIncrementsNOAutoPrimary key
project_idunsignedBigInteger(FK)NO-FK: projects.id (CASCADE)
template_idunsignedBigInteger(FK)NO-FK: templates.id (CASCADE)
usage_typeenumNOlinkedType (linked, cloned)
aliasstring(100)YESNULLTemplate alias in project
configjsonYESNULLTemplate-specific configuration
is_activebooleanNOtrueUsage active status
used_attimestampNOCURRENTFirst usage timestamp
created_attimestampNO-Creation timestamp
updated_attimestampNO-Last update timestamp

Indexes

  • Primary Key: id
  • Unique: (project_id, template_id) - Each template once per project
  • Composite: (project_id, is_active), (template_id, is_active)
  • Foreign Keys: project_id, template_id

Relationships

  • Belongs To → Projects
  • Belongs To → Templates
  • Has Many → Project Template Variable Values

Usage Types

  • linked: Reference to original template
  • cloned: Copy of template (independent)

project_template_variable_values

Stores template variable assignments for projects.

Purpose

  • Store project-specific template variable values
  • Support per-language variable overrides
  • Enable template customization per project

Fields

FieldTypeNullDefaultDescription
idbigIncrementsNOAutoPrimary key
project_idunsignedBigInteger(FK)NO-FK: projects.id (CASCADE)
template_idunsignedBigInteger(FK)NO-FK: templates.id (CASCADE)
variable_namestring(100)NO-Template variable name
languagestring(10)NOenLanguage code for this value
valuetextNO-Variable value for project/language
created_attimestampNO-Creation timestamp
updated_attimestampNO-Last update timestamp

Indexes

  • Primary Key: id
  • Unique: (project_id, template_id, variable_name, language) - Unique per context
  • Composite: (project_id, template_id), (template_id, variable_name)
  • Foreign Keys: project_id, template_id

Relationships

  • Belongs To → Projects
  • Belongs To → Templates

Usage

When generating code from templates, Scoriet uses these project-specific variable values instead of defaults.


project_applications

Manages join requests and applications to projects.

Purpose

  • Store project join requests from users
  • Track application status and approvals
  • Support invite/apply workflow

Fields

FieldTypeNullDefaultDescription
idbigIncrementsNOAutoPrimary key
project_idunsignedBigInteger(FK)NO-FK: projects.id (CASCADE)
user_idunsignedBigInteger(FK)NO-FK: users.id (CASCADE) - Applicant
join_codestring(20)YESNULLJoin code used (if applicable)
messagetextYESNULLApplicant's request message
statusenumNOpendingStatus (pending, approved, rejected)
reviewed_byunsignedBigInteger(FK)YESNULLFK: users.id - Who reviewed
reviewed_attimestampYESNULLReview timestamp
review_notestextYESNULLReviewer's notes
created_attimestampNO-Creation timestamp
updated_attimestampNO-Last update timestamp

Indexes

  • Primary Key: id
  • Composite: (project_id, user_id, status), (project_id, status, created_at)
  • Foreign Keys: project_id, user_id, reviewed_by

Relationships

  • Belongs To → Projects
  • Belongs To → Users (applicant)
  • Belongs To → Users (reviewer)

Statuses

  • pending: Awaiting review
  • approved: Request approved, member added
  • rejected: Request denied

project_invitations

Manages email-based project invitations.

Purpose

  • Send project invitations via email
  • Track invitation status and expiration
  • Support external user invitations

Fields

FieldTypeNullDefaultDescription
idbigIncrementsNOAutoPrimary key
project_idunsignedBigInteger(FK)NO-FK: projects.id (CASCADE)
invited_byunsignedBigInteger(FK)NO-FK: users.id - Inviter
invited_user_idunsignedBigInteger(FK)YESNULLFK: users.id - Invited user (if exists)
invited_emailstring(255)NO-Email address invitation target
roleenumNOmemberInvited role (member, admin)
statusenumNOpendingStatus (pending, accepted, declined, expired)
messagetextYESNULLInvitation message from inviter
tokenstring(100, unique)NO-Secure invitation token
expires_attimestampNO-Token expiration (14 days)
responded_attimestampYESNULLResponse timestamp
created_attimestampNO-Creation timestamp
updated_attimestampNO-Last update timestamp

Indexes

  • Primary Key: id
  • Unique: token
  • Composite: (project_id, invited_email, status), (invited_email, status)
  • Foreign Keys: project_id, invited_by, invited_user_id

Relationships

  • Belongs To → Projects
  • Belongs To → Users (inviter)
  • Belongs To → Users (invited user, optional)

Statuses

  • pending: Invitation sent, awaiting response
  • accepted: Invitation accepted, member added
  • declined: Invitation declined by user
  • expired: Invitation token expired

project_attachments

Stores project-level file attachments and documentation.

Purpose

  • Store project-related files (documentation, resources)
  • Track attachment metadata and access
  • Support file categorization and pinning

Fields

FieldTypeNullDefaultDescription
idbigIncrementsNOAutoPrimary key
project_idunsignedBigInteger(FK)NO-FK: projects.id (CASCADE)
uploaded_byunsignedBigInteger(FK)NO-FK: users.id - Uploader
filenamestring(255)NO-Stored filename (hashed)
original_filenamestring(255)NO-Original filename
mime_typestring(100)YESNULLFile MIME type
sizeintegerNO-File size in bytes
pathstring(500)NO-Storage path
descriptiontextYESNULLFile description
categorystring(50)YESNULLFile category (doc, resource, spec, etc.)
is_pinnedbooleanNOfalsePinned to top flag
download_countintegerNO0Download count
created_attimestampNO-Creation timestamp
updated_attimestampNO-Last update timestamp

Indexes

  • Primary Key: id
  • Composite: (project_id, category), (project_id, is_pinned)
  • Foreign Keys: project_id, uploaded_by

Relationships

  • Belongs To → Projects
  • Belongs To → Users (uploader)

project_form_set

Associates form sets with projects.

Purpose

  • Link form designers to projects
  • Track active form sets per project

Fields

FieldTypeNullDefaultDescription
idbigIncrementsNOAutoPrimary key
project_idunsignedBigInteger(FK)NO-FK: projects.id (CASCADE)
form_set_idunsignedBigInteger(FK)NO-FK: form_sets.id (CASCADE)
is_activebooleanNOtrueAssociation active status
created_attimestampNO-Creation timestamp
updated_attimestampNO-Last update timestamp

Indexes

  • Primary Key: id
  • Unique: (project_id, form_set_id) - Each form set once per project
  • Foreign Keys: project_id, form_set_id

Relationships

  • Belongs To → Projects
  • Belongs To → Form Sets

project_kanban_roles

Tracks special kanban board roles for users in projects.

Purpose

  • Assign kanban-specific roles (SRM, SDM, Flow Manager)
  • Track role assignments and delegation

Fields

FieldTypeNullDefaultDescription
idbigIncrementsNOAutoPrimary key
project_idunsignedBigInteger(FK)NO-FK: projects.id (CASCADE)
user_idunsignedBigInteger(FK)NO-FK: users.id (CASCADE)
roleenumNO-Kanban role (srm, sdm, flow_manager)
assigned_byunsignedBigInteger(FK)NO-FK: users.id - Who assigned
created_attimestampNO-Creation timestamp
updated_attimestampNO-Last update timestamp

Indexes

  • Primary Key: id
  • Unique: (project_id, user_id) - One role per user per project
  • Composite: (project_id, role), (user_id, role)
  • Foreign Keys: project_id, user_id, assigned_by

Relationships

  • Belongs To → Projects
  • Belongs To → Users (role holder)
  • Belongs To → Users (assigner)

Kanban Roles

  • srm: Scrum Master (process facilitator)
  • sdm: Senior Development Manager (technical lead)
  • flow_manager: Flow Manager (workflow optimizer)

project_translations

Stores project-level localization and formatting settings.

Purpose

  • Store project translations and localized content
  • Define locale-specific number/date formatting
  • Support multi-language projects

Fields

FieldTypeNullDefaultDescription
idbigIncrementsNOAutoPrimary key
project_idunsignedBigInteger(FK)NO-FK: projects.id (CASCADE)
language_codestring(10)NO-Language code (en, de, fr, etc.)
captionstring(255)YESNULLLanguage display name
descriptiontextYESNULLLanguage description
decimal_separatorstring(1)YESNULLNumber decimal separator
thousands_separatorstring(1)YESNULLNumber thousands separator
date_formatstring(20)YESNULLDate display format
time_formatstring(20)YESNULLTime display format
currency_symbolstring(5)YESNULLCurrency symbol
timezonestring(50)YESNULLTimezone identifier
created_attimestampNO-Creation timestamp
updated_attimestampNO-Last update timestamp

Indexes

  • Primary Key: id
  • Unique: (project_id, language_code) - One per language
  • Foreign Key: project_id

Relationships

  • Belongs To → Projects

project_report_patterns

Associates report patterns with projects.

Purpose

  • Link report designers to projects
  • Track active report patterns

Fields

FieldTypeNullDefaultDescription
idbigIncrementsNOAutoPrimary key
project_idunsignedBigInteger(FK)NO-FK: projects.id (CASCADE)
report_pattern_idunsignedBigInteger(FK)NO-FK: report_patterns.id (CASCADE)
is_activebooleanNOtrueAssociation active status
created_attimestampNO-Creation timestamp
updated_attimestampNO-Last update timestamp

Indexes

  • Primary Key: id
  • Unique: (project_id, report_pattern_id) - Each pattern once per project
  • Foreign Keys: project_id, report_pattern_id

Relationships

  • Belongs To → Projects
  • Belongs To → Report Patterns

Key Concepts

Project Access Control

  • Owner: Creator of project, full control
  • Admin: Delegated administrator, manage members/invitations
  • Member: Regular member, can use project resources

Invitation Workflow

  1. Owner invites via email or generates join code
  2. Link/code sent to user
  3. User accepts or declines
  4. If accepted, user added as member

Schema Management in Projects

  • Schemas can be linked (live reference) or cloned (independent copy)
  • Multiple schemas per project supported
  • Schema alias allows context-specific naming

Template Usage

  • Project can use multiple templates
  • Each template has configuration stored separately
  • Variable values overrideable per project/language

  • See Core Tables for project and user information
  • See Schema Tables for schema details
  • See Template Tables for template information
  • See Form Tables for form set details
  • See Report Tables for report pattern details
  • See Kanban Tables for kanban board structure