Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate ORM and versioned DB migrations to registry #804

Merged
merged 10 commits into from
Feb 16, 2024

Conversation

haoming29
Copy link
Contributor

Closes #646

This PR introduced gorm, an ORM for interacting with registry sqlite database, and migrated raw SQL queries to use gorm queries

It also introduced goose, a DB migration tool for versioned schema migration. Although gorm has built-in AutoMigration function, it fails quickly with an existing database and it does not support versioned migration.

It finally removed the conditional creation of topology table but rather create the table by default, and populate the value if it's in OSDF mode.

The easiest way to test is to build and spin up your registry with -d flag and watch for the message at the beginning of the log:

goose: successfully migrated database to version: 20240212194951

@haoming29 haoming29 added critical High priority for next release registry Issue relating to the registry component internal Internal code improvements, not user-facing labels Feb 12, 2024
@haoming29 haoming29 added this to the v7.6.0 milestone Feb 12, 2024
registry/registry_db.go Show resolved Hide resolved
registry/registry_db.go Show resolved Hide resolved
registry/registry_db.go Outdated Show resolved Hide resolved
Copy link
Member

@jhiemstrawisc jhiemstrawisc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this one!

@jhiemstrawisc jhiemstrawisc merged commit a1eee8b into PelicanPlatform:main Feb 16, 2024
9 checks passed
@haoming29 haoming29 deleted the registry-orm branch February 16, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical High priority for next release internal Internal code improvements, not user-facing registry Issue relating to the registry component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate ORM to registry
2 participants