@marinoscar/platform-db 0.1.0-next.25 → 0.1.0-next.26

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @marinoscar/platform-db
2
2
 
3
+ ## 0.1.0-next.26
4
+
5
+ ### Minor Changes
6
+
7
+ - 5c815ac: Identity: `PersonalAccessToken` is now marked `// @extensible`, so an app fragment can declare the back-relation of a foreign key to `personal_access_tokens` (for example a device row that records the token it paired with) with `extend model PersonalAccessToken { ... }`. Marker only: no column, key or index changes, no migration.
8
+
3
9
  ## 0.1.0-next.25
4
10
 
5
11
  ## 0.1.0-next.24
package/README.md CHANGED
@@ -148,6 +148,7 @@ Rules:
148
148
  |---|---|---|---|---|
149
149
  | `User` | `users` | system | its own per-user rows (a plain key on `id`); app fields that fit a document go in [`metadata`](#app-metadata-on-users-and-organizations) with no table at all | a column; the credential and token tables |
150
150
  | `Organization` | `organizations` | system | its own per-organization rows; org-owned app tables point here with a `Cascade` key on `org_id` | |
151
+ | `PersonalAccessToken` | `personal_access_tokens` | system | a link from an app row to the token it was paired with (a nullable key on `id`, `onDelete: SetNull`, so revoking or purging a token never deletes the app row) | the `token_hash` column: an app reads token state through `PatService`, never copies the hash |
151
152
  | `Role` | `roles` | system | per-role app data (a plain key on `id`) | `role_permissions`: `seedPlatform` owns the grants |
152
153
  | `Group` | `groups` | org (row-level security) | app rows of a group: a composite key `(group_id, org_id)` -> `groups (id, org_id)` | a plain key on `id` alone |
153
154
  | `Grant` | `grants` | org (row-level security) | an annotation of a grant: a composite key `(grant_id, org_id)` -> `grants (id, org_id)` | a plain key on `id` alone; an `@@unique` over the two partial unique indexes' columns |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marinoscar/platform-db",
3
- "version": "0.1.0-next.25",
3
+ "version": "0.1.0-next.26",
4
4
  "description": "Prisma schema fragments, SQL migrations and seed functions of the platform (CommonJS).",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -203,6 +203,7 @@ enum PatDurationUnit {
203
203
  months
204
204
  }
205
205
 
206
+ // @extensible — back-relations only, added with "extend model PersonalAccessToken { ... }" in a fragment
206
207
  model PersonalAccessToken {
207
208
  id String @id @default(uuid()) @db.Uuid
208
209
  userId String @map("user_id") @db.Uuid