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.
Risks
Low. This PR reduces risks related to database schema initialization and migration conflicts by properly integrating manual database configurations into Drizzle's migration system.
Background
What does this PR do?
This PR addresses the challenge of running specific migrations to prepare the database while maintaining a code-first approach with Drizzle ORM. It resolves conflicts that occur during re-initialization when manual queries (such as enabling extensions) are executed alongside Drizzle's automatic schema initialization.
The solution incorporates manual changes (e.g., enabling extensions) into custom migration files, using Drizzle ORM's support for custom SQL migrations. This ensures that all database changes are properly tracked and managed through Drizzle's migration system.
What kind of change is this?
Documentation changes needed?
My changes do not require a change to the project documentation.
Testing
Where should a reviewer start?
Review the custom migration files to ensure that manual SQL commands are properly implemented and are idempotent.
Detailed testing steps