@coffre/db 0.7.0 → 0.8.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.
@@ -64,6 +64,13 @@
64
64
  "when": 1792255560312,
65
65
  "tag": "0008_recipes",
66
66
  "breakpoints": true
67
+ },
68
+ {
69
+ "idx": 9,
70
+ "version": "6",
71
+ "when": 1792281880190,
72
+ "tag": "0009_handles",
73
+ "breakpoints": true
67
74
  }
68
75
  ]
69
76
  }
@@ -682,7 +682,7 @@ export const credentials = sqliteTable(
682
682
  },
683
683
  (table) => [
684
684
  unique('credentials_token_hash_key').on(table.tokenHash),
685
- check('credentials_kind_check', sql`${table.kind} IN ('browser', 'cli', 'service', 'personal')`),
685
+ check('credentials_kind_check', sql`${table.kind} IN ('browser', 'cli', 'service', 'personal', 'handle')`),
686
686
  check('credentials_principal_check', sql`${table.principal} LIKE 'user:%' OR ${table.principal} LIKE 'token:%'`),
687
687
  check('credentials_kind_matches_principal', sql`(${table.kind} = 'service') = (${table.principal} LIKE 'token:%')`),
688
688
  check('credentials_token_hash_check', sql`octet_length(${table.tokenHash}) = 32`),
package/src/schema.ts CHANGED
@@ -756,7 +756,7 @@ export const credentials = pgTable(
756
756
  },
757
757
  (table) => [
758
758
  unique('credentials_token_hash_key').on(table.tokenHash),
759
- check('credentials_kind_check', sql`${table.kind} IN ('browser', 'cli', 'service', 'personal')`),
759
+ check('credentials_kind_check', sql`${table.kind} IN ('browser', 'cli', 'service', 'personal', 'handle')`),
760
760
  check('credentials_principal_check', sql`${table.principal} LIKE 'user:%' OR ${table.principal} LIKE 'token:%'`),
761
761
  check('credentials_kind_matches_principal', sql`(${table.kind} = 'service') = (${table.principal} LIKE 'token:%')`),
762
762
  check('credentials_token_hash_check', sql`octet_length(${table.tokenHash}) = 32`),