[PR #2149] [MERGED] Fix store migration on empty string #14719

Closed
opened 2026-08-05 03:06:11 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2149
Author: @mlsmaycon
Created: 6/18/2024
Status: Merged
Merged: 6/18/2024
Merged by: @mlsmaycon

Base: mainHead: fix/migration-on-empty-string


📝 Commits (4)

  • cfc4bcb Fix store migration on empty string
  • 0fb9fb9 Update management/server/sql_store_test.go
  • 8fe19cb Update management/server/sql_store_test.go
  • dfbccf3 Update management/server/migration/migration.go

📊 Changes

2 files changed (+27 additions, -4 deletions)

View changed files

📝 management/server/migration/migration.go (+6 -4)
📝 management/server/sql_store_test.go (+21 -0)

📄 Description

When fetching empty values from the database to check for migration our parser failed to handle null strings preventing the service from start

This uses sql.NullString to handle that and check for empty string resulted from null data

Describe your changes

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 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/netbirdio/netbird/pull/2149 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 6/18/2024 **Status:** ✅ Merged **Merged:** 6/18/2024 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `fix/migration-on-empty-string` --- ### 📝 Commits (4) - [`cfc4bcb`](https://github.com/netbirdio/netbird/commit/cfc4bcbc636a69137f07e199d66090870437956c) Fix store migration on empty string - [`0fb9fb9`](https://github.com/netbirdio/netbird/commit/0fb9fb9c3072ea6987e09c829c63612e3a2e2c15) Update management/server/sql_store_test.go - [`8fe19cb`](https://github.com/netbirdio/netbird/commit/8fe19cbe8434828a26828bdda808bf25369c445c) Update management/server/sql_store_test.go - [`dfbccf3`](https://github.com/netbirdio/netbird/commit/dfbccf313bf3ee02b692f9c27bb573f53f539999) Update management/server/migration/migration.go ### 📊 Changes **2 files changed** (+27 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `management/server/migration/migration.go` (+6 -4) 📝 `management/server/sql_store_test.go` (+21 -0) </details> ### 📄 Description When fetching empty values from the database to check for migration our parser failed to handle null strings preventing the service from start This uses sql.NullString to handle that and check for empty string resulted from null data ## Describe your changes ## Issue ticket number and link ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 03:06:11 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#14719