mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-09-26 12:59:05 +02:00
chore: update Francis to rc.2
Also replaces the direct use of the github.com/google/uuid package with the uuid package from the standard library in Go 1.27 (package remains as a transitive dep)
This commit is contained in:
@@ -5,8 +5,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
"uuid"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
// If no instance ID exists yet, a new one is generated and persisted atomically
|
||||
func Load(parentCtx context.Context, db *gorm.DB) (string, error) {
|
||||
// Candidate value used only if there's no instance ID stored yet
|
||||
newInstanceID := uuid.NewString()
|
||||
newInstanceID := uuid.NewV4().String()
|
||||
|
||||
// We use a raw query because gorm can't build it for us in this atomic way
|
||||
// The syntax is valid for both SQLite and Postgres
|
||||
|
||||
@@ -3,8 +3,8 @@ package instanceid
|
||||
import (
|
||||
"sync"
|
||||
"testing"
|
||||
"uuid"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
"gorm.io/gorm"
|
||||
|
||||
@@ -138,7 +138,7 @@ func TestMigrateFromAppConfig(t *testing.T) {
|
||||
}
|
||||
|
||||
t.Run("moves an existing instance ID from app_config_variables into the kv table", func(t *testing.T) {
|
||||
legacyID := uuid.NewString()
|
||||
legacyID := uuid.NewV4().String()
|
||||
db := testutils.NewDatabaseForTestWithMigrationSeed(t, versionBeforeMove, seedAppConfigInstanceID(legacyID))
|
||||
|
||||
// The migration should have copied the value into the kv table under the "instance_id" key
|
||||
@@ -160,7 +160,7 @@ func TestMigrateFromAppConfig(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("keeps the existing kv value when both tables have an instance ID", func(t *testing.T) {
|
||||
legacyID := uuid.NewString()
|
||||
legacyID := uuid.NewV4().String()
|
||||
db := testutils.NewDatabaseForTestWithMigrationSeed(t, versionBeforeMove, func(t *testing.T, db *gorm.DB) {
|
||||
t.Helper()
|
||||
// An instance ID is already present in the kv table before the move runs
|
||||
|
||||
Reference in New Issue
Block a user