forked from windmill-labs/windmill
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(backend): apps backend v0 (windmill-labs#888)
* progress * post merge * progress * fix * fix * fix * fix * v1 * fix openapi
- Loading branch information
1 parent
df11f50
commit 2d9e990
Showing
9 changed files
with
857 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- Add down migration script here | ||
DROP TABLE app; | ||
DROP TABLE app_version; | ||
DROP TYPE EXECUTION_MODE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
-- Add up migration script here | ||
CREATE TABLE app ( | ||
id BIGSERIAL PRIMARY KEY, | ||
workspace_id VARCHAR(50) NOT NULL REFERENCES workspace(id), | ||
path varchar(255) NOT NULL, | ||
summary VARCHAR(1000) NOT NULL DEFAULT '', | ||
policy JSONB NOT NULL, | ||
versions BIGINT[] NOT NULL, | ||
extra_perms JSONB NOT NULL DEFAULT '{}' | ||
); | ||
|
||
CREATE TABLE app_version( | ||
id BIGSERIAL PRIMARY KEY, | ||
flow_id BIGINT NOT NULL, | ||
value JSONB NOT NULL, | ||
created_by VARCHAR(50) NOT NULL, | ||
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), | ||
FOREIGN KEY (flow_id) REFERENCES app(id) ON DELETE CASCADE | ||
); | ||
|
||
CREATE POLICY see_own ON app FOR ALL | ||
USING (SPLIT_PART(app.path, '/', 1) = 'u' AND SPLIT_PART(app.path, '/', 2) = current_setting('session.user')); | ||
|
||
CREATE POLICY see_member ON app FOR ALL | ||
USING (SPLIT_PART(app.path, '/', 1) = 'g' AND SPLIT_PART(app.path, '/', 2) = any(regexp_split_to_array(current_setting('session.groups'), ',')::text[])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.