multi-env

command
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

multi-env

Migrations folders selected from environment variable APP_ENV.

Use-case: populating data with different settings for test and production.

In the following example, we populate some initial data with different values for the test and the production environment.

Usage

APP_ENV=production go run migrate.go
{"level":"info","msg":"applying db migrations","operation":"migratedb"}
{"level":"info","msg":"OK   20231102204811_create_example.sql (3.52ms)","operation":"migratedb"}
{"level":"info","msg":"OK   20231103204811_populate_example.sql (3.02ms)","operation":"migratedb"}
{"level":"info","msg":"OK   20231103204911_populate_prod.sql (3.33ms)","operation":"migratedb"}
APP_ENV=test go run migrate.go
{"level":"info","msg":"applying db migrations","operation":"migratedb"}
{"level":"info","msg":"OK   20231102204811_create_example.sql (3.52ms)","operation":"migratedb"}
{"level":"info","msg":"OK   20231103204811_populate_example.sql (3.02ms)","operation":"migratedb"}
{"level":"info","msg":"OK   20231103204911_populate_test.sql (2.68ms)","operation":"migratedb"}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL