Skip to content

[feature]: Consolidate SQL Schema into a Single SQL File and Integrate with CI #1062

Closed
@ffranr

Description

@ffranr

Our current SQL database schema is distributed across multiple SQL migration scripts. This structure complicates understanding the entire schema, as it requires examining multiple migration scripts individually.

To simplify this, we should generate a complete database schema as a single SQL file and place it in the docs directory for easier reference. Additionally, similar to our test vectors, this schema SQL file should be autogenerated and checked for determinism as part of our Continuous Integration (CI) process.

Tasks:

  1. Use SQLite to dump the database schema from a fully migrated database.
  2. Save the dumped schema as a SQL file in the docs directory.
  3. Integrate the schema generation process into CI:
    • Autogenerate the schema during the CI build process.
    • Implement checks to ensure the schema dump is deterministic.

Command to use:

sqlite3 <database_file> .schema > docs/database_schema.sql

Note:

  • Ensure that the schema reflects the fully migrated state of the database.
  • Implement the CI checks to ensure any changes to the schema are intentional and deterministic.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions