]> source.dussan.org Git - gitea.git/commit
Migration fixes for gogs (0.11.66) to gitea (1.6.0) #5318 (#5341)
authorFlorian Eitel <feitel@indeedgeek.de>
Sun, 18 Nov 2018 18:25:32 +0000 (19:25 +0100)
committerLauris BH <lauris@nix.lv>
Sun, 18 Nov 2018 18:25:32 +0000 (20:25 +0200)
commitd9b51a781cbdaeea53de9888831b33c680e43d46
treefd1338c8290fb710305794bc1633c0f96aa48081
parent241ee793b74365927dda216e67ecb24245f07fab
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
models/migrations/v64.go
models/migrations/v67.go