After upgrade to gitea 1.5 issues are not assigned #2205

Closed
opened 2025-11-02 04:27:02 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @HoffmannP on GitHub (Aug 16, 2018).

  • Gitea version (or commit ref): 1.5.0 Docker (cfe6941 built with: bindata, sqlite)
  • Git version: 2.15.2
  • Operating system: /
  • Database (use [x]):
    • PostgreSQL
    • [ X ] MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • [ X ] No
    • Not relevant
  • Log gist:

After I updated the binary to Gitea 1.5.0 the issues are not assigned any more

Originally created by @HoffmannP on GitHub (Aug 16, 2018). - Gitea version (or commit ref): 1.5.0 Docker (cfe6941 built with: bindata, sqlite) - Git version: 2.15.2 - Operating system: / - Database (use `[x]`): - [ ] PostgreSQL - [ X ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ X ] No - [ ] Not relevant - Log gist: After I updated the binary to Gitea 1.5.0 the issues are not assigned any more
GiteaMirror added the issue/stale label 2025-11-02 04:27:02 -06:00
Author
Owner

@HoffmannP commented on GitHub (Aug 16, 2018):

How I solved it:

INSERT INTO `issue_assignees` 
SELECT NULL, A.assignee_id, A.issue_id
FROM comment A
LEFT JOIN comment B ON A.issue_id = B.issue_id AND A.id < B.id AND B.assignee_id != 0
WHERE A.assignee_id != 0 AND B.assignee_id IS NULL
@HoffmannP commented on GitHub (Aug 16, 2018): How I solved it: ```sql INSERT INTO `issue_assignees` SELECT NULL, A.assignee_id, A.issue_id FROM comment A LEFT JOIN comment B ON A.issue_id = B.issue_id AND A.id < B.id AND B.assignee_id != 0 WHERE A.assignee_id != 0 AND B.assignee_id IS NULL ```
Author
Owner

@lafriks commented on GitHub (Aug 16, 2018):

Check if you had no errors/warnings in gitea.log for time when you upgraded as there was migration to insert records in that table

@lafriks commented on GitHub (Aug 16, 2018): Check if you had no errors/warnings in gitea.log for time when you upgraded as there was migration to insert records in that table
Author
Owner

@lunny commented on GitHub (Aug 16, 2018):

@HoffmannP I don't think that works. comment table should have no column issue_id and assignee_id.

@lunny commented on GitHub (Aug 16, 2018): @HoffmannP I don't think that works. ~comment table should have no column issue_id and assignee_id.~
Author
Owner

@HoffmannP commented on GitHub (Aug 16, 2018):

@lunny if you are right my DB upgrade failed:

SHOW CREATE TABLE comment

CREATE TABLE `comment` (
 `id` bigint(20) NOT NULL AUTO_INCREMENT,
 `type` int(11) DEFAULT NULL,
 `poster_id` bigint(20) DEFAULT NULL,
 `issue_id` bigint(20) DEFAULT NULL,
 `label_id` bigint(20) DEFAULT NULL,
 `old_milestone_id` bigint(20) DEFAULT NULL,
 `milestone_id` bigint(20) DEFAULT NULL,
 `old_assignee_id` bigint(20) DEFAULT NULL,
 `assignee_id` bigint(20) DEFAULT NULL,
 `old_title` varchar(255) DEFAULT NULL,
 `new_title` varchar(255) DEFAULT NULL,
 `commit_id` bigint(20) DEFAULT NULL,
 `line` bigint(20) DEFAULT NULL,
 `content` text DEFAULT NULL,
 `created_unix` bigint(20) DEFAULT NULL,
 `updated_unix` bigint(20) DEFAULT NULL,
 `commit_sha` varchar(40) DEFAULT NULL,
 `removed_assignee` tinyint(1) DEFAULT NULL,
 PRIMARY KEY (`id`),
 KEY `IDX_comment_poster_id` (`poster_id`),
 KEY `IDX_comment_issue_id` (`issue_id`),
 KEY `IDX_comment_created_unix` (`created_unix`),
 KEY `IDX_comment_updated_unix` (`updated_unix`)
) ENGINE=InnoDB AUTO_INCREMENT=2818 DEFAULT CHARSET=utf8
@HoffmannP commented on GitHub (Aug 16, 2018): @lunny if you are right my DB upgrade failed: ```sql SHOW CREATE TABLE comment CREATE TABLE `comment` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `type` int(11) DEFAULT NULL, `poster_id` bigint(20) DEFAULT NULL, `issue_id` bigint(20) DEFAULT NULL, `label_id` bigint(20) DEFAULT NULL, `old_milestone_id` bigint(20) DEFAULT NULL, `milestone_id` bigint(20) DEFAULT NULL, `old_assignee_id` bigint(20) DEFAULT NULL, `assignee_id` bigint(20) DEFAULT NULL, `old_title` varchar(255) DEFAULT NULL, `new_title` varchar(255) DEFAULT NULL, `commit_id` bigint(20) DEFAULT NULL, `line` bigint(20) DEFAULT NULL, `content` text DEFAULT NULL, `created_unix` bigint(20) DEFAULT NULL, `updated_unix` bigint(20) DEFAULT NULL, `commit_sha` varchar(40) DEFAULT NULL, `removed_assignee` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id`), KEY `IDX_comment_poster_id` (`poster_id`), KEY `IDX_comment_issue_id` (`issue_id`), KEY `IDX_comment_created_unix` (`created_unix`), KEY `IDX_comment_updated_unix` (`updated_unix`) ) ENGINE=InnoDB AUTO_INCREMENT=2818 DEFAULT CHARSET=utf8 ```
Author
Owner

@lunny commented on GitHub (Aug 16, 2018):

@HoffmannP I think I'm wrong on comment table's struct.

@lunny commented on GitHub (Aug 16, 2018): @HoffmannP I think I'm wrong on comment table's struct.
Author
Owner

@w3p706 commented on GitHub (Aug 28, 2018):

I ran into the same issue updating from Gitea version 1.4.3 built with: bindata, sqlite to version 1.5

Error:

2018/08/28 08:05:15 [I] Migration: add multiple assignees
2018/08/28 08:05:15 [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: mssql: Ungültiger Spaltenname "assignee_id"

removed the column in sql-server and re-added it to solve it, but most probably it was a foreign key which prevented the removal of the column.

@w3p706 commented on GitHub (Aug 28, 2018): I ran into the same issue updating from Gitea version 1.4.3 built with: bindata, sqlite to version 1.5 Error: ``` 2018/08/28 08:05:15 [I] Migration: add multiple assignees 2018/08/28 08:05:15 [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: mssql: Ungültiger Spaltenname "assignee_id" ``` removed the column in sql-server and re-added it to solve it, but most probably it was a foreign key which prevented the removal of the column.
Author
Owner

@stale[bot] commented on GitHub (Jan 12, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jan 12, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Feb 21, 2019):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Feb 21, 2019): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2205