itdoxy-lab/models
Florian Eitel d9b51a781c Migration fixes for gogs (0.11.66) to gitea (1.6.0) #5318 (#5341)
* Remove field from migration to support upgrades from older version

That will ensure the field does not get queried in the Select if it does
not exist yet:

```
[I] [SQL] SELECT "id", "repo_id", "index", "poster_id", "name", "content", "milestone_id", "priority", "assignee_id", "is_closed", "is_pull", "num_comments", "ref", "deadline_unix", "created_unix", "updated_unix
[...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: pq: column "ref" does not exist
```

see #5318

* Skip remove stale watcher migration if not required

Otherwise the migration will fail if executed from a older database
version without multiple IssueWatch feature.

```
2018/11/11 23:51:14 [I] [SQL] SELECT DISTINCT "issue_watch"."user_id", "issue"."repo_id" FROM "issue_watch" INNER JOIN issue ON issue_watch.issue_id = issue.id WHERE (issue_watch.is_watching = $1) LIMIT 50 []int
[...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: pq: relation "issue_watch" does not exist
```

see #5318
2018-11-18 20:25:32 +02:00
..
fixtures
migrations
access.go
access_test.go
action.go
action_list.go
action_test.go
admin.go
admin_test.go
attachment.go
attachment_test.go
branches.go
branches_test.go
consistency.go
error.go
error_oauth2.go
external_login_user.go
git_diff.go
git_diff_test.go
gpg_key.go
gpg_key_test.go
graph.go
graph_test.go
helper.go
issue.go
issue_assignees.go Fix failure on creating pull request with assignees (#4419) (#4583) 2018-08-16 19:52:51 +08:00
issue_assignees_test.go
issue_comment.go
issue_comment_test.go
issue_dependency.go
issue_dependency_test.go
issue_indexer.go
issue_label.go
issue_label_test.go
issue_list.go
issue_list_test.go
issue_mail.go
issue_milestone.go
issue_milestone_test.go
issue_reaction.go
issue_reaction_test.go
issue_stopwatch.go
issue_stopwatch_test.go
issue_test.go
issue_tracked_time.go
issue_tracked_time_test.go
issue_user.go
issue_user_test.go
issue_watch.go
issue_watch_test.go
lfs.go
lfs_lock.go
login_source.go
mail.go
main_test.go
models.go
models_sqlite.go
models_test.go
notification.go
notification_test.go
oauth2.go
org.go
org_team.go
org_team_test.go
org_test.go
pull.go
pull_test.go
release.go
release_test.go
repo.go
repo_activity.go
repo_branch.go
repo_collaboration.go
repo_collaboration_test.go
repo_editor.go
repo_indexer.go
repo_issue.go
repo_list.go
repo_list_test.go
repo_mirror.go
repo_redirect.go
repo_redirect_test.go
repo_test.go
repo_unit.go
repo_watch.go
repo_watch_test.go
review.go
review_test.go
ssh_key.go
ssh_key_test.go
star.go
star_test.go
status.go
status_test.go
test_fixtures.go
token.go
token_test.go
topic.go
topic_test.go
twofactor.go
u2f.go
u2f_test.go
unit.go
unit_tests.go
update.go
update_test.go
user.go
user_follow.go
user_follow_test.go
user_heatmap.go
user_heatmap_test.go
user_mail.go
user_mail_test.go
user_openid.go
user_openid_test.go
user_test.go
webhook.go
webhook_dingtalk.go
webhook_discord.go
webhook_slack.go
webhook_test.go
wiki.go
wiki_test.go