Skip to content

Commit

Permalink
Remove hard coded role and db name from init db migration (#358)
Browse files Browse the repository at this point in the history
## Description

The initial database migration currently has a hard coded database name and role.  This change removes both.

## Why is this needed

This prevents us from deploying tink against a database that happens to utilize a different role or db name.
## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
  • Loading branch information
mergify[bot] authored Nov 6, 2020
2 parents a94738e + 5d2ea7a commit 384fe30
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 0 additions & 3 deletions db/migration/202009171251-init-database.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ func Get202009171251() *migrate.Migration {
return &migrate.Migration{
Id: "202009171251-init-database",
Up: []string{`
SET ROLE tinkerbell;
SELECT 'CREATE DATABASE tinkerbell' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'tinkerbell');
CREATE TABLE IF NOT EXISTS hardware (
id UUID UNIQUE
, inserted_at TIMESTAMPTZ
Expand Down
1 change: 1 addition & 0 deletions deploy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ services:
environment:
POSTGRES_PASSWORD: tinkerbell
POSTGRES_USER: tinkerbell
POSTGRES_DB: tinkerbell
volumes:
- postgres_data:/var/lib/postgresql/data:rw
ports:
Expand Down

0 comments on commit 384fe30

Please sign in to comment.