AFFiNE maintains two migration areas in the server package:
packages/backend/server/migrationspackages/backend/server/src/data/migrationsAfter migration changes, initialize the local development database with:
The server package currently combines Prisma development migration and application data migration in its init script. Review the generated SQL or data migration, test both a clean database and the intended upgrade path, and include rollback or compatibility notes in the pull request when the change is not backward compatible.