Skip to content

Commit e9aca23

Browse files
committed
test(prisma-next): v3 String e2e domain matrix + example UserV3 model
Adds the UserV3 model (validated end-to-end: contract emit + migration plan emit the per-index eql_v3.text_eq/text_match/text_ord domains via expandNativeType), the v3 seed/oracle helpers, the gated e2e matrix, and the user_v3 truncate. The e2e run requires live Postgres + ZeroKMS credentials (gated on DATABASE_URL).
1 parent 9f55cdc commit e9aca23

18 files changed

Lines changed: 3641 additions & 9 deletions

File tree

examples/prisma/migrations/app/20260616T2336_migration/end-contract.d.ts

Lines changed: 572 additions & 0 deletions
Large diffs are not rendered by default.

examples/prisma/migrations/app/20260616T2336_migration/end-contract.json

Lines changed: 569 additions & 0 deletions
Large diffs are not rendered by default.

examples/prisma/migrations/app/20260616T2336_migration/migration.json

Lines changed: 1049 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env -S node
2+
import { Migration, MigrationCLI, createTable } from '@prisma-next/target-postgres/migration';
3+
4+
export default class M extends Migration {
5+
override describe() {
6+
return {
7+
from: 'sha256:7475191ce0d78258ce5586265bcdfd12202f5daf90690b902890e58eb7508373',
8+
to: 'sha256:4e951512096c6bb3dbfa55779a34474176fc6f925f97087ca341b28681a1e7e3',
9+
};
10+
}
11+
12+
override get operations() {
13+
return [
14+
createTable(
15+
'public',
16+
'user_v3',
17+
[
18+
{ name: 'bio', typeSql: 'eql_v3.text_match', defaultSql: '', nullable: false },
19+
{ name: 'email', typeSql: 'eql_v3.text_eq', defaultSql: '', nullable: false },
20+
{ name: 'id', typeSql: 'text', defaultSql: '', nullable: false },
21+
{ name: 'name', typeSql: 'eql_v3.text_ord', defaultSql: '', nullable: false },
22+
],
23+
{ columns: ['id'] },
24+
),
25+
];
26+
}
27+
}
28+
29+
MigrationCLI.run(import.meta.url, M);
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[
2+
{
3+
"id": "table.user_v3",
4+
"label": "Create table \"user_v3\"",
5+
"summary": "Creates table \"user_v3\"",
6+
"operationClass": "additive",
7+
"target": {
8+
"id": "postgres",
9+
"details": {
10+
"schema": "public",
11+
"objectType": "table",
12+
"name": "user_v3"
13+
}
14+
},
15+
"precheck": [
16+
{
17+
"description": "ensure table \"user_v3\" does not exist",
18+
"sql": "SELECT to_regclass('\"public\".\"user_v3\"') IS NULL"
19+
}
20+
],
21+
"execute": [
22+
{
23+
"description": "create table \"user_v3\"",
24+
"sql": "CREATE TABLE \"public\".\"user_v3\" (\n \"bio\" eql_v3.text_match NOT NULL,\n \"email\" eql_v3.text_eq NOT NULL,\n \"id\" text NOT NULL,\n \"name\" eql_v3.text_ord NOT NULL,\n PRIMARY KEY (\"id\")\n)"
25+
}
26+
],
27+
"postcheck": [
28+
{
29+
"description": "verify table \"user_v3\" exists",
30+
"sql": "SELECT to_regclass('\"public\".\"user_v3\"') IS NOT NULL"
31+
}
32+
]
33+
}
34+
]

0 commit comments

Comments
 (0)