Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Migrate from GORM v1 to v2 #59

Merged
merged 1 commit into from
Mar 4, 2022
Merged

Migrate from GORM v1 to v2 #59

merged 1 commit into from
Mar 4, 2022

Conversation

fenriskiba
Copy link
Contributor

Developed in collaboration with @vodzak.

Description

Migrated Flagr from GORM v1 to GORM v2.

Motivation and Context

This code change is required to support implementing Casbin in Flagr.

Casbin offers an adapter for GORM that sets up the required table and handles adding, updating, etc. information to the table. Casbin's GORM adapter is only compatible with GORM v2.

Rather than rewrite the adapter's functionality to support Flagr's current version of GORM, we're instead migrating Flagr to use GORM v2, as GORM v1 is depreciated.

How Has This Been Tested?

  • Manual testing for all three database types (PostgreSQL, SQLite, MySQL) for the following scenarios:
    • Creating a new Flagr database using GORM v2
    • Migrating an existing GORM v1 Flagr database to GORM v2
  • Manual regression testing (using all of the above scenarios)
  • Local CI Test runs

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

* migrated from GORM v1 to v2
@fenriskiba
Copy link
Contributor Author

@zhouzhuojie @marceloboeira Is there any kind of ETA on reviewing this PR? Just don't want this to get auto-closed for lack of activity before it gets a review like I saw a few other PRs did.

Copy link
Contributor

@zhouzhuojie zhouzhuojie left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@zhouzhuojie zhouzhuojie merged commit 91156bf into openflagr:main Mar 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants