-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
v38 migration used an outdated version of RepoUnit model #2602
Conversation
Signed-off-by: David Schneiderbauer <[email protected]>
Signed-off-by: David Schneiderbauer <[email protected]>
Signed-off-by: David Schneiderbauer <[email protected]>
LGTM |
Not blocking but shouldn't it be also a custom type V38RepoUnit ? It would limit in futur mistake like that ? |
models/migrations/v16.go
Outdated
// RepoUnit describes all units of a repository | ||
type RepoUnit struct { | ||
// V16RepoUnit describes all units of a repository | ||
type V16RepoUnit struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better is to move type inside migration function so that you don't need to rename it and don't need table name function
models/migrations/v38.go
Outdated
"github.com/go-xorm/xorm" | ||
) | ||
|
||
// RepoUnit describes all units of a repository | ||
type RepoUnit struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, move it inside migration function
Or like https://github.com/go-gitea/gitea/blob/master/models/migrations/v40.go defining the struct inside the func. |
@lafriks suggesting the same. |
Signed-off-by: David Schneiderbauer <[email protected]>
LGTM |
* change repoUnit model in migration * fix v16 migration repo_unit table * fix lint error * move type definition inside function Signed-off-by: David Schneiderbauer <[email protected]>
* change repoUnit model in migration * fix v16 migration repo_unit table * fix lint error * move type definition inside function Signed-off-by: David Schneiderbauer <[email protected]>
* v38 migration used an outdated version of RepoUnit model (#2602) * change repoUnit model in migration * fix v16 migration repo_unit table * fix lint error * move type definition inside function Signed-off-by: David Schneiderbauer <[email protected]> * fix lint error Signed-off-by: David Schneiderbauer <[email protected]> * Fix time tracking migration * Refactor code * Fix migration from Gogs * v38 migration used an outdated version of RepoUnit model (#2602) * change repoUnit model in migration * fix v16 migration repo_unit table * fix lint error * move type definition inside function Signed-off-by: David Schneiderbauer <[email protected]> * fix lint error Signed-off-by: David Schneiderbauer <[email protected]> * Fix time tracking migration * Refactor code * Fix migration from Gogs * add error check Signed-off-by: David Schneiderbauer <[email protected]> * Additiomal fixes for migrations * Fix timetracking migration * Add back nil check
* v38 migration used an outdated version of RepoUnit model (go-gitea#2602) * change repoUnit model in migration * fix v16 migration repo_unit table * fix lint error * move type definition inside function * Fix migration from Gogs * Refactor code * add error check * Additiomal fixes for migrations * Add back nil check
* Rewrite migrations to not depend on future code changes (#2604) * v38 migration used an outdated version of RepoUnit model (#2602) * change repoUnit model in migration * fix v16 migration repo_unit table * fix lint error * move type definition inside function * Fix migration from Gogs * Refactor code * add error check * Additiomal fixes for migrations * Add back nil check * replace deprecated .Id with .ID Signed-off-by: David Schneiderbauer <[email protected]> * change string map to interface map Signed-off-by: David Schneiderbauer <[email protected]>
v38 migration used an old version of RepoUnit.
Changed to current RepoUnit model