mirror of
https://github.com/yanislav-igonin/micrach
synced 2025-07-01 17:01:14 +03:00
feat: query -> exec
This commit is contained in:
parent
329c47ec2a
commit
fd97ae01f6
6
db/db.go
6
db/db.go
@ -45,8 +45,9 @@ func Migrate() {
|
||||
// Get name without extension
|
||||
name := strings.Split(splitted[1], ".")[0]
|
||||
|
||||
if _, ok := dbMigrations[id]; !ok {
|
||||
_, err = Pool.Query(context.TODO(), Files.ReadFileText(m))
|
||||
_, isMigrationInDb := dbMigrations[id]
|
||||
if !isMigrationInDb {
|
||||
_, err := Pool.Exec(context.TODO(), Files.ReadFileText(m))
|
||||
if err != nil {
|
||||
log.Panicln(err)
|
||||
}
|
||||
@ -56,6 +57,7 @@ func Migrate() {
|
||||
if err != nil {
|
||||
log.Panicln(err)
|
||||
}
|
||||
log.Println("database migration - " + name + " - online")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user