[PR #2455] [MERGED] fix: use MySQL-compatible CREATE INDEX in migration 20260224215050 #9999

Closed
opened 2026-04-23 09:20:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2455
Author: @tink-bot
Created: 3/23/2026
Status: Merged
Merged: 3/23/2026
Merged by: @kolaente

Base: mainHead: fix/mysql-create-index-migration-2431


📝 Commits (1)

  • deab991 fix: use MySQL-compatible CREATE INDEX in migration 20260224215050

📊 Changes

1 file changed (+16 additions, -2 deletions)

View changed files

📝 pkg/migration/20260224215050.go (+16 -2)

📄 Description

Migration 20260224215050 uses CREATE INDEX IF NOT EXISTS, which is not valid MySQL syntax, causing a SQL error (1064) and crash loop for all MySQL users upgrading to 2.2.0.

This switches on the database type to use IF NOT EXISTS only for Postgres/SQLite, and plain CREATE INDEX with duplicate key error suppression (Error 1061) for MySQL — matching the pattern already used in migrations 20241028131622 and 20251108154913.

Fixes #2431


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2455 **Author:** [@tink-bot](https://github.com/tink-bot) **Created:** 3/23/2026 **Status:** ✅ Merged **Merged:** 3/23/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `fix/mysql-create-index-migration-2431` --- ### 📝 Commits (1) - [`deab991`](https://github.com/go-vikunja/vikunja/commit/deab991d2d1061ebd002e3519a3a938654c7ced5) fix: use MySQL-compatible CREATE INDEX in migration 20260224215050 ### 📊 Changes **1 file changed** (+16 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `pkg/migration/20260224215050.go` (+16 -2) </details> ### 📄 Description Migration 20260224215050 uses `CREATE INDEX IF NOT EXISTS`, which is not valid MySQL syntax, causing a SQL error (1064) and crash loop for all MySQL users upgrading to 2.2.0. This switches on the database type to use `IF NOT EXISTS` only for Postgres/SQLite, and plain `CREATE INDEX` with duplicate key error suppression (Error 1061) for MySQL — matching the pattern already used in migrations 20241028131622 and 20251108154913. Fixes #2431 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-23 09:20:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#9999