Skip to content

Commit

Permalink
feat(node): add run migrations to node startup
Browse files Browse the repository at this point in the history
  • Loading branch information
GMKrieger committed Jul 9, 2024
1 parent d22c78c commit fed7556
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/cartesi-rollups-node/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package main

import (
"context"
"fmt"
"log/slog"
"os"
"os/signal"
Expand All @@ -13,6 +14,7 @@ import (

"github.com/cartesi/rollups-node/internal/node"
"github.com/cartesi/rollups-node/internal/node/config"
"github.com/cartesi/rollups-node/internal/repository"
"github.com/lmittmann/tint"
"github.com/mattn/go-isatty"
)
Expand Down Expand Up @@ -43,6 +45,9 @@ func main() {
slog.SetDefault(logger)
slog.Info("Starting the Cartesi Rollups Node", "version", buildVersion, "config", config)

// run database migrations
repository.RunMigrations(fmt.Sprintf("%v?sslmode=disable", config.PostgresEndpoint.Value))

// create the node supervisor
supervisor, err := node.Setup(ctx, config, "")
if err != nil {
Expand Down

0 comments on commit fed7556

Please sign in to comment.