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

v38 migration used an outdated version of RepoUnit model #2602

Merged
merged 4 commits into from
Sep 25, 2017

Conversation

daviian
Copy link
Member

@daviian daviian commented Sep 25, 2017

v38 migration used an old version of RepoUnit.
Changed to current RepoUnit model

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
@sapk
Copy link
Member

sapk commented Sep 25, 2017

LGTM

@sapk
Copy link
Member

sapk commented Sep 25, 2017

Not blocking but shouldn't it be also a custom type V38RepoUnit ? It would limit in futur mistake like that ?

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Sep 25, 2017
// RepoUnit describes all units of a repository
type RepoUnit struct {
// V16RepoUnit describes all units of a repository
type V16RepoUnit struct {
Copy link
Member

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

"github.com/go-xorm/xorm"
)

// RepoUnit describes all units of a repository
type RepoUnit struct {
Copy link
Member

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

@sapk
Copy link
Member

sapk commented Sep 25, 2017

Or like https://github.com/go-gitea/gitea/blob/master/models/migrations/v40.go defining the struct inside the func.

@sapk
Copy link
Member

sapk commented Sep 25, 2017

@lafriks suggesting the same.

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
@daviian
Copy link
Member Author

daviian commented Sep 25, 2017

@lafriks @sapk Changed

@lafriks
Copy link
Member

lafriks commented Sep 25, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 25, 2017
@lafriks lafriks merged commit 4c9bf91 into go-gitea:release/v1.2 Sep 25, 2017
daviian added a commit to daviian/gitea that referenced this pull request Sep 25, 2017
* change repoUnit model in migration

* fix v16 migration repo_unit table

* fix lint error

* move type definition inside function

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
@lunny lunny added this to the 1.2.0 milestone Sep 26, 2017
@lunny lunny added the type/bug label Sep 26, 2017
@daviian daviian deleted the bugfix/v38-migration branch September 26, 2017 20:45
daviian added a commit to daviian/gitea that referenced this pull request Sep 28, 2017
* change repoUnit model in migration

* fix v16 migration repo_unit table

* fix lint error

* move type definition inside function

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
lunny pushed a commit that referenced this pull request Oct 8, 2017
* 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 <dschneiderbauer@gmail.com>

* fix lint error

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* 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 <dschneiderbauer@gmail.com>

* fix lint error

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* Fix time tracking migration

* Refactor code

* Fix migration from Gogs

* add error check

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* Additiomal fixes for migrations

* Fix timetracking migration

* Add back nil check
daviian added a commit to daviian/gitea that referenced this pull request Oct 9, 2017
* 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
lafriks pushed a commit that referenced this pull request Oct 9, 2017
* 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 <dschneiderbauer@gmail.com>

* change string map to interface map

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants