0.3.0 • Published 9 months ago

@overture-stack/lyric-data-model v0.3.0

Weekly downloads
-
License
AGPL-3.0-or-later
Repository
github
Last release
9 months ago

!NOTE This package is likely not the one you want to use in your project, it is primarily used as a dependency within the Lyric monorepo. @overture-stack/lyric is what you are most likely to want to use.

NPM Version

Data Model for Lyric

Project structure

Documentation

docs/ folder contains general documention about this project.

Database diagram

Describes the structure of the database illustrating how tables within the database are related to each other.

Check the latest diagram located at docs/schema.dbml

Used DBML generator script to generate bellow file

A free database visualizer at dbdiagram.io

Submission Status State Diagram

Illustrate the transitions of status on a lifecycle of a Submission

Check the latest diagram located at docs/stateDiagramSubmissionStatus.md

Migrations

All migration files are provided under migrations/ folder.

  • SQL Files

    A list of .sql files are provided under migrations/ which contains SQL statements to apply directly to the database.

    File names correspond to the sequential order in which it must be executed.

    You can apply .sql files directly to the database or you can use the migration script.

  • Drizzle Metadata and Journal

    The meta/ folder contains the migrations history used by Drizzle.

Scripts

Generate DBML file

A script dbmlGenerator.ts is provided to generate a DBML file based on the source schema files found at the folder src/models/.

To run this script use the command pnpm run build:dbml.

Run Migration

A script migrate.ts is provided as a helper to run SQL migration files on a specific database.

It executes all the .sql files found on migrations/ folder using Drizzle tools.

Database details are defined via environment variables. Use the variables found on file .env.schema as a template.

To run this script use the following command pnpm run db:migrate:dev.

Drizzle Models

Model files are located at src/models/.

Follow the SQL schema declarion on Drizzle oficial documentation to create schemas and check the PostgreSQL available column types.

0.3.0

9 months ago

0.2.2

11 months ago

0.2.1

11 months ago

0.2.0

11 months ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago