Skip to content

Commit

Permalink
fix: ensure notes are stored as null value instead of null string wit…
Browse files Browse the repository at this point in the history
…h bun insert
  • Loading branch information
corban-beaird committed Jun 10, 2024
1 parent a83a2ba commit 47f19fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions master/internal/project/postgres_project_intg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func TestProjectByName(t *testing.T) {

func TestGetProjectByKey(t *testing.T) {
require.NoError(t, etc.SetRootPath(internaldb.RootFromDB))
testDB, close := internaldb.MustResolveTestPostgres(t)
defer close()
testDB, closeDB := internaldb.MustResolveTestPostgres(t)
defer closeDB()
internaldb.MustMigrateTestPostgres(t, testDB, internaldb.MigrationsFromDB)

// add a workspace, and project
Expand Down Expand Up @@ -90,8 +90,8 @@ func TestGetProjectByKey(t *testing.T) {

func TestUpdateProjectKey(t *testing.T) {
require.NoError(t, etc.SetRootPath(internaldb.RootFromDB))
testDB, close := internaldb.MustResolveTestPostgres(t)
defer close()
testDB, closeDB := internaldb.MustResolveTestPostgres(t)
defer closeDB()
internaldb.MustMigrateTestPostgres(t, testDB, internaldb.MigrationsFromDB)

// add a workspace, and project
Expand Down
2 changes: 1 addition & 1 deletion master/pkg/model/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type Project struct {
Username string `bun:"username,scanonly"`
Immutable bool `bun:"immutable"`
Description string `bun:"description"`
Notes []*projectv1.Note `bun:"notes,type:jsonb"`
Notes []*projectv1.Note `bun:"notes,type:jsonb,nullzero"`
NumActiveExperiments int32 `bun:"num_active_experiments,scanonly"`
NumExperiments int32 `bun:"num_experiments,scanonly"`
State WorkspaceState `bun:"state,default:'UNSPECIFIED'::workspace_state"`
Expand Down

0 comments on commit 47f19fc

Please sign in to comment.