Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🗃️ EAV Tables for connection strategies #341

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 74 additions & 1 deletion packages/api/scripts/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ CREATE TABLE users
id_stytch text NULL,
created_at timestamp NOT NULL DEFAULT NOW(),
modified_at timestamp NOT NULL DEFAULT NOW(),
CONSTRAINT PK_users PRIMARY KEY ( id_user )
CONSTRAINT PK_users PRIMARY KEY ( id_user ),
CONSTRAINT force_stytch_id_unique UNIQUE ( id_stytch )
);


Expand All @@ -85,6 +86,8 @@ STYTCH_B2B
STYTCH_B2C';
COMMENT ON COLUMN users.created_at IS 'DEFAULT NOW() to automatically insert a value if nothing supplied';

COMMENT ON CONSTRAINT force_stytch_id_unique ON users IS 'force unique on stytch id';




Expand Down Expand Up @@ -143,6 +146,7 @@ CREATE TABLE tcg_collections
name text NULL,
description text NULL,
remote_id text NULL,
remote_platform text NULL,
collection_type text NULL,
parent_collection uuid NULL,
created_at timestamp NOT NULL,
Expand Down Expand Up @@ -219,6 +223,57 @@ COMMENT ON COLUMN entity.ressource_owner_id IS 'uuid of the ressource owner - ca



-- ************************************** cs_values

CREATE TABLE cs_values
(
id_cs_value uuid NOT NULL,
value text NOT NULL,
id_ct_attribute uuid NOT NULL

);








-- ************************************** cs_entities

CREATE TABLE cs_entities
(
id_cs_entity uuid NOT NULL,
id_connection_strategy uuid NOT NULL

);








-- ************************************** cs_attributes

CREATE TABLE cs_attributes
(
id_cs_attribute uuid NOT NULL,
id_cs_entity uuid NOT NULL,
attribute_slug text NOT NULL,
data_type text NOT NULL

);








-- ************************************** crm_users

CREATE TABLE crm_users
Expand Down Expand Up @@ -262,6 +317,24 @@ CREATE TABLE crm_deals_stages



-- ************************************** connection_strategies

CREATE TABLE connection_strategies
(
id_connection_strategy uuid NOT NULL,
type text NOT NULL,
id_project uuid NULL

);



COMMENT ON COLUMN connection_strategies.type IS 'OAUTH2, API_KEY, PIPEDRIVE_CLOUD_OAUTH, PIPEDRIVE_CLOUD_API, HUBSPOT_CLOUD';





-- ************************************** tcg_tickets

CREATE TABLE tcg_tickets
Expand Down
Loading