@pgpm/metaschema-modules 0.21.0 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,11 +18,14 @@ CREATE TABLE metaschema_modules_public.storage_module (
18
18
  upload_requests_table_id uuid NOT NULL DEFAULT uuid_nil(),
19
19
 
20
20
  -- Table names (input to the generator)
21
- buckets_table_name text NOT NULL DEFAULT 'buckets',
22
- files_table_name text NOT NULL DEFAULT 'files',
23
- upload_requests_table_name text NOT NULL DEFAULT 'upload_requests',
21
+ buckets_table_name text NOT NULL DEFAULT 'app_buckets',
22
+ files_table_name text NOT NULL DEFAULT 'app_files',
23
+ upload_requests_table_name text NOT NULL DEFAULT 'app_upload_requests',
24
24
 
25
- -- Entity table for RLS (users table, since users and orgs share it)
25
+ -- Multi-tenant storage identity
26
+ membership_type int DEFAULT NULL, -- NULL = global gate (AuthzMembership via app_sprt), non-NULL = entity-scoped (AuthzEntityMembership)
27
+
28
+ -- Entity table for RLS (NULL for app-level storage, entity table for entity-scoped storage)
26
29
  entity_table_id uuid NULL,
27
30
 
28
31
  -- S3 connection config (NULL = use global env/plugin defaults)
@@ -52,4 +55,8 @@ CREATE TABLE metaschema_modules_public.storage_module (
52
55
 
53
56
  CREATE INDEX storage_module_database_id_idx ON metaschema_modules_public.storage_module ( database_id );
54
57
 
58
+ -- Unique constraint on (database_id, membership_type) using COALESCE to handle NULLs.
59
+ -- NULL membership_type = app-level (only one per database), non-NULL = entity-scoped (one per membership_type per database).
60
+ CREATE UNIQUE INDEX storage_module_unique_scope ON metaschema_modules_public.storage_module ( database_id, COALESCE(membership_type, -1) );
61
+
55
62
  COMMIT;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpm/metaschema-modules",
3
- "version": "0.21.0",
3
+ "version": "0.21.1",
4
4
  "description": "Module metadata handling and dependency tracking",
5
5
  "author": "Dan Lynch <pyramation@gmail.com>",
6
6
  "contributors": [
@@ -35,5 +35,5 @@
35
35
  "bugs": {
36
36
  "url": "https://github.com/constructive-io/pgpm-modules/issues"
37
37
  },
38
- "gitHead": "f79dd69a3f7bac456bbd4474262b0ccbdb3e66a3"
38
+ "gitHead": "60f39d6306b9f920ddeff0cc267491fdb98b00c7"
39
39
  }