From 7e792c7e8b95871e0a33c76af29b2a473b7674a6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 10:08:00 +0000 Subject: [PATCH] Version Packages --- .../fix-marketplace-settings-repo-key.md | 5 - .changeset/fix-migrate-docs-url.md | 5 - .changeset/fix-singleton-int-id.md | 35 ----- .changeset/restore-db-field-config.md | 64 -------- .changeset/silent-bears-run.md | 5 - .changeset/silver-foxes-migrate.md | 37 ----- .changeset/silver-mice-dream.md | 53 ------- .changeset/swift-wolves-migrate.md | 21 --- packages/auth/CHANGELOG.md | 2 + packages/auth/package.json | 2 +- packages/cli/CHANGELOG.md | 145 ++++++++++++++++++ packages/cli/package.json | 2 +- packages/core/CHANGELOG.md | 145 ++++++++++++++++++ packages/core/package.json | 2 +- packages/rag/CHANGELOG.md | 2 + packages/rag/package.json | 2 +- packages/storage-s3/CHANGELOG.md | 2 + packages/storage-s3/package.json | 2 +- packages/storage-vercel/CHANGELOG.md | 2 + packages/storage-vercel/package.json | 2 +- packages/storage/CHANGELOG.md | 2 + packages/storage/package.json | 2 +- packages/tiptap/CHANGELOG.md | 2 + packages/tiptap/package.json | 2 +- packages/ui/CHANGELOG.md | 2 + packages/ui/package.json | 2 +- 26 files changed, 313 insertions(+), 234 deletions(-) delete mode 100644 .changeset/fix-marketplace-settings-repo-key.md delete mode 100644 .changeset/fix-migrate-docs-url.md delete mode 100644 .changeset/fix-singleton-int-id.md delete mode 100644 .changeset/restore-db-field-config.md delete mode 100644 .changeset/silent-bears-run.md delete mode 100644 .changeset/silver-foxes-migrate.md delete mode 100644 .changeset/silver-mice-dream.md delete mode 100644 .changeset/swift-wolves-migrate.md diff --git a/.changeset/fix-marketplace-settings-repo-key.md b/.changeset/fix-marketplace-settings-repo-key.md deleted file mode 100644 index f2a62f58..00000000 --- a/.changeset/fix-marketplace-settings-repo-key.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@opensaas/stack-cli': patch ---- - -Fix `migrate --with-ai` generating `path` instead of `repo` in Claude marketplace settings diff --git a/.changeset/fix-migrate-docs-url.md b/.changeset/fix-migrate-docs-url.md deleted file mode 100644 index 255ac9b0..00000000 --- a/.changeset/fix-migrate-docs-url.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@opensaas/stack-cli': patch ---- - -Fix broken migration guide URL in `migrate` console output (missing `/docs` prefix) diff --git a/.changeset/fix-singleton-int-id.md b/.changeset/fix-singleton-int-id.md deleted file mode 100644 index 5629ee91..00000000 --- a/.changeset/fix-singleton-int-id.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -'@opensaas/stack-core': patch -'@opensaas/stack-cli': patch ---- - -Fix singleton lists to use `Int @id @default(1)` matching Keystone 6 behaviour - -Singleton lists now generate `Int @id @default(1)` in the Prisma schema instead of -`String @id @default(cuid())`. This matches Keystone 6's behaviour where singleton -records always use integer primary key `1`, making migration from Keystone 6 straightforward -without data loss. - -**Migration guide for existing singleton lists:** - -If you have an existing database with singleton models that use `String @id`, you will need -to run an SQL migration to convert the id column from text to integer: - -```sql --- Example for PostgreSQL (adjust table name as needed) -ALTER TABLE "EmailSettings" ALTER COLUMN id TYPE INTEGER USING id::integer; -UPDATE "EmailSettings" SET id = 1; -``` - -For SQLite (which does not support ALTER COLUMN): - -```sql --- Recreate the table with Int id -CREATE TABLE "EmailSettings_new" (id INTEGER PRIMARY KEY DEFAULT 1, ...); -INSERT INTO "EmailSettings_new" SELECT 1, ... FROM "EmailSettings"; -DROP TABLE "EmailSettings"; -ALTER TABLE "EmailSettings_new" RENAME TO "EmailSettings"; -``` - -New projects and fresh databases will work automatically without any migration steps. -Fixes #350. diff --git a/.changeset/restore-db-field-config.md b/.changeset/restore-db-field-config.md deleted file mode 100644 index e1c741fd..00000000 --- a/.changeset/restore-db-field-config.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -'@opensaas/stack-core': minor ---- - -Add `db.isNullable` and `db.nativeType` support to all field types - -All field types now support two new `db` configuration options that were previously only available in Keystone 6: - -### `db.isNullable` - -Controls DB-level nullability independently of `validation.isRequired`. This allows you to: - -- Make a field non-nullable at the DB level without making it API-required -- Explicitly mark a field as nullable regardless of other settings - -```typescript -fields: { - // DB non-nullable, but API optional (relies on a default value or hook) - phoneNumber: text({ - db: { isNullable: false } - // Generates: phoneNumber String (non-nullable) - }), - - // DB nullable, explicitly set - lastMessagePreview: text({ - db: { isNullable: true } - // Generates: lastMessagePreview String? (nullable) - }), - - // DB non-nullable without API validation (field must always be set via hooks or defaults) - internalCode: integer({ - db: { isNullable: false } - // Generates: internalCode Int (non-nullable) - }) -} -``` - -### `db.nativeType` - -Overrides the native database column type. Generates a `@db.` attribute in the Prisma schema. Available types depend on your database provider. - -```typescript -fields: { - // PostgreSQL: use TEXT instead of VARCHAR for long content - medical: text({ - db: { isNullable: true, nativeType: 'Text' } - // Generates: medical String? @db.Text - }), - - // PostgreSQL: use SMALLINT for small numbers - score: integer({ - db: { nativeType: 'SmallInt' } - // Generates: score Int? @db.SmallInt - }), - - // PostgreSQL: use TIMESTAMPTZ for timezone-aware timestamps - scheduledAt: timestamp({ - db: { nativeType: 'Timestamptz' } - // Generates: scheduledAt DateTime? @db.Timestamptz - }) -} -``` - -Both options are supported on `text`, `integer`, `password`, `json`, `timestamp`, `checkbox` (isNullable only), `decimal`, and `calendarDay` fields. diff --git a/.changeset/silent-bears-run.md b/.changeset/silent-bears-run.md deleted file mode 100644 index 412b3bc2..00000000 --- a/.changeset/silent-bears-run.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@opensaas/stack-cli': patch ---- - -Fix updatedAt field to include @default(now()) in generated Prisma schema to prevent migration failures on databases with existing data diff --git a/.changeset/silver-foxes-migrate.md b/.changeset/silver-foxes-migrate.md deleted file mode 100644 index 252b36ec..00000000 --- a/.changeset/silver-foxes-migrate.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -'@opensaas/stack-cli': minor ---- - -Improve KeystoneJS migration guidance for virtual fields and context.graphql patterns - -The Keystone migration guide now covers two areas that require changes beyond a simple import swap: - -**Virtual fields** — detected automatically; the generated guide shows how to replace `graphql.field({ resolve })` with `hooks: { resolveOutput }` and a `type` declaration: - -```diff -- fullName: virtual({ -- field: graphql.field({ -- type: graphql.String, -- resolve: (item) => `${item.firstName} ${item.lastName}`, -- }), -- }) -+ fullName: virtual({ -+ type: 'string', -+ hooks: { -+ resolveOutput: ({ item }) => `${item.firstName} ${item.lastName}`, -+ }, -+ }) -``` - -**context.graphql calls** — the guide now includes a step showing how to replace `context.graphql.run()` and `context.query.*` with `context.db.{listName}.{method}()`: - -```diff -- const { posts } = await context.graphql.run({ -- query: `query { posts(where: { status: { equals: published } }) { id title } }`, -- }) -+ const posts = await context.db.post.findMany({ -+ where: { status: { equals: 'published' } }, -+ }) -``` - -The introspector warning for virtual fields is also updated to give clearer guidance. diff --git a/.changeset/silver-mice-dream.md b/.changeset/silver-mice-dream.md deleted file mode 100644 index 9a732ee4..00000000 --- a/.changeset/silver-mice-dream.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -'@opensaas/stack-core': minor -'@opensaas/stack-cli': minor ---- - -Add `db.type: 'enum'` support to the `select` field for native database enum storage - -The `select` field now supports `db.type: 'enum'` to store values as a native Prisma enum type rather than a plain string. This generates an `enum` block in the Prisma schema and uses the enum type in the model, matching Keystone 6's enum select behaviour. - -```typescript -import { select } from '@opensaas/stack-core/fields' - -lists: { - Post: list({ - fields: { - status: select({ - options: [ - { label: 'Draft', value: 'draft' }, - { label: 'Published', value: 'published' }, - { label: 'Archived', value: 'archived' }, - ], - db: { type: 'enum' }, // generates a Prisma enum - defaultValue: 'draft', - }), - }, - }), -} -``` - -This generates the following Prisma schema: - -```prisma -enum PostStatus { - draft - published - archived -} - -model Post { - id String @id @default(cuid()) - status PostStatus @default(draft) - createdAt DateTime @default(now()) - updatedAt DateTime @default(now()) @updatedAt -} -``` - -**Notes:** - -- The enum name is derived from `` in PascalCase (e.g. `PostStatus`, `UserRole`) -- Default values use unquoted Prisma enum syntax (`@default(draft)` not `@default("draft")`) -- Enum option values must be valid Prisma identifiers: start with a letter, contain only letters, digits, and underscores (e.g. `in_progress` is valid, `in-progress` is not) -- The TypeScript union type (`'draft' | 'published'`) is generated identically to a string select field -- Omitting `db.type` or setting `db.type: 'string'` (the default) preserves the existing `String` column behaviour diff --git a/.changeset/swift-wolves-migrate.md b/.changeset/swift-wolves-migrate.md deleted file mode 100644 index 8fb09e5a..00000000 --- a/.changeset/swift-wolves-migrate.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -'@opensaas/stack-cli': minor ---- - -Improve KeystoneJS migration agent with side-by-side examples and targeted update guidance - -The Keystone migration wizard and agent now produce a targeted migration guide instead of -regenerating the entire config. Since Keystone and OpenSaaS Stack share the same -`list()`/field/hook/access API, only imports, the database adapter config, and auth setup -need to change. - -Key improvements: - -- The migration agent prompt now includes side-by-side Keystone vs OpenSaaS examples for - config structure, imports, access control, hooks, auth, and many-to-many join tables -- The wizard uses a minimal fast-path for Keystone projects (just 3 questions: db provider, - auth, auth methods) instead of the full question flow -- The generator produces a diff-style migration guide for Keystone showing exactly what to - change, rather than regenerating list definitions the user already has -- Many-to-many join table naming is now surfaced automatically when M2M relations are - detected, with `joinTableNaming: 'keystone'` guidance to preserve existing data diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 98b683ee..54cd52c5 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,7 @@ # @opensaas/stack-auth +## 0.19.0 + ## 0.18.2 ## 0.18.1 diff --git a/packages/auth/package.json b/packages/auth/package.json index 5b32012b..d29410bc 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-auth", - "version": "0.18.2", + "version": "0.19.0", "description": "Better-auth integration for OpenSaas Stack", "type": "module", "main": "./dist/index.js", diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index d5fd1cfa..becbbd69 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,150 @@ # @opensaas/stack-cli +## 0.19.0 + +### Minor Changes + +- [#346](https://github.com/OpenSaasAU/stack/pull/346) [`aa5edec`](https://github.com/OpenSaasAU/stack/commit/aa5edecfbd2fc2dcab67479088d4c6ff2dd24600) Thanks [@borisno2](https://github.com/borisno2)! - Improve KeystoneJS migration guidance for virtual fields and context.graphql patterns + + The Keystone migration guide now covers two areas that require changes beyond a simple import swap: + + **Virtual fields** — detected automatically; the generated guide shows how to replace `graphql.field({ resolve })` with `hooks: { resolveOutput }` and a `type` declaration: + + ```diff + - fullName: virtual({ + - field: graphql.field({ + - type: graphql.String, + - resolve: (item) => `${item.firstName} ${item.lastName}`, + - }), + - }) + + fullName: virtual({ + + type: 'string', + + hooks: { + + resolveOutput: ({ item }) => `${item.firstName} ${item.lastName}`, + + }, + + }) + ``` + + **context.graphql calls** — the guide now includes a step showing how to replace `context.graphql.run()` and `context.query.*` with `context.db.{listName}.{method}()`: + + ```diff + - const { posts } = await context.graphql.run({ + - query: `query { posts(where: { status: { equals: published } }) { id title } }`, + - }) + + const posts = await context.db.post.findMany({ + + where: { status: { equals: 'published' } }, + + }) + ``` + + The introspector warning for virtual fields is also updated to give clearer guidance. + +- [#348](https://github.com/OpenSaasAU/stack/pull/348) [`5410cb6`](https://github.com/OpenSaasAU/stack/commit/5410cb604198e087762e39c8aec87fe3736d8c01) Thanks [@borisno2](https://github.com/borisno2)! - Add `db.type: 'enum'` support to the `select` field for native database enum storage + + The `select` field now supports `db.type: 'enum'` to store values as a native Prisma enum type rather than a plain string. This generates an `enum` block in the Prisma schema and uses the enum type in the model, matching Keystone 6's enum select behaviour. + + ```typescript + import { select } from '@opensaas/stack-core/fields' + + lists: { + Post: list({ + fields: { + status: select({ + options: [ + { label: 'Draft', value: 'draft' }, + { label: 'Published', value: 'published' }, + { label: 'Archived', value: 'archived' }, + ], + db: { type: 'enum' }, // generates a Prisma enum + defaultValue: 'draft', + }), + }, + }), + } + ``` + + This generates the following Prisma schema: + + ```prisma + enum PostStatus { + draft + published + archived + } + + model Post { + id String @id @default(cuid()) + status PostStatus @default(draft) + createdAt DateTime @default(now()) + updatedAt DateTime @default(now()) @updatedAt + } + ``` + + **Notes:** + - The enum name is derived from `` in PascalCase (e.g. `PostStatus`, `UserRole`) + - Default values use unquoted Prisma enum syntax (`@default(draft)` not `@default("draft")`) + - Enum option values must be valid Prisma identifiers: start with a letter, contain only letters, digits, and underscores (e.g. `in_progress` is valid, `in-progress` is not) + - The TypeScript union type (`'draft' | 'published'`) is generated identically to a string select field + - Omitting `db.type` or setting `db.type: 'string'` (the default) preserves the existing `String` column behaviour + +- [#342](https://github.com/OpenSaasAU/stack/pull/342) [`94b0df6`](https://github.com/OpenSaasAU/stack/commit/94b0df65c860348441200d914dbf37bda3bd25cf) Thanks [@borisno2](https://github.com/borisno2)! - Improve KeystoneJS migration agent with side-by-side examples and targeted update guidance + + The Keystone migration wizard and agent now produce a targeted migration guide instead of + regenerating the entire config. Since Keystone and OpenSaaS Stack share the same + `list()`/field/hook/access API, only imports, the database adapter config, and auth setup + need to change. + + Key improvements: + - The migration agent prompt now includes side-by-side Keystone vs OpenSaaS examples for + config structure, imports, access control, hooks, auth, and many-to-many join tables + - The wizard uses a minimal fast-path for Keystone projects (just 3 questions: db provider, + auth, auth methods) instead of the full question flow + - The generator produces a diff-style migration guide for Keystone showing exactly what to + change, rather than regenerating list definitions the user already has + - Many-to-many join table naming is now surfaced automatically when M2M relations are + detected, with `joinTableNaming: 'keystone'` guidance to preserve existing data + +### Patch Changes + +- [#345](https://github.com/OpenSaasAU/stack/pull/345) [`c815d2f`](https://github.com/OpenSaasAU/stack/commit/c815d2f02a81b16189e8eea0e635ea1aa0a1d6ec) Thanks [@borisno2](https://github.com/borisno2)! - Fix `migrate --with-ai` generating `path` instead of `repo` in Claude marketplace settings + +- [#345](https://github.com/OpenSaasAU/stack/pull/345) [`c815d2f`](https://github.com/OpenSaasAU/stack/commit/c815d2f02a81b16189e8eea0e635ea1aa0a1d6ec) Thanks [@borisno2](https://github.com/borisno2)! - Fix broken migration guide URL in `migrate` console output (missing `/docs` prefix) + +- [#352](https://github.com/OpenSaasAU/stack/pull/352) [`bd41b1e`](https://github.com/OpenSaasAU/stack/commit/bd41b1e75b78c2e9748422352e6a500ed26df4e9) Thanks [@borisno2](https://github.com/borisno2)! - Fix singleton lists to use `Int @id @default(1)` matching Keystone 6 behaviour + + Singleton lists now generate `Int @id @default(1)` in the Prisma schema instead of + `String @id @default(cuid())`. This matches Keystone 6's behaviour where singleton + records always use integer primary key `1`, making migration from Keystone 6 straightforward + without data loss. + + **Migration guide for existing singleton lists:** + + If you have an existing database with singleton models that use `String @id`, you will need + to run an SQL migration to convert the id column from text to integer: + + ```sql + -- Example for PostgreSQL (adjust table name as needed) + ALTER TABLE "EmailSettings" ALTER COLUMN id TYPE INTEGER USING id::integer; + UPDATE "EmailSettings" SET id = 1; + ``` + + For SQLite (which does not support ALTER COLUMN): + + ```sql + -- Recreate the table with Int id + CREATE TABLE "EmailSettings_new" (id INTEGER PRIMARY KEY DEFAULT 1, ...); + INSERT INTO "EmailSettings_new" SELECT 1, ... FROM "EmailSettings"; + DROP TABLE "EmailSettings"; + ALTER TABLE "EmailSettings_new" RENAME TO "EmailSettings"; + ``` + + New projects and fresh databases will work automatically without any migration steps. + Fixes #350. + +- [#344](https://github.com/OpenSaasAU/stack/pull/344) [`c259030`](https://github.com/OpenSaasAU/stack/commit/c259030dab3cdc641a9f40dd21746a1bd46fb76d) Thanks [@borisno2](https://github.com/borisno2)! - Fix updatedAt field to include @default(now()) in generated Prisma schema to prevent migration failures on databases with existing data + +- Updated dependencies [[`bd41b1e`](https://github.com/OpenSaasAU/stack/commit/bd41b1e75b78c2e9748422352e6a500ed26df4e9), [`28f2834`](https://github.com/OpenSaasAU/stack/commit/28f2834b199b93200c74cefb1594ba3704f0a839), [`5410cb6`](https://github.com/OpenSaasAU/stack/commit/5410cb604198e087762e39c8aec87fe3736d8c01)]: + - @opensaas/stack-core@0.19.0 + ## 0.18.2 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index add056ed..4a308862 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-cli", - "version": "0.18.2", + "version": "0.19.0", "description": "CLI tools for OpenSaas Stack", "type": "module", "main": "./dist/index.js", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index c3cecc50..4ab4000f 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,150 @@ # @opensaas/stack-core +## 0.19.0 + +### Minor Changes + +- [#353](https://github.com/OpenSaasAU/stack/pull/353) [`28f2834`](https://github.com/OpenSaasAU/stack/commit/28f2834b199b93200c74cefb1594ba3704f0a839) Thanks [@borisno2](https://github.com/borisno2)! - Add `db.isNullable` and `db.nativeType` support to all field types + + All field types now support two new `db` configuration options that were previously only available in Keystone 6: + + ### `db.isNullable` + + Controls DB-level nullability independently of `validation.isRequired`. This allows you to: + - Make a field non-nullable at the DB level without making it API-required + - Explicitly mark a field as nullable regardless of other settings + + ```typescript + fields: { + // DB non-nullable, but API optional (relies on a default value or hook) + phoneNumber: text({ + db: { isNullable: false } + // Generates: phoneNumber String (non-nullable) + }), + + // DB nullable, explicitly set + lastMessagePreview: text({ + db: { isNullable: true } + // Generates: lastMessagePreview String? (nullable) + }), + + // DB non-nullable without API validation (field must always be set via hooks or defaults) + internalCode: integer({ + db: { isNullable: false } + // Generates: internalCode Int (non-nullable) + }) + } + ``` + + ### `db.nativeType` + + Overrides the native database column type. Generates a `@db.` attribute in the Prisma schema. Available types depend on your database provider. + + ```typescript + fields: { + // PostgreSQL: use TEXT instead of VARCHAR for long content + medical: text({ + db: { isNullable: true, nativeType: 'Text' } + // Generates: medical String? @db.Text + }), + + // PostgreSQL: use SMALLINT for small numbers + score: integer({ + db: { nativeType: 'SmallInt' } + // Generates: score Int? @db.SmallInt + }), + + // PostgreSQL: use TIMESTAMPTZ for timezone-aware timestamps + scheduledAt: timestamp({ + db: { nativeType: 'Timestamptz' } + // Generates: scheduledAt DateTime? @db.Timestamptz + }) + } + ``` + + Both options are supported on `text`, `integer`, `password`, `json`, `timestamp`, `checkbox` (isNullable only), `decimal`, and `calendarDay` fields. + +- [#348](https://github.com/OpenSaasAU/stack/pull/348) [`5410cb6`](https://github.com/OpenSaasAU/stack/commit/5410cb604198e087762e39c8aec87fe3736d8c01) Thanks [@borisno2](https://github.com/borisno2)! - Add `db.type: 'enum'` support to the `select` field for native database enum storage + + The `select` field now supports `db.type: 'enum'` to store values as a native Prisma enum type rather than a plain string. This generates an `enum` block in the Prisma schema and uses the enum type in the model, matching Keystone 6's enum select behaviour. + + ```typescript + import { select } from '@opensaas/stack-core/fields' + + lists: { + Post: list({ + fields: { + status: select({ + options: [ + { label: 'Draft', value: 'draft' }, + { label: 'Published', value: 'published' }, + { label: 'Archived', value: 'archived' }, + ], + db: { type: 'enum' }, // generates a Prisma enum + defaultValue: 'draft', + }), + }, + }), + } + ``` + + This generates the following Prisma schema: + + ```prisma + enum PostStatus { + draft + published + archived + } + + model Post { + id String @id @default(cuid()) + status PostStatus @default(draft) + createdAt DateTime @default(now()) + updatedAt DateTime @default(now()) @updatedAt + } + ``` + + **Notes:** + - The enum name is derived from `` in PascalCase (e.g. `PostStatus`, `UserRole`) + - Default values use unquoted Prisma enum syntax (`@default(draft)` not `@default("draft")`) + - Enum option values must be valid Prisma identifiers: start with a letter, contain only letters, digits, and underscores (e.g. `in_progress` is valid, `in-progress` is not) + - The TypeScript union type (`'draft' | 'published'`) is generated identically to a string select field + - Omitting `db.type` or setting `db.type: 'string'` (the default) preserves the existing `String` column behaviour + +### Patch Changes + +- [#352](https://github.com/OpenSaasAU/stack/pull/352) [`bd41b1e`](https://github.com/OpenSaasAU/stack/commit/bd41b1e75b78c2e9748422352e6a500ed26df4e9) Thanks [@borisno2](https://github.com/borisno2)! - Fix singleton lists to use `Int @id @default(1)` matching Keystone 6 behaviour + + Singleton lists now generate `Int @id @default(1)` in the Prisma schema instead of + `String @id @default(cuid())`. This matches Keystone 6's behaviour where singleton + records always use integer primary key `1`, making migration from Keystone 6 straightforward + without data loss. + + **Migration guide for existing singleton lists:** + + If you have an existing database with singleton models that use `String @id`, you will need + to run an SQL migration to convert the id column from text to integer: + + ```sql + -- Example for PostgreSQL (adjust table name as needed) + ALTER TABLE "EmailSettings" ALTER COLUMN id TYPE INTEGER USING id::integer; + UPDATE "EmailSettings" SET id = 1; + ``` + + For SQLite (which does not support ALTER COLUMN): + + ```sql + -- Recreate the table with Int id + CREATE TABLE "EmailSettings_new" (id INTEGER PRIMARY KEY DEFAULT 1, ...); + INSERT INTO "EmailSettings_new" SELECT 1, ... FROM "EmailSettings"; + DROP TABLE "EmailSettings"; + ALTER TABLE "EmailSettings_new" RENAME TO "EmailSettings"; + ``` + + New projects and fresh databases will work automatically without any migration steps. + Fixes #350. + ## 0.18.2 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 5e793236..b158386e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-core", - "version": "0.18.2", + "version": "0.19.0", "description": "Core stack for OpenSaas - schema definition, access control, and runtime utilities", "type": "module", "main": "./dist/index.js", diff --git a/packages/rag/CHANGELOG.md b/packages/rag/CHANGELOG.md index fb4a0781..fe696144 100644 --- a/packages/rag/CHANGELOG.md +++ b/packages/rag/CHANGELOG.md @@ -1,5 +1,7 @@ # @opensaas/stack-rag +## 0.19.0 + ## 0.18.2 ## 0.18.1 diff --git a/packages/rag/package.json b/packages/rag/package.json index 2f3c07a0..fcac04dd 100644 --- a/packages/rag/package.json +++ b/packages/rag/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-rag", - "version": "0.18.2", + "version": "0.19.0", "description": "RAG and AI embeddings integration for OpenSaas Stack", "type": "module", "main": "./dist/index.js", diff --git a/packages/storage-s3/CHANGELOG.md b/packages/storage-s3/CHANGELOG.md index 120a42ee..82a5e8de 100644 --- a/packages/storage-s3/CHANGELOG.md +++ b/packages/storage-s3/CHANGELOG.md @@ -1,5 +1,7 @@ # @opensaas/stack-storage-s3 +## 0.19.0 + ## 0.18.2 ## 0.18.1 diff --git a/packages/storage-s3/package.json b/packages/storage-s3/package.json index ca32a1c1..a4cdc42f 100644 --- a/packages/storage-s3/package.json +++ b/packages/storage-s3/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-storage-s3", - "version": "0.18.2", + "version": "0.19.0", "description": "AWS S3 storage provider for OpenSaas Stack file uploads", "type": "module", "exports": { diff --git a/packages/storage-vercel/CHANGELOG.md b/packages/storage-vercel/CHANGELOG.md index 238832e1..b0b985e1 100644 --- a/packages/storage-vercel/CHANGELOG.md +++ b/packages/storage-vercel/CHANGELOG.md @@ -1,5 +1,7 @@ # @opensaas/stack-storage-vercel +## 0.19.0 + ## 0.18.2 ## 0.18.1 diff --git a/packages/storage-vercel/package.json b/packages/storage-vercel/package.json index 4159ce0b..73e293bd 100644 --- a/packages/storage-vercel/package.json +++ b/packages/storage-vercel/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-storage-vercel", - "version": "0.18.2", + "version": "0.19.0", "description": "Vercel Blob storage provider for OpenSaas Stack file uploads", "type": "module", "exports": { diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index 28c1b629..5344ae3f 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,7 @@ # @opensaas/stack-storage +## 0.19.0 + ## 0.18.2 ## 0.18.1 diff --git a/packages/storage/package.json b/packages/storage/package.json index 4b2bed5a..1125cdd7 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-storage", - "version": "0.18.2", + "version": "0.19.0", "description": "File and image upload field types with pluggable storage providers for OpenSaas Stack", "type": "module", "exports": { diff --git a/packages/tiptap/CHANGELOG.md b/packages/tiptap/CHANGELOG.md index fe02e1b8..b5d7ea89 100644 --- a/packages/tiptap/CHANGELOG.md +++ b/packages/tiptap/CHANGELOG.md @@ -1,5 +1,7 @@ # @opensaas/stack-tiptap +## 0.19.0 + ## 0.18.2 ## 0.18.1 diff --git a/packages/tiptap/package.json b/packages/tiptap/package.json index 4ffe5f33..62f23cd3 100644 --- a/packages/tiptap/package.json +++ b/packages/tiptap/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-tiptap", - "version": "0.18.2", + "version": "0.19.0", "description": "Tiptap rich text editor integration for OpenSaas Stack", "type": "module", "main": "./dist/index.js", diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index c295ae1c..2a875743 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -1,5 +1,7 @@ # @opensaas/stack-ui +## 0.19.0 + ## 0.18.2 ## 0.18.1 diff --git a/packages/ui/package.json b/packages/ui/package.json index d185d922..9113ce53 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-ui", - "version": "0.18.2", + "version": "0.19.0", "description": "Composable React UI components for OpenSaas Stack", "type": "module", "main": "./dist/index.js",