Skip to content

Commit f3bd2fc

Browse files
committed
fix: add membership_type column to test fixture storage_module table
The test fixture setup.sql hardcodes the storage_module CREATE TABLE instead of using the published @pgpm/metaschema-modules package. Add the membership_type column and update table name defaults to match the 0.21.1 schema (app_buckets, app_files, app_upload_requests). Also add the unique scope index on (database_id, COALESCE(membership_type, -1)).
1 parent e4fe73d commit f3bd2fc

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

  • graphql/server-test/__fixtures__/seed/simple-seed-storage

graphql/server-test/__fixtures__/seed/simple-seed-storage/setup.sql

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ CREATE TABLE IF NOT EXISTS metaschema_modules_public.storage_module (
4848
buckets_table_id uuid NOT NULL DEFAULT uuid_nil(),
4949
files_table_id uuid NOT NULL DEFAULT uuid_nil(),
5050
upload_requests_table_id uuid NOT NULL DEFAULT uuid_nil(),
51-
buckets_table_name text NOT NULL DEFAULT 'buckets',
52-
files_table_name text NOT NULL DEFAULT 'files',
53-
upload_requests_table_name text NOT NULL DEFAULT 'upload_requests',
51+
buckets_table_name text NOT NULL DEFAULT 'app_buckets',
52+
files_table_name text NOT NULL DEFAULT 'app_files',
53+
upload_requests_table_name text NOT NULL DEFAULT 'app_upload_requests',
54+
membership_type int DEFAULT NULL,
5455
entity_table_id uuid NULL,
5556
endpoint text NULL,
5657
public_url_prefix text NULL,
@@ -67,4 +68,7 @@ CREATE TABLE IF NOT EXISTS metaschema_modules_public.storage_module (
6768
CREATE INDEX IF NOT EXISTS storage_module_database_id_idx
6869
ON metaschema_modules_public.storage_module (database_id);
6970

71+
CREATE UNIQUE INDEX IF NOT EXISTS storage_module_unique_scope
72+
ON metaschema_modules_public.storage_module (database_id, COALESCE(membership_type, -1));
73+
7074
GRANT SELECT, INSERT, UPDATE, DELETE ON metaschema_modules_public.storage_module TO administrator, authenticated, anonymous;

0 commit comments

Comments
 (0)