Skip to content

Commit 37af6dd

Browse files
Work In Progress
1 parent fcf19a1 commit 37af6dd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

database/pgx/pgx.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,10 @@ func (p *Postgres) ensureVersionTable() (err error) {
462462
}
463463
var query string
464464
if len(schemaName) > 0 {
465-
query := `SELECT COUNT(1) FROM information_schema.tables WHERE table_name = $1 AND table_schema = $2 LIMIT 1`
465+
query = `SELECT COUNT(1) FROM information_schema.tables WHERE table_name = $1 AND table_schema = $2 LIMIT 1`
466466
row = p.conn.QueryRowContext(context.Background(), query, tableName, schemaName)
467467
} else {
468-
query := `SELECT COUNT(1) FROM information_schema.tables WHERE table_name = $1 AND table_schema = (SELECT current_schema()) LIMIT 1`
468+
query = `SELECT COUNT(1) FROM information_schema.tables WHERE table_name = $1 AND table_schema = (SELECT current_schema()) LIMIT 1`
469469
row = p.conn.QueryRowContext(context.Background(), query, tableName)
470470
}
471471

database/postgres/postgres.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,10 @@ func (p *Postgres) ensureVersionTable() (err error) {
465465
}
466466
var query string
467467
if len(schemaName) > 0 {
468-
query := `SELECT COUNT(1) FROM information_schema.tables WHERE table_name = $1 AND table_schema = $2 LIMIT 1`
468+
query = `SELECT COUNT(1) FROM information_schema.tables WHERE table_name = $1 AND table_schema = $2 LIMIT 1`
469469
row = p.conn.QueryRowContext(context.Background(), query, tableName, schemaName)
470470
} else {
471-
query := `SELECT COUNT(1) FROM information_schema.tables WHERE table_name = $1 AND table_schema = (SELECT current_schema()) LIMIT 1`
471+
query = `SELECT COUNT(1) FROM information_schema.tables WHERE table_name = $1 AND table_schema = (SELECT current_schema()) LIMIT 1`
472472
row = p.conn.QueryRowContext(context.Background(), query, tableName)
473473
}
474474

0 commit comments

Comments
 (0)