How surrealdb-migrations organizes schema, events, and migrations
mainThe project follows a philosophy that divides a SurrealDB migration project into three distinct categories to manage the evolution of the database:
- Schemas (
/schemasfolder): Represents the Query model. Each file represents no more than one SurrealDB table. This folder provides a view of the current data model. - Events (
/eventsfolder): Represents the Command model. Each file represents no more than one SurrealDB event and its underlying table. This folder shows the different ways to update the data model. - Migrations (
/migrationsfolder): Represents changes in the SurrealDB data itself (e.g., renaming columns, dropping tables, or adding default values). These files are applied to transition the database between schema states.