Skip to Content
File StructurePackagesDbDocumentation for assists.ts

Documentation for assists.ts

This file defines several tables and their relationships using drizzle-orm for managing assists and their related entities in a PostgreSQL database.

Tables

assist

The assist table stores information about assists.

ColumnData TypeDescription
idserialUnique identifier for the assist. Primary key.
nametextName of the assist.
slugtextSlug for the assist.
isExternalbooleanIndicates if the assist is external. Default is false.
isAutomatedbooleanIndicates if the assist is automated. Default is false.
isApibooleanIndicates if the assist is API-based. Default is false.
createdAttimestampTimestamp when the assist was created. Default is the current time.
updatedAttimestampTimestamp when the assist was last updated. Updates automatically.
isActivebooleanIndicates if the assist is active. Default is true.
createdByIdtextIdentifier of the user who created the assist. References user.id.
updatedByIdtextIdentifier of the user who last updated the assist. References user.id.

assistOrganization

The assistOrganization table stores the relationship between assists and organizations.

ColumnData TypeDescription
idserialUnique identifier for the relationship. Primary key.
organizationIdvarcharIdentifier of the organization. References organization.id.
assistIdintegerIdentifier of the assist. References assist.id.
createdAttimestampTimestamp when the relationship was created. Default is the current time.
updatedAttimestampTimestamp when the relationship was last updated. Updates automatically.
isActivebooleanIndicates if the relationship is active. Default is true.
createdByIdtextIdentifier of the user who created the relationship. References user.id.
updatedByIdtextIdentifier of the user who last updated the relationship. References user.id.

assistServiceOrderType

The assistServiceOrderType table stores the relationship between assists and service order types.

ColumnData TypeDescription
idserialUnique identifier for the relationship. Primary key.
serviceOrderTypeIdintegerIdentifier of the service order type. References serviceOrderTypeLU.id.
assistIdintegerIdentifier of the assist. References assist.id.
createdAttimestampTimestamp when the relationship was created. Default is the current time.
updatedAttimestampTimestamp when the relationship was last updated. Updates automatically.
isActivebooleanIndicates if the relationship is active. Default is true.
createdByIdtextIdentifier of the user who created the relationship. References user.id.
updatedByIdtextIdentifier of the user who last updated the relationship. References user.id.

assistServiceOrderCategory

The assistServiceOrderCategory table stores the relationship between assists and service order categories.

ColumnData TypeDescription
idserialUnique identifier for the relationship. Primary key.
serviceOrderCategoryIdintegerIdentifier of the service order category. References serviceOrderCategoryLU.id.
assistIdintegerIdentifier of the assist. References assist.id.
createdAttimestampTimestamp when the relationship was created. Default is the current time.
updatedAttimestampTimestamp when the relationship was last updated. Updates automatically.
isActivebooleanIndicates if the relationship is active. Default is true.
createdByIdtextIdentifier of the user who created the relationship. References user.id.
updatedByIdtextIdentifier of the user who last updated the relationship. References user.id.

Relationships

assistRelations

Defines the relationships for the assist table.

  • organizations: Many-to-many relationship with the assistOrganization table.
  • serviceOrderTypes: Many-to-many relationship with the assistServiceOrderType table.
  • serviceOrderCategories: Many-to-many relationship with the assistServiceOrderCategory table.

Schemas

newAssistSchema

Schema for inserting a new assist.

export const newAssistSchema = createInsertSchema(assist)
Last updated on