change migration driver to pgx
This commit is contained in:
parent
4f108e1b05
commit
4559856214
@ -8,7 +8,7 @@ import (
|
|||||||
"github.com/golang-migrate/migrate/v4"
|
"github.com/golang-migrate/migrate/v4"
|
||||||
_ "github.com/golang-migrate/migrate/v4/database/postgres"
|
_ "github.com/golang-migrate/migrate/v4/database/postgres"
|
||||||
"github.com/golang-migrate/migrate/v4/source/iofs"
|
"github.com/golang-migrate/migrate/v4/source/iofs"
|
||||||
_ "github.com/lib/pq"
|
_ "github.com/jackc/pgx/v5/stdlib"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
"ron"
|
"ron"
|
||||||
@ -21,7 +21,7 @@ import (
|
|||||||
var database embed.FS
|
var database embed.FS
|
||||||
|
|
||||||
func migrateDB() {
|
func migrateDB() {
|
||||||
dbConn, err := sql.Open("postgres", os.Getenv("DATASOURCE"))
|
dbConn, err := sql.Open("pgx", os.Getenv("DATASOURCE"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return
|
return
|
||||||
|
|||||||
2
go.mod
2
go.mod
@ -8,7 +8,6 @@ require (
|
|||||||
aidanwoods.dev/go-paseto v1.5.2
|
aidanwoods.dev/go-paseto v1.5.2
|
||||||
github.com/golang-migrate/migrate/v4 v4.18.1
|
github.com/golang-migrate/migrate/v4 v4.18.1
|
||||||
github.com/jackc/pgx/v5 v5.7.1
|
github.com/jackc/pgx/v5 v5.7.1
|
||||||
github.com/lib/pq v1.10.9
|
|
||||||
ron v0.0.0-00010101000000-000000000000
|
ron v0.0.0-00010101000000-000000000000
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -19,6 +18,7 @@ require (
|
|||||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||||
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
||||||
|
github.com/lib/pq v1.10.9 // indirect
|
||||||
go.uber.org/atomic v1.7.0 // indirect
|
go.uber.org/atomic v1.7.0 // indirect
|
||||||
golang.org/x/crypto v0.29.0 // indirect
|
golang.org/x/crypto v0.29.0 // indirect
|
||||||
golang.org/x/sync v0.9.0 // indirect
|
golang.org/x/sync v0.9.0 // indirect
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user