add docs about apply migrations via sqlx #411
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to how database migrations are managed and documented for the NEAR Read RPC project. The changes remove migration logic from the Rust codebase and centralize migration management using SQLx CLI and dedicated scripts, with comprehensive documentation for developers and operators. This streamlines the workflow, reduces code complexity, and clarifies best practices for handling migrations across all database types.
Migration Management Refactor
read_onlyfield and migration runner methods have been eliminated fromDatabaseConfigandPostgresDBManager, so migrations are no longer handled in application code. Instead, migrations are now managed externally via scripts and SQLx CLI. [1] [2] [3] [4] [5] [6] [7]Documentation and Developer Workflow
docs/DATABASE_MIGRATIONS.mddetails the migration process, directory structure, best practices, troubleshooting, and integration with development and deployment workflows.database/README.mdto reference the new migration documentation and legacy migration scripts for upgrading existing deployments.Automation and Tooling
scripts/apply_all_migrations.shautomates the process of applying migrations to all database types, handles environment variables, and provides clear status output and error handling.These changes make migration management more robust, transparent, and maintainable for both new and existing deployments.