{ "formatVersion": 1, "targetFamily": "sql", "target": "postgres", "profileHash": "3916f444a8a17ad749191acf9e08dad97d1a327b88c2f1d45d12f240296aa8b2", "roots": { "comments": { "model": "Comment", "namespace": "public" }, "posts": { "model": "Post", "namespace": "public" }, "tags": { "model": "Tag", "namespace": "public" }, "users": { "model": "User", "namespace": "public" } }, "domain": { "namespaces": { "public": { "models": { "Comment": { "fields": { "body": { "nullable": false, "type": { "codecId": "pg/text@1", "kind": "scalar" } }, "deletedAt": { "nullable": true, "type": { "codecId": "pg/timestamptz-temporal@1", "kind": "scalar" } }, "id": { "nullable": false, "type": { "codecId": "pg/int4@1", "kind": "scalar" } }, "postId": { "nullable": false, "type": { "codecId": "pg/int4@1", "kind": "scalar" } } }, "relations": { "post": { "cardinality": "N:1", "nullable": false, "on": { "localFields": [ "postId" ], "targetFields": [ "id" ] }, "to": { "model": "Post", "namespace": "public" } } }, "storage": { "fields": { "body": { "column": "body" }, "deletedAt": { "column": "deleted_at" }, "id": { "column": "id" }, "postId": { "column": "post_id" } }, "namespaceId": "public", "table": "comments" } }, "Post": { "fields": { "createdAt": { "nullable": false, "type": { "codecId": "pg/timestamptz-temporal@1", "kind": "scalar" } }, "deletedAt": { "nullable": true, "type": { "codecId": "pg/timestamptz-temporal@1", "kind": "scalar" } }, "id": { "nullable": false, "type": { "codecId": "pg/int4@1", "kind": "scalar" } }, "title": { "nullable": false, "type": { "codecId": "pg/text@1", "kind": "scalar" } }, "userId": { "nullable": false, "type": { "codecId": "pg/int4@1", "kind": "scalar" } }, "views": { "nullable": false, "type": { "codecId": "pg/int4@1", "kind": "scalar" } } }, "relations": { "comments": { "cardinality": "1:N", "on": { "localFields": [ "id" ], "targetFields": [ "postId" ] }, "to": { "model": "Comment", "namespace": "public" } }, "user": { "cardinality": "N:1", "nullable": false, "on": { "localFields": [ "userId" ], "targetFields": [ "id" ] }, "to": { "model": "User", "namespace": "public" } } }, "storage": { "fields": { "createdAt": { "column": "created_at" }, "deletedAt": { "column": "deleted_at" }, "id": { "column": "id" }, "title": { "column": "title" }, "userId": { "column": "user_id" }, "views": { "column": "views" } }, "namespaceId": "public", "table": "posts" } }, "Tag": { "fields": { "addresses": { "many": { "elementNullable": false }, "nullable": false, "type": { "entityKind": "valueObject", "entityName": "Address", "kind": "valueObject", "namespaceId": "public", "plane": "storage" } }, "id": { "nullable": false, "type": { "codecId": "pg/int4@1", "kind": "scalar" } }, "labels": { "many": { "elementNullable": false }, "nullable": false, "type": { "codecId": "pg/text@1", "kind": "scalar" } }, "name": { "nullable": false, "type": { "codecId": "pg/text@1", "kind": "scalar" } }, "notes": { "many": { "elementNullable": true }, "nullable": false, "type": { "codecId": "pg/text@1", "kind": "scalar" } } }, "relations": {}, "storage": { "fields": { "addresses": { "column": "addresses" }, "id": { "column": "id" }, "labels": { "column": "labels" }, "name": { "column": "name" }, "notes": { "column": "notes" } }, "namespaceId": "public", "table": "tags" } }, "User": { "fields": { "id": { "nullable": false, "type": { "codecId": "pg/int4@1", "kind": "scalar" } }, "name": { "nullable": false, "type": { "codecId": "pg/text@1", "kind": "scalar" } } }, "relations": { "posts": { "cardinality": "1:N", "on": { "localFields": [ "id" ], "targetFields": [ "userId" ] }, "to": { "model": "Post", "namespace": "public" } } }, "storage": { "fields": { "id": { "column": "id" }, "name": { "column": "name" } }, "namespaceId": "public", "table": "users" } } } } } }, "storage": { "namespaces": { "public": { "entries": { "table": { "comments": { "columns": { "body": { "codecId": "pg/text@1", "dataType": "pg/text", "nullable": false }, "deleted_at": { "codecId": "pg/timestamptz-temporal@1", "dataType": "pg/timestamptz", "nullable": true }, "id": { "codecId": "pg/int4@1", "dataType": "pg/int4", "default": { "expression": "autoincrement()", "kind": "function" }, "nullable": false }, "post_id": { "codecId": "pg/int4@1", "dataType": "pg/int4", "nullable": false } }, "foreignKeys": [ { "index": { "name": "comments_post_id_idx_865a6df2" }, "source": { "columns": [ "post_id" ], "namespaceId": "public", "tableName": "comments" }, "target": { "columns": [ "id" ], "namespaceId": "public", "tableName": "posts" } } ], "indexes": [ { "columns": [ "post_id" ], "name": "comments_post_id_idx_865a6df2", "prefix": "comments_post_id_idx", "unique": false } ], "primaryKey": { "columns": [ "id" ] }, "uniques": [] }, "posts": { "columns": { "created_at": { "codecId": "pg/timestamptz-temporal@1", "dataType": "pg/timestamptz", "default": { "expression": "now()", "kind": "function" }, "nullable": false }, "deleted_at": { "codecId": "pg/timestamptz-temporal@1", "dataType": "pg/timestamptz", "nullable": true }, "id": { "codecId": "pg/int4@1", "dataType": "pg/int4", "default": { "expression": "autoincrement()", "kind": "function" }, "nullable": false }, "title": { "codecId": "pg/text@1", "dataType": "pg/text", "nullable": false }, "user_id": { "codecId": "pg/int4@1", "dataType": "pg/int4", "nullable": false }, "views": { "codecId": "pg/int4@1", "dataType": "pg/int4", "nullable": false } }, "foreignKeys": [ { "index": { "name": "posts_user_id_idx_6c952402" }, "source": { "columns": [ "user_id" ], "namespaceId": "public", "tableName": "posts" }, "target": { "columns": [ "id" ], "namespaceId": "public", "tableName": "users" } } ], "indexes": [ { "columns": [ "user_id" ], "name": "posts_user_id_idx_6c952402", "prefix": "posts_user_id_idx", "unique": false } ], "primaryKey": { "columns": [ "id" ] }, "uniques": [] }, "tags": { "checks": [ { "expression": "jsonb_path_match(\"addresses\", 'strict $.type() == \"array\" && !exists($[*] ? (!((@.type() == \"object\" && exists(@.keyvalue() ? (@.key == \"street\" && (@.value.type() == \"string\"))) && !exists(@.keyvalue() ? (@.key != \"street\"))))))') IS TRUE", "name": "tags_addresses_shape_c752a33a", "prefix": "tags_addresses_shape" }, { "expression": "array_position(\"labels\", NULL) IS NULL", "name": "tags_labels_elem_not_null_0c04ab5c", "prefix": "tags_labels_elem_not_null" } ], "columns": { "addresses": { "codecId": "pg/jsonb@1", "dataType": "pg/jsonb", "nullable": false }, "id": { "codecId": "pg/int4@1", "dataType": "pg/int4", "default": { "expression": "autoincrement()", "kind": "function" }, "nullable": false }, "labels": { "codecId": "pg/text@1", "dataType": "pg/text", "many": { "elementNullable": false }, "nullable": false }, "name": { "codecId": "pg/text@1", "dataType": "pg/text", "nullable": false }, "notes": { "codecId": "pg/text@1", "dataType": "pg/text", "many": { "elementNullable": true }, "nullable": false } }, "foreignKeys": [], "indexes": [], "primaryKey": { "columns": [ "id" ] }, "uniques": [] }, "users": { "columns": { "id": { "codecId": "pg/int4@1", "dataType": "pg/int4", "default": { "expression": "autoincrement()", "kind": "function" }, "nullable": false }, "name": { "codecId": "pg/text@1", "dataType": "pg/text", "nullable": false } }, "foreignKeys": [], "indexes": [], "primaryKey": { "columns": [ "id" ] }, "uniques": [] } }, "valueObject": { "Address": { "fields": { "street": { "nullable": false, "type": { "codecId": "pg/text@1", "kind": "scalar" } } } } } }, "id": "public", "kind": "postgres-schema" } }, "storageHash": "388580bf7258d1c37e6113016201f45f9054b3a56527588f9d8f6646473ea9ef" }, "capabilities": { "postgres": { "distinctOn": true, "forKeyShare": true, "forNoKeyUpdate": true }, "sql": { "checkConstraint": true, "defaultInInsert": true, "forShare": true, "forUpdate": true, "insertOnConflictSkip": true, "insertOnConflictTarget": true, "insertOnConflictWithoutTarget": true, "interactiveTransactions": true, "jsonAgg": true, "jsonAggWithoutTruncation": true, "lateral": true, "lockNowait": true, "lockOf": true, "lockSkipLocked": true, "outerReferencesInDerivedTables": true, "returning": true, "scalarList": true } }, "extensions": {}, "meta": {}, "_generated": { "warning": "⚠️ GENERATED FILE - DO NOT EDIT", "message": "This file is automatically generated by \"prisma contract emit\".", "regenerate": "To regenerate, run: prisma contract emit" } }