Upgrading
Upgrading 0.30 to 0.31
Upgrading 0.30 → 0.31
Section titled “Upgrading 0.30 → 0.31”0.31 makes the backend Postgres-first. The tables you declare with defineTable in backend/schema/ are the only thing the backend knows about your data; what the admin panel shows on top of them lives in the frontend. Almost every entry below is one consequence of that split, and almost all of it is done for you by one command.
The checklist, per project
Section titled “The checklist, per project”-
Bump every
@rebasepropackage first, in every workspace package, so the types the codemod reads are 0.31’s:pnpm -r up "@rebasepro/*@0.31.0", thenpnpm install. A project on a release before 0.30 applies the code changes of the guides in between first (Upgrading), and meets 0.31’s toolchain floors — Node 22.22, TypeScript 6, React 19.2.7, React Router 8, Vite 8 (the list): the codemod loads a 0.20–0.29config/and its SQL check passes, but that check compares the 0.31 compiler with itself — only step 7, against your database, proves the generated DDL is what your database has. -
Commit, then run the codemod as a dry run:
rebase migrate collections-to-tables --dry-run. It prints the files it would write, what it refuses (with file and line), the notes and the manual steps, and writes nothing. Fix what it refuses inconfig/first. -
Run it for real:
rebase migrate collections-to-tables. It writesbackend/schema/,frontend/src/cms/(withui-config.json), thebackend/modules and the project files, addsrebaseBackendGuard()to the scaffold’svite.config.ts, rewrites your SDK calls, moves the imports of names 0.31 moved to another package (section 135), and proves the generated SQL byte-identical — or puts every file back. See section 108. -
Read the last section of its output, “Review before deploying: these rules change meaning”, and decide each rule it lists (below).
-
Do the manual steps it prints, in order. Each names its file, and most carry the snippet to write: the
<RebaseCMS>mount withtableCustomizationsanduiConfigwhen yourApp.tsxis not the scaffold’s (or the panel is mounted in another module, which the step names),rebaseBackendGuard()when yourvite.config.tsis not and in every other static app ofrebase.json(section 130), global hooks, an import of a name 0.31 removed (section 135), andrebase skills installwhen the project holds agent skills (section 128). Runpnpm installwhen the output lists “Dependencies added”. Then read two lists in the SDK part of the output:- “Rewritten by name — review”:
.collection(calls on a receiver with no type (any), rewritten because the receiver is nameddataAsAdmin, or is.datawith a literal table name; thecollectionmember of a type adata/dataAsAdminslot holds; and test doubles. Check each is the SDK. - “Left unchanged — check each”:
.collection(calls the codemod did not prove to be the SDK, such as a call through a type your project declares itself. A call left here that is the SDK fails at runtime on 0.31: rename it to.table(by hand. Code that tests whethercollectionexists (typeof data.collection === "function") is a manual step: on 0.31 it silently takes the other branch.
A file committed as build output (a bundled or minified
.js) is never edited: it is listed, so rebuild it after migrating, and replace a vendored copy of the client with the 0.31 build. Repeated steps of one kind are printed once, listing every file and line they are about;--jsonkeeps each step separately. Then read What projects changed by hand: the edits real projects still made after these steps. - “Rewritten by name — review”:
-
Run the
git rmline the codemod printed once the diff is reviewed andrebase migrate collections-to-tables --checkpasses:git rm -r config/collections …and the wiring it moved tobackend/, orgit rm -r configwhen nothing of your own is left there (section 109). The next three steps need it done:generate-sdk,db push,doctorandverifyrefuse a project that still hasconfig/collections. -
rebase generate-sdk— the generated module’s names changed (section 115). -
Against your database, run
rebase db push --dry-runand expect “No changes: the database already matches these tables.”, thenrebase doctor --policiesand expect no policy drift. The codemod’s SQL check proves the conversion faithful; these two prove it against the real database, and any policy difference either one lists is a change in who can access what. -
rebase verify— it now also readsfrontend/src/cms: a customization naming a table or field that does not exist, a required column kept off the form, a missingrebaseBackendGuard(), aui-config.jsonnot passed to<RebaseCMS>. -
Rebuild and deploy. A bundle built before 0.31 does not boot on a 0.31 runtime (section 112). The first boot restamps the database’s schema version once (section 113).
Run rebase migrate collections-to-tables --check in CI until config/ is gone: it verifies the migrated tables still render the same SQL as the collections they came from, and exits 1 while a rule listed under “Review before deploying” is unacknowledged — pass --accept-rule-changes once you have reviewed them.
Review before deploying: these rules change meaning
Section titled “Review before deploying: these rules change meaning”The codemod carries every security rule as written, and each keeps its policy name. But the 0.30 compiler read only the first of condition, using, access: "public" and ownerField, and knew no other access value, so four shapes of rule now grant something different. Two of them widen access:
| The rule | 0.30 granted | 0.31 grants | |
|---|---|---|---|
a bare access: "authenticated" (no roles) |
nothing | every signed-in caller, guests included | widens |
access + check, no condition, on select / update / delete / all |
no existing row | every existing row, to the access callers |
widens |
access: "authenticated" + condition |
anyone matching condition |
only signed-in callers matching it | narrows |
access: "authenticated" + check, on insert |
anyone inserting a matching row | only signed-in callers | narrows |
The commonest is the first. Write access: "registered" to admit only callers with an account (not anonymous guests), or remove the rule to keep granting nothing. access with roles, and a plain-object condition, mean what they did and are not listed.
The codemod also refuses a rule the 0.31 compiler refuses: one that combines clauses the SecurityRule type excludes (access beside ownerField, using or withCheck; ownerField beside using, withCheck, condition or check; condition or check beside using or withCheck), and one with an invalid access, mode, operation(s) or roles value — a misspelt "restrictive" used to compile as permissive. See Security rules.
What else behaves differently
Section titled “What else behaves differently”- What
GET /api/schema/tablestells a person. Administrators andschema:readholders get every table. Any other signed-in person, guests included, gets only the tables their roles can reach, with only the rules that can apply to them; relations into other tables are dropped and hook flags withheld. A frontend that read another table’s description as a regular user gets less;schemaTables: { persons: "all" }in the backend options restores the full description. See Endpoints. - Relation names are exact, and big-integer foreign keys are numbers (section 131).
- History is served masked (section 132).
- MCP tool names and the view payload change together for the hosted connector and the runtimes it reaches (section 122).
- Narrowed on purpose. Audit stamps (
.onCreateNow()/.onUpdateNow()columns) are hidden from the panel’s list columns by default: a migrated list that showedcreated_atloses that column until you writefields: { created_at: { hidden: false } }in itscustomizeTable. The codemod refuses, with the reason, tuple JSON arrays, avector/binary/referenceinside a map,databaseIdon a Postgres collection,isId: "cuid", a soleisIdrelation anddisableDefaultPolicies: truewith no rules. A one-column relation into a table with a composite key is refused (write it withrel.via()). OpenAPI tags come from the slug, not the display name.rebase schema introspectleaves out a table with no primary key and says why (a server introspecting the database still serves it). A plain view declaringrolesis a compile error; the codemod drops it with a note. - What real projects still changed by hand — toolchain floors,
({ entity })in admin code, includes of a renamed relation, collection objects changed at run time, SDK calls on untyped receivers: What projects changed by hand. - A restore to another cluster. The default-admin policies’ stamp hashes role OIDs, so after a dump or point-in-time restore into a different cluster the first
db pushor boot re-creates those policies once, with the same names and the same SQL.
The words
Section titled “The words”| Before | Now | Where “collection” stays |
|---|---|---|
a collection in config/collections/ |
a table in backend/schema/ (defineTable) |
— |
properties |
columns (col.*) and relations (rel.*) |
— |
securityRules, defaultSecurityRules |
rls (required), defaultRls |
— |
callbacks, Property.callbacks |
hooks, a column’s .transform() |
— |
the admin block |
customizeTable in frontend/src/cms/ |
— |
data.collection(slug) |
data.table(slug) |
— |
| what the admin panel draws | a collection: a table as the panel shows it, or a Firestore collection | the CMS: CollectionPanel, the Collection Editor, externalCollections |
108. Tables in backend/schema replace config/collections — run the codemod first
Section titled “108. Tables in backend/schema replace config/collections — run the codemod first”Who this hits: every project with a config/collections/ directory.
What changed: the backend reads only backend/schema/index.ts and the defineTable, defineAuthTable and defineView results it exports. defineCollection files are not read by anything: the runtime, every CLI command and rebase.json validation refuse a project that still has config/collections, naming the command below. rls is required on every table — a list of rules, "admin-only", or "inherit" for the defaultRls the index exports — and disableDefaultPolicies is defaultPolicies: false.
What to do:
rebase migrate collections-to-tables # or --dry-run firstIt writes one table per collection, every physical column explicit at its original position (so a belongsTo‘s key column is written out), the index with defaultRls from defaultSecurityRules, a customizeTable for each collection whose presentation was not the default, and defineFirestoreCollection files for Firestore collections. A collection’s callbacks become its table’s hooks and its columns’ .transform()s; the global callbacks config/index.ts exported are a manual step (section 109). Then it reads the result back through the new pipeline: DDL, policies, search, vector, triggers, views and the Drizzle schema must be byte-identical to what the collections generated, or every file is put back and the run exits 1 with the diff.
It also carries what used to need hand work:
- Callbacks built by a helper (
callbacks: softDeleteCallbacks(...), or an imported callbacks object) becomehooks:with the same expression, and the helper’s functions are converted to table-hook props where they are written (the codemod follows relative imports,consts, property reads and a singlereturn). When it cannot follow the helper, a step names the hooks to check. - A function
storagePathmigrates as two halves: the function becomes the customization’sstorage.path, so the panel still chooses where an upload goes, and the column’spathtemplate is the shape of the keys it returns — the static text of its template literal with each${…}as{path}(`${owner}/cv`→{path}/cv). The server now applies the column’smaxBytesandacceptto every upload whose key matches that template, not only to one that names the column, so the limits are stricter than on 0.30. A function whose result has no static text is refused: give it one first. - A 0.30
policy.existsIn({ collection })keeps its table, andauth: { collection: usersCollection }in a custom backend entry is dropped (thedefineAuthTableis the auth table). Acollectionsboot option becomesschemaDir. - A
dynamicPropsbuilder returns a field customization with flat keys on 0.31 ({ readOnly: true }, not{ admin: { readOnly: true } }). The codemod rewrites a builder whose returns are object literals, inline or in a shared module, and lists any other. - Presentation spread in from one shared object is carried into the customization (
….dynamicProps); presentation a wrapper function computes is a step to check, not a refusal of the project. A component path is resolved against the module that wrote it, and a value computed whenconfig/loads (new Date(),Date.now(), an environment read) is carried as its expression, never frozen to the run’s value. - Firestore collections a function builds (a
getAllFirestoreCollections()the app spreads into the panel) are converted todefineFirestoreCollectionone by one where a collection’s file holds its literal; one step per builder names the rest and the shape to write, and another names a reference written outside a converted literal, which would still saypath. - Imports of
config/through a path alias (a tsconfigpathsentry, a Viteresolve.alias) are rewritten or listed like relative ones, and astorageAuthorizethatconfig/index.tsre-exports is carried tobackend/storage.ts. - A relation renamed to
<key>Relationkeeps its label, list column and title: the customization names the new key. Code that includes it does not follow (what to change).
What it cannot carry exactly is refused with its file and line, and nothing is written: a collection built by calling a function, a spread or accessor it cannot read through, an engine other than Postgres or Firestore, an output file that exists with other content (move it aside, or --force). A dirty git tree or a project outside git is refused too, so the migration is one reviewable diff. --json prints the whole report for a script or an agent. See rebase migrate and Tables.
The tables it writes spell their columns as Drizzle’s pg-core does — col.varchar({ length: 160 }), col.timestamp({ withTimezone: true }), col.text().array(), pgEnum(...), .default(sql`…`), .generatedByDefaultAsIdentity() — so its output needs nothing more; see Columns. A table written by hand against a 0.31 pre-release in the earlier spellings (col.timestamptz(), col.varchar(160), col.array(col.text()), col.enum(values, { name }), .defaultSql(), .identity(), .column("…")) no longer compiles: tooling/scripts/drizzle-sweep.mts in the Rebase repository converts it, rewriting only the builder chains, and with --verify proves every converted table compiles to the same descriptor (npx tsx drizzle-sweep.mts --verify backend/schema).
The sdk-calls pass that follows also rewrites rule sources: existsIn({ collection }) and membership: { collection } become table (section 123); --skip-sdk-calls skips that too. What is left to you is printed as numbered manual steps, and when the project holds installed agent skills the last one is the rebase skills install line that refreshes them (section 128). A bare rebase migrate prints the help for both subcommands.
109. There is no config package
Section titled “109. There is no config package”Who this hits: every project — config/ was a workspace of its own.
0.31 stops reading config/collections; it does not forbid config/. The codemod removes what Rebase read — the collection files and the wiring it moves to backend/ (resources.ts, storage.ts, generated/register.ts, and the re-exports of those in config/index.ts) — and leaves your own modules in config/ where they are, importable as before: config/ stays a workspace package, and the backend still compiles ../config/**/*. Only imports of what goes are rewritten: a collection file imported by backend code points at the table module (a step lists the uses that read it as an object); imported by frontend code, it becomes a type import of the table where it is used only as a type, or a step naming the customization; a helper inside config/collections is copied next to the code that needs it.
What changed: what lived beside the collections moves into backend/:
| Before | Now |
|---|---|
config/resources.ts |
backend/resources.ts |
config/storage.ts, storageAuthorize from config/index.ts |
backend/storage.ts |
callbacks exported from config/index.ts |
hooks exported from backend/hooks.ts (TableHooks: table for collection, values for row) |
config/generated/register.ts |
backend/generated/register.ts |
rebase.json config, usersCollection |
tables (default backend/schema); the auth table is the one declared with defineAuthTable |
The runtime reads storageAuthorize and hooks and nothing else from those modules; any other export is reported at boot. The frontend imports backend/** as types only — pnpm check:frontend-backend-imports refuses a value import, which would ship server code to the browser.
What to do: the codemod moves resources.ts, storage.ts and the registration, and rewrites rebase.json, package.json, pnpm-workspace.yaml and backend/tsconfig.json. The global callbacks are a manual step it prints: move them to backend/hooks.ts by hand, and add hooks.ts to the include of backend/tsconfig.json so tsc checks it. Then run the git rm line it prints: git rm -r config/collections …, or git rm -r config when nothing of your own is left.
110. Boot options and hooks name tables
Section titled “110. Boot options and hooks name tables”Who this hits: a backend you boot yourself (initializeRebaseBackend, createRebaseBackend), and code that attaches hooks after boot.
What changed:
| Before | Now |
|---|---|
collections, collectionsDir |
tables, defaultRls, schemaDir |
callbacks |
hooks |
auth.collection |
gone: the defineAuthTable in tables |
backend.setCollectionCallbacks(slug, cb) |
backend.setTableHooks(slug, hooks) |
hook props collection, row |
table (the descriptor), values |
composeCallbacks |
composeTableHooks from @rebasepro/common |
openRebase({ collections, callbacks }) |
openRebase({ tables, hooks }), tables from compileSchema([...]) |
OpenedRebase.collections; the rebase console variable collections |
.tables; tables |
await initializeRebaseBackend({ app, server, collectionsDir: "./config/collections", callbacks });await initializeRebaseBackend({ app, server, schemaDir: path.resolve(__dirname, "../schema"), hooks });Hooks attached to a collection object you passed at a call site no longer run: the driver runs the hooks of the tables it serves, so attach them with setTableHooks.
What to do: rebase migrate sdk-calls rewrites setCollectionCallbacks and adapts the hook props, and lists each backend options object to update by hand. A script that opens the data compiles its tables:
const rebase = await openRebase({ databaseUrl, collections, callbacks });const rebase = await openRebase({ databaseUrl, tables: compileSchema([products, orders]), hooks });See Scripts. See Backend overview and Global hooks.
111. The admin panel renders the tables the server serves
Section titled “111. The admin panel renders the tables the server serves”Who this hits: every frontend that mounts <RebaseCMS>.
What changed: <RebaseCMS collections> is gone. The panel shows every table the backend serves at GET /api/schema/tables, with no file per table, then externalCollections (Firestore). tableCustomizations takes the customizeTable objects from frontend/src/cms/. The Vite collections plugin and virtual:rebase-collections are removed. CollectionsProvider takes the same three inputs (tableCustomizations, externalCollections, tables).
import { collections } from "virtual:rebase-collections";<RebaseCMS collections={collections}/>import { postsCms } from "./cms/posts";<RebaseCMS tableCustomizations={[postsCms]}/>What to do: the codemod writes frontend/src/cms/index.ts, which exports tableCustomizations (and externalCollections), and mounts it in a scaffold’s App.tsx itself; an App.tsx it does not recognise, the plugin in vite.config.ts and the virtual module declaration are manual steps it prints. See Customizing a table.
112. Bundle format 3; format-2 bundles are refused
Section titled “112. Bundle format 3; format-2 bundles are refused”Who this hits: every deployment of a built bundle — self-hosted with the runtime image, or on Rebase Cloud.
What changed: a bundle’s schema is entry.tables, beside entry.resources, entry.storage and entry.hooks; bundleFormat is 3 and the runtime contract 2. A format-1 or format-2 bundle carries config/collections, which a 0.31 runtime has nothing to read with, so it refuses to boot with the codemod in the message rather than introspecting the database and serving a different API.
What to do: migrate the source, then rebase build and deploy. On Rebase Cloud, deploying the migrated repository rebuilds it. See Runtime and bundles.
On Rebase Cloud, a project still on 0.30 keeps running but cannot deploy. The platform keeps serving the bundle it has, and its runtime updates stop there (the console says so), but it accepts format 3 only: a deploy from a 0.30 CLI uploads the whole bundle and is then refused with BUNDLE_FORMAT_TOO_OLD. The way forward is the same three commands on any project:
pnpm exec rebase upgrade --to latestrebase migrate collections-to-tablesrebase cloud deployA CLI from after 0.32.0 refuses earlier, before it builds or uploads anything: rebase build and rebase cloud deploy on a project whose tables are still in config/collections stop with the codemod’s name, a --bundle-dir holding a format-2 bundle is refused with “Nothing was uploaded”, and rebase upgrade names the codemod as the next step instead of rebase build. (0.30’s own rebase upgrade still ends by saying “Run rebase build”; the build it points to is the one that stops.)
113. The schema version is computed from tables (v2:)
Section titled “113. The schema version is computed from tables (v2:)”Who this hits: every database a runtime before 0.31 provisioned, and every generated SDK.
What changed: the schema version hashes the compiled table descriptors and starts with v2:. A database stamped v1: reports the model change once — the boot log and rebase doctor say so and how to restamp — and every generated SDK is reported stale once.
What to do: provision once with the new runtime: boot the process that owns the schema, or run rebase db push. With REBASE_REQUIRE_SCHEMA_MATCH=true, restamp before rolling the other processes. Regenerate the SDK.
114. Error codes name tables
Section titled “114. Error codes name tables”Who this hits: code that branches on an error code.
What changed:
| Before | Now |
|---|---|
NO_COLLECTIONS (404) |
NO_TABLES |
COLLECTION_READ_ONLY (405) |
TABLE_READ_ONLY |
UNKNOWN_COLLECTION (SDK) |
UNKNOWN_TABLE |
INVALID_COLLECTION_PATH (SDK) |
INVALID_TABLE_PATH |
What to do: rebase migrate sdk-calls rewrites the string literals. See Errors.
115. The SDK addresses a table: data.table(slug)
Section titled “115. The SDK addresses a table: data.table(slug)”Who this hits: every client, function, cron, hook and script that names a table by slug, or passes the generated dictionary.
What changed:
| Before | Now |
|---|---|
data.collection(slug) |
data.table(slug) |
createRebaseClient({ collections: collectionsDictionary }) |
createRebaseClient({ tables: tablesDictionary }) |
generated CollectionName, CollectionsDictionary |
TableName, TablesDictionary |
batch { op, collection } (SDK and POST /api/data/_batch) |
{ op, table } |
CollectionClient, SDKCollectionClient, CollectionAccessor, CollectionTrashAccessor |
TableClient, SDKTableClient, TableAccessor, TableTrashAccessor |
offline maxCachedRowsPerCollection, maxCachedQueriesPerCollection |
…PerTable |
reserved accessor <name>Collection; collectionCollection |
<name>Table; the collection table is collection |
const { data } = await client.data.collection("posts").find();const { data } = await client.data.table("posts").find();Typed accessors (client.data.posts) are unchanged.
What to do: the codemod runs rebase migrate sdk-calls over your code — run it alone on a project already migrated — then rebase generate-sdk. A .collection( call whose receiver is not the SDK is left as written and listed. See Typed SDK.
116. CLI flags: --schema-dir, not --collections
Section titled “116. CLI flags: --schema-dir, not --collections”Who this hits: scripts and CI steps that call the CLI with a schema path.
What changed: --collections / -c are refused on every command that reads the schema, with the codemod in the message (generate-sdk ignores a stray --collections-dir); --schema-dir names a schema directory other than backend/schema. rebase schema introspect writes defineTable files to backend/schema/ — --output is gone. REBASE_STRICT_COLLECTION_CONFIG is no longer read: a schema that does not compile always refuses the boot.
What to do: replace the flags. See CLI and Schema generation.
117. The schema editor edits backend/schema with TablePatch
Section titled “117. The schema editor edits backend/schema with TablePatch”Who this hits: code that calls the schema-editor or live-schema routes, and deployments that set the live-editing variables.
What changed: /api/admin/schema-editor/collection/save, collection/delete, property/save and property/delete are gone. The editor serves GET /tables, POST /preview and POST /apply, and live schema editing’s /plan and /apply take { patches: TablePatch[] } instead of a collection or a patch of one. REBASE_LIVE_SCHEMA_COLLECTIONS_PATH is refused at boot: it is REBASE_LIVE_SCHEMA_PATH (default backend/schema), and liveSchema.repository.collectionsPath is schemaPath. Presentation is never a schema edit: it is saved as UI preferences (/api/admin/ui-config). An edit whose file changed on disk after the edit was prepared (an IDE save, another process) answers 409 SCHEMA_EDIT_STALE_FILE and writes nothing; it was a 400 SCHEMA_EDIT_REFUSED.
What to do: rename the variable; rewrite a caller of the routes to send TablePatch edits, and reload on SCHEMA_EDIT_STALE_FILE. See Live schema editing.
118. A component slot is a component
Section titled “118. A component slot is a component”Who this hits: customizations that named a React component by a string path or a lazy () => import(…) thunk.
What changed: a field’s Field / Preview / Filter, collection Actions, entityViews[].Builder, collectionViews[].Builder, formView.Builder and component overrides take the component itself. ComponentRef, ComponentLike, LazyComponentRef and isLazyComponentRef (@rebasepro/types), asComponentRef and asReactComponent (@rebasepro/cms-types) and resolveComponentRef / useResolvedComponent (@rebasepro/app) are removed. customizeTable refuses a string or a thunk with the “imported by value” message.
What to do: import the component in the frontend/src/cms/ file and pass it. See Custom fields.
The codemod does this for every string path, and notes each one, because an imported component is type-checked against its slot where a path never was. A Preview that declares customProps?: MyProps fails your frontend’s tsc: the slot hands customProps as unknown, since nothing ties a field’s customProps to the component that reads them. Take customProps?: unknown and narrow it inside the component.
119. Panel preferences are UI preferences
Section titled “119. Panel preferences are UI preferences”Who this hits: code that implements UserConfigurationPersistence.
What changed: how a user resized or reordered a table is a UiTablePreferences delta: getTablePreferences / saveTablePreferences replace getCollectionConfig / onCollectionModified, and the partial collection-config type it took is removed. The browser store keeps them under table_preferences::<slug>, and ignores what an older panel stored, so each user’s column widths and view modes reset once. userSelect on a field is gone: a .userId() column is the user picker.
Studio’s bridge follows: StudioSchemaEditing.updateCollection is applyTablePatches(slug, patches), and the collection editor sends { patches } to the schema editor.
What to do: port a custom persistence to the two methods, and a custom StudioSchemaEditing to applyTablePatches.
120. MongoDB is retired
Section titled “120. MongoDB is retired”Who this hits: a project on @rebasepro/server-mongo, or one declaring database(…, { engine: "mongodb" }).
What changed: the package is gone, and so are the Mongo collection types and the rest of the Mongo model. Postgres is the only server engine: a server-transport source on another engine refuses the boot, naming it.
What to do: move the data to Postgres. There is no migration path inside Rebase.
121. Firestore collections live in the frontend
Section titled “121. Firestore collections live in the frontend”Who this hits: a hybrid project with engine: "firestore" collections.
What changed: a Firestore collection is a CMS source the browser reads directly: defineFirestoreCollection from @rebasepro/firebase, in frontend/src/cms/, passed to <RebaseCMS externalCollections>. A reference between Firestore and a Postgres table is stored as the target’s id, and a Firestore reference whose path is also a Postgres slug now targets the Postgres table.
What to do: the codemod writes the defineFirestoreCollection files. Point a reference at a Firestore collection by that collection’s slug. See Firebase.
122. MCP tools are named for tables
Section titled “122. MCP tools are named for tables”Who this hits: prompts, scripts and allow-lists that name MCP tools.
What changed: remote /mcp: list_collections, describe_collection, query_collection, show_collection, count_documents, aggregate_documents, get_document, create_document, update_document, delete_document → list_tables, describe_table, query_table, show_table, count_rows, aggregate_rows, get_row, create_row, update_row, delete_row; the collection argument is table, and show_app / save_app take tables. The local server: list_documents → query_table, get_document → get_row, create_document → create_row, update_document → update_row, delete_document → delete_row; rebase_schema_plan takes patches; resources are rebase://tables/{name}. The MCP Apps view payload is version 3: caller-redacted table descriptors, per-table grants, and each caller’s UI preferences under preferences (file, workspace, user; an API key has no user layer), with blocks and seeds naming table. The collection-table view is removed. list_tables has no title; describe_table adds primaryKey, relations, the caller’s rls, title and presentation.
What to do: rename. The view and the server must speak the same payload version: a hosted connector and the runtimes it reaches upgrade together, and a project-built MCP view is rebuilt with the 0.31 packages. See MCP tool reference and Remote MCP.
123. The rule vocabulary says table
Section titled “123. The rule vocabulary says table”Who this hits: rules that use policy.existsIn or a membership tenant, and rules that combine access with other clauses.
What changed: policy.existsIn({ collection, where }) is existsIn({ table, where }), and tenant.from.membership.collection is membership.table; policy names do not move. Four rule shapes now grant something different, two of them more (the table above): a bare { access: "authenticated" }, which granted nothing, now admits every signed-in caller, and the junctions of such a table gain their edge-write policies. Rules combining clauses the SecurityRule type excludes, or carrying an invalid access, mode, operation or roles, are refused.
What to do: the codemod renames the keys, refuses the invalid rules with their file and line, and lists the rules that change meaning under “Review before deploying”. For each, keep it, write access: "registered" (signed-in callers with an account), or remove it. Then read rebase db push --dry-run and rebase doctor --policies against your database.
124. Studio reads the tables from the server
Section titled “124. Studio reads the tables from the server”Who this hits: Studio pointed at a backend older than 0.31, and Studio JS console scripts.
What changed: every schema-aware tool reads GET /api/schema/tables; against a runtime without it they show an upgrade notice. The RLS editor’s declared side is what the server compiled. A JS console script receives context.tables (it was context.collections).
What to do: upgrade the runtime with the panel. See Studio.
125. rls-check --format agent says rls
Section titled “125. rls-check --format agent says rls”Who this hits: a tool that reads rls-check --format agent.
What changed: remediation.rebase.securityRules is remediation.rebase.rls, the excerpt is a defineTable(…, { rls }), and the document’s format version is 2. --json is unchanged. See rls-check.
What to do: read the new key.
126. @rebasepro/plugin-review: reviewRls
Section titled “126. @rebasepro/plugin-review: reviewRls”Who this hits: a project using the review plugin.
What changed: reviewSecurityRules(slug, review) is reviewRls(slug, review), spread into the table’s rls; findReviewConfigProblems and assertReviewConfig take table descriptors.
What to do: rename the call and pass services.tables() or compileTables(…).
127. @rebasepro/codegen reads descriptors
Section titled “127. @rebasepro/codegen reads descriptors”Who this hits: code that calls the generator directly.
What changed: generateTypedefs(tables) and generateSDK(tables, options) take TableDescriptor[] — what compileTables returns and GET /api/schema/tables serves — instead of collections.
What to do: compile your definitions first, or use rebase generate-sdk.
128. The agent skill rebase-collections is rebase-tables
Section titled “128. The agent skill rebase-collections is rebase-tables”Who this hits: a project with the agent skills installed, and prompts or instruction files that name the skill.
What changed: the skill that teaches the data model is rebase-tables: authoring tables, columns, relations, rls, hooks, and the CMS layer on top. rebase skills install removes the old rebase-collections copy, including from installs made before the skills manifest existed, and keeps any directory of that name you wrote yourself.
What to do: run rebase skills install after upgrading. The steps rebase migrate collections-to-tables prints say so too. Rename the skill in any instruction file that names it. See Agent Skills.
129. useJsonCollectionsConfigController is removed
Section titled “129. useJsonCollectionsConfigController is removed”Who this hits: a project that stored collection definitions as JSON through @rebasepro/cms.
What changed: useJsonCollectionsConfigController is gone, with its options type and the JSON store class behind it. A table’s schema lives in backend/schema, and how the panel shows it lives in UI preferences: frontend/src/cms/ui-config.json in development, the rebase.ui_preferences table on a deployment.
What to do: declare the tables with defineTable (rebase migrate collections-to-tables writes them from collection definitions), and pass the scaffold’s uiConfig to <RebaseCMS>. See Customizing a table.
130. rebase build refuses a frontend without rebaseBackendGuard()
Section titled “130. rebase build refuses a frontend without rebaseBackendGuard()”Who this hits: every project with a frontend.
What changed: the frontend may import backend/ as types only. A value
import would put server code — hooks, and whatever secrets they read — into
the browser bundle. rebaseBackendGuard() from @rebasepro/app/vitePlugin fails vite build and vite dev when any frontend module resolves into backend/, naming the importer, the import and the file, after aliases, tsconfig paths, package and absolute resolution, globs, ?raw, re-exports and dynamic imports. rebase build, and the frontend build rebase cloud deploy runs, refuse a frontend whose Vite config does not use it; rebase dev warns; rebase verify reports cms-backend-guard-missing.
What to do: the codemod adds it to a scaffold’s frontend/vite.config.ts, and prints the lines for any other config:
import { rebaseBackendGuard } from "@rebasepro/app/vitePlugin";
export default defineConfig({ plugins: [react()], plugins: [react(), rebaseBackendGuard()],});Then turn any value import of backend/ into import type.
131. Rows on the wire follow their column
Section titled “131. Rows on the wire follow their column”Who this hits: clients that read foreign keys or name relations, and writes that send generated columns or partial JSON objects.
What changed: values go through their column’s codec on the way out and the column’s rules on the way in.
-
A
bigintornumericforeign-key column a relation generates, which Postgres returns as text, is served as a number in REST, the SDK and the admin panel. Declared number keys already were. -
A native array’s items are served as their scalar type is, in REST, the SDK, the socket and the driver:
Column 0.30 served 0.31 serves timestamptz[]["2026-01-02 11:00:00+01"]["2026-01-02T10:00:00.000Z"]numeric[](a driver opened without the boot-time numeric setting: tests, scripts)["1.50", "2.25"][1.5, 2.25]bigint[]with a null item[1, 0, 3][1, null, 3]date[],timestamptz[]or an enum array with a null item["2026-01-02", "NULL"]["2026-01-02", null]date[],time[],text[],uuid[],boolean[],integer[]anddouble precision[]are served as before. What is stored does not change: a row read and saved back stores the same array. -
A relation named in
include, a filter or a sort must be its exact name. The retries with the slug and the snake_case spelling are gone. -
A generated column is refused on write, and left out of the OpenAPI input schema.
-
A required field inside a JSON object is enforced;
$incand array items on an integer column must be whole numbers.
What to do: read foreign keys as numbers where you compared strings, parse timestamptz[] items as RFC 3339 and treat a null array item as null, and spell relation names as the table declares them (its relations keys). Stop sending generated columns.
132. History is served as reads
Section titled “132. History is served as reads”Who this hits: readers of history snapshots, and anyone who implements a DataDriver.
What changed: history entries are served as reads: field access first, then afterRead (global, table, column). A column masked by a hook or a .transform({ afterRead }) is masked in every snapshot, a column the caller cannot read is withheld and left out of changed_fields, keys of dropped columns are withheld, and a revert never writes a column the caller cannot read. A hook that throws on an old snapshot fails the request. 0.30 served the stored values raw, so a project with history and masking hooks should upgrade.
An entry holds the row as GET /api/data/<table>/<id> reads it with no include: plain values, a belongsTo as its foreign key. An entry an older version recorded with the admin panel’s view model is served, and reverted, as that row: a { "__type": "date", "value" } envelope as its value, a { "__type": "relation" } ref of an owning relation as the foreign key under the key’s own name, and any other ref as the related row’s key. 0.30 served those refs as written.
A driver serves history through DataDriver.serveStoredRows(path, rows), inside the caller’s read-only transaction; the history routes answer 501 for a driver without it, so history is never served unmasked.
What to do: nothing for the bundled Postgres driver. A custom driver implements serveStoredRows. See History.
133. @rebasepro/server exports name tables
Section titled “133. @rebasepro/server exports name tables”Who this hits: a server you assemble from @rebasepro/server’s parts instead of initializeRebaseBackend / createRebaseBackend.
What changed:
| Before | Now |
|---|---|
new RestApiGenerator(collections, …) |
new RestApiGenerator(tables, …) (RestTables) |
mountOpenApiDocs({ collections }), createHistoryRoutes({ collections }) |
mountOpenApiDocs({ serverTables }), createHistoryRoutes({ tables }) |
versionProperty, buildCollection*Schema |
versionColumn, buildTable*Schema; validators, conflict and ETag helpers take a TableDescriptor |
auth-collection-writes |
auth-table-writes: createUserThroughAuthTable, isAuthTable, prepareAuthTableUpdates, deletingAuthTableUsers |
auth adapter option collectionAuthConfig |
authTableHooks (CompiledAuthHooks) |
McpRoutesConfig.getCollections |
getTables() |
assertUploadWithinPropertyLimits, readUploadPropertyContext |
assertUploadWithinColumnLimits, readUploadColumnContext (returns { table, column }); refusal details say column |
provisionCollectionTables, provisionCollectionPolicies, collectionsStoredBy |
provisionTableSchema, provisionTablePolicies, tablesStoredBy |
handGlobalCallbacksTo, warnOnAuthCollectionDataCallbacks |
handGlobalHooksTo, warnOnAuthTableDataHooks |
SchemaEditingAdmin.planSchemaChange(collections, …) |
planSchemaChange(tables, …) with CompiledTable[]; EditedSchema.tables |
buildCollectionFromTableMetadata, IntrospectedCollection, IntrospectedRelation |
removed: an introspected table is a TableDescriptor |
createUserThroughAuthCollection; NestedWriteHop.parentCollection / .targetCollection; ContractRoutesConfig.collectionRegistry |
createUserThroughAuthTable; .parent / .target (descriptors); removed |
the collection loader: CollectionConfigError, ConfigProblem, applyCollectionDefaults, CollectionDefaults and the validator’s options type, accessModelFromCollections, loadBundleConfigExports, BundleConfigExports, unknownKeyPolicyFromEnv, UnknownKeyPolicy |
removed: compileSchema / loadBackendSchema load and check backend/schema, and a SchemaDefinitionError names every problem |
What to do: rename. rebase migrate sdk-calls renames assertUploadWithinPropertyLimits and the upload field constants (UPLOAD_COLLECTION_FIELD / UPLOAD_PROPERTY_FIELD → UPLOAD_TABLE_FIELD / UPLOAD_COLUMN_FIELD, same values), and lists every other import or option in this table as a numbered manual step.
134. @rebasepro/server-postgres exports name tables
Section titled “134. @rebasepro/server-postgres exports name tables”Who this hits: code that opens the Postgres driver itself, wraps the adapter, or imports the schema planner.
What changed:
| Before | Now |
|---|---|
the class PostgresCollectionRegistry, getTable(name), registerTable |
PostgresTableRegistry, getPgTable, registerPgTable |
openPostgresDriver(config, { collections }) |
openPostgresDriver(config, { tables }), tables from compileSchema; driver calls carry no collection prop (section 137) |
adapter / bootstrapper ensureCollectionSchema, ensureCollectionPolicies, readCollectionsSchemaVersion, stampCollectionsSchemaVersion |
ensureTableSchema, ensureTablePolicies, readTablesSchemaVersion, stampTablesSchemaVersion, taking CompiledTable[] |
serializePropertyToServer, parsePropertyFromServer |
serializeColumnToServer(value, column); parsePropertyFromServer is removed — a driver read returns the REST row (section 136) |
ensureCollectionTables, planCollectionSchemaEnsure, planCollectionPolicies, CollectionPolicyPlan, lockCollectionTables |
ensureTables, planTableSchemaEnsure, planTablePolicies, TablePolicyPlan, lockTables |
CollectionIndexSpec, CollectionIndexConfigError, collectionIndexStatements |
TableIndexSpec, TableIndexConfigError, tableIndexStatements |
checkCollectionsVsDatabase / …VsSchema / …VsSdk, columnKeysFromCollections, buildDrizzleRelationsFromCollections, schemaOfCollection, getTableIncludesFromCollections |
checkTablesVs…, columnKeysFromTables, buildDrizzleRelationsFromTables, schemaOfTable, getTableIncludesFromTables |
SchemaDifference.collection, .property (and the boot drift warning’s log fields) |
.slug, .key |
createStampKeys, sharedRelationName, isAuthCollection, lowerCompiledTables, buildCollectionIndexPlan |
removed |
The JSON the planner reports keeps its keys: SchemaReconcileColumn.collection and the SchemaChange kinds are unchanged.
What to do: rename. A wrapper that turns the adapter into a BackendBootstrapper must forward ensureTableSchema and ensureTablePolicies. See Embedding the Postgres driver.
135. @rebasepro/types and @rebasepro/common drop the collection model from their roots
Section titled “135. @rebasepro/types and @rebasepro/common drop the collection model from their roots”Who this hits: code that imports collection or property types, admin-panel helpers or the lift from @rebasepro/types or @rebasepro/common — custom fields, custom views, plugins, tests with collection fixtures — and custom drivers that implement the registry.
What changed: the kernel packages describe tables only. What describes a collection as the admin panel draws it lives in @rebasepro/cms-types:
- Types that moved from
@rebasepro/types:CollectionConfig,PostgresCollectionConfig,FirebaseCollectionConfig,AnyCollectionConfig, every…Property(StringProperty,NumberProperty,ArrayProperty, …) andProperties,CollectionCallbacksand its hook props, the 0.30 relation kinds and theirResolved…forms,CollectionIndex, the chip colors (ColorScheme,ColorKey, …),FieldAccess,EnumValues. - Helpers that moved from
@rebasepro/common: the collection-shaped policy helpers (policyToPostgres,compileRulePolicies,getEffectiveSecurityRules,getGeneratedPolicyNames, …),CollectionRegistry,resolveCollectionRelations,resolveRelation,getTableName,findRelation,rowToViewModel,resolvePrimaryKeys, the field-access view of a property (effectiveAccess,canReadField,canWriteField),evaluateCondition,canEditEntity,resolveProperty,getDefaultValuesFor,getSubcollections,getCopyValues,enumToObjectEntries. A rule compiled from a bare expression usescompilePolicyExpression(expr)from@rebasepro/common. composeCallbackscomposes a collection’s callbacks for the panel and moved to@rebasepro/cms-types;@rebasepro/serverno longer re-exports it. Backend code composes a table’s hooks withcomposeTableHooksfrom@rebasepro/common, and the codemod lists a backend import ofcomposeCallbacksas a manual step saying so.defineCollectionis removed from@rebasepro/commonand@rebasepro/cms-types: declare the table withdefineTableinbackend/schemaand customize it withcustomizeTableinfrontend/src/cms; a Firestore collection isdefineFirestoreCollectionfrom@rebasepro/firebase.- The admin panel’s accessor and its types:
Entity,EntityValues,TableAccessor,TableTrashAccessor,FindResponse,QueryBuilderInterface,RebaseDataandAuthStateleft@rebasepro/types;buildRebaseData,wrapAsEntityData,buildRoutedRebaseData,EntityDataOptions,QueryBuilder,RelationRefandcreateRelationRefleft@rebasepro/common. All import from@rebasepro/cms-types. The SDK’s own data layer —buildSdkData,createDriverTableRows,buildRoutedSdkData, in@rebasepro/common— serves rows directly and returns what it returned before. EntityDataOptions.resolveCollectionis replaced byprimaryKeysOf,viewModelOf,storedValuesOfandviewModelSourceOf;collectionEntityDataOptions(resolveCollection, { resolveDataPath, resolveAccessor })from@rebasepro/cms-typesbuilds them.- The migration lift (
collectionsToTableDefs,collectionToTableDef,LiftNote,LiftResult,LiftOptions) moved to@rebasepro/common/migrate, beside a frozen copy of the 0.30 collection model (Legacy…types) anddefineLegacyCollection. - Also removed from the kernel roots, each listed by the codemod as a manual step: the collection-patch API of
@rebasepro/types(CollectionPatch,CollectionPatchOp,applyCollectionPatch,collectionPatchProblems,isCollectionPatch,nestCollectionPatchPaths→TablePatch), its collection JSON helpers (diffCollections,diffJsonValues,toCollectionJson,RUNTIME_ONLY_COLLECTION_KEYS,runtimeOnlyKeyIn), the Mongo-eraDocumentAdmin,isDocumentAdminandsupportsDocumentAdmincapability, andRebaseProjectContract.collectionSlugs/.collections/.generatedAt(/api/meta/contractservestables); from@rebasepro/common,buildTenantSecurityRule→tenantSecurityRule,defaultPoliciesDisabled→tableDefaultPoliciesDisabled,restoresSoftDeletedRow→isSoftDeleteRestore,softDeleteFieldOf→softDeleteColumn,getJunctionConfigForRelation→resolveTableJunctions, andisRelationRequired,relationDeclaringProperty,requireCallbackCollectionwith no successor (read theTableDescriptor). - A driver’s registry is a
TableRegistryInterface(it wasCollectionRegistryInterface):setGlobalHooks?andsetTableHooks?replacegetGlobalCallbacks/setGlobalCallbacks?.globalHooksAsCallbacks,resolveDriftCheckNameandPENDING_TABLE_FEATURESare removed.
What to do: rebase migrate sdk-calls (part of collections-to-tables) moves each import below to its new package — merged into an import of that package the file already has, import type, inline type and as aliases kept — and adds the package to the importing workspace package’s dependencies; run pnpm install afterwards. An import of a removed name, a namespace import (import * as), an export *, a dynamic import() or a require() that uses a moved name is a numbered manual step. A test that keeps collection literals as fixtures types them with the Legacy… types and lifts them through @rebasepro/common/migrate.
Imports that moved
Section titled “Imports that moved”Every name 0.31 moved to another package, or removed, is listed on Imports that moved in 0.31, with what to write for each removed one. The list is written from the same table the codemod reads, so it is exactly what rebase migrate sdk-calls rewrites.
136. The Postgres driver and the socket’s one-shot reads return the REST row
Section titled “136. The Postgres driver and the socket’s one-shot reads return the REST row”Who this hits: a function or plugin that reads through requireDriver(c) / getDriver(c), code that sends the socket’s FETCH_COLLECTION / FETCH_ONE frames, and code that read { __type } objects from a response.
What changed: there is one read shape. fetchCollection and fetchOne on the Postgres driver — what a function’s requireDriver(c), plugins, the socket’s one-shot frames, MCP and the RLS simulator read through — return what GET /api/data/<table> returns:
| Value | 0.30 driver read | 0.31 |
|---|---|---|
| a timestamp | { "__type": "date", "value": … } |
an RFC 3339 string |
a belongsTo |
{ "__type": "relation", "id", "path" } under the relation’s name |
the foreign key under its own key (authorId) |
| a related row | every relation loaded by fetchOne |
only a relation include names, as the target’s own row |
a vector, a bytea |
{ "__type": "Vector" }, a data URL |
as REST serves them |
FetchOneProps takes include (ListenOneTarget is removed: use FetchOneProps). rebase.data, context.data and the SDK already returned this shape and are unchanged.
@rebasepro/client reads REST bodies and socket frames as plain JSON: a value with a __type key is no longer turned into a Date, EntityReference, EntityRelation, GeoPoint or Vector, and a JSON document that holds a __type key is returned as stored.
What to do: read the plain row: parse dates from their strings, read a foreign key from its own key, and pass include for each relation you read:
const article = await requireDriver(c).fetchOne({ path: "articles", id });const authorId = article?.author.id; // a { __type: "relation" } refconst article = await requireDriver(c).fetchOne({ path: "articles", id, include: ["author"] });const authorId = article?.authorId;137. Driver and backend interfaces carry tables, not collections
Section titled “137. Driver and backend interfaces carry tables, not collections”Who this hits: a custom DataDriver, a database adapter, or a backend you assemble from @rebasepro/server’s parts.
What changed:
| Before | Now |
|---|---|
the collection prop of DataDriver calls (fetch, save, delete, count, search, listen) |
removed: the driver reads the table it serves by path |
checkUniqueField(path, name, value, id, collection) |
checkUniqueField(path, name, value, id?) |
scanStoredRows({ path, collection, pageSize }) |
scanStoredRows({ path, pageSize }) |
DataDriver.initTextSearch |
removed |
DatabaseAdapterInitConfig.collections, .collectionRegistry |
removed: the adapter is handed CompiledTable[] |
BackendServices.collections() |
services.tables() |
serializeCollections, deserializeCollections, isSerializedCollectionRef, SerializedCollectionRef |
removed: descriptors are served at GET /api/schema/tables |
AuthAdapter.prepareUserCreation(values, collectionAuth, options?), describeUserCreationContract(collectionAuth) |
prepareUserCreation(values, options?), describeUserCreationContract() |
initializeDriver returning { driver, collectionRegistry, … }; BackendInstance.collectionRegistry |
{ driver, tableRegistry, … }; BackendInstance.tableRegistry |
PolicyEvalContext.entity (an Entity) |
PolicyEvalContext.row (the row’s values) |
wrapAsSdkData(…) |
buildSdkData(driver); several data sources: buildRoutedSdkData |
FindResponse from @rebasepro/client |
FindResult |
ListenCollectionRequest, ListenEntityRequest from @rebasepro/server |
ListenCollectionProps, ListenOneProps |
What to do: drop the arguments and read tables by path. The codemod lists implements DataDriver as a manual step. See Embedding the Postgres driver.
138. The backend accepts the values the REST API documents, and nothing else
Section titled “138. The backend accepts the values the REST API documents, and nothing else”Who this hits: a client that writes a to-one relation as an object or a vector as { value }, code that filters on a relation with an object, code that imports the admin’s value classes, and an offline app with writes queued by 0.30.
What changed: a write takes the shape a read returns — one write shape for REST, the socket, MCP and the in-process SDK:
| Value | Accepted | Refused now |
|---|---|---|
a to-one relation (belongsTo, hasOne, a to-one via) |
the related row’s key, or null ("" is null), under the relation’s name or the foreign key’s |
an object such as { "id": 5 }: 400 VALIDATION_INVALID_VALUE, “‘posts.author’ links one ‘authors’ row: write that row’s key (a string or a number), or null to unlink — not an object.” |
a to-many relation (hasMany, manyToMany, a writable to-many via) |
a list of keys, or of { id, _pivot? } |
— (other keys on the object are ignored, as before) |
| a vector | a list of numbers | a Vector, or { "value": [...] }: 400, “‘embedding’ expects a vector as a list of numbers” |
| a date, a time | ISO text (Date in process) |
— |
| a geopoint | { latitude, longitude } |
— |
a bytea |
a data:application/octet-stream;base64, URL (Buffer / Uint8Array in process) |
— |
| a filter on a relation | the key | an object is no longer unwrapped: it is compared as given |
0.30 accepted a to-one relation written as an object and quietly took its id; that shape was never documented and is the admin panel’s view model. The admin panel now converts its view model to wire values in the browser before every write and filter.
The admin’s value classes moved with the rest of its view model: EntityReference, EntityRelation, GeoPoint, Vector and EntityReferenceProps import from @rebasepro/cms-types (they left @rebasepro/types), and normalizeToEntityRelation too (it left @rebasepro/common); withRelationReferencesOnly is removed. History stores the row as a read returns it; entries recorded before are served and reverted as plain values (section 132).
@rebasepro/client’s offline queue stores wire values. A write queued offline by the 0.30 SDK is converted when it is read back and replayed: nothing queued before the upgrade is lost.
What to do: send the key: { "author": 5 }, not { "author": { "id": 5 } }; send a vector as a list of numbers, and filter a relation by its key. rebase migrate sdk-calls moves the value-class imports (the list). See Writes.
139. /api/docs is served to the schema endpoint’s audience
Section titled “139. /api/docs is served to the schema endpoint’s audience”Who this hits: a person or tool that reads /api/docs or opens /api/swagger — Swagger UI, an API client generator, a CI step.
What changed: with enableSwagger unset (REBASE_ENABLE_SWAGGER unset), in every environment, the OpenAPI document is served to the callers GET /api/schema/tables describes tables to, with the same refusals — 401 for an anonymous caller unless schemaTables.public, 403 for a credential without a schema or data scope — and each caller gets the document of exactly the tables, columns and relations that endpoint describes to them (an administrator gets all of it). There is no Swagger UI. A server with no authentication configured answers 404 DOCS_UNAVAILABLE. 0.30 published the whole document, every served table and non-private column, to anonymous callers in development, and kept it admin-only in production.
enableSwagger / REBASE_ENABLE_SWAGGER |
/api/docs |
/api/swagger |
|---|---|---|
| unset (default) | each caller the schema endpoint describes tables to: their tables | not served |
true |
the whole document, to everyone | served outside production |
false |
the whole document, behind the admin gate | not served |
What to do: call /api/docs signed in. To publish the whole document as 0.30 did in development, set REBASE_ENABLE_SWAGGER=true (or enableSwagger: true). See Endpoints.
140. A many-to-many pivot column may not declare .transform()
Section titled “140. A many-to-many pivot column may not declare .transform()”Who this hits: a rel.manyToMany(…, { pivot: { … } }) whose pivot column has a .transform().
What changed: the compiler refuses it (“the pivot column “x” declares .transform() …“). A pivot column’s transform never ran anywhere, so a value you meant to mask was served as stored.
What to do: remove the .transform() and mask _pivot in the target table’s hooks.afterRead. See Relations.
141. A link is exactly as readable and writable as its key column
Section titled “141. A link is exactly as readable and writable as its key column”Who this hits: a client that writes a belongsTo by its relation name, reads or filters a relation whose key column is restricted, or relies on strictWrites: false.
What changed: a restriction on a key column is a restriction on every spelling that reads or writes it.
- Writing a link by its relation name (
{ "reviewer": 7 }) is held to every rule of the key column it sets —.readOnly(),.private(),access.write, create stamps, the tenant column, key immutability — on REST, bulk,_batch, the socket and MCP. Writing the link under both names ({ "reviewer": 7, "reviewerId": 8 }) with different values is a 400VALIDATION_INVALID_VALUE. Moving a row to another tenant through its link answers 400TENANT_IMMUTABLE(it was a 500). - A relation is readable only when the caller may read every column its join reads, on every table it passes through: a
belongsTo’s key, the target’s foreign key for ahasMany/hasOne, every column avia’s steps join on. One that fails is left out ofincludeand_count, and a filter, sort or relation path through it answersFIELD_NOT_READABLE(an unknown relation when the column is.private()). A to-oneviawrite that would copy a column the caller may not read is refused withFIELD_NOT_READABLE. The inverse andviacases were open in 0.30.x too. - A link whose key column the caller may not read is left out of
include, and a filter, sort,fieldsentry or relation path through it answersFIELD_NOT_READABLE; a link bound to a.private()key is an unknown relation.GET /api/schema/tables, OpenAPI and MCPdescribe_tabledescribe a link and its key together, so a key column whose link is closed is withheld there too. strictWrites: falsedecides one thing: an undeclared key goes to the driver (written if the database has the column, else 400VALIDATION_UNKNOWN_FIELDS). It never opens a declared column, a stamp, the tenant, the key, a relation target or a_pivotrule.
What to do: write a link by one name, or by both with the same value; read restricted links with a role that may read their key. See Field access.