diff --git a/packages/twenty-docker/twenty-postgres-spilo/Dockerfile b/packages/twenty-docker/twenty-postgres-spilo/Dockerfile index 21e107c47..a87a8a97e 100644 --- a/packages/twenty-docker/twenty-postgres-spilo/Dockerfile +++ b/packages/twenty-docker/twenty-postgres-spilo/Dockerfile @@ -1,6 +1,5 @@ ARG POSTGRES_VERSION=15 ARG SPILO_VERSION=3.2-p1 -ARG PG_GRAPHQL_VERSION=1.5.6 ARG WRAPPERS_VERSION=0.2.0 # Build the mysql_fdw extension @@ -38,10 +37,9 @@ WORKDIR /build/openssl RUN ./config && make && make install -# Extend the Spilo image with the pg_graphql and mysql_fdw extensions +# Extend the Spilo image with the mysql_fdw extensions FROM ghcr.io/zalando/spilo-${POSTGRES_VERSION}:${SPILO_VERSION} ARG POSTGRES_VERSION -ARG PG_GRAPHQL_VERSION ARG WRAPPERS_VERSION ARG TARGETARCH @@ -63,14 +61,6 @@ RUN curl -L "https://github.com/supabase/wrappers/releases/download/v${WRAPPERS_ COPY --from=build-libssl /usr/local/lib/libssl* /usr/local/lib/libcrypto* /usr/lib/ COPY --from=build-libssl /usr/local/lib/engines-1.1 /usr/lib/engines-1.1 -# Copy pg_graphql -COPY ./packages/twenty-postgres/linux/${TARGETARCH}/${POSTGRES_VERSION}/pg_graphql/${PG_GRAPHQL_VERSION}/pg_graphql--${PG_GRAPHQL_VERSION}.sql \ - /usr/share/postgresql/${POSTGRES_VERSION}/extension -COPY ./packages/twenty-postgres/linux/${TARGETARCH}/${POSTGRES_VERSION}/pg_graphql/${PG_GRAPHQL_VERSION}/pg_graphql.control \ - /usr/share/postgresql/${POSTGRES_VERSION}/extension -COPY ./packages/twenty-postgres/linux/${TARGETARCH}/${POSTGRES_VERSION}/pg_graphql/${PG_GRAPHQL_VERSION}/pg_graphql.so \ - /usr/lib/postgresql/${POSTGRES_VERSION}/lib/pg_graphql.so - # Copy mysql_fdw COPY --from=build-mysql_fdw /mysql_fdw/mysql_fdw.so \ /usr/lib/postgresql/${POSTGRES_VERSION}/lib/mysql_fdw.so diff --git a/packages/twenty-docker/twenty-postgres/Dockerfile b/packages/twenty-docker/twenty-postgres/Dockerfile index 5647a6cd3..9c9b96398 100644 --- a/packages/twenty-docker/twenty-postgres/Dockerfile +++ b/packages/twenty-docker/twenty-postgres/Dockerfile @@ -3,7 +3,6 @@ ARG IMAGE_TAG='15.5.0-debian-11-r15' FROM bitnami/postgresql:${IMAGE_TAG} ARG PG_MAIN_VERSION=15 -ARG PG_GRAPHQL_VERSION=1.5.6 ARG WRAPPERS_VERSION=0.2.0 ARG TARGETARCH @@ -26,14 +25,6 @@ RUN set -eux; \ RUN apt update && apt install build-essential git curl default-libmysqlclient-dev -y -# Install precompiled pg_graphql extensions -COPY ./packages/twenty-postgres/linux/${TARGETARCH}/${PG_MAIN_VERSION}/pg_graphql/${PG_GRAPHQL_VERSION}/pg_graphql--${PG_GRAPHQL_VERSION}.sql \ - /opt/bitnami/postgresql/share/extension/ -COPY ./packages/twenty-postgres/linux/${TARGETARCH}/${PG_MAIN_VERSION}/pg_graphql/${PG_GRAPHQL_VERSION}/pg_graphql.control \ - /opt/bitnami/postgresql/share/extension/ -COPY ./packages/twenty-postgres/linux/${TARGETARCH}/${PG_MAIN_VERSION}/pg_graphql/${PG_GRAPHQL_VERSION}/pg_graphql.so \ - /opt/bitnami/postgresql/lib/ - # Install precompiled supabase wrappers extensions RUN curl -L "https://github.com/supabase/wrappers/releases/download/v${WRAPPERS_VERSION}/wrappers-v${WRAPPERS_VERSION}-pg${PG_MAIN_VERSION}-${TARGETARCH}-linux-gnu.deb" -o wrappers.deb RUN dpkg --install wrappers.deb diff --git a/packages/twenty-postgres/Makefile b/packages/twenty-postgres/Makefile deleted file mode 100644 index 9e56adb19..000000000 --- a/packages/twenty-postgres/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -provision-on-docker: - @docker compose -f docker/docker-compose.yml up - -provision-on-macos-arm: - sh ./macos/arm/provision-postgres-macos-arm.sh - -provision-on-macos-intel: - sh ./macos/intel/provision-postgres-macos-intel.sh - -provision-on-linux: - sh ./linux/provision-postgres-linux.sh - diff --git a/packages/twenty-postgres/docker/docker-compose.yml b/packages/twenty-postgres/docker/docker-compose.yml deleted file mode 100644 index 8db2c32d4..000000000 --- a/packages/twenty-postgres/docker/docker-compose.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: "3.9" -services: - postgres: - container_name: twenty_postgres - image: twentycrm/twenty-postgres:latest - volumes: - - twenty_db_data:/var/lib/postgresql/data - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - - POSTGRES_DB=default - ports: - - "5432:5432" -volumes: - twenty_db_data: - name: twenty_db_data - diff --git a/packages/twenty-postgres/init.sql b/packages/twenty-postgres/init.sql deleted file mode 100644 index 16a4788af..000000000 --- a/packages/twenty-postgres/init.sql +++ /dev/null @@ -1,4 +0,0 @@ -CREATE DATABASE "default"; -CREATE DATABASE "test"; -CREATE USER twenty PASSWORD 'twenty'; -ALTER ROLE twenty superuser; diff --git a/packages/twenty-postgres/linux/Dockerfile b/packages/twenty-postgres/linux/Dockerfile deleted file mode 100644 index 871f87dff..000000000 --- a/packages/twenty-postgres/linux/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -ARG IMAGE_TAG='15.5.0-debian-11-r15' - -FROM bitnami/postgresql:${IMAGE_TAG} - -ARG PG_MAIN_VERSION=15 -ARG PG_GRAPHQL_VERSION=1.5.6 -ARG WRAPPERS_VERSION=0.2.0 -ARG TARGETARCH - -USER root - -CMD ["tail", "-f", "/dev/null"] diff --git a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.4.2/pg_graphql--1.4.2.sql b/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.4.2/pg_graphql--1.4.2.sql deleted file mode 100644 index 60aa38168..000000000 --- a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.4.2/pg_graphql--1.4.2.sql +++ /dev/null @@ -1,116 +0,0 @@ -/* -This file is auto generated by pgrx. - -The ordering of items is not stable, it is driven by a dependency graph. -*/ - --- src/lib.rs:26 --- pg_graphql::_internal_resolve -CREATE FUNCTION graphql."_internal_resolve"( - "query" TEXT, /* &str */ - "variables" jsonb DEFAULT '{}', /* core::option::Option */ - "operationName" TEXT DEFAULT null, /* core::option::Option */ - "extensions" jsonb DEFAULT null /* core::option::Option */ -) RETURNS jsonb /* pgrx::datum::json::JsonB */ - -LANGUAGE c /* Rust */ -AS 'MODULE_PATHNAME', 'resolve_wrapper'; - --- src/lib.rs:21 -create or replace function graphql.exception(message text) - returns text - language plpgsql -as $$ -begin - raise exception using errcode='22000', message=message; -end; -$$; - - --- src/lib.rs:19 --- Is updated every time the schema changes -create sequence if not exists graphql.seq_schema_version as int cycle; - -create or replace function graphql.increment_schema_version() - returns event_trigger - security definer - language plpgsql -as $$ -begin - perform nextval('graphql.seq_schema_version'); -end; -$$; - -create or replace function graphql.get_schema_version() - returns int - security definer - language sql -as $$ - select last_value from graphql.seq_schema_version; -$$; - --- On DDL event, increment the schema version number -create event trigger graphql_watch_ddl - on ddl_command_end - execute procedure graphql.increment_schema_version(); - -create event trigger graphql_watch_drop - on sql_drop - execute procedure graphql.increment_schema_version(); - - --- src/lib.rs:22 --- requires: --- resolve - -create or replace function graphql.resolve( - "query" text, - "variables" jsonb default '{}', - "operationName" text default null, - "extensions" jsonb default null -) - returns jsonb - language plpgsql -as $$ -declare - res jsonb; - message_text text; -begin - begin - select graphql._internal_resolve("query" := "query", - "variables" := "variables", - "operationName" := "operationName", - "extensions" := "extensions") into res; - return res; - exception - when others then - get stacked diagnostics message_text = message_text; - return - jsonb_build_object('data', null, - 'errors', jsonb_build_array(jsonb_build_object('message', message_text))); - end; -end; -$$; - - --- src/lib.rs:20 -create function graphql.comment_directive(comment_ text) - returns jsonb - language sql - immutable -as $$ - /* - comment on column public.account.name is '@graphql.name: myField' - */ - select - coalesce( - ( - regexp_match( - comment_, - '@graphql\((.+?)\)' - ) - )[1]::jsonb, - jsonb_build_object() - ) -$$; - diff --git a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.4.2/pg_graphql.control b/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.4.2/pg_graphql.control deleted file mode 100644 index 94f95b90b..000000000 --- a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.4.2/pg_graphql.control +++ /dev/null @@ -1,6 +0,0 @@ -comment = 'pg_graphql: GraphQL support' -default_version = '1.4.2' -module_pathname = '$libdir/pg_graphql' -relocatable = false -superuser = true -schema = 'graphql' diff --git a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.4.2/pg_graphql.so b/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.4.2/pg_graphql.so deleted file mode 100755 index e5ae0c98e..000000000 Binary files a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.4.2/pg_graphql.so and /dev/null differ diff --git a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.1/pg_graphql--1.5.1.sql b/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.1/pg_graphql--1.5.1.sql deleted file mode 100644 index 915d4c190..000000000 --- a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.1/pg_graphql--1.5.1.sql +++ /dev/null @@ -1,116 +0,0 @@ -/* -This file is auto generated by pgrx. - -The ordering of items is not stable, it is driven by a dependency graph. -*/ - --- src/lib.rs:27 --- pg_graphql::_internal_resolve -CREATE FUNCTION graphql."_internal_resolve"( - "query" TEXT, /* &str */ - "variables" jsonb DEFAULT '{}', /* core::option::Option */ - "operationName" TEXT DEFAULT null, /* core::option::Option */ - "extensions" jsonb DEFAULT null /* core::option::Option */ -) RETURNS jsonb /* pgrx::datum::json::JsonB */ - -LANGUAGE c /* Rust */ -AS 'MODULE_PATHNAME', 'resolve_wrapper'; - --- src/lib.rs:23 --- requires: --- resolve - -create or replace function graphql.resolve( - "query" text, - "variables" jsonb default '{}', - "operationName" text default null, - "extensions" jsonb default null -) - returns jsonb - language plpgsql -as $$ -declare - res jsonb; - message_text text; -begin - begin - select graphql._internal_resolve("query" := "query", - "variables" := "variables", - "operationName" := "operationName", - "extensions" := "extensions") into res; - return res; - exception - when others then - get stacked diagnostics message_text = message_text; - return - jsonb_build_object('data', null, - 'errors', jsonb_build_array(jsonb_build_object('message', message_text))); - end; -end; -$$; - - --- src/lib.rs:22 -create or replace function graphql.exception(message text) - returns text - language plpgsql -as $$ -begin - raise exception using errcode='22000', message=message; -end; -$$; - - --- src/lib.rs:20 --- Is updated every time the schema changes -create sequence if not exists graphql.seq_schema_version as int cycle; - -create or replace function graphql.increment_schema_version() - returns event_trigger - security definer - language plpgsql -as $$ -begin - perform nextval('graphql.seq_schema_version'); -end; -$$; - -create or replace function graphql.get_schema_version() - returns int - security definer - language sql -as $$ - select last_value from graphql.seq_schema_version; -$$; - --- On DDL event, increment the schema version number -create event trigger graphql_watch_ddl - on ddl_command_end - execute procedure graphql.increment_schema_version(); - -create event trigger graphql_watch_drop - on sql_drop - execute procedure graphql.increment_schema_version(); - - --- src/lib.rs:21 -create function graphql.comment_directive(comment_ text) - returns jsonb - language sql - immutable -as $$ - /* - comment on column public.account.name is '@graphql.name: myField' - */ - select - coalesce( - ( - regexp_match( - comment_, - '@graphql\((.+?)\)' - ) - )[1]::jsonb, - jsonb_build_object() - ) -$$; - diff --git a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.1/pg_graphql.control b/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.1/pg_graphql.control deleted file mode 100644 index 172c6f114..000000000 --- a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.1/pg_graphql.control +++ /dev/null @@ -1,6 +0,0 @@ -comment = 'pg_graphql: GraphQL support' -default_version = '1.5.1' -module_pathname = '$libdir/pg_graphql' -relocatable = false -superuser = true -schema = 'graphql' diff --git a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.1/pg_graphql.so b/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.1/pg_graphql.so deleted file mode 100755 index 458e9ae82..000000000 Binary files a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.1/pg_graphql.so and /dev/null differ diff --git a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.6/pg_graphql--1.5.6.sql b/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.6/pg_graphql--1.5.6.sql deleted file mode 100644 index b5489e7cd..000000000 --- a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.6/pg_graphql--1.5.6.sql +++ /dev/null @@ -1,116 +0,0 @@ -/* -This file is auto generated by pgrx. - -The ordering of items is not stable, it is driven by a dependency graph. -*/ - --- src/lib.rs:27 --- pg_graphql::_internal_resolve -CREATE FUNCTION graphql."_internal_resolve"( - "query" TEXT, /* &str */ - "variables" jsonb DEFAULT '{}', /* core::option::Option */ - "operationName" TEXT DEFAULT null, /* core::option::Option */ - "extensions" jsonb DEFAULT null /* core::option::Option */ -) RETURNS jsonb /* pgrx::datum::json::JsonB */ - -LANGUAGE c /* Rust */ -AS 'MODULE_PATHNAME', 'resolve_wrapper'; - --- src/lib.rs:22 -create or replace function graphql.exception(message text) - returns text - language plpgsql -as $$ -begin - raise exception using errcode='22000', message=message; -end; -$$; - - --- src/lib.rs:23 --- requires: --- resolve - -create or replace function graphql.resolve( - "query" text, - "variables" jsonb default '{}', - "operationName" text default null, - "extensions" jsonb default null -) - returns jsonb - language plpgsql -as $$ -declare - res jsonb; - message_text text; -begin - begin - select graphql._internal_resolve("query" := "query", - "variables" := "variables", - "operationName" := "operationName", - "extensions" := "extensions") into res; - return res; - exception - when others then - get stacked diagnostics message_text = message_text; - return - jsonb_build_object('data', null, - 'errors', jsonb_build_array(jsonb_build_object('message', message_text))); - end; -end; -$$; - - --- src/lib.rs:21 -create function graphql.comment_directive(comment_ text) - returns jsonb - language sql - immutable -as $$ - /* - comment on column public.account.name is '@graphql.name: myField' - */ - select - coalesce( - ( - regexp_match( - comment_, - '@graphql\((.+?)\)' - ) - )[1]::jsonb, - jsonb_build_object() - ) -$$; - - --- src/lib.rs:20 --- Is updated every time the schema changes -create sequence if not exists graphql.seq_schema_version as int cycle; - -create or replace function graphql.increment_schema_version() - returns event_trigger - security definer - language plpgsql -as $$ -begin - perform nextval('graphql.seq_schema_version'); -end; -$$; - -create or replace function graphql.get_schema_version() - returns int - security definer - language sql -as $$ - select last_value from graphql.seq_schema_version; -$$; - --- On DDL event, increment the schema version number -create event trigger graphql_watch_ddl - on ddl_command_end - execute procedure graphql.increment_schema_version(); - -create event trigger graphql_watch_drop - on sql_drop - execute procedure graphql.increment_schema_version(); - diff --git a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.6/pg_graphql.control b/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.6/pg_graphql.control deleted file mode 100644 index 56c20ea62..000000000 --- a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.6/pg_graphql.control +++ /dev/null @@ -1,6 +0,0 @@ -comment = 'pg_graphql: GraphQL support' -default_version = '1.5.6' -module_pathname = '$libdir/pg_graphql' -relocatable = false -superuser = true -schema = 'graphql' diff --git a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.6/pg_graphql.so b/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.6/pg_graphql.so deleted file mode 100755 index 9d1667369..000000000 Binary files a/packages/twenty-postgres/linux/amd64/15/pg_graphql/1.5.6/pg_graphql.so and /dev/null differ diff --git a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.4.2/pg_graphql--1.4.2.sql b/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.4.2/pg_graphql--1.4.2.sql deleted file mode 100644 index 7a238a08c..000000000 --- a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.4.2/pg_graphql--1.4.2.sql +++ /dev/null @@ -1,116 +0,0 @@ -/* -This file is auto generated by pgrx. - -The ordering of items is not stable, it is driven by a dependency graph. -*/ - --- src/lib.rs:26 --- pg_graphql::_internal_resolve -CREATE FUNCTION graphql."_internal_resolve"( - "query" TEXT, /* &str */ - "variables" jsonb DEFAULT '{}', /* core::option::Option */ - "operationName" TEXT DEFAULT null, /* core::option::Option */ - "extensions" jsonb DEFAULT null /* core::option::Option */ -) RETURNS jsonb /* pgrx::datum::json::JsonB */ - -LANGUAGE c /* Rust */ -AS 'MODULE_PATHNAME', 'resolve_wrapper'; - --- src/lib.rs:19 --- Is updated every time the schema changes -create sequence if not exists graphql.seq_schema_version as int cycle; - -create or replace function graphql.increment_schema_version() - returns event_trigger - security definer - language plpgsql -as $$ -begin - perform nextval('graphql.seq_schema_version'); -end; -$$; - -create or replace function graphql.get_schema_version() - returns int - security definer - language sql -as $$ - select last_value from graphql.seq_schema_version; -$$; - --- On DDL event, increment the schema version number -create event trigger graphql_watch_ddl - on ddl_command_end - execute procedure graphql.increment_schema_version(); - -create event trigger graphql_watch_drop - on sql_drop - execute procedure graphql.increment_schema_version(); - - --- src/lib.rs:22 --- requires: --- resolve - -create or replace function graphql.resolve( - "query" text, - "variables" jsonb default '{}', - "operationName" text default null, - "extensions" jsonb default null -) - returns jsonb - language plpgsql -as $$ -declare - res jsonb; - message_text text; -begin - begin - select graphql._internal_resolve("query" := "query", - "variables" := "variables", - "operationName" := "operationName", - "extensions" := "extensions") into res; - return res; - exception - when others then - get stacked diagnostics message_text = message_text; - return - jsonb_build_object('data', null, - 'errors', jsonb_build_array(jsonb_build_object('message', message_text))); - end; -end; -$$; - - --- src/lib.rs:21 -create or replace function graphql.exception(message text) - returns text - language plpgsql -as $$ -begin - raise exception using errcode='22000', message=message; -end; -$$; - - --- src/lib.rs:20 -create function graphql.comment_directive(comment_ text) - returns jsonb - language sql - immutable -as $$ - /* - comment on column public.account.name is '@graphql.name: myField' - */ - select - coalesce( - ( - regexp_match( - comment_, - '@graphql\((.+?)\)' - ) - )[1]::jsonb, - jsonb_build_object() - ) -$$; - diff --git a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.4.2/pg_graphql.control b/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.4.2/pg_graphql.control deleted file mode 100644 index 94f95b90b..000000000 --- a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.4.2/pg_graphql.control +++ /dev/null @@ -1,6 +0,0 @@ -comment = 'pg_graphql: GraphQL support' -default_version = '1.4.2' -module_pathname = '$libdir/pg_graphql' -relocatable = false -superuser = true -schema = 'graphql' diff --git a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.4.2/pg_graphql.so b/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.4.2/pg_graphql.so deleted file mode 100755 index 859ca348d..000000000 Binary files a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.4.2/pg_graphql.so and /dev/null differ diff --git a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.1/pg_graphql--1.5.1.sql b/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.1/pg_graphql--1.5.1.sql deleted file mode 100644 index 05ad736a3..000000000 --- a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.1/pg_graphql--1.5.1.sql +++ /dev/null @@ -1,116 +0,0 @@ -/* -This file is auto generated by pgrx. - -The ordering of items is not stable, it is driven by a dependency graph. -*/ - --- src/lib.rs:27 --- pg_graphql::_internal_resolve -CREATE FUNCTION graphql."_internal_resolve"( - "query" TEXT, /* &str */ - "variables" jsonb DEFAULT '{}', /* core::option::Option */ - "operationName" TEXT DEFAULT null, /* core::option::Option */ - "extensions" jsonb DEFAULT null /* core::option::Option */ -) RETURNS jsonb /* pgrx::datum::json::JsonB */ - -LANGUAGE c /* Rust */ -AS 'MODULE_PATHNAME', 'resolve_wrapper'; - --- src/lib.rs:21 -create function graphql.comment_directive(comment_ text) - returns jsonb - language sql - immutable -as $$ - /* - comment on column public.account.name is '@graphql.name: myField' - */ - select - coalesce( - ( - regexp_match( - comment_, - '@graphql\((.+?)\)' - ) - )[1]::jsonb, - jsonb_build_object() - ) -$$; - - --- src/lib.rs:20 --- Is updated every time the schema changes -create sequence if not exists graphql.seq_schema_version as int cycle; - -create or replace function graphql.increment_schema_version() - returns event_trigger - security definer - language plpgsql -as $$ -begin - perform nextval('graphql.seq_schema_version'); -end; -$$; - -create or replace function graphql.get_schema_version() - returns int - security definer - language sql -as $$ - select last_value from graphql.seq_schema_version; -$$; - --- On DDL event, increment the schema version number -create event trigger graphql_watch_ddl - on ddl_command_end - execute procedure graphql.increment_schema_version(); - -create event trigger graphql_watch_drop - on sql_drop - execute procedure graphql.increment_schema_version(); - - --- src/lib.rs:22 -create or replace function graphql.exception(message text) - returns text - language plpgsql -as $$ -begin - raise exception using errcode='22000', message=message; -end; -$$; - - --- src/lib.rs:23 --- requires: --- resolve - -create or replace function graphql.resolve( - "query" text, - "variables" jsonb default '{}', - "operationName" text default null, - "extensions" jsonb default null -) - returns jsonb - language plpgsql -as $$ -declare - res jsonb; - message_text text; -begin - begin - select graphql._internal_resolve("query" := "query", - "variables" := "variables", - "operationName" := "operationName", - "extensions" := "extensions") into res; - return res; - exception - when others then - get stacked diagnostics message_text = message_text; - return - jsonb_build_object('data', null, - 'errors', jsonb_build_array(jsonb_build_object('message', message_text))); - end; -end; -$$; - diff --git a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.1/pg_graphql.control b/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.1/pg_graphql.control deleted file mode 100644 index 172c6f114..000000000 --- a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.1/pg_graphql.control +++ /dev/null @@ -1,6 +0,0 @@ -comment = 'pg_graphql: GraphQL support' -default_version = '1.5.1' -module_pathname = '$libdir/pg_graphql' -relocatable = false -superuser = true -schema = 'graphql' diff --git a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.1/pg_graphql.so b/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.1/pg_graphql.so deleted file mode 100755 index c655afcf7..000000000 Binary files a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.1/pg_graphql.so and /dev/null differ diff --git a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.6/pg_graphql--1.5.6.sql b/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.6/pg_graphql--1.5.6.sql deleted file mode 100644 index 35a393c22..000000000 --- a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.6/pg_graphql--1.5.6.sql +++ /dev/null @@ -1,116 +0,0 @@ -/* -This file is auto generated by pgrx. - -The ordering of items is not stable, it is driven by a dependency graph. -*/ - --- src/lib.rs:27 --- pg_graphql::_internal_resolve -CREATE FUNCTION graphql."_internal_resolve"( - "query" TEXT, /* &str */ - "variables" jsonb DEFAULT '{}', /* core::option::Option */ - "operationName" TEXT DEFAULT null, /* core::option::Option */ - "extensions" jsonb DEFAULT null /* core::option::Option */ -) RETURNS jsonb /* pgrx::datum::json::JsonB */ - -LANGUAGE c /* Rust */ -AS 'MODULE_PATHNAME', 'resolve_wrapper'; - --- src/lib.rs:21 -create function graphql.comment_directive(comment_ text) - returns jsonb - language sql - immutable -as $$ - /* - comment on column public.account.name is '@graphql.name: myField' - */ - select - coalesce( - ( - regexp_match( - comment_, - '@graphql\((.+?)\)' - ) - )[1]::jsonb, - jsonb_build_object() - ) -$$; - - --- src/lib.rs:22 -create or replace function graphql.exception(message text) - returns text - language plpgsql -as $$ -begin - raise exception using errcode='22000', message=message; -end; -$$; - - --- src/lib.rs:20 --- Is updated every time the schema changes -create sequence if not exists graphql.seq_schema_version as int cycle; - -create or replace function graphql.increment_schema_version() - returns event_trigger - security definer - language plpgsql -as $$ -begin - perform nextval('graphql.seq_schema_version'); -end; -$$; - -create or replace function graphql.get_schema_version() - returns int - security definer - language sql -as $$ - select last_value from graphql.seq_schema_version; -$$; - --- On DDL event, increment the schema version number -create event trigger graphql_watch_ddl - on ddl_command_end - execute procedure graphql.increment_schema_version(); - -create event trigger graphql_watch_drop - on sql_drop - execute procedure graphql.increment_schema_version(); - - --- src/lib.rs:23 --- requires: --- resolve - -create or replace function graphql.resolve( - "query" text, - "variables" jsonb default '{}', - "operationName" text default null, - "extensions" jsonb default null -) - returns jsonb - language plpgsql -as $$ -declare - res jsonb; - message_text text; -begin - begin - select graphql._internal_resolve("query" := "query", - "variables" := "variables", - "operationName" := "operationName", - "extensions" := "extensions") into res; - return res; - exception - when others then - get stacked diagnostics message_text = message_text; - return - jsonb_build_object('data', null, - 'errors', jsonb_build_array(jsonb_build_object('message', message_text))); - end; -end; -$$; - diff --git a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.6/pg_graphql.control b/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.6/pg_graphql.control deleted file mode 100644 index 56c20ea62..000000000 --- a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.6/pg_graphql.control +++ /dev/null @@ -1,6 +0,0 @@ -comment = 'pg_graphql: GraphQL support' -default_version = '1.5.6' -module_pathname = '$libdir/pg_graphql' -relocatable = false -superuser = true -schema = 'graphql' diff --git a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.6/pg_graphql.so b/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.6/pg_graphql.so deleted file mode 100755 index 462b79453..000000000 Binary files a/packages/twenty-postgres/linux/arm64/15/pg_graphql/1.5.6/pg_graphql.so and /dev/null differ diff --git a/packages/twenty-postgres/linux/build-postgres-linux.sh b/packages/twenty-postgres/linux/build-postgres-linux.sh deleted file mode 100755 index 4b6e3b218..000000000 --- a/packages/twenty-postgres/linux/build-postgres-linux.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash - -# Colors -RED=31 -GREEN=32 -BLUE=34 - -# Function to display colored output -echo_header () { - COLOR=$1 - MESSAGE=$2 - echo "\e[${COLOR}m\n=======================================================\e[0m" - echo "\e[${COLOR}m${MESSAGE}\e[0m" - echo "\e[${COLOR}m=======================================================\e[0m" -} - -# Function to handle errors -handle_error () { - echo_header $RED "Error: $1" - exit 1 -} - -cat << "EOF" -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@#*+=================@@@@@%*+=========++*%@@@@@@@ -@@@@#- .+@@%=. .+@@@@@ -@@@- .*@@%- .#@@@ -@@= .=+++++++++++*#@@@= -++++++++++- %@@ -@@. %@@@@@@@@@@@@@@@+ =%@@@@@@@@@@@@= +@@ -@@. .@@@@@@@@@@@@@@+. -%@@@@@@@@@@@@@@+ +@@ -@@. .@@@@@@@@@@@@*. -#@@#:=@@@@@@@@@@@= +@@ -@@ @@@@@@@@@@#: :#@@#: -@@@@@@@@@@@= +@@ -@@#====#@@@@@@@@#- .*@@@= -@@@@@@@@@@@= +@@ -@@@@@@@@@@@@@@%- .*@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@@@@@@%= +@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@@@@@+ =@@@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@@@+. -%@@@@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@*. -%@@@@@@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@#: :#@@@@@@@@@@@@@# -@@@@@@@@@@@+ +@@ -@@@#: :#@@@@@@@@@@@@@@@# :@@@@@@@@@@@= +@@ -@@= :+*+++++++++++*%@@@. :+++++++++- %@@ -@@ :@@@%. .#@@@ -@@- :@@@@@+: .+@@@@@ -@@@#+===================+%@@@@@@@%*++=======++*%@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -EOF - -echo_header $BLUE " DATABASE SETUP" - -PG_MAIN_VERSION=15 -PG_GRAPHQL_VERSION=1.5.6 -CARGO_PGRX_VERSION=0.11.2 -TARGETARCH=$(dpkg --print-architecture) - -# Install PostgresSQL -echo_header $GREEN "Step [1/4]: Installing PostgreSQL..." -apt update -y || handle_error "Failed to update package list." -apt install -y curl || handle_error "Failed to install curl." -apt install -y sudo || handle_error "Failed to install sudo." -apt install build-essential -y || handle_error "Failed to install build-essential." -apt install pkg-config -y || handle_error "Failed to install pkg-config." -apt install libssl-dev -y || handle_error "Failed to install libssl-dev." -apt install libreadline-dev -y || handle_error "Failed to install libreadline-dev." -apt install zlib1g-dev -y || handle_error "Failed to install zlib1g-dev." -apt install unzip -y || handle_error "Failed to install unzip." -apt install libclang-dev -y || handle_error "Failed to install libclang-dev." - -# Install pg_graphql extensions -current_directory=$(pwd) -script_directory="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" - -existing_rust_path=$(which rustc) -if [ -n "$existing_rust_path" ]; then - echo "Uninstalling existing Rust installation..." - rm -rf "$existing_rust_path" -fi - -# To force a reinstall of cargo-pgrx, pass --force to the command below -curl https://sh.rustup.rs -sSf | sh -source "$HOME/.cargo/env" || . "$HOME/.cargo/env" -cargo install --locked cargo-pgrx@$CARGO_PGRX_VERSION --force || handle_error "Failed to install cargo" -cargo pgrx init --pg$PG_MAIN_VERSION download || handle_error "Failed to init postgresql" - -# Create a temporary directory -temp_dir=$(mktemp -d) -cd "$temp_dir" - -curl -LJO https://github.com/supabase/pg_graphql/archive/refs/tags/v$PG_GRAPHQL_VERSION.zip || handle_error "Failed to download pg_graphql package." - -unzip pg_graphql-$PG_GRAPHQL_VERSION.zip - -cd "pg_graphql-$PG_GRAPHQL_VERSION" - -# Apply patches to pg_graphql files -echo "Applying patches to pg_graphql files..." -for patch_file in "/twenty/patches/pg_graphql/"*.patch; do - echo "Applying patch: $patch_file" - patch -p1 < "$patch_file" -done - -echo_header $GREEN "Step [2/4]: Building PostgreSQL service..." -cargo pgrx install --release --pg-config /opt/bitnami/postgresql/bin/pg_config || handle_error "Failed to build postgresql" - - -# Clean up the temporary directory -echo "Cleaning up..." -cd "$current_directory" -rm -rf "$temp_dir" - -# Start postgresql service -echo_header $GREEN "Step [3/4]: Starting PostgreSQL service..." -if sudo service postgresql start; then - echo "PostgreSQL service started successfully." -else - handle_error "Failed to start PostgreSQL service." -fi - -# Run the init.sql to setup database -echo_header $GREEN "Step [4/4]: Setting up database..." -cp ./init.sql /tmp/init.sql -sudo -u postgres psql -f /tmp/init.sql || handle_error "Failed to execute init.sql script." diff --git a/packages/twenty-postgres/linux/build_postgres.md b/packages/twenty-postgres/linux/build_postgres.md deleted file mode 100644 index b727e05fd..000000000 --- a/packages/twenty-postgres/linux/build_postgres.md +++ /dev/null @@ -1,24 +0,0 @@ - -This doc explains how to build postgresql for Twenty - -Build .control, .so and .pg_graphql--version.sql -``` -docker buildx create --name mybuilder -docker buildx use mybuilder -``` - -Do the same for in ['amd64', 'arm64'] ('amd64' builds faster) -``` -cd packages/twenty-postgres -docker buildx build --platform linux/ --load -t twenty-bitnami-postgres- linux -docker run --name twenty-bitnami- -v ~/Desktop/twenty/packages/twenty-postgres:/twenty -``` - -In another terminal -``` -docker exec -it sh -sh twenty/linux/build-postgres-linux.sh -cp opt/bitnami/postgresql/lib/pg_graphql.so twenty/linux//15/pg_graphql/ -cp opt/bitnami/postgresql/share/extension/pg_graphql.control twenty/linux//15/pg_graphql/ -cp opt/bitnami/postgresql/share/extension/pg_graphql--.sql twenty/linux//15/pg_graphql/ -``` diff --git a/packages/twenty-postgres/linux/provision-postgres-linux.sh b/packages/twenty-postgres/linux/provision-postgres-linux.sh deleted file mode 100755 index 84f047a72..000000000 --- a/packages/twenty-postgres/linux/provision-postgres-linux.sh +++ /dev/null @@ -1,125 +0,0 @@ -#!/bin/sh - -# Colors -RED=31 -GREEN=32 -BLUE=34 - -# Function to display colored output -echo_header () { - COLOR=$1 - MESSAGE=$2 - echo "\e[${COLOR}m\n=======================================================\e[0m" - echo "\e[${COLOR}m${MESSAGE}\e[0m" - echo "\e[${COLOR}m=======================================================\e[0m" -} - -# Function to handle errors -handle_error () { - echo_header $RED "Error: $1" - exit 1 -} - -read -p "This script uses sudo to install PostgreSQL, curl, and configure the system. Do you want to run this script? [y/N] " AGREEMENT - -if ! echo "$AGREEMENT" | grep -iq "^y"; then - exit 1 -fi - -cat << "EOF" -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@#*+=================@@@@@%*+=========++*%@@@@@@@ -@@@@#- .+@@%=. .+@@@@@ -@@@- .*@@%- .#@@@ -@@= .=+++++++++++*#@@@= -++++++++++- %@@ -@@. %@@@@@@@@@@@@@@@+ =%@@@@@@@@@@@@= +@@ -@@. .@@@@@@@@@@@@@@+. -%@@@@@@@@@@@@@@+ +@@ -@@. .@@@@@@@@@@@@*. -#@@#:=@@@@@@@@@@@= +@@ -@@ @@@@@@@@@@#: :#@@#: -@@@@@@@@@@@= +@@ -@@#====#@@@@@@@@#- .*@@@= -@@@@@@@@@@@= +@@ -@@@@@@@@@@@@@@%- .*@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@@@@@@%= +@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@@@@@+ =@@@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@@@+. -%@@@@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@*. -%@@@@@@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@#: :#@@@@@@@@@@@@@# -@@@@@@@@@@@+ +@@ -@@@#: :#@@@@@@@@@@@@@@@# :@@@@@@@@@@@= +@@ -@@= :+*+++++++++++*%@@@. :+++++++++- %@@ -@@ :@@@%. .#@@@ -@@- :@@@@@+: .+@@@@@ -@@@#+===================+%@@@@@@@%*++=======++*%@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -EOF - -echo_header $BLUE " DATABASE SETUP" - -PG_MAIN_VERSION=15 -PG_GRAPHQL_VERSION=1.5.6 - -if command -v dpkg &> /dev/null; then - TARGETARCH=$(dpkg --print-architecture) -else - TARGETARCH=$(uname -m) -fi - -# Detect package manager and set up PostgreSQL and curl -if command -v dpkg &> /dev/null; then - PACKAGE_MANAGER="dpkg" -elif command -v pacman &> /dev/null; then - PACKAGE_MANAGER="pacman" -else - handle_error "Unsupported package manager. This script only supports dpkg and pacman." -fi - -# Installation for Debian/Ubuntu -if [ "$PACKAGE_MANAGER" = "dpkg" ]; then - echo_header $GREEN "Step [1/4]: Installing PostgreSQL on Debian/Ubuntu..." - sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' - wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null - sudo apt update -y || handle_error "Failed to update package list." - sudo apt install -y postgresql-$PG_MAIN_VERSION postgresql-contrib-$PG_MAIN_VERSION curl || handle_error "Failed to install PostgreSQL or curl." - - echo_header $GREEN "Step [2/4]: Installing GraphQL for PostgreSQL on Debian/Ubuntu..." - curl -L https://github.com/supabase/pg_graphql/releases/download/v$PG_GRAPHQL_VERSION/pg_graphql-v$PG_GRAPHQL_VERSION-pg$PG_MAIN_VERSION-$TARGETARCH-linux-gnu.deb -o pg_graphql.deb || handle_error "Failed to download pg_graphql package." - sudo dpkg --install pg_graphql.deb || handle_error "Failed to install pg_graphql package." - rm pg_graphql.deb - - echo_header $GREEN "Step [3/4]: Starting PostgreSQL service..." - if sudo service postgresql start; then - echo "PostgreSQL service started successfully." - else - handle_error "Failed to start PostgreSQL service." - fi - -# Installation for Arch -elif [ "$PACKAGE_MANAGER" = "pacman" ]; then - echo_header $GREEN "Step [1/4]: Installing PostgreSQL on Arch..." - sudo pacman -Syu --noconfirm || handle_error "Failed to update package list." - sudo pacman -S postgresql postgresql-libs curl --noconfirm || handle_error "Failed to install PostgreSQL or curl." - - echo_header $GREEN "Step [2/4]: Installing GraphQL for PostgreSQL on Arch..." - if ! yay -S --noconfirm pg_graphql && ! paru -S --noconfirm pg_graphql; then - handle_error "Failed to install pg_graphql package from AUR." - fi - - echo_header $GREEN "Step [3/4]: Initializing and starting PostgreSQL service..." - if sudo -u postgres sh -c 'test "$(ls -A /var/lib/postgres/data 2>/dev/null)"'; then - echo "PostgreSQL data directory already contains data. Skipping initdb." - else - sudo -iu postgres initdb --locale en_US.UTF-8 -D /var/lib/postgres/data || handle_error "Failed to initialize PostgreSQL database." - fi - - if [ "$(ps -p 1 -o comm=)" = "systemd" ]; then - sudo systemctl enable postgresql - sudo systemctl start postgresql || handle_error "Failed to start PostgreSQL service." - else - sudo mkdir -p /run/postgresql - sudo chown postgres:postgres /run/postgresql - sudo -iu postgres pg_ctl -D /var/lib/postgres/data -l /var/lib/postgres/logfile start || handle_error "Failed to start PostgreSQL service." - fi -fi - -# Run the init.sql to setup database -echo_header $GREEN "Step [4/4]: Setting up database..." -cp ./init.sql /tmp/init.sql -sudo -u postgres psql -f /tmp/init.sql || handle_error "Failed to execute init.sql script." diff --git a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.4.2/pg_graphql--1.4.2.sql b/packages/twenty-postgres/macos/arm/15/pg_graphql/1.4.2/pg_graphql--1.4.2.sql deleted file mode 100644 index 7bafc8f7d..000000000 --- a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.4.2/pg_graphql--1.4.2.sql +++ /dev/null @@ -1,116 +0,0 @@ -/* -This file is auto generated by pgrx. - -The ordering of items is not stable, it is driven by a dependency graph. -*/ - --- src/lib.rs:26 --- pg_graphql::_internal_resolve -CREATE FUNCTION graphql."_internal_resolve"( - "query" TEXT, /* &str */ - "variables" jsonb DEFAULT '{}', /* core::option::Option */ - "operationName" TEXT DEFAULT null, /* core::option::Option */ - "extensions" jsonb DEFAULT null /* core::option::Option */ -) RETURNS jsonb /* pgrx::datum::json::JsonB */ - -LANGUAGE c /* Rust */ -AS 'MODULE_PATHNAME', 'resolve_wrapper'; - --- src/lib.rs:19 --- Is updated every time the schema changes -create sequence if not exists graphql.seq_schema_version as int cycle; - -create or replace function graphql.increment_schema_version() - returns event_trigger - security definer - language plpgsql -as $$ -begin - perform nextval('graphql.seq_schema_version'); -end; -$$; - -create or replace function graphql.get_schema_version() - returns int - security definer - language sql -as $$ - select last_value from graphql.seq_schema_version; -$$; - --- On DDL event, increment the schema version number -create event trigger graphql_watch_ddl - on ddl_command_end - execute procedure graphql.increment_schema_version(); - -create event trigger graphql_watch_drop - on sql_drop - execute procedure graphql.increment_schema_version(); - - --- src/lib.rs:20 -create function graphql.comment_directive(comment_ text) - returns jsonb - language sql - immutable -as $$ - /* - comment on column public.account.name is '@graphql.name: myField' - */ - select - coalesce( - ( - regexp_match( - comment_, - '@graphql\((.+?)\)' - ) - )[1]::jsonb, - jsonb_build_object() - ) -$$; - - --- src/lib.rs:22 --- requires: --- resolve - -create or replace function graphql.resolve( - "query" text, - "variables" jsonb default '{}', - "operationName" text default null, - "extensions" jsonb default null -) - returns jsonb - language plpgsql -as $$ -declare - res jsonb; - message_text text; -begin - begin - select graphql._internal_resolve("query" := "query", - "variables" := "variables", - "operationName" := "operationName", - "extensions" := "extensions") into res; - return res; - exception - when others then - get stacked diagnostics message_text = message_text; - return - jsonb_build_object('data', null, - 'errors', jsonb_build_array(jsonb_build_object('message', message_text))); - end; -end; -$$; - - --- src/lib.rs:21 -create or replace function graphql.exception(message text) - returns text - language plpgsql -as $$ -begin - raise exception using errcode='22000', message=message; -end; -$$; - diff --git a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.4.2/pg_graphql.control b/packages/twenty-postgres/macos/arm/15/pg_graphql/1.4.2/pg_graphql.control deleted file mode 100644 index 94f95b90b..000000000 --- a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.4.2/pg_graphql.control +++ /dev/null @@ -1,6 +0,0 @@ -comment = 'pg_graphql: GraphQL support' -default_version = '1.4.2' -module_pathname = '$libdir/pg_graphql' -relocatable = false -superuser = true -schema = 'graphql' diff --git a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.4.2/pg_graphql.so b/packages/twenty-postgres/macos/arm/15/pg_graphql/1.4.2/pg_graphql.so deleted file mode 100755 index a3abd0372..000000000 Binary files a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.4.2/pg_graphql.so and /dev/null differ diff --git a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.1/pg_graphql--1.5.1.sql b/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.1/pg_graphql--1.5.1.sql deleted file mode 100644 index 81b2d5c4c..000000000 --- a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.1/pg_graphql--1.5.1.sql +++ /dev/null @@ -1,116 +0,0 @@ -/* -This file is auto generated by pgrx. - -The ordering of items is not stable, it is driven by a dependency graph. -*/ - --- src/lib.rs:27 --- pg_graphql::_internal_resolve -CREATE FUNCTION graphql."_internal_resolve"( - "query" TEXT, /* &str */ - "variables" jsonb DEFAULT '{}', /* core::option::Option */ - "operationName" TEXT DEFAULT null, /* core::option::Option */ - "extensions" jsonb DEFAULT null /* core::option::Option */ -) RETURNS jsonb /* pgrx::datum::json::JsonB */ - -LANGUAGE c /* Rust */ -AS 'MODULE_PATHNAME', 'resolve_wrapper'; - --- src/lib.rs:21 -create function graphql.comment_directive(comment_ text) - returns jsonb - language sql - immutable -as $$ - /* - comment on column public.account.name is '@graphql.name: myField' - */ - select - coalesce( - ( - regexp_match( - comment_, - '@graphql\((.+?)\)' - ) - )[1]::jsonb, - jsonb_build_object() - ) -$$; - - --- src/lib.rs:22 -create or replace function graphql.exception(message text) - returns text - language plpgsql -as $$ -begin - raise exception using errcode='22000', message=message; -end; -$$; - - --- src/lib.rs:23 --- requires: --- resolve - -create or replace function graphql.resolve( - "query" text, - "variables" jsonb default '{}', - "operationName" text default null, - "extensions" jsonb default null -) - returns jsonb - language plpgsql -as $$ -declare - res jsonb; - message_text text; -begin - begin - select graphql._internal_resolve("query" := "query", - "variables" := "variables", - "operationName" := "operationName", - "extensions" := "extensions") into res; - return res; - exception - when others then - get stacked diagnostics message_text = message_text; - return - jsonb_build_object('data', null, - 'errors', jsonb_build_array(jsonb_build_object('message', message_text))); - end; -end; -$$; - - --- src/lib.rs:20 --- Is updated every time the schema changes -create sequence if not exists graphql.seq_schema_version as int cycle; - -create or replace function graphql.increment_schema_version() - returns event_trigger - security definer - language plpgsql -as $$ -begin - perform nextval('graphql.seq_schema_version'); -end; -$$; - -create or replace function graphql.get_schema_version() - returns int - security definer - language sql -as $$ - select last_value from graphql.seq_schema_version; -$$; - --- On DDL event, increment the schema version number -create event trigger graphql_watch_ddl - on ddl_command_end - execute procedure graphql.increment_schema_version(); - -create event trigger graphql_watch_drop - on sql_drop - execute procedure graphql.increment_schema_version(); - diff --git a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.1/pg_graphql.control b/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.1/pg_graphql.control deleted file mode 100644 index 172c6f114..000000000 --- a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.1/pg_graphql.control +++ /dev/null @@ -1,6 +0,0 @@ -comment = 'pg_graphql: GraphQL support' -default_version = '1.5.1' -module_pathname = '$libdir/pg_graphql' -relocatable = false -superuser = true -schema = 'graphql' diff --git a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.1/pg_graphql.so b/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.1/pg_graphql.so deleted file mode 100755 index 96ffdaf0d..000000000 Binary files a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.1/pg_graphql.so and /dev/null differ diff --git a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.6/pg_graphql--1.5.6.sql b/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.6/pg_graphql--1.5.6.sql deleted file mode 100644 index f7687883c..000000000 --- a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.6/pg_graphql--1.5.6.sql +++ /dev/null @@ -1,116 +0,0 @@ -/* -This file is auto generated by pgrx. - -The ordering of items is not stable, it is driven by a dependency graph. -*/ - --- src/lib.rs:27 --- pg_graphql::_internal_resolve -CREATE FUNCTION graphql."_internal_resolve"( - "query" TEXT, /* &str */ - "variables" jsonb DEFAULT '{}', /* core::option::Option */ - "operationName" TEXT DEFAULT null, /* core::option::Option */ - "extensions" jsonb DEFAULT null /* core::option::Option */ -) RETURNS jsonb /* pgrx::datum::json::JsonB */ - -LANGUAGE c /* Rust */ -AS 'MODULE_PATHNAME', 'resolve_wrapper'; - --- src/lib.rs:22 -create or replace function graphql.exception(message text) - returns text - language plpgsql -as $$ -begin - raise exception using errcode='22000', message=message; -end; -$$; - - --- src/lib.rs:20 --- Is updated every time the schema changes -create sequence if not exists graphql.seq_schema_version as int cycle; - -create or replace function graphql.increment_schema_version() - returns event_trigger - security definer - language plpgsql -as $$ -begin - perform nextval('graphql.seq_schema_version'); -end; -$$; - -create or replace function graphql.get_schema_version() - returns int - security definer - language sql -as $$ - select last_value from graphql.seq_schema_version; -$$; - --- On DDL event, increment the schema version number -create event trigger graphql_watch_ddl - on ddl_command_end - execute procedure graphql.increment_schema_version(); - -create event trigger graphql_watch_drop - on sql_drop - execute procedure graphql.increment_schema_version(); - - --- src/lib.rs:21 -create function graphql.comment_directive(comment_ text) - returns jsonb - language sql - immutable -as $$ - /* - comment on column public.account.name is '@graphql.name: myField' - */ - select - coalesce( - ( - regexp_match( - comment_, - '@graphql\((.+?)\)' - ) - )[1]::jsonb, - jsonb_build_object() - ) -$$; - - --- src/lib.rs:23 --- requires: --- resolve - -create or replace function graphql.resolve( - "query" text, - "variables" jsonb default '{}', - "operationName" text default null, - "extensions" jsonb default null -) - returns jsonb - language plpgsql -as $$ -declare - res jsonb; - message_text text; -begin - begin - select graphql._internal_resolve("query" := "query", - "variables" := "variables", - "operationName" := "operationName", - "extensions" := "extensions") into res; - return res; - exception - when others then - get stacked diagnostics message_text = message_text; - return - jsonb_build_object('data', null, - 'errors', jsonb_build_array(jsonb_build_object('message', message_text))); - end; -end; -$$; - diff --git a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.6/pg_graphql.control b/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.6/pg_graphql.control deleted file mode 100644 index 56c20ea62..000000000 --- a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.6/pg_graphql.control +++ /dev/null @@ -1,6 +0,0 @@ -comment = 'pg_graphql: GraphQL support' -default_version = '1.5.6' -module_pathname = '$libdir/pg_graphql' -relocatable = false -superuser = true -schema = 'graphql' diff --git a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.6/pg_graphql.so b/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.6/pg_graphql.so deleted file mode 100755 index c87cdbd4c..000000000 Binary files a/packages/twenty-postgres/macos/arm/15/pg_graphql/1.5.6/pg_graphql.so and /dev/null differ diff --git a/packages/twenty-postgres/macos/arm/build-postgres-macos-arm.sh b/packages/twenty-postgres/macos/arm/build-postgres-macos-arm.sh deleted file mode 100755 index 3decabfd7..000000000 --- a/packages/twenty-postgres/macos/arm/build-postgres-macos-arm.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/bash - -# Colors -RED=31 -GREEN=32 -BLUE=34 - -# Function to display colored output -function echo_header { - COLOR=$1 - MESSAGE=$2 - echo -e "\e[${COLOR}m\n=======================================================\e[0m" - echo -e "\e[${COLOR}m${MESSAGE}\e[0m" - echo -e "\e[${COLOR}m=======================================================\e[0m" -} - -# Function to handle errors -function handle_error { - echo_header $RED "Error: $1" - exit 1 -} - -cat << "EOF" -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@#*+=================@@@@@%*+=========++*%@@@@@@@ -@@@@#- .+@@%=. .+@@@@@ -@@@- .*@@%- .#@@@ -@@= .=+++++++++++*#@@@= -++++++++++- %@@ -@@. %@@@@@@@@@@@@@@@+ =%@@@@@@@@@@@@= +@@ -@@. .@@@@@@@@@@@@@@+. -%@@@@@@@@@@@@@@+ +@@ -@@. .@@@@@@@@@@@@*. -#@@#:=@@@@@@@@@@@= +@@ -@@ @@@@@@@@@@#: :#@@#: -@@@@@@@@@@@= +@@ -@@#====#@@@@@@@@#- .*@@@= -@@@@@@@@@@@= +@@ -@@@@@@@@@@@@@@%- .*@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@@@@@@%= +@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@@@@@+ =@@@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@@@+. -%@@@@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@*. -%@@@@@@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@#: :#@@@@@@@@@@@@@# -@@@@@@@@@@@+ +@@ -@@@#: :#@@@@@@@@@@@@@@@# :@@@@@@@@@@@= +@@ -@@= :+*+++++++++++*%@@@. :+++++++++- %@@ -@@ :@@@%. .#@@@ -@@- :@@@@@+: .+@@@@@ -@@@#+===================+%@@@@@@@%*++=======++*%@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -EOF - -echo_header $BLUE " DATABASE SETUP" - -PG_MAIN_VERSION=15 -PG_GRAPHQL_VERSION=1.5.6 -CARGO_PGRX_VERSION=0.11.2 - -current_directory=$(pwd) -script_directory="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" - -# Install PostgresSQL -echo_header $GREEN "Step [1/4]: Installing PostgreSQL..." - -brew reinstall postgresql@$PG_MAIN_VERSION - -# Install pg_graphql extensions -echo_header $GREEN "Step [2/4]: Installing GraphQL for PostgreSQL..." - -# Uninstall existing Rust installation if found -existing_rust_path=$(which rustc) -if [ -n "$existing_rust_path" ]; then - echo "Uninstalling existing Rust installation..." - rm -rf "$existing_rust_path" -fi - -# To force a reinstall of cargo-pgrx, pass --force to the command below -curl https://sh.rustup.rs -sSf | sh -source "$HOME/.cargo/env" -cargo install --locked cargo-pgrx@$CARGO_PGRX_VERSION --force -cargo pgrx init --pg$PG_MAIN_VERSION download - -# Create a temporary directory -temp_dir=$(mktemp -d) -cd "$temp_dir" - -curl -LJO https://github.com/supabase/pg_graphql/archive/refs/tags/v$PG_GRAPHQL_VERSION.zip || handle_error "Failed to download pg_graphql package." - -unzip pg_graphql-$PG_GRAPHQL_VERSION.zip - -[[ ":$PATH:" != *":/opt/homebrew/opt/postgresql@$PG_MAIN_VERSION/bin:"* ]] && PATH="/opt/homebrew/opt/postgresql@$PG_MAIN_VERSION/bin:${PATH}" - -cd "pg_graphql-$PG_GRAPHQL_VERSION" - -# Apply patches to pg_graphql files -echo "Applying patches to pg_graphql files..." -for patch_file in "$script_directory/../../patches/pg_graphql/"*.patch; do - echo "Applying patch: $patch_file" - patch -p1 < "$patch_file" -done - -cargo pgrx install --release --pg-config /opt/homebrew/opt/postgresql@$PG_MAIN_VERSION/bin/pg_config - -# Clean up the temporary directory -echo "Cleaning up..." -cd "$current_directory" -rm -rf "$temp_dir" - -# Start postgresql service -echo_header $GREEN "Step [3/4]: Starting PostgreSQL service..." - - -if brew services start postgresql@$PG_MAIN_VERSION; then - echo "PostgreSQL service started successfully." -else - handle_error "Failed to start PostgreSQL service." -fi - -# Run the init.sql to setup database -echo_header $GREEN "Step [4/4]: Setting up database..." -cp ./postgres/init.sql /tmp/init.sql -psql -f /tmp/init.sql -d postgres|| handle_error "Failed to execute init.sql script." diff --git a/packages/twenty-postgres/macos/arm/provision-postgres-macos-arm.sh b/packages/twenty-postgres/macos/arm/provision-postgres-macos-arm.sh deleted file mode 100755 index 201a4abb2..000000000 --- a/packages/twenty-postgres/macos/arm/provision-postgres-macos-arm.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -PG_MAIN_VERSION=15 -PG_GRAPHQL_VERSION=1.5.6 - -current_directory=$(pwd) - -echo "Step [1/4]: Installing PostgreSQL..." -brew reinstall postgresql@$PG_MAIN_VERSION - -echo "Step [2/4]: Installing GraphQL for PostgreSQL..." -cp ./macos/arm/${PG_MAIN_VERSION}/pg_graphql/${PG_GRAPHQL_VERSION}/pg_graphql--${PG_GRAPHQL_VERSION}.sql \ - /opt/homebrew/opt/postgresql@${PG_MAIN_VERSION}/share/postgresql@${PG_MAIN_VERSION}/extension -cp ./macos/arm/${PG_MAIN_VERSION}/pg_graphql/${PG_GRAPHQL_VERSION}/pg_graphql.control \ - /opt/homebrew/opt/postgresql@${PG_MAIN_VERSION}/share/postgresql@${PG_MAIN_VERSION}/extension -cp ./macos/arm/${PG_MAIN_VERSION}/pg_graphql/${PG_GRAPHQL_VERSION}/pg_graphql.so \ - /opt/homebrew/opt/postgresql@${PG_MAIN_VERSION}/lib/postgresql - -export PATH="/opt/homebrew/opt/postgresql@${PG_MAIN_VERSION}/bin:$PATH" - -echo "Step [3/4]: Starting PostgreSQL service..." -brew services restart postgresql@15 - -echo "Step [4/4]: Setting up database..." -cp ./init.sql /tmp/init.sql -sleep 5 -psql -f /tmp/init.sql -d postgres diff --git a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.3.0/pg_graphql--1.3.0.sql b/packages/twenty-postgres/macos/intel/15/pg_graphql/1.3.0/pg_graphql--1.3.0.sql deleted file mode 100644 index 7bafc8f7d..000000000 --- a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.3.0/pg_graphql--1.3.0.sql +++ /dev/null @@ -1,116 +0,0 @@ -/* -This file is auto generated by pgrx. - -The ordering of items is not stable, it is driven by a dependency graph. -*/ - --- src/lib.rs:26 --- pg_graphql::_internal_resolve -CREATE FUNCTION graphql."_internal_resolve"( - "query" TEXT, /* &str */ - "variables" jsonb DEFAULT '{}', /* core::option::Option */ - "operationName" TEXT DEFAULT null, /* core::option::Option */ - "extensions" jsonb DEFAULT null /* core::option::Option */ -) RETURNS jsonb /* pgrx::datum::json::JsonB */ - -LANGUAGE c /* Rust */ -AS 'MODULE_PATHNAME', 'resolve_wrapper'; - --- src/lib.rs:19 --- Is updated every time the schema changes -create sequence if not exists graphql.seq_schema_version as int cycle; - -create or replace function graphql.increment_schema_version() - returns event_trigger - security definer - language plpgsql -as $$ -begin - perform nextval('graphql.seq_schema_version'); -end; -$$; - -create or replace function graphql.get_schema_version() - returns int - security definer - language sql -as $$ - select last_value from graphql.seq_schema_version; -$$; - --- On DDL event, increment the schema version number -create event trigger graphql_watch_ddl - on ddl_command_end - execute procedure graphql.increment_schema_version(); - -create event trigger graphql_watch_drop - on sql_drop - execute procedure graphql.increment_schema_version(); - - --- src/lib.rs:20 -create function graphql.comment_directive(comment_ text) - returns jsonb - language sql - immutable -as $$ - /* - comment on column public.account.name is '@graphql.name: myField' - */ - select - coalesce( - ( - regexp_match( - comment_, - '@graphql\((.+?)\)' - ) - )[1]::jsonb, - jsonb_build_object() - ) -$$; - - --- src/lib.rs:22 --- requires: --- resolve - -create or replace function graphql.resolve( - "query" text, - "variables" jsonb default '{}', - "operationName" text default null, - "extensions" jsonb default null -) - returns jsonb - language plpgsql -as $$ -declare - res jsonb; - message_text text; -begin - begin - select graphql._internal_resolve("query" := "query", - "variables" := "variables", - "operationName" := "operationName", - "extensions" := "extensions") into res; - return res; - exception - when others then - get stacked diagnostics message_text = message_text; - return - jsonb_build_object('data', null, - 'errors', jsonb_build_array(jsonb_build_object('message', message_text))); - end; -end; -$$; - - --- src/lib.rs:21 -create or replace function graphql.exception(message text) - returns text - language plpgsql -as $$ -begin - raise exception using errcode='22000', message=message; -end; -$$; - diff --git a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.3.0/pg_graphql.control b/packages/twenty-postgres/macos/intel/15/pg_graphql/1.3.0/pg_graphql.control deleted file mode 100644 index f5edd6fc5..000000000 --- a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.3.0/pg_graphql.control +++ /dev/null @@ -1,6 +0,0 @@ -comment = 'pg_graphql: GraphQL support' -default_version = '1.3.0' -module_pathname = '$libdir/pg_graphql' -relocatable = false -superuser = true -schema = 'graphql' diff --git a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.3.0/pg_graphql.so b/packages/twenty-postgres/macos/intel/15/pg_graphql/1.3.0/pg_graphql.so deleted file mode 100644 index 319475bff..000000000 Binary files a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.3.0/pg_graphql.so and /dev/null differ diff --git a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.1/pg_graphql--1.5.1.sql b/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.1/pg_graphql--1.5.1.sql deleted file mode 100644 index ef7ef9aca..000000000 --- a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.1/pg_graphql--1.5.1.sql +++ /dev/null @@ -1,116 +0,0 @@ -/* -This file is auto generated by pgrx. - -The ordering of items is not stable, it is driven by a dependency graph. -*/ - --- src/lib.rs:27 --- pg_graphql::_internal_resolve -CREATE FUNCTION graphql."_internal_resolve"( - "query" TEXT, /* &str */ - "variables" jsonb DEFAULT '{}', /* core::option::Option */ - "operationName" TEXT DEFAULT null, /* core::option::Option */ - "extensions" jsonb DEFAULT null /* core::option::Option */ -) RETURNS jsonb /* pgrx::datum::json::JsonB */ - -LANGUAGE c /* Rust */ -AS 'MODULE_PATHNAME', 'resolve_wrapper'; - --- src/lib.rs:23 --- requires: --- resolve - -create or replace function graphql.resolve( - "query" text, - "variables" jsonb default '{}', - "operationName" text default null, - "extensions" jsonb default null -) - returns jsonb - language plpgsql -as $$ -declare - res jsonb; - message_text text; -begin - begin - select graphql._internal_resolve("query" := "query", - "variables" := "variables", - "operationName" := "operationName", - "extensions" := "extensions") into res; - return res; - exception - when others then - get stacked diagnostics message_text = message_text; - return - jsonb_build_object('data', null, - 'errors', jsonb_build_array(jsonb_build_object('message', message_text))); - end; -end; -$$; - - --- src/lib.rs:22 -create or replace function graphql.exception(message text) - returns text - language plpgsql -as $$ -begin - raise exception using errcode='22000', message=message; -end; -$$; - - --- src/lib.rs:21 -create function graphql.comment_directive(comment_ text) - returns jsonb - language sql - immutable -as $$ - /* - comment on column public.account.name is '@graphql.name: myField' - */ - select - coalesce( - ( - regexp_match( - comment_, - '@graphql\((.+?)\)' - ) - )[1]::jsonb, - jsonb_build_object() - ) -$$; - - --- src/lib.rs:20 --- Is updated every time the schema changes -create sequence if not exists graphql.seq_schema_version as int cycle; - -create or replace function graphql.increment_schema_version() - returns event_trigger - security definer - language plpgsql -as $$ -begin - perform nextval('graphql.seq_schema_version'); -end; -$$; - -create or replace function graphql.get_schema_version() - returns int - security definer - language sql -as $$ - select last_value from graphql.seq_schema_version; -$$; - --- On DDL event, increment the schema version number -create event trigger graphql_watch_ddl - on ddl_command_end - execute procedure graphql.increment_schema_version(); - -create event trigger graphql_watch_drop - on sql_drop - execute procedure graphql.increment_schema_version(); - diff --git a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.1/pg_graphql.control b/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.1/pg_graphql.control deleted file mode 100644 index 172c6f114..000000000 --- a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.1/pg_graphql.control +++ /dev/null @@ -1,6 +0,0 @@ -comment = 'pg_graphql: GraphQL support' -default_version = '1.5.1' -module_pathname = '$libdir/pg_graphql' -relocatable = false -superuser = true -schema = 'graphql' diff --git a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.1/pg_graphql.so b/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.1/pg_graphql.so deleted file mode 100644 index 61eda3333..000000000 Binary files a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.1/pg_graphql.so and /dev/null differ diff --git a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.6/pg_graphql--1.5.6.sql b/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.6/pg_graphql--1.5.6.sql deleted file mode 100644 index a24d69a1a..000000000 --- a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.6/pg_graphql--1.5.6.sql +++ /dev/null @@ -1,116 +0,0 @@ -/* -This file is auto generated by pgrx. - -The ordering of items is not stable, it is driven by a dependency graph. -*/ - --- src/lib.rs:27 --- pg_graphql::_internal_resolve -CREATE FUNCTION graphql."_internal_resolve"( - "query" TEXT, /* &str */ - "variables" jsonb DEFAULT '{}', /* core::option::Option */ - "operationName" TEXT DEFAULT null, /* core::option::Option */ - "extensions" jsonb DEFAULT null /* core::option::Option */ -) RETURNS jsonb /* pgrx::datum::json::JsonB */ - -LANGUAGE c /* Rust */ -AS 'MODULE_PATHNAME', 'resolve_wrapper'; - --- src/lib.rs:20 --- Is updated every time the schema changes -create sequence if not exists graphql.seq_schema_version as int cycle; - -create or replace function graphql.increment_schema_version() - returns event_trigger - security definer - language plpgsql -as $$ -begin - perform nextval('graphql.seq_schema_version'); -end; -$$; - -create or replace function graphql.get_schema_version() - returns int - security definer - language sql -as $$ - select last_value from graphql.seq_schema_version; -$$; - --- On DDL event, increment the schema version number -create event trigger graphql_watch_ddl - on ddl_command_end - execute procedure graphql.increment_schema_version(); - -create event trigger graphql_watch_drop - on sql_drop - execute procedure graphql.increment_schema_version(); - - --- src/lib.rs:22 -create or replace function graphql.exception(message text) - returns text - language plpgsql -as $$ -begin - raise exception using errcode='22000', message=message; -end; -$$; - - --- src/lib.rs:21 -create function graphql.comment_directive(comment_ text) - returns jsonb - language sql - immutable -as $$ - /* - comment on column public.account.name is '@graphql.name: myField' - */ - select - coalesce( - ( - regexp_match( - comment_, - '@graphql\((.+?)\)' - ) - )[1]::jsonb, - jsonb_build_object() - ) -$$; - - --- src/lib.rs:23 --- requires: --- resolve - -create or replace function graphql.resolve( - "query" text, - "variables" jsonb default '{}', - "operationName" text default null, - "extensions" jsonb default null -) - returns jsonb - language plpgsql -as $$ -declare - res jsonb; - message_text text; -begin - begin - select graphql._internal_resolve("query" := "query", - "variables" := "variables", - "operationName" := "operationName", - "extensions" := "extensions") into res; - return res; - exception - when others then - get stacked diagnostics message_text = message_text; - return - jsonb_build_object('data', null, - 'errors', jsonb_build_array(jsonb_build_object('message', message_text))); - end; -end; -$$; - diff --git a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.6/pg_graphql.control b/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.6/pg_graphql.control deleted file mode 100644 index 56c20ea62..000000000 --- a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.6/pg_graphql.control +++ /dev/null @@ -1,6 +0,0 @@ -comment = 'pg_graphql: GraphQL support' -default_version = '1.5.6' -module_pathname = '$libdir/pg_graphql' -relocatable = false -superuser = true -schema = 'graphql' diff --git a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.6/pg_graphql.so b/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.6/pg_graphql.so deleted file mode 100644 index c6f712ec0..000000000 Binary files a/packages/twenty-postgres/macos/intel/15/pg_graphql/1.5.6/pg_graphql.so and /dev/null differ diff --git a/packages/twenty-postgres/macos/intel/build-postgres-macos-intel.sh b/packages/twenty-postgres/macos/intel/build-postgres-macos-intel.sh deleted file mode 100755 index 944f64d72..000000000 --- a/packages/twenty-postgres/macos/intel/build-postgres-macos-intel.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/bash - -# Colors -RED=31 -GREEN=32 -BLUE=34 - -# Function to display colored output -function echo_header { - COLOR=$1 - MESSAGE=$2 - echo -e "\e[${COLOR}m\n=======================================================\e[0m" - echo -e "\e[${COLOR}m${MESSAGE}\e[0m" - echo -e "\e[${COLOR}m=======================================================\e[0m" -} - -# Function to handle errors -function handle_error { - echo_header $RED "Error: $1" - exit 1 -} - -cat << "EOF" -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@#*+=================@@@@@%*+=========++*%@@@@@@@ -@@@@#- .+@@%=. .+@@@@@ -@@@- .*@@%- .#@@@ -@@= .=+++++++++++*#@@@= -++++++++++- %@@ -@@. %@@@@@@@@@@@@@@@+ =%@@@@@@@@@@@@= +@@ -@@. .@@@@@@@@@@@@@@+. -%@@@@@@@@@@@@@@+ +@@ -@@. .@@@@@@@@@@@@*. -#@@#:=@@@@@@@@@@@= +@@ -@@ @@@@@@@@@@#: :#@@#: -@@@@@@@@@@@= +@@ -@@#====#@@@@@@@@#- .*@@@= -@@@@@@@@@@@= +@@ -@@@@@@@@@@@@@@%- .*@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@@@@@@%= +@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@@@@@+ =@@@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@@@+. -%@@@@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@@@*. -%@@@@@@@@@@@# -@@@@@@@@@@@= +@@ -@@@@@#: :#@@@@@@@@@@@@@# -@@@@@@@@@@@+ +@@ -@@@#: :#@@@@@@@@@@@@@@@# :@@@@@@@@@@@= +@@ -@@= :+*+++++++++++*%@@@. :+++++++++- %@@ -@@ :@@@%. .#@@@ -@@- :@@@@@+: .+@@@@@ -@@@#+===================+%@@@@@@@%*++=======++*%@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -EOF - -echo_header $BLUE " DATABASE SETUP" - -PG_MAIN_VERSION=15 -PG_GRAPHQL_VERSION=1.5.6 -CARGO_PGRX_VERSION=0.11.2 - -current_directory=$(pwd) -script_directory="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" - -# Install PostgresSQL -echo_header $GREEN "Step [1/4]: Installing PostgreSQL..." - -brew reinstall postgresql@$PG_MAIN_VERSION - -# Install pg_graphql extensions -echo_header $GREEN "Step [2/4]: Installing GraphQL for PostgreSQL..." - -# Uninstall existing Rust installation if found -existing_rust_path=$(which rustc) -if [ -n "$existing_rust_path" ]; then - echo "Uninstalling existing Rust installation..." - rm -rf "$existing_rust_path" -fi - -# To force a reinstall of cargo-pgrx, pass --force to the command below -curl https://sh.rustup.rs -sSf | sh -source "$HOME/.cargo/env" -cargo install --locked cargo-pgrx@$CARGO_PGRX_VERSION --force -cargo pgrx init --pg$PG_MAIN_VERSION download - -# Create a temporary directory -temp_dir=$(mktemp -d) -cd "$temp_dir" - -curl -LJO https://github.com/supabase/pg_graphql/archive/refs/tags/v$PG_GRAPHQL_VERSION.zip || handle_error "Failed to download pg_graphql package." - -unzip pg_graphql-$PG_GRAPHQL_VERSION.zip - -[[ ":$PATH:" != *":/usr/local/opt/postgresql@$PG_MAIN_VERSION/bin:"* ]] && PATH="/usr/local/opt/postgresql@$PG_MAIN_VERSION/bin:${PATH}" - -cd "pg_graphql-$PG_GRAPHQL_VERSION" - -# Apply patches to pg_graphql files -echo "Applying patches to pg_graphql files..." -for patch_file in "$script_directory/../../patches/pg_graphql/"*.patch; do - echo "Applying patch: $patch_file" - patch -p1 < "$patch_file" -done - -cargo pgrx install --release --pg-config /usr/local/opt/postgresql@$PG_MAIN_VERSION/bin/pg_config - -# Clean up the temporary directory -echo "Cleaning up..." -cd "$current_directory" -rm -rf "$temp_dir" - -# Start postgresql service -echo_header $GREEN "Step [3/4]: Starting PostgreSQL service..." - - -if brew services start postgresql@$PG_MAIN_VERSION; then - echo "PostgreSQL service started successfully." -else - handle_error "Failed to start PostgreSQL service." -fi - -# Run the init.sql to setup database -echo_header $GREEN "Step [4/4]: Setting up database..." -cp ./postgres/init.sql /tmp/init.sql -psql -f /tmp/init.sql -d postgres|| handle_error "Failed to execute init.sql script." diff --git a/packages/twenty-postgres/macos/intel/provision-postgres-macos-intel.sh b/packages/twenty-postgres/macos/intel/provision-postgres-macos-intel.sh deleted file mode 100755 index 72091af18..000000000 --- a/packages/twenty-postgres/macos/intel/provision-postgres-macos-intel.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -PG_MAIN_VERSION=15 -PG_GRAPHQL_VERSION=1.5.6 - -current_directory=$(pwd) - -echo "Step [1/4]: Installing PostgreSQL..." -brew reinstall postgresql@$PG_MAIN_VERSION - -echo "Step [2/4]: Installing GraphQL for PostgreSQL..." -cp ./macos/intel/${PG_MAIN_VERSION}/pg_graphql/${PG_GRAPHQL_VERSION}/pg_graphql--${PG_GRAPHQL_VERSION}.sql \ - /usr/local/opt/postgresql@${PG_MAIN_VERSION}/share/postgresql@${PG_MAIN_VERSION}/extension -cp ./macos/intel/${PG_MAIN_VERSION}/pg_graphql/${PG_GRAPHQL_VERSION}/pg_graphql.control \ - /usr/local/opt/postgresql@${PG_MAIN_VERSION}/share/postgresql@${PG_MAIN_VERSION}/extension -cp ./macos/intel/${PG_MAIN_VERSION}/pg_graphql/${PG_GRAPHQL_VERSION}/pg_graphql.so \ - /usr/local/opt/postgresql@${PG_MAIN_VERSION}/lib/postgresql - -export PATH="/usr/local/opt/postgresql@${PG_MAIN_VERSION}/bin:$PATH" - -echo "Step [3/4]: Starting PostgreSQL service..." -brew services restart postgresql@15 - -echo "Step [4/4]: Setting up database..." -cp ./init.sql /tmp/init.sql -sleep 5 -psql -f /tmp/init.sql -d postgres diff --git a/packages/twenty-postgres/patches/pg_graphql/0001-performance.patch b/packages/twenty-postgres/patches/pg_graphql/0001-performance.patch deleted file mode 100644 index e0d35c950..000000000 --- a/packages/twenty-postgres/patches/pg_graphql/0001-performance.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/sql/load_sql_context.sql b/sql/load_sql_context.sql -index 565e4e3..40cd99e 100644 ---- a/sql/load_sql_context.sql -+++ b/sql/load_sql_context.sql -@@ -95,6 +95,8 @@ select - pg_type pt - left join pg_class tabs - on pt.typrelid = tabs.oid -+ join search_path_oids spo -+ on pt.typnamespace = spo.schema_oid or pt.typnamespace = 'pg_catalog'::regnamespace::oid - ), - jsonb_build_object() - ), -@@ -111,6 +113,8 @@ select - pg_type pt - join pg_class tabs - on pt.typrelid = tabs.oid -+ join search_path_oids spo -+ on pt.typnamespace = spo.schema_oid or pt.typnamespace = 'pg_catalog'::regnamespace::oid - where - pt.typcategory = 'C' - and tabs.relkind = 'c' -@@ -420,4 +424,4 @@ select - jsonb_build_array() - ) - -- ) -+ ); diff --git a/packages/twenty-server/scripts/setup-db.ts b/packages/twenty-server/scripts/setup-db.ts index cefc1245e..a562a3114 100644 --- a/packages/twenty-server/scripts/setup-db.ts +++ b/packages/twenty-server/scripts/setup-db.ts @@ -19,10 +19,6 @@ rawDataSource 'CREATE SCHEMA IF NOT EXISTS "core"', 'create schema "core"', ); - await performQuery( - 'CREATE EXTENSION IF NOT EXISTS "pg_graphql"', - 'create extension pg_graphql', - ); await performQuery( 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp"', @@ -66,34 +62,6 @@ rawDataSource true, ); } - - await performQuery( - `COMMENT ON SCHEMA "core" IS '@graphql({"inflect_names": true})';`, - 'inflect names for graphql', - ); - - await performQuery( - ` - DROP FUNCTION IF EXISTS graphql; - CREATE FUNCTION graphql( - "operationName" text default null, - query text default null, - variables jsonb default null, - extensions jsonb default null - ) - returns jsonb - language sql - as $$ - select graphql.resolve( - query := query, - variables := coalesce(variables, '{}'), - "operationName" := "operationName", - extensions := extensions - ); - $$; - `, - 'create function graphql', - ); }) .catch((err) => { console.error('Error during Data Source initialization:', err); diff --git a/packages/twenty-website/src/content/developers/local-setup.mdx b/packages/twenty-website/src/content/developers/local-setup.mdx index 6bae7137c..3d7f09005 100644 --- a/packages/twenty-website/src/content/developers/local-setup.mdx +++ b/packages/twenty-website/src/content/developers/local-setup.mdx @@ -93,49 +93,70 @@ cd twenty You should run all commands in the following steps from the root of the project. ## Step 3: Set up a PostgreSQL Database -We rely on [pg_graphql](https://github.com/supabase/pg_graphql) and recommend you use the scripts below to provision a database with the right extensions. You can access the database at [localhost:5432](localhost:5432), with user `twenty` and password `twenty` . Option 1: To provision your database locally: + Use the following link to install Postgresql on your Linux machine: [Postgresql Installation](https://www.postgresql.org/download/linux/) ```bash - make postgres-on-linux + psql postgres -c "CREATE DATABASE \"default\";" -c "CREATE DATABASE test;" -c "CREATE USER twenty PASSWORD 'twenty';" -c "ALTER ROLE twenty superuser;" ``` Option 2: If you have docker installed: ```bash - make postgres-on-docker + docker run \ + --name twenty_postgres \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_DB=default \ + -v twenty_db_data:/var/lib/postgresql/data \ + -p 5432:5432 \ + twentycrm/twenty-postgres:latest ``` Option 1: To provision your database locally with `brew`: - ```bash - make postgres-on-macos-intel #for intel architecture - make postgres-on-macos-arm #for M1/M2/M3 architecture + ```bash + brew install postgresql@16 + export PATH="/opt/homebrew/opt/postgresql@16/bin:$PATH" + psql postgres -c "CREATE DATABASE \"default\";" -c "CREATE DATABASE test;" -c "CREATE USER twenty PASSWORD 'twenty';" -c "ALTER ROLE twenty superuser;" ``` Option 2: If you have docker installed: ```bash - make postgres-on-docker + docker run \ + --name twenty_postgres \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_DB=default \ + -v twenty_db_data:/var/lib/postgresql/data \ + -p 5432:5432 \ + twentycrm/twenty-postgres:latest ``` All the following steps are to be run in the WSL terminal (within your virtual machine) - Option 1: To provision your database locally: + Option 1: To provision your Postgresql locally: + Use the following link to install Postgresql on your Linux virtual machine: [Postgresql Installation](https://www.postgresql.org/download/linux/) ```bash - make postgres-on-linux + psql postgres -c "CREATE DATABASE \"default\";" -c "CREATE DATABASE test;" -c "CREATE USER twenty PASSWORD 'twenty';" -c "ALTER ROLE twenty superuser;" ``` - Note: you might need to run `sudo apt-get install build-essential` before running the above command if you don't have the build tools installed. - Option 2: If you have docker installed: Running Docker on WSL adds an extra layer of complexity. Only use this option if you are comfortable with the extra steps involved, including turning on [Docker Desktop WSL2](https://docs.docker.com/desktop/wsl). ```bash - make postgres-on-docker + docker run \ + --name twenty_postgres \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_DB=default \ + -v twenty_db_data:/var/lib/postgresql/data \ + -p 5432:5432 \ + twentycrm/twenty-postgres:latest ``` @@ -154,7 +175,7 @@ Twenty requires a redis cache to provide the best performances ``` - Option 1:To provision your Redis locally with `brew`: + Option 1: To provision your Redis locally with `brew`: ```bash brew install redis ``` diff --git a/packages/twenty-website/src/database/migrations/0003_polite_lorna_dane.sql b/packages/twenty-website/src/database/migrations/0003_polite_lorna_dane.sql new file mode 100644 index 000000000..c4b1eceb6 --- /dev/null +++ b/packages/twenty-website/src/database/migrations/0003_polite_lorna_dane.sql @@ -0,0 +1,9 @@ +CREATE TABLE IF NOT EXISTS "githubReleases" ( + "tagName" text PRIMARY KEY NOT NULL, + "publishedAt" date NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "githubStars" ( + "timestamp" timestamp DEFAULT now() NOT NULL, + "numberOfStars" integer +); diff --git a/packages/twenty-website/src/database/migrations/meta/0003_snapshot.json b/packages/twenty-website/src/database/migrations/meta/0003_snapshot.json new file mode 100644 index 000000000..e8ba9df97 --- /dev/null +++ b/packages/twenty-website/src/database/migrations/meta/0003_snapshot.json @@ -0,0 +1,388 @@ +{ + "id": "b3a89784-eb82-49d8-b081-31c49e6906dc", + "prevId": "a7895a79-44a3-4fad-b750-f89d8c04d85c", + "version": "5", + "dialect": "pg", + "tables": { + "githubReleases": { + "name": "githubReleases", + "schema": "", + "columns": { + "tagName": { + "name": "tagName", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "publishedAt": { + "name": "publishedAt", + "type": "date", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "githubStars": { + "name": "githubStars", + "schema": "", + "columns": { + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "numberOfStars": { + "name": "numberOfStars", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "issueLabels": { + "name": "issueLabels", + "schema": "", + "columns": { + "issueId": { + "name": "issueId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "labelId": { + "name": "labelId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "issueLabels_issueId_issues_id_fk": { + "name": "issueLabels_issueId_issues_id_fk", + "tableFrom": "issueLabels", + "tableTo": "issues", + "columnsFrom": [ + "issueId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "issueLabels_labelId_labels_id_fk": { + "name": "issueLabels_labelId_labels_id_fk", + "tableFrom": "issueLabels", + "tableTo": "labels", + "columnsFrom": [ + "labelId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "issues": { + "name": "issues", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "externalId": { + "name": "externalId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updatedAt": { + "name": "updatedAt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "closedAt": { + "name": "closedAt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "authorId": { + "name": "authorId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "issues_authorId_users_id_fk": { + "name": "issues_authorId_users_id_fk", + "tableFrom": "issues", + "tableTo": "users", + "columnsFrom": [ + "authorId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "labels": { + "name": "labels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "externalId": { + "name": "externalId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "pullRequestLabels": { + "name": "pullRequestLabels", + "schema": "", + "columns": { + "pullRequestExternalId": { + "name": "pullRequestExternalId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "labelId": { + "name": "labelId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "pullRequestLabels_pullRequestExternalId_pullRequests_id_fk": { + "name": "pullRequestLabels_pullRequestExternalId_pullRequests_id_fk", + "tableFrom": "pullRequestLabels", + "tableTo": "pullRequests", + "columnsFrom": [ + "pullRequestExternalId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "pullRequestLabels_labelId_labels_id_fk": { + "name": "pullRequestLabels_labelId_labels_id_fk", + "tableFrom": "pullRequestLabels", + "tableTo": "labels", + "columnsFrom": [ + "labelId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "pullRequests": { + "name": "pullRequests", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updatedAt": { + "name": "updatedAt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "closedAt": { + "name": "closedAt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mergedAt": { + "name": "mergedAt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "authorId": { + "name": "authorId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "pullRequests_authorId_users_id_fk": { + "name": "pullRequests_authorId_users_id_fk", + "tableFrom": "pullRequests", + "tableTo": "users", + "columnsFrom": [ + "authorId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "users": { + "name": "users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "avatarUrl": { + "name": "avatarUrl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "isEmployee": { + "name": "isEmployee", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": {}, + "schemas": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file