# Cloudflare D1 SQL Assets
This folder contains Athena-owned SQL assets for Cloudflare D1 development.
- `migrations/` contains Wrangler-compatible `.sql` migrations.
- These files are examples and local fixtures for the dedicated D1 proxy app and Athena D1 backend work.
- Run `PRAGMA optimize;` after index-creating migrations when validating locally or remotely.
- D1 does not support `PRAGMA optimize(-1)`, so use plain `PRAGMA optimize;` in Athena examples and runbooks.
- Generated columns are supported as plain SQLite/D1 schema behavior. Prefer raw SQL migrations for `VIRTUAL`/`STORED` definitions and treat generated columns as read-only from higher-level Athena CRUD helpers.
- Drizzle-style nested migration layouts remain compatible with Wrangler via `migrations_pattern`, but Athena does not take a runtime dependency on Drizzle.
- Useful schema inspection during fixture work:
- `PRAGMA table_info("table_name")`
- `PRAGMA index_list("table_name")`
- `SELECT name, sql FROM sqlite_master`