Open lunny opened 2 months ago
default
should be boolean
column type.
The issue title is a bit long ;P
Have you recreated your database?
Have you recreated your database?
No, I didn't. I remember something similar from the past (3 years ago) regarding bigint with boolean type issue as well. Maybe due to a PostgreSQL upgrade from v13 to v14. Where I indeed manually needed to fix these issues. Maybe I missed this column (type). When I migrate to a new major PostgreSQL, your database might gets recreated, that could be the case. Anyhow, I was running Gitea fine for at least 2 or 3 years now. Updates & migrations were running fine, until this one.
That being said, default
is also a reserved word in PostgreSQL/SQL. Meaning if something (eg. a migration) went wrong in the past, it might show up now. Because the name of the column is called 'default', be sure to always but the column name between double quotes.
I fixed the problem using the following 3 queries, now the migration went successful again. And Gitea is up and running!
ALTER TABLE project_board ALTER COLUMN "default" DROP DEFAULT;
ALTER TABLE project_board ALTER "default" TYPE bool USING CASE WHEN "default"=0 THEN FALSE ELSE TRUE END;
ALTER TABLE project_board ALTER COLUMN "default" SET DEFAULT FALSE;
Thank you! <3
I'm using Docker
gitea/gitea:latest-rootless
image with PostgreSQL v14.When I currently dump the project & project_board schema, it looks like this (hope this helps):
Project table:
Project board table:
Originally posted by @melroy89 in https://github.com/go-gitea/gitea/issues/30153#issuecomment-2162865858