Skip to content

Commit 3f6c448

Browse files
authored
Allow changing db schema from public (#4873)
* Remove public schema from enum defs * Update queries * Fix
1 parent 104d660 commit 3f6c448

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

coderd/database/dump.sql

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/gen/dump/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ func main() {
6363
// Remove all comments.
6464
"/^--/d",
6565
// Public is implicit in the schema.
66-
"s/ public\\./ /",
66+
"s/ public\\./ /g",
67+
"s/::public\\./::/g",
68+
"s/'public\\./'/g",
6769
// Remove database settings.
6870
"s/SET .* = .*;//g",
6971
// Remove select statements. These aren't useful

coderd/database/queries.sql.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/users.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ SELECT
3737
FROM
3838
users
3939
WHERE
40-
status = 'active'::public.user_status AND deleted = false;
40+
status = 'active'::user_status AND deleted = false;
4141

4242
-- name: InsertUser :one
4343
INSERT INTO

0 commit comments

Comments
 (0)