Skip to content

Commit

Permalink
add relative path to embedded open
Browse files Browse the repository at this point in the history
  • Loading branch information
cottand committed Aug 25, 2024
1 parent b817c02 commit b15f6bb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion services/s-rpc-portfolio-stats/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Migrate(db *sql.DB) error {
return terrors.Augment(err, "failed to create migration instance client", errParams)
}
// TODO use this like below but with embedded?
sourceDriver, err := iofs.New(embeddedMigrations, ".")
sourceDriver, err := iofs.New(embeddedMigrations, "migrations")
if err != nil {
return terrors.Augment(err, "failed to open db migrations embedded fs", errParams)
}
Expand Down
3 changes: 2 additions & 1 deletion services/s-rpc-portfolio-stats/job.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let
in
lib.mkServiceJob {
name = "s-rpc-portfolio-stats";
version = "33837b2";
version = "b817c02";
upstream."roach-db".localBindPort = dbPort;
cpu = 80;
memMb = 200;
Expand All @@ -20,6 +20,7 @@ lib.mkServiceJob {
{{with secret "secret/data/services/db-rw-default"}}
CRDB_CONN_URL="postgres://{{.Data.data.username}}:{{.Data.data.password}}@localhost:${toString dbPort}/services?ssl_sni=roach-db.traefik"
{{end}}
'';
};
vault.env = true;
Expand Down
13 changes: 13 additions & 0 deletions services/s-rpc-portfolio-stats/open_db_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main

import (
"github.com/golang-migrate/migrate/v4/source/iofs"
"testing"
)

func TestCanOpenEmbedded(t *testing.T) {
_, err := iofs.New(embeddedMigrations, "migrations")
if err != nil {
t.Fatalf("failed to open embedded migrations: %v", err)
}
}

0 comments on commit b15f6bb

Please sign in to comment.