Skip to content

Commit 33feb16

Browse files
committed
Merge remote-tracking branch 'origin/claude/issue-24583-7b0-tenant-not-null-ddl' into claude/issue-24583-7b12-index-plain-form
2 parents d4e977b + 5bd3515 commit 33feb16

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

‎packages/plugins/plugin-approvals/src/later-step-original-submitter.integration.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import type { EngineQueryOptions } from '@objectstack/spec/data';
5151
import { ApprovalService } from './approval-service.js';
5252
import { ApprovalsServicePlugin } from './approvals-plugin.js';
5353
import { registerApprovalNode } from './approval-node.js';
54+
import { installDefaultOrganization } from './default-organization.testkit.js';
5455

5556
const SYSTEM = { isSystem: true, positions: [], permissions: [] } as any;
5657
const asUser = (userId: string) => ({ userId, positions: [], permissions: [] }) as any;
@@ -250,6 +251,9 @@ describe('every step of an approval run names the run\'s original submitter (#24
250251
engine.registry.registerObject(def as any, 'approvals-test', 'approvals-test');
251252
}
252253
await engine.syncSchemas();
254+
// A real `single` install's Default Organization: the system writes below
255+
// derive it (ADR-0131 D9), as a fresh NOT NULL tenant column requires (D1).
256+
await installDefaultOrganization(engine);
253257
for (const u of USERS) await engine.insert('sys_user', u, { context: SYSTEM } as any);
254258

255259
automation = new AutomationEngine(silent);

‎packages/plugins/plugin-approvals/src/remind-notified-per-person.integration.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import type { EngineQueryOptions } from '@objectstack/spec/data';
4646
import { ApprovalService } from './approval-service.js';
4747
import { ApprovalsServicePlugin } from './approvals-plugin.js';
4848
import { registerApprovalNode } from './approval-node.js';
49+
import { installDefaultOrganization } from './default-organization.testkit.js';
4950

5051
const SYSTEM = { isSystem: true, positions: [], permissions: [] } as any;
5152
const asUser = (userId: string) => ({ userId, positions: [], permissions: [] }) as any;
@@ -180,6 +181,9 @@ describe('a reminder counts the reminders it hands over, one per distinct approv
180181
engine.registry.registerObject(def as any, 'approvals-test', 'approvals-test');
181182
}
182183
await engine.syncSchemas();
184+
// A real `single` install's Default Organization: the system writes below
185+
// derive it (ADR-0131 D9), as a fresh NOT NULL tenant column requires (D1).
186+
await installDefaultOrganization(engine);
183187
for (const u of USERS) await engine.insert('sys_user', u, { context: SYSTEM } as any);
184188

185189
automation = new AutomationEngine(silent);

‎packages/qa/dogfood/test/sharing-rule-criteria-required.dogfood.test.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
2626
import { type VerifyStack } from '@objectstack/verify';
2727
import { bootShowcase } from './showcase-boot.js';
28-
import { relaxTenantColumns } from './pre-18-tenant-column.testkit.js';
2928

3029
// Sharing-rule routes are anchored on the API base, not under `/data/:object`
3130
// (they administer rules tenant-wide) — `/api/v1/sharing/rules`.
@@ -153,11 +152,13 @@ describe('#3896 — a sharing rule POSTed without criteria is rejected, never ma
153152
const id = 'srule_3896_legacy';
154153
const driver = (ql as any).getDriverForObject('sys_sharing_rule');
155154
expect(driver, 'sys_sharing_rule driver must be resolvable').toBeTruthy();
156-
// That residue lives only on a store built before 18.x, whose tenant column is
157-
// nullable (ADR-0131 D1 makes a fresh one NOT NULL): the table is that store's.
158-
await relaxTenantColumns(ql as any, ['sys_sharing_rule']);
155+
// The legacy row belongs to the install's organization, as every row does
156+
// since the ownership ceremony (ADR-0131 D1): its missing criteria is the
157+
// subject here, not its owner.
158+
const [organization] = (await ql.find('sys_organization', { context: SYS })) as Array<{ id: string }>;
159159
await driver.create('sys_sharing_rule', {
160160
id,
161+
organization_id: organization.id,
161162
name: 'legacy_match_all_3896',
162163
label: 'Legacy match-all',
163164
object_name: OBJECT,

0 commit comments

Comments
 (0)