{ "type": "diff", "version": "10", "dialect": "postgres", "id": "7d8afcd9-0950-488b-b642-ef874960d2b3", "prevIds": [ "d8d24fdc-bb81-4b87-8ec6-6d18c20db156" ], "footprints": [ { "statementType": "alter_enum", "statementTarget": [ "enum", "public", "conversation_type" ], "writes": [ "s|enum|public.conversation_type" ], "reads": [ "n|sch|public" ] }, { "statementType": "create_table", "statementTarget": [ "table", "public", "realm" ], "writes": [ "s|tbl|public.realm", "n|tbl|public.realm", "e|tbl|public.realm", "n|rel|public.realm", "n|type|public.realm", "n|rel|public.realm_pkey" ], "reads": [ "n|sch|public" ] }, { "statementType": "create_table", "statementTarget": [ "table", "public", "realm_invite" ], "writes": [ "s|tbl|public.realm_invite", "n|tbl|public.realm_invite", "e|tbl|public.realm_invite", "n|rel|public.realm_invite", "n|type|public.realm_invite", "n|rel|public.realm_invite_pkey" ], "reads": [ "n|sch|public" ] }, { "statementType": "create_table", "statementTarget": [ "table", "public", "realm_member" ], "writes": [ "s|tbl|public.realm_member", "n|tbl|public.realm_member", "e|tbl|public.realm_member", "n|rel|public.realm_member", "n|type|public.realm_member", "n|rel|public.realm_member_pkey" ], "reads": [ "n|sch|public" ] }, { "statementType": "create_table", "statementTarget": [ "table", "public", "realm_member_role" ], "writes": [ "s|tbl|public.realm_member_role", "n|tbl|public.realm_member_role", "e|tbl|public.realm_member_role", "n|rel|public.realm_member_role", "n|type|public.realm_member_role", "n|rel|public.realm_member_role_pkey" ], "reads": [ "n|sch|public" ] }, { "statementType": "create_table", "statementTarget": [ "table", "public", "realm_role" ], "writes": [ "s|tbl|public.realm_role", "n|tbl|public.realm_role", "e|tbl|public.realm_role", "n|rel|public.realm_role", "n|type|public.realm_role", "n|rel|public.realm_role_pkey" ], "reads": [ "n|sch|public" ] }, { "statementType": "add_column", "statementTarget": [ "column", "public", "conversation", "realm_id" ], "writes": [ "s|col|public.conversation.realm_id", "n|col|public.conversation.realm_id", "e|col|public.conversation.realm_id" ], "reads": [ "n|tbl|public.conversation", "n|sch|public" ] }, { "statementType": "create_index", "statementTarget": [ "index", "public", "conversation", "conversation_realm_id_idx" ], "writes": [ "s|idx|public.conversation_realm_id_idx", "n|idx|public.conversation_realm_id_idx", "e|idx|public.conversation_realm_id_idx", "n|rel|public.conversation_realm_id_idx" ], "reads": [ "n|tbl|public.conversation", "n|sch|public", "n|col|public.conversation.realm_id" ] }, { "statementType": "create_index", "statementTarget": [ "index", "public", "realm_invite", "realm_invite_realm_id_idx" ], "writes": [ "s|idx|public.realm_invite_realm_id_idx", "n|idx|public.realm_invite_realm_id_idx", "e|idx|public.realm_invite_realm_id_idx", "n|rel|public.realm_invite_realm_id_idx" ], "reads": [ "n|tbl|public.realm_invite", "n|sch|public", "n|col|public.realm_invite.realm_id" ] }, { "statementType": "create_index", "statementTarget": [ "index", "public", "realm_member", "realm_member_user_id_idx" ], "writes": [ "s|idx|public.realm_member_user_id_idx", "n|idx|public.realm_member_user_id_idx", "e|idx|public.realm_member_user_id_idx", "n|rel|public.realm_member_user_id_idx" ], "reads": [ "n|tbl|public.realm_member", "n|sch|public", "n|col|public.realm_member.user_id" ] }, { "statementType": "create_index", "statementTarget": [ "index", "public", "realm_member_role", "realm_member_role_role_id_idx" ], "writes": [ "s|idx|public.realm_member_role_role_id_idx", "n|idx|public.realm_member_role_role_id_idx", "e|idx|public.realm_member_role_role_id_idx", "n|rel|public.realm_member_role_role_id_idx" ], "reads": [ "n|tbl|public.realm_member_role", "n|sch|public", "n|col|public.realm_member_role.role_id" ] }, { "statementType": "create_index", "statementTarget": [ "index", "public", "realm_role", "realm_role_realm_id_idx" ], "writes": [ "s|idx|public.realm_role_realm_id_idx", "n|idx|public.realm_role_realm_id_idx", "e|idx|public.realm_role_realm_id_idx", "n|rel|public.realm_role_realm_id_idx" ], "reads": [ "n|tbl|public.realm_role", "n|sch|public", "n|col|public.realm_role.realm_id" ] }, { "statementType": "create_index", "statementTarget": [ "index", "public", "realm_role", "realm_role_one_default_idx" ], "writes": [ "s|idx|public.realm_role_one_default_idx", "n|idx|public.realm_role_one_default_idx", "e|idx|public.realm_role_one_default_idx", "n|rel|public.realm_role_one_default_idx" ], "reads": [ "n|tbl|public.realm_role", "n|sch|public", "n|col|public.realm_role.realm_id" ] }, { "statementType": "create_fk", "statementTarget": [ "table", "public", "conversation" ], "writes": [ "s|fk|public.conversation.conversation_realm_id_realm_id_fkey", "n|fk|public.conversation.conversation_realm_id_realm_id_fkey", "e|fk|public.conversation.conversation_realm_id_realm_id_fkey", "n|con|public.conversation.conversation_realm_id_realm_id_fkey" ], "reads": [ "n|tbl|public.conversation", "n|sch|public", "n|tbl|public.realm", "n|sch|public", "n|col|public.conversation.realm_id", "n|col|public.realm.id", "e|uniqueness|public.realm.id" ] }, { "statementType": "create_fk", "statementTarget": [ "table", "public", "realm" ], "writes": [ "s|fk|public.realm.realm_owner_id_user_id_fkey", "n|fk|public.realm.realm_owner_id_user_id_fkey", "e|fk|public.realm.realm_owner_id_user_id_fkey", "n|con|public.realm.realm_owner_id_user_id_fkey" ], "reads": [ "n|tbl|public.realm", "n|sch|public", "n|tbl|public.user", "n|sch|public", "n|col|public.realm.owner_id", "n|col|public.user.id", "e|uniqueness|public.user.id" ] }, { "statementType": "create_fk", "statementTarget": [ "table", "public", "realm_invite" ], "writes": [ "s|fk|public.realm_invite.realm_invite_realm_id_realm_id_fkey", "n|fk|public.realm_invite.realm_invite_realm_id_realm_id_fkey", "e|fk|public.realm_invite.realm_invite_realm_id_realm_id_fkey", "n|con|public.realm_invite.realm_invite_realm_id_realm_id_fkey" ], "reads": [ "n|tbl|public.realm_invite", "n|sch|public", "n|tbl|public.realm", "n|sch|public", "n|col|public.realm_invite.realm_id", "n|col|public.realm.id", "e|uniqueness|public.realm.id" ] }, { "statementType": "create_fk", "statementTarget": [ "table", "public", "realm_invite" ], "writes": [ "s|fk|public.realm_invite.realm_invite_created_by_id_user_id_fkey", "n|fk|public.realm_invite.realm_invite_created_by_id_user_id_fkey", "e|fk|public.realm_invite.realm_invite_created_by_id_user_id_fkey", "n|con|public.realm_invite.realm_invite_created_by_id_user_id_fkey" ], "reads": [ "n|tbl|public.realm_invite", "n|sch|public", "n|tbl|public.user", "n|sch|public", "n|col|public.realm_invite.created_by_id", "n|col|public.user.id", "e|uniqueness|public.user.id" ] }, { "statementType": "create_fk", "statementTarget": [ "table", "public", "realm_member" ], "writes": [ "s|fk|public.realm_member.realm_member_realm_id_realm_id_fkey", "n|fk|public.realm_member.realm_member_realm_id_realm_id_fkey", "e|fk|public.realm_member.realm_member_realm_id_realm_id_fkey", "n|con|public.realm_member.realm_member_realm_id_realm_id_fkey" ], "reads": [ "n|tbl|public.realm_member", "n|sch|public", "n|tbl|public.realm", "n|sch|public", "n|col|public.realm_member.realm_id", "n|col|public.realm.id", "e|uniqueness|public.realm.id" ] }, { "statementType": "create_fk", "statementTarget": [ "table", "public", "realm_member" ], "writes": [ "s|fk|public.realm_member.realm_member_user_id_user_id_fkey", "n|fk|public.realm_member.realm_member_user_id_user_id_fkey", "e|fk|public.realm_member.realm_member_user_id_user_id_fkey", "n|con|public.realm_member.realm_member_user_id_user_id_fkey" ], "reads": [ "n|tbl|public.realm_member", "n|sch|public", "n|tbl|public.user", "n|sch|public", "n|col|public.realm_member.user_id", "n|col|public.user.id", "e|uniqueness|public.user.id" ] }, { "statementType": "create_fk", "statementTarget": [ "table", "public", "realm_member_role" ], "writes": [ "s|fk|public.realm_member_role.realm_member_role_role_id_realm_role_id_fkey", "n|fk|public.realm_member_role.realm_member_role_role_id_realm_role_id_fkey", "e|fk|public.realm_member_role.realm_member_role_role_id_realm_role_id_fkey", "n|con|public.realm_member_role.realm_member_role_role_id_realm_role_id_fkey" ], "reads": [ "n|tbl|public.realm_member_role", "n|sch|public", "n|tbl|public.realm_role", "n|sch|public", "n|col|public.realm_member_role.role_id", "n|col|public.realm_role.id", "e|uniqueness|public.realm_role.id" ] }, { "statementType": "create_fk", "statementTarget": [ "table", "public", "realm_member_role" ], "writes": [ "s|fk|public.realm_member_role.realm_member_role_member_fk", "n|fk|public.realm_member_role.realm_member_role_member_fk", "e|fk|public.realm_member_role.realm_member_role_member_fk", "n|con|public.realm_member_role.realm_member_role_member_fk" ], "reads": [ "n|tbl|public.realm_member_role", "n|sch|public", "n|tbl|public.realm_member", "n|sch|public", "n|col|public.realm_member_role.realm_id", "n|col|public.realm_member_role.user_id", "n|col|public.realm_member.realm_id", "n|col|public.realm_member.user_id", "e|uniqueness|public.realm_member.realm_id.user_id" ] }, { "statementType": "create_fk", "statementTarget": [ "table", "public", "realm_role" ], "writes": [ "s|fk|public.realm_role.realm_role_realm_id_realm_id_fkey", "n|fk|public.realm_role.realm_role_realm_id_realm_id_fkey", "e|fk|public.realm_role.realm_role_realm_id_realm_id_fkey", "n|con|public.realm_role.realm_role_realm_id_realm_id_fkey" ], "reads": [ "n|tbl|public.realm_role", "n|sch|public", "n|tbl|public.realm", "n|sch|public", "n|col|public.realm_role.realm_id", "n|col|public.realm.id", "e|uniqueness|public.realm.id" ] } ], "deltas": [ { "op": "create", "row": { "schema": "public", "name": "realm", "isRlsEnabled": false, "entityType": "tables" } }, { "op": "create", "row": { "schema": "public", "name": "realm_invite", "isRlsEnabled": false, "entityType": "tables" } }, { "op": "create", "row": { "schema": "public", "name": "realm_member", "isRlsEnabled": false, "entityType": "tables" } }, { "op": "create", "row": { "schema": "public", "name": "realm_member_role", "isRlsEnabled": false, "entityType": "tables" } }, { "op": "create", "row": { "schema": "public", "name": "realm_role", "isRlsEnabled": false, "entityType": "tables" } }, { "op": "create", "row": { "schema": "public", "table": "conversation", "name": "realm_id", "type": "uuid", "typeSchema": null, "notNull": false, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm", "name": "id", "type": "uuid", "typeSchema": null, "notNull": true, "dimensions": 0, "default": "uuidv7()", "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm", "name": "name", "type": "text", "typeSchema": null, "notNull": true, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm", "name": "owner_id", "type": "text", "typeSchema": null, "notNull": true, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm", "name": "created_at", "type": "timestamp with time zone", "typeSchema": null, "notNull": true, "dimensions": 0, "default": "now()", "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_invite", "name": "code", "type": "text", "typeSchema": null, "notNull": true, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_invite", "name": "realm_id", "type": "uuid", "typeSchema": null, "notNull": true, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_invite", "name": "created_by_id", "type": "text", "typeSchema": null, "notNull": true, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_invite", "name": "created_at", "type": "timestamp with time zone", "typeSchema": null, "notNull": true, "dimensions": 0, "default": "now()", "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_invite", "name": "expires_at", "type": "timestamp with time zone", "typeSchema": null, "notNull": false, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_invite", "name": "max_uses", "type": "integer", "typeSchema": null, "notNull": false, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_invite", "name": "uses", "type": "integer", "typeSchema": null, "notNull": true, "dimensions": 0, "default": "0", "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_member", "name": "realm_id", "type": "uuid", "typeSchema": null, "notNull": true, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_member", "name": "user_id", "type": "text", "typeSchema": null, "notNull": true, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_member", "name": "joined_at", "type": "timestamp with time zone", "typeSchema": null, "notNull": true, "dimensions": 0, "default": "now()", "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_member_role", "name": "realm_id", "type": "uuid", "typeSchema": null, "notNull": true, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_member_role", "name": "user_id", "type": "text", "typeSchema": null, "notNull": true, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_member_role", "name": "role_id", "type": "uuid", "typeSchema": null, "notNull": true, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_role", "name": "id", "type": "uuid", "typeSchema": null, "notNull": true, "dimensions": 0, "default": "uuidv7()", "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_role", "name": "realm_id", "type": "uuid", "typeSchema": null, "notNull": true, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_role", "name": "name", "type": "text", "typeSchema": null, "notNull": true, "dimensions": 0, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_role", "name": "permissions", "type": "text", "typeSchema": null, "notNull": true, "dimensions": 1, "default": null, "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "realm_role", "name": "is_default", "type": "boolean", "typeSchema": null, "notNull": true, "dimensions": 0, "default": "false", "generated": null, "identity": null, "entityType": "columns" } }, { "op": "create", "row": { "schema": "public", "table": "conversation", "name": "conversation_realm_id_idx", "nameExplicit": true, "columns": [ { "value": "realm_id", "isExpression": false, "asc": true, "nullsFirst": false, "opclass": null } ], "isUnique": false, "where": null, "with": "", "method": "btree", "entityType": "indexes" } }, { "op": "create", "row": { "schema": "public", "table": "realm_invite", "name": "realm_invite_realm_id_idx", "nameExplicit": true, "columns": [ { "value": "realm_id", "isExpression": false, "asc": true, "nullsFirst": false, "opclass": null } ], "isUnique": false, "where": null, "with": "", "method": "btree", "entityType": "indexes" } }, { "op": "create", "row": { "schema": "public", "table": "realm_member", "name": "realm_member_user_id_idx", "nameExplicit": true, "columns": [ { "value": "user_id", "isExpression": false, "asc": true, "nullsFirst": false, "opclass": null } ], "isUnique": false, "where": null, "with": "", "method": "btree", "entityType": "indexes" } }, { "op": "create", "row": { "schema": "public", "table": "realm_member_role", "name": "realm_member_role_role_id_idx", "nameExplicit": true, "columns": [ { "value": "role_id", "isExpression": false, "asc": true, "nullsFirst": false, "opclass": null } ], "isUnique": false, "where": null, "with": "", "method": "btree", "entityType": "indexes" } }, { "op": "create", "row": { "schema": "public", "table": "realm_role", "name": "realm_role_realm_id_idx", "nameExplicit": true, "columns": [ { "value": "realm_id", "isExpression": false, "asc": true, "nullsFirst": false, "opclass": null } ], "isUnique": false, "where": null, "with": "", "method": "btree", "entityType": "indexes" } }, { "op": "create", "row": { "schema": "public", "table": "realm_role", "name": "realm_role_one_default_idx", "nameExplicit": true, "columns": [ { "value": "realm_id", "isExpression": false, "asc": true, "nullsFirst": false, "opclass": null } ], "isUnique": true, "where": "\"is_default\"", "with": "", "method": "btree", "entityType": "indexes" } }, { "op": "create", "row": { "schema": "public", "table": "conversation", "name": "conversation_realm_id_realm_id_fkey", "nameExplicit": false, "columns": [ "realm_id" ], "schemaTo": "public", "tableTo": "realm", "columnsTo": [ "id" ], "onUpdate": "NO ACTION", "onDelete": "CASCADE", "entityType": "fks" } }, { "op": "create", "row": { "schema": "public", "table": "realm", "name": "realm_owner_id_user_id_fkey", "nameExplicit": false, "columns": [ "owner_id" ], "schemaTo": "public", "tableTo": "user", "columnsTo": [ "id" ], "onUpdate": "NO ACTION", "onDelete": "CASCADE", "entityType": "fks" } }, { "op": "create", "row": { "schema": "public", "table": "realm_invite", "name": "realm_invite_realm_id_realm_id_fkey", "nameExplicit": false, "columns": [ "realm_id" ], "schemaTo": "public", "tableTo": "realm", "columnsTo": [ "id" ], "onUpdate": "NO ACTION", "onDelete": "CASCADE", "entityType": "fks" } }, { "op": "create", "row": { "schema": "public", "table": "realm_invite", "name": "realm_invite_created_by_id_user_id_fkey", "nameExplicit": false, "columns": [ "created_by_id" ], "schemaTo": "public", "tableTo": "user", "columnsTo": [ "id" ], "onUpdate": "NO ACTION", "onDelete": "CASCADE", "entityType": "fks" } }, { "op": "create", "row": { "schema": "public", "table": "realm_member", "name": "realm_member_realm_id_realm_id_fkey", "nameExplicit": false, "columns": [ "realm_id" ], "schemaTo": "public", "tableTo": "realm", "columnsTo": [ "id" ], "onUpdate": "NO ACTION", "onDelete": "CASCADE", "entityType": "fks" } }, { "op": "create", "row": { "schema": "public", "table": "realm_member", "name": "realm_member_user_id_user_id_fkey", "nameExplicit": false, "columns": [ "user_id" ], "schemaTo": "public", "tableTo": "user", "columnsTo": [ "id" ], "onUpdate": "NO ACTION", "onDelete": "CASCADE", "entityType": "fks" } }, { "op": "create", "row": { "schema": "public", "table": "realm_member_role", "name": "realm_member_role_role_id_realm_role_id_fkey", "nameExplicit": false, "columns": [ "role_id" ], "schemaTo": "public", "tableTo": "realm_role", "columnsTo": [ "id" ], "onUpdate": "NO ACTION", "onDelete": "CASCADE", "entityType": "fks" } }, { "op": "create", "row": { "schema": "public", "table": "realm_member_role", "name": "realm_member_role_member_fk", "nameExplicit": true, "columns": [ "realm_id", "user_id" ], "schemaTo": "public", "tableTo": "realm_member", "columnsTo": [ "realm_id", "user_id" ], "onUpdate": "NO ACTION", "onDelete": "CASCADE", "entityType": "fks" } }, { "op": "create", "row": { "schema": "public", "table": "realm_role", "name": "realm_role_realm_id_realm_id_fkey", "nameExplicit": false, "columns": [ "realm_id" ], "schemaTo": "public", "tableTo": "realm", "columnsTo": [ "id" ], "onUpdate": "NO ACTION", "onDelete": "CASCADE", "entityType": "fks" } }, { "op": "create", "row": { "schema": "public", "table": "realm_member", "name": "realm_member_pkey", "columns": [ "realm_id", "user_id" ], "nameExplicit": false, "entityType": "pks" } }, { "op": "create", "row": { "schema": "public", "table": "realm_member_role", "name": "realm_member_role_pkey", "columns": [ "realm_id", "user_id", "role_id" ], "nameExplicit": false, "entityType": "pks" } }, { "op": "create", "row": { "schema": "public", "table": "realm", "name": "realm_pkey", "columns": [ "id" ], "nameExplicit": false, "entityType": "pks" } }, { "op": "create", "row": { "schema": "public", "table": "realm_invite", "name": "realm_invite_pkey", "columns": [ "code" ], "nameExplicit": false, "entityType": "pks" } }, { "op": "create", "row": { "schema": "public", "table": "realm_role", "name": "realm_role_pkey", "columns": [ "id" ], "nameExplicit": false, "entityType": "pks" } }, { "op": "alter", "key": "enums\u0000[\"public\",\"conversation_type\"]", "set": { "values": [ "direct", "group", "cauldron" ] } } ] }