Skip to content

Commit

Permalink
Unify env variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Lun4m committed Dec 2, 2024
1 parent 09c6bcf commit 7e0deb9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion migrations/kdvh/db/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package db

const KDVH_ENV_VAR string = "KDVH_PROXY_CONN"
const KDVH_ENV_VAR string = "KDVH_PROXY_CONN_STRING"

// Map of all tables found in KDVH, with set max import year
type KDVH struct {
Expand Down
2 changes: 1 addition & 1 deletion migrations/lard/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package lard

import "time"

const LARD_ENV_VAR string = "LARD_STRING"
const LARD_ENV_VAR string = "LARD_CONN_STRING"

// Struct mimicking the `public.data` table
type DataObs struct {
Expand Down
2 changes: 1 addition & 1 deletion migrations/lard/permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/jackc/pgx/v5"
)

const STINFO_ENV_VAR string = "STINFO_STRING"
const STINFO_ENV_VAR string = "STINFO_CONN_STRING"

type StationId = int32
type PermitId = int32
Expand Down
10 changes: 6 additions & 4 deletions migrations/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ type CmdArgs struct {
func main() {
log.SetFlags(log.LstdFlags | log.Lshortfile)

// The following env variables are needed:
// The following env variables are required:
// 1. Dump
// - kdvh: "KDVH_PROXY_CONN"
// - kdvh: "KDVH_CONN_STRING"
// - kvalobs: "KVALOBS_CONN_STRING", "HISTKVALOBS_CONN_STRING"
//
// 2. Import
// - kdvh: "LARD_STRING", "STINFO_STRING", "KDVH_PROXY_CONN"
// - kvalobs: "LARD_STRING", "STINFO_STRING"
// - kdvh: "LARD_CONN_STRING", "STINFO_CONN_STRING", "KDVH_CONN_STRING"
// - kvalobs: "LARD_CONN_STRING", "STINFO_CONN_STRING", "KVALOBS_CONN_STRING"
//
// NOTE: KDVH_CONN_STRING refers to the proxy
err := godotenv.Load()
if err != nil {
fmt.Println(err)
Expand Down

0 comments on commit 7e0deb9

Please sign in to comment.