Skip to content

Feat: Add support for indexes and foreign key changes #2

Merged
beesaferoot merged 10 commits intomainfrom
feat-migrator-facade
Aug 4, 2025
Merged

Feat: Add support for indexes and foreign key changes #2
beesaferoot merged 10 commits intomainfrom
feat-migrator-facade

Conversation

@beesaferoot
Copy link
Copy Markdown
Owner

@beesaferoot beesaferoot commented Aug 4, 2025

This PR directly adds support for detecting index/foreignkey changes from the database schema and the models.

It specifically focuses on postgresql support by utilizing a wrapper around gorm.Migrator to implement two key methodsGetIndexes and GetRelationships.

By using this approach we can yank out the current implemention when they become available on Gorm

The  commit contains changes to generate sql scripts for foreign key changes as well as indexes.
We specifically assume db to be postgres i.e by using pg_indexes, querying pg metadata.

A wrapper for `gormDb.Migrator` was added to isolate the usage to make things straightforward to change when gorm directly supports `GetIndexes` and `GetRelationships`
@beesaferoot beesaferoot merged commit bd071d0 into main Aug 4, 2025
3 checks passed
@beesaferoot beesaferoot deleted the feat-migrator-facade branch October 22, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant