Database migrations

AFFiNE maintains two migration areas in the server package:

After migration changes, initialize the local development database with:

yarn affine server init

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.