File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ IMAGE := e2b-orchestration/db-migrator
77.PHONY : migrate
88migrate :
99 @echo " Applying Postgres migration *$( notdir $@ ) *"
10- POSTGRES_CONNECTION_STRING= $( POSTGRES_CONNECTION_STRING ) go run ./scripts/migrator.go
10+ @ $( goose ) up
1111 @echo " Done"
1212migrate/up : migrate
1313migrate/down :
Original file line number Diff line number Diff line change 22-- +goose StatementBegin
33CREATE SCHEMA IF NOT EXISTS auth;
44
5+ CREATE ROLE authenticated;
6+
7+ CREATE FUNCTION auth .uid() RETURNS uuid AS $func$
8+ BEGIN
9+ RETURN gen_random_uuid();
10+ END;
11+ $func$ LANGUAGE plpgsql;
12+
13+ -- Grant execute on auth.uid() to postgres role
14+ GRANT EXECUTE ON FUNCTION auth .uid () TO postgres;
15+
516CREATE TABLE auth .users (
617 id uuid NOT NULL DEFAULT gen_random_uuid(),
718 email text NOT NULL ,
You can’t perform that action at this time.
0 commit comments