Skip to content

Commit

Permalink
add user extension resources schema (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
bailinhe authored Oct 20, 2023
1 parent c7f0dd4 commit b961a23
Show file tree
Hide file tree
Showing 5 changed files with 1,783 additions and 0 deletions.
22 changes: 22 additions & 0 deletions db/migrations/00036_user_extensions_resources.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE user_extension_resources (
id UUID PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(),
resource jsonb NOT NULL,

created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
deleted_at TIMESTAMPTZ NULL,

user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE,
extension_resource_definition_id UUID NOT NULL REFERENCES extension_resource_definitions(id) ON DELETE CASCADE ON UPDATE CASCADE,

INDEX (user_id, extension_resource_definition_id, deleted_at) STORING (resource, created_at, updated_at)
);

-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin
DROP TABLE user_extension_resources;
-- +goose StatementEnd
2 changes: 2 additions & 0 deletions internal/models/boil_table_names.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

192 changes: 192 additions & 0 deletions internal/models/extension_resource_definitions.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b961a23

Please sign in to comment.