mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-04 16:37:46 +08:00
refactor(data): remove MySQL and SQLite support
Use PostgreSQL as the only database backend across runtime, schema tooling, installation, Compose, and CI. Update regression tests and reject removed drivers explicitly.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Aether Schema Source
|
||||
|
||||
This directory is the schema maintenance workspace. Executable migrations are
|
||||
owned by the Postgres, MySQL, and SQLite adapters under `../../adapters/`.
|
||||
owned by the Postgres adapter under `../../adapters/`.
|
||||
The Postgres bootstrap snapshot is compiled from the source fragments here
|
||||
during `aether-data` builds, so there is no checked-in bootstrap artifact.
|
||||
|
||||
@@ -14,7 +14,7 @@ bash crates/aether-data/runtime/schema/compose_schema.sh check
|
||||
```
|
||||
|
||||
- `generate` renders `logical/*.toml` through `aether-data-schema` into
|
||||
`generated/{postgres,mysql,sqlite}`. This is a build output, not another SQL
|
||||
`generated/postgres`. This is a build output, not another SQL
|
||||
source to maintain.
|
||||
- `compose` rewrites the executable SQL from the manifest order.
|
||||
- `check` verifies generated output is current, confirms the bootstrap source
|
||||
@@ -30,15 +30,15 @@ The schema workspace has three normal source areas:
|
||||
| Path | Role | Edit policy |
|
||||
|---|---|---|
|
||||
| `logical/*.toml` | Long-term logical table model shared by all SQL drivers. | Edit first for portable table-shape changes. |
|
||||
| `drivers/{postgres,mysql,sqlite}/` | Current maintenance fragments for executable SQL. | Edit only for deployment compatibility, ordering, or generator gaps. |
|
||||
| `drivers/postgres/` | Current maintenance fragments for executable SQL. | Edit only for deployment compatibility, ordering, or generator gaps. |
|
||||
| `bootstrap/postgres/` | Source fragments for the Postgres empty-database bootstrap snapshot. | Edit here when the bootstrap snapshot changes, then rebuild `aether-data` so `build.rs` regenerates the embedded snapshot. |
|
||||
|
||||
Everything else is output:
|
||||
|
||||
| Path | Role | Edit policy |
|
||||
|---|---|---|
|
||||
| `generated/{postgres,mysql,sqlite}/` | Machine-written SQL emitted from `logical/*.toml` for audit and drift detection. | Do not edit; regenerate with `compose_schema.sh generate`. |
|
||||
| `../../adapters/{postgres,mysql,sqlite}/migrations/` | Runtime SQL artifacts embedded by each database adapter. | Regenerate through `compose_schema.sh compose`; do not edit independently. |
|
||||
| `generated/postgres/` | Machine-written SQL emitted from `logical/*.toml` for audit and drift detection. | Do not edit; regenerate with `compose_schema.sh generate`. |
|
||||
| `../../adapters/postgres/migrations/` | Runtime SQL artifacts embedded by each database adapter. | Regenerate through `compose_schema.sh compose`; do not edit independently. |
|
||||
|
||||
`generated/**` is deliberately checked in so reviews and CI can see exactly
|
||||
what the logical schema compiler emits for each driver. It is not a fourth SQL
|
||||
@@ -59,8 +59,7 @@ cargo run -p aether-data-schema --bin aether-schema -- print --driver postgres
|
||||
## Logical Schema
|
||||
|
||||
`logical/*.toml` is the long-term source for table definitions. It covers the
|
||||
clean baseline table set and the portable MySQL/SQLite table-creation
|
||||
migrations. The generator emits driver-specific SQL under `generated/`; those
|
||||
PostgreSQL baseline table set. The generator emits driver-specific SQL under `generated/`; those
|
||||
files include a directory README plus `Do not edit` headers and should only
|
||||
change through `compose_schema.sh generate`.
|
||||
|
||||
@@ -82,7 +81,7 @@ The migration path is incremental:
|
||||
`overrides/` only when they cannot live cleanly in a driver fragment.
|
||||
6. Once a domain matches, move its baseline maintenance to generated output.
|
||||
|
||||
The existing `drivers/postgres`, `drivers/mysql`, and `drivers/sqlite`
|
||||
The existing `drivers/postgres`
|
||||
fragment trees remain authoritative for executable migrations until a generated
|
||||
fragment is deliberately promoted.
|
||||
|
||||
@@ -95,8 +94,6 @@ by logical schema or the normal driver fragments. Keep it small and explicit.
|
||||
|---|---|---|
|
||||
| Postgres baseline | `../../adapters/postgres/migrations/20260403000000_baseline.sql` | `drivers/postgres/baseline/manifest.txt` |
|
||||
| Postgres empty-database snapshot | `aether-data` build output (`OUT_DIR/empty_database_snapshot.sql`) | `bootstrap/postgres/manifest.txt` |
|
||||
| MySQL baseline | `../../adapters/mysql/migrations/20260403000000_baseline.sql` | `drivers/mysql/baseline/manifest.txt` |
|
||||
| SQLite baseline | `../../adapters/sqlite/migrations/20260403000000_baseline.sql` | `drivers/sqlite/baseline/manifest.txt` |
|
||||
|
||||
Driver baseline source manifests are kept as a small set of numbered SQL
|
||||
fragments. Postgres uses execution-phase fragments so the pg_dump ordering
|
||||
@@ -110,9 +107,5 @@ remains byte-for-byte stable when composed:
|
||||
- `006_footer.sql`
|
||||
- `100_*` extension files for empty-database snapshot-only additions
|
||||
|
||||
MySQL and SQLite use similarly numbered domain fragments (`001_identity.sql`
|
||||
through `006_usage.sql`) because their baselines are shorter and already
|
||||
organized by domain.
|
||||
|
||||
The Rust migration tests compose these manifests too, so fragment drift is
|
||||
caught during `cargo test -p aether-data split_baseline_sources_match_executable_migrations`.
|
||||
|
||||
Reference in New Issue
Block a user