Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@ exports[`db_meta_modules should have all expected module tables 1`] = `
"limits_module",
"membership_types_module",
"memberships_module",
"organization_settings_module",
"permissions_module",
"phone_numbers_module",
"profiles_module",
"rls_module",
"secrets_module",
"table_module",
"table_template_module",
"tokens_module",
"user_auth_module",
"user_profiles_module",
"user_settings_module",
"users_module",
"uuid_module",
],
Expand All @@ -35,8 +33,8 @@ exports[`db_meta_modules should have all expected module tables 1`] = `

exports[`db_meta_modules should verify all module tables exist in metaschema_modules_public schema 1`] = `
{
"moduleTablesCount": 26,
"totalTables": 27,
"moduleTablesCount": 24,
"totalTables": 25,
}
`;

Expand Down Expand Up @@ -91,13 +89,13 @@ exports[`db_meta_modules should verify emails_module table structure 1`] = `

exports[`db_meta_modules should verify module table structures have database_id foreign keys 1`] = `
{
"constraintCount": 78650,
"constraintCount": 67416,
}
`;

exports[`db_meta_modules should verify module tables have proper foreign key relationships 1`] = `
{
"constraintCount": 113921,
"constraintCount": 94299,
"foreignTables": [
"apis",
"database",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
-- Deploy schemas/metaschema_modules_public/tables/table_template_module/table to pg

-- requires: schemas/metaschema_modules_public/schema

BEGIN;

CREATE TABLE metaschema_modules_public.table_template_module (
id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
database_id uuid NOT NULL,

schema_id uuid NOT NULL DEFAULT uuid_nil(),
private_schema_id uuid NOT NULL DEFAULT uuid_nil(),

table_id uuid NOT NULL DEFAULT uuid_nil(),
owner_table_id uuid NOT NULL DEFAULT uuid_nil(),

table_name text NOT NULL,

node_type text NOT NULL,

data jsonb NOT NULL DEFAULT '{}',

--
CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
CONSTRAINT table_fkey FOREIGN KEY (table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
CONSTRAINT owner_table_fkey FOREIGN KEY (owner_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE
);

COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.table_template_module IS E'@omit manyToMany';
COMMENT ON CONSTRAINT private_schema_fkey ON metaschema_modules_public.table_template_module IS E'@omit manyToMany';
COMMENT ON CONSTRAINT table_fkey ON metaschema_modules_public.table_template_module IS E'@omit manyToMany';
COMMENT ON CONSTRAINT owner_table_fkey ON metaschema_modules_public.table_template_module IS E'@omit manyToMany';
COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.table_template_module IS E'@omit manyToMany';
CREATE INDEX table_template_module_database_id_idx ON metaschema_modules_public.table_template_module ( database_id );
CREATE INDEX table_template_module_schema_id_idx ON metaschema_modules_public.table_template_module ( schema_id );
CREATE INDEX table_template_module_private_schema_id_idx ON metaschema_modules_public.table_template_module ( private_schema_id );
CREATE INDEX table_template_module_table_id_idx ON metaschema_modules_public.table_template_module ( table_id );
CREATE INDEX table_template_module_owner_table_id_idx ON metaschema_modules_public.table_template_module ( owner_table_id );
CREATE INDEX table_template_module_node_type_idx ON metaschema_modules_public.table_template_module ( node_type );

COMMIT;

This file was deleted.

This file was deleted.

4 changes: 1 addition & 3 deletions packages/metaschema-modules/pgpm.plan
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,4 @@ schemas/metaschema_modules_public/tables/users_module/table [schemas/metaschema_
schemas/metaschema_modules_public/tables/uuid_module/table [schemas/metaschema_modules_public/schema] 2017-08-11T08:11:51Z skitch <skitch@5b0c196eeb62> # add schemas/metaschema_modules_public/tables/uuid_module/table
schemas/metaschema_modules_public/tables/hierarchy_module/table [schemas/metaschema_modules_public/schema] 2024-12-28T00:00:00Z skitch <skitch@5b0c196eeb62> # add schemas/metaschema_modules_public/tables/hierarchy_module/table
schemas/metaschema_modules_public/tables/table_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin <devin@cognition.ai> # add schemas/metaschema_modules_public/tables/table_module/table
schemas/metaschema_modules_public/tables/user_profiles_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin <devin@cognition.ai> # add schemas/metaschema_modules_public/tables/user_profiles_module/table
schemas/metaschema_modules_public/tables/user_settings_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin <devin@cognition.ai> # add schemas/metaschema_modules_public/tables/user_settings_module/table
schemas/metaschema_modules_public/tables/organization_settings_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin <devin@cognition.ai> # add schemas/metaschema_modules_public/tables/organization_settings_module/table
schemas/metaschema_modules_public/tables/table_template_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin <devin@cognition.ai> # add schemas/metaschema_modules_public/tables/table_template_module/table

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- Revert schemas/metaschema_modules_public/tables/table_template_module/table from pg

BEGIN;

DROP TABLE IF EXISTS metaschema_modules_public.table_template_module;

COMMIT;

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- Verify schemas/metaschema_modules_public/tables/table_template_module/table on pg

BEGIN;

SELECT
id,
database_id,
schema_id,
private_schema_id,
table_id,
owner_table_id,
table_name,
node_type,
data
FROM metaschema_modules_public.table_template_module
WHERE FALSE;

ROLLBACK;

This file was deleted.

This file was deleted.