updates on the otp updates on the customer app

This commit is contained in:
2026-09-15 11:50:12 +05:30
parent e8f4c0a593
commit 89321c9e06
17 changed files with 1072 additions and 69 deletions

View File

@@ -6,12 +6,21 @@ import (
"database/sql"
"fmt"
"log"
"os"
_ "github.com/lib/pq"
)
func main() {
dsn := "host=31.97.228.132 user=admin password=Package@321# dbname=logistics port=5433 sslmode=disable"
// Built from the environment, not hardcoded. This line used to carry the
// production host and password in plaintext, in a file tracked by git — so
// the live database credential shipped with every clone. Export DB_HOST,
// DB_USER, DB_PASSWORD, DB_NAME and DB_PORT (or source .env) before running.
dsn := fmt.Sprintf(
"host=%s user=%s password=%s dbname=%s port=%s sslmode=disable",
os.Getenv("DB_HOST"), os.Getenv("DB_USER"), os.Getenv("DB_PASSWORD"),
os.Getenv("DB_NAME"), os.Getenv("DB_PORT"),
)
db, err := sql.Open("postgres", dsn)
if err != nil {
log.Fatalf("Open failed: %v", err)
@@ -81,4 +90,4 @@ func main() {
db.Exec("DELETE FROM pickupbookings WHERE bookingno = 'DM-BK-DEBUG-001'")
fmt.Println("Cleaned up test row.")
}
}
}

View File

@@ -6,12 +6,21 @@ import (
"database/sql"
"fmt"
"log"
"os"
_ "github.com/lib/pq"
)
func main() {
dsn := "host=31.97.228.132 user=admin password=Package@321# dbname=logistics port=5433 sslmode=disable"
// Built from the environment, not hardcoded. This line used to carry the
// production host and password in plaintext, in a file tracked by git — so
// the live database credential shipped with every clone. Export DB_HOST,
// DB_USER, DB_PASSWORD, DB_NAME and DB_PORT (or source .env) before running.
dsn := fmt.Sprintf(
"host=%s user=%s password=%s dbname=%s port=%s sslmode=disable",
os.Getenv("DB_HOST"), os.Getenv("DB_USER"), os.Getenv("DB_PASSWORD"),
os.Getenv("DB_NAME"), os.Getenv("DB_PORT"),
)
db, err := sql.Open("postgres", dsn)
if err != nil {
log.Fatalf("Open failed: %v", err)
@@ -57,4 +66,4 @@ func main() {
WHERE rel.relname = 'pickupbookings' AND con.contype = 'c'
`).Scan(&def)
fmt.Println("Current constraint:", def)
}
}

View File

@@ -6,13 +6,22 @@ import (
"database/sql"
"fmt"
"log"
"os"
_ "github.com/lib/pq"
)
func main() {
// DSN matches the one in connect.go and .env
dsn := "host=31.97.228.132 user=admin password=Package@321# dbname=logistics port=5433 sslmode=disable"
// Built from the environment, not hardcoded. This line used to carry the
// production host and password in plaintext, in a file tracked by git — so
// the live database credential shipped with every clone. Export DB_HOST,
// DB_USER, DB_PASSWORD, DB_NAME and DB_PORT (or source .env) before running.
dsn := fmt.Sprintf(
"host=%s user=%s password=%s dbname=%s port=%s sslmode=disable",
os.Getenv("DB_HOST"), os.Getenv("DB_USER"), os.Getenv("DB_PASSWORD"),
os.Getenv("DB_NAME"), os.Getenv("DB_PORT"),
)
db, err := sql.Open("postgres", dsn)
if err != nil {
log.Fatalf("Failed to open DB: %v", err)
@@ -42,4 +51,4 @@ func main() {
}
fmt.Printf("Table: %s\n", name)
}
}
}