[x]
):
2017/12/02 15:19:37 [I] Log Mode: File(Debug)
2017/12/02 15:19:37 [I] XORM Log Mode: File(Debug)
2017/12/02 15:19:37 [I] Cache Service Enabled
2017/12/02 15:19:37 [I] Session Service Enabled
2017/12/02 15:19:37 [I] Mail Service Enabled
2017/12/02 15:19:37 [I] Notify Mail Service Enabled
2017/12/02 15:19:37 [I] Migration: add deleted branches
2017/12/02 15:19:37 [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: Sync2: Error 1071: Specified key was too long; max key length is 1000 bytes
I was running gitea on a old MySQL 5.1 and after upgrading to 1.3.0, I was faced with above error which is caused by the table deleted_branch
apparently not being compatible with the MyISAM engine. I resolved it by changing the engine of the table to InnoDB, but this is how gitea had initially created this table:
| deleted_branch | CREATE TABLE `deleted_branch` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`repo_id` bigint(20) NOT NULL,
`name` varchar(255) NOT NULL,
`commit` varchar(255) NOT NULL,
`deleted_by_id` bigint(20) NOT NULL,
`deleted_unix` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `IDX_deleted_branch_deleted_unix` (`deleted_unix`),
KEY `IDX_deleted_branch_deleted_by_id` (`deleted_by_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 |
I wonder if it might be wise to have a migration that converts all tables to InnoDB (if the database supports it) to avoid such issues in the future, or alternatively maintain support of MyISAM.
I don't think Gitea should support MyISAM since so many transations needed.
I too think it's reasonable to require InnoDB, but gitea should explicitly create tables with it, not rely on the default of MySQL which was MyISAM prior to 5.5.5.
Yes, Gitea should check the engine otherwise it should print fail
Had the same problem. Changing deleted_branch
to InnoDB engine solved it. Thanks. :)
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.
You should set database default engine as InnoDB when creating mysql.
Most helpful comment
Yes, Gitea should check the engine otherwise it should print fail