@bettercms-ai/db 0.8.0 → 0.8.2

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/dist/index.js CHANGED
@@ -22095,6 +22095,7 @@ __export(index_exports, {
22095
22095
  previewTokenRevocations: () => previewTokenRevocations,
22096
22096
  projectBranches: () => projectBranches,
22097
22097
  projectEnvVars: () => projectEnvVars,
22098
+ projectFavorites: () => projectFavorites,
22098
22099
  projectFolders: () => projectFolders,
22099
22100
  projectLayoutVersions: () => projectLayoutVersions,
22100
22101
  projectLayouts: () => projectLayouts,
@@ -22204,7 +22205,8 @@ import {
22204
22205
  integer as integer8,
22205
22206
  index as index10,
22206
22207
  uniqueIndex as uniqueIndex4,
22207
- unique
22208
+ unique,
22209
+ primaryKey
22208
22210
  } from "drizzle-orm/pg-core";
22209
22211
  import { relations as relations9 } from "drizzle-orm/relations";
22210
22212
  import { sql as sql6 } from "drizzle-orm";
@@ -23091,7 +23093,8 @@ var forms = pgTable7(
23091
23093
  /**
23092
23094
  * Not one of the customer's CMS forms (0365): never counted, wired or put in the conversion
23093
23095
  * brief, but kept as a grey row with "Restore". `user` = the row action; `auth-heuristic` =
23094
- * the derive lane judged it the site's own sign-in / register / reset form. Before 0365 such a
23096
+ * the derive lane judged it the site's own sign-in / register / reset form; `commerce-action` =
23097
+ * the shop's own add-to-basket or checkout form. Before 0365 such a
23095
23098
  * form was dropped at derive time, so a wrong guess had no row to restore.
23096
23099
  */
23097
23100
  ignoredAt: timestamp8("ignored_at"),
@@ -23572,6 +23575,10 @@ var projects = pgTable10(
23572
23575
  runtimeContent: varchar10("runtime_content", { length: 16 }),
23573
23576
  // What the build's setup and the on-demand editor setup last did (0391). @see lib/hosting/setup-state.ts
23574
23577
  setupState: jsonb8("setup_state").$type(),
23578
+ // In-place structure on a code-built site (0402): the release annotator stamps section bands
23579
+ // and the content apply moves, removes and inserts sections in the live HTML. Off for every
23580
+ // project that existed before 0402; on by default after. @see src/lib/hosting/sections-in-place.ts
23581
+ structureInPlace: boolean7("structure_in_place").notNull().default(true),
23575
23582
  // The project's switch for custom dock inputs (0394): { enabled, disabled[] }. NULL = off.
23576
23583
  // @see src/lib/projects/dock-inputs.ts
23577
23584
  dockInputs: jsonb8("dock_inputs").$type(),
@@ -23692,6 +23699,18 @@ var projectFolders = pgTable10("project_folders", {
23692
23699
  name: varchar10("name", { length: 100 }).notNull(),
23693
23700
  ...auditColumns
23694
23701
  });
23702
+ var projectFavorites = pgTable10(
23703
+ "project_favorites",
23704
+ {
23705
+ userId: text11("user_id").notNull(),
23706
+ projectId: text11("project_id").notNull(),
23707
+ // FK → projects.id, ON DELETE CASCADE
23708
+ workspaceId: text11("workspace_id").notNull(),
23709
+ // RLS scope
23710
+ createdAt: timestamp11("created_at").notNull().defaultNow()
23711
+ },
23712
+ (t) => [primaryKey({ columns: [t.userId, t.projectId] })]
23713
+ );
23695
23714
  var projectsRelations = relations9(projects, ({ one, many }) => ({
23696
23715
  workspace: one(workspaces, {
23697
23716
  fields: [projects.workspaceId],
@@ -23985,7 +24004,7 @@ import {
23985
24004
  integer as integer10,
23986
24005
  jsonb as jsonb11,
23987
24006
  timestamp as timestamp18,
23988
- primaryKey,
24007
+ primaryKey as primaryKey2,
23989
24008
  index as index16
23990
24009
  } from "drizzle-orm/pg-core";
23991
24010
  var contentVersions = pgTable17(
@@ -24003,7 +24022,7 @@ var contentVersions = pgTable17(
24003
24022
  (table) => [
24004
24023
  // composite PK: (entryId, version) for uniqueness + soft reference
24005
24024
  // id is kept as a nanoid but not a PK to avoid duplicate primary key error
24006
- primaryKey({ columns: [table.entryId, table.version, table.id] }),
24025
+ primaryKey2({ columns: [table.entryId, table.version, table.id] }),
24007
24026
  // Fast lookups by entry
24008
24027
  index16("content_versions_entry_id_idx").on(table.entryId),
24009
24028
  // version DESC ordering for listing
@@ -24018,7 +24037,7 @@ import {
24018
24037
  integer as integer11,
24019
24038
  jsonb as jsonb12,
24020
24039
  timestamp as timestamp19,
24021
- primaryKey as primaryKey2,
24040
+ primaryKey as primaryKey3,
24022
24041
  index as index17
24023
24042
  } from "drizzle-orm/pg-core";
24024
24043
  var pageVersions = pgTable18(
@@ -24034,7 +24053,7 @@ var pageVersions = pgTable18(
24034
24053
  createdAt: timestamp19("created_at").notNull().defaultNow()
24035
24054
  },
24036
24055
  (table) => [
24037
- primaryKey2({ columns: [table.pageId, table.version, table.id] }),
24056
+ primaryKey3({ columns: [table.pageId, table.version, table.id] }),
24038
24057
  index17("page_versions_page_id_idx").on(table.pageId),
24039
24058
  index17("page_versions_page_version_idx").on(table.pageId, table.version)
24040
24059
  ]
@@ -24208,7 +24227,7 @@ var emailSuppressions = pgTable23(
24208
24227
  );
24209
24228
 
24210
24229
  // src/schema/newsletter.ts
24211
- import { pgTable as pgTable24, text as text25, timestamp as timestamp24, integer as integer14, jsonb as jsonb14, index as index22, primaryKey as primaryKey3 } from "drizzle-orm/pg-core";
24230
+ import { pgTable as pgTable24, text as text25, timestamp as timestamp24, integer as integer14, jsonb as jsonb14, index as index22, primaryKey as primaryKey4 } from "drizzle-orm/pg-core";
24212
24231
  var newsletterIssues = pgTable24(
24213
24232
  "newsletter_issues",
24214
24233
  {
@@ -24257,7 +24276,7 @@ var newsletterSends = pgTable24(
24257
24276
  },
24258
24277
  (t) => [
24259
24278
  // One send per person per issue — this is what makes the drain idempotent.
24260
- primaryKey3({ columns: [t.issueId, t.userId] }),
24279
+ primaryKey4({ columns: [t.issueId, t.userId] }),
24261
24280
  index22("newsletter_sends_claim_idx").on(t.status, t.claimedAt)
24262
24281
  ]
24263
24282
  );
@@ -26399,7 +26418,7 @@ import {
26399
26418
  smallint,
26400
26419
  index as index64,
26401
26420
  uniqueIndex as uniqueIndex31,
26402
- primaryKey as primaryKey4
26421
+ primaryKey as primaryKey5
26403
26422
  } from "drizzle-orm/pg-core";
26404
26423
  import { sql as sql16 } from "drizzle-orm";
26405
26424
  var analyticsEventsRaw = pgTable75(
@@ -26461,7 +26480,7 @@ var analyticsDailyTotals = pgTable75(
26461
26480
  bounces: integer33("bounces")
26462
26481
  },
26463
26482
  (t) => [
26464
- primaryKey4({ columns: [t.projectId, t.day] }),
26483
+ primaryKey5({ columns: [t.projectId, t.day] }),
26465
26484
  index64("analytics_daily_totals_ws_day_idx").on(t.workspaceId, t.day)
26466
26485
  ]
26467
26486
  );
@@ -26476,7 +26495,7 @@ var analyticsDailyPages = pgTable75(
26476
26495
  uniques: integer33("uniques").notNull().default(0),
26477
26496
  bytes: bigint3("bytes", { mode: "number" }).notNull().default(0)
26478
26497
  },
26479
- (t) => [primaryKey4({ columns: [t.projectId, t.day, t.path] })]
26498
+ (t) => [primaryKey5({ columns: [t.projectId, t.day, t.path] })]
26480
26499
  );
26481
26500
  var analyticsDailyReferrers = pgTable75(
26482
26501
  "analytics_daily_referrers",
@@ -26487,7 +26506,7 @@ var analyticsDailyReferrers = pgTable75(
26487
26506
  refererHost: varchar55("referer_host", { length: 255 }).notNull(),
26488
26507
  views: integer33("views").notNull().default(0)
26489
26508
  },
26490
- (t) => [primaryKey4({ columns: [t.projectId, t.day, t.refererHost] })]
26509
+ (t) => [primaryKey5({ columns: [t.projectId, t.day, t.refererHost] })]
26491
26510
  );
26492
26511
  var analyticsDailyBreakdown = pgTable75(
26493
26512
  "analytics_daily_breakdown",
@@ -26501,7 +26520,7 @@ var analyticsDailyBreakdown = pgTable75(
26501
26520
  uniques: integer33("uniques").notNull().default(0)
26502
26521
  },
26503
26522
  (t) => [
26504
- primaryKey4({ columns: [t.projectId, t.day, t.dim, t.key] }),
26523
+ primaryKey5({ columns: [t.projectId, t.day, t.dim, t.key] }),
26505
26524
  index64("analytics_daily_breakdown_ws_day_dim_idx").on(t.workspaceId, t.day, t.dim)
26506
26525
  ]
26507
26526
  );
@@ -26561,7 +26580,7 @@ var indexnowSubmissions = pgTable77(
26561
26580
  );
26562
26581
 
26563
26582
  // src/schema/brand_kit_versions.ts
26564
- import { pgTable as pgTable78, text as text79, integer as integer36, jsonb as jsonb42, timestamp as timestamp72, primaryKey as primaryKey5, index as index66 } from "drizzle-orm/pg-core";
26583
+ import { pgTable as pgTable78, text as text79, integer as integer36, jsonb as jsonb42, timestamp as timestamp72, primaryKey as primaryKey6, index as index66 } from "drizzle-orm/pg-core";
26565
26584
  var brandKitVersions = pgTable78(
26566
26585
  "brand_kit_versions",
26567
26586
  {
@@ -26578,7 +26597,7 @@ var brandKitVersions = pgTable78(
26578
26597
  createdAt: timestamp72("created_at").notNull().defaultNow()
26579
26598
  },
26580
26599
  (t) => [
26581
- primaryKey5({ columns: [t.projectId, t.version, t.id] }),
26600
+ primaryKey6({ columns: [t.projectId, t.version, t.id] }),
26582
26601
  index66("brand_kit_versions_project_created_idx").on(t.projectId, t.version)
26583
26602
  ]
26584
26603
  );
@@ -27354,7 +27373,7 @@ import {
27354
27373
  integer as integer43,
27355
27374
  jsonb as jsonb48,
27356
27375
  pgTable as pgTable87,
27357
- primaryKey as primaryKey6,
27376
+ primaryKey as primaryKey7,
27358
27377
  text as text88,
27359
27378
  timestamp as timestamp80,
27360
27379
  unique as unique6,
@@ -27540,7 +27559,7 @@ var orchestrationRunStartKeys = pgTable87(
27540
27559
  createdAt: timestamp80("created_at", { withTimezone: true }).notNull().defaultNow()
27541
27560
  },
27542
27561
  (table) => [
27543
- primaryKey6({ columns: [table.projectId, table.idempotencyKey] }),
27562
+ primaryKey7({ columns: [table.projectId, table.idempotencyKey] }),
27544
27563
  foreignKey7({
27545
27564
  columns: [table.runId, table.workspaceId, table.projectId],
27546
27565
  foreignColumns: [orchestrationRuns.id, orchestrationRuns.workspaceId, orchestrationRuns.projectId],
@@ -29432,7 +29451,7 @@ var cloneJobs = pgTable100(
29432
29451
 
29433
29452
  // src/schema/project_branches.ts
29434
29453
  import {
29435
- primaryKey as primaryKey7,
29454
+ primaryKey as primaryKey8,
29436
29455
  pgTable as pgTable101,
29437
29456
  text as text102,
29438
29457
  varchar as varchar76,
@@ -29473,7 +29492,7 @@ var branchRowSyncs = pgTable101(
29473
29492
  syncedAt: timestamp94("synced_at").notNull().defaultNow()
29474
29493
  },
29475
29494
  (t) => [
29476
- primaryKey7({ columns: [t.branchId, t.kind, t.parentRowId] }),
29495
+ primaryKey8({ columns: [t.branchId, t.kind, t.parentRowId] }),
29477
29496
  index88("branch_row_syncs_project_idx").on(t.projectId)
29478
29497
  ]
29479
29498
  );
@@ -31021,6 +31040,7 @@ export {
31021
31040
  previewTokenRevocations,
31022
31041
  projectBranches,
31023
31042
  projectEnvVars,
31043
+ projectFavorites,
31024
31044
  projectFolders,
31025
31045
  projectLayoutVersions,
31026
31046
  projectLayouts,