[PR #2884] [MERGED] db: remove _schema from migration tests #2917

Closed
opened 2025-12-29 04:19:39 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2884
Author: @kradalby
Created: 11/13/2025
Status: Merged
Merged: 11/13/2025
Merged by: @kradalby

Base: mainHead: kradalby/db-migration-tests


📝 Commits (2)

  • 67051ac db: remove _schema from migration tests
  • a67ee66 db: add comment to always check errors in migration

📊 Changes

7 files changed (+27 additions, -55 deletions)

View changed files

📝 hscontrol/db/db.go (+1 -0)
📝 hscontrol/db/db_test.go (+4 -5)
hscontrol/db/testdata/sqlite/headscale_0.26.0-beta.1_schema.sql (+0 -12)
hscontrol/db/testdata/sqlite/headscale_0.26.0-beta.2_schema.sql (+0 -12)
hscontrol/db/testdata/sqlite/headscale_0.26.0_schema.sql (+0 -12)
📝 hscontrol/db/testdata/sqlite/headscale_0.26.1_dump-litestream.sql (+22 -2)
hscontrol/db/testdata/sqlite/headscale_0.26.1_schema.sql (+0 -12)

📄 Description

Previously we tested migrations on schemas and dumps
of old databases.

The problems with testing migrations against the schemas
is that the migration table is empty, so we try to run
migrations that are already ran on that schema, which might
blow up.

This commit removes the schema approach and just leaves all
the dumps, which include the migration table.


🔄 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/juanfont/headscale/pull/2884 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 11/13/2025 **Status:** ✅ Merged **Merged:** 11/13/2025 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `kradalby/db-migration-tests` --- ### 📝 Commits (2) - [`67051ac`](https://github.com/juanfont/headscale/commit/67051aceaf3e1ef347b935e17aaaf9ad56d7f19e) db: remove _schema from migration tests - [`a67ee66`](https://github.com/juanfont/headscale/commit/a67ee6644332ef162e91c5d547322409b54daa14) db: add comment to always check errors in migration ### 📊 Changes **7 files changed** (+27 additions, -55 deletions) <details> <summary>View changed files</summary> 📝 `hscontrol/db/db.go` (+1 -0) 📝 `hscontrol/db/db_test.go` (+4 -5) ➖ `hscontrol/db/testdata/sqlite/headscale_0.26.0-beta.1_schema.sql` (+0 -12) ➖ `hscontrol/db/testdata/sqlite/headscale_0.26.0-beta.2_schema.sql` (+0 -12) ➖ `hscontrol/db/testdata/sqlite/headscale_0.26.0_schema.sql` (+0 -12) 📝 `hscontrol/db/testdata/sqlite/headscale_0.26.1_dump-litestream.sql` (+22 -2) ➖ `hscontrol/db/testdata/sqlite/headscale_0.26.1_schema.sql` (+0 -12) </details> ### 📄 Description Previously we tested migrations on schemas and dumps of old databases. The problems with testing migrations against the schemas is that the migration table is empty, so we try to run migrations that are already ran on that schema, which might blow up. This commit removes the schema approach and just leaves all the dumps, which include the migration table. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 04:19:39 +01:00
adam closed this issue 2025-12-29 04:19:39 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2917