Skip to content

Commit

Permalink
made the tables editable in the pqadmin webview
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasB-NU committed Jun 5, 2024
1 parent 0df22ea commit 80531de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/database/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func InitalCheckup() {
log.Printf("Error connecting to database: %v\n", err)
return
}
db.Exec("CREATE SCHEMA showmaster;")
}

func CreateTable(table string) {
Expand All @@ -51,7 +52,8 @@ func CreateTable(table string) {

log.Printf("Creating table %s\n", table)
execSQL := fmt.Sprintf(`
CREATE TABLE IF NOT EXISTS %s (
CREATE TABLE IF NOT EXISTS showmaster.%s (
identifier SERIAL PRIMARY KEY,
id double precision,
name text,
audio text,
Expand Down
2 changes: 1 addition & 1 deletion src/database/getTables.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func GetTables() []string {
query := `
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
WHERE table_schema = 'showmaster'
`

rows, err := db.Query(query)
Expand Down

0 comments on commit 80531de

Please sign in to comment.