1005 lines
24 KiB
JSON
1005 lines
24 KiB
JSON
{
|
|
"type": "diff",
|
|
"version": "10",
|
|
"dialect": "postgres",
|
|
"id": "093dfccd-003b-4b87-9780-15e56d12e34e",
|
|
"prevIds": [
|
|
"599a945d-6169-416b-9398-fe17247d8d99"
|
|
],
|
|
"footprints": [
|
|
{
|
|
"statementType": "create_enum",
|
|
"statementTarget": [
|
|
"enum",
|
|
"public",
|
|
"conversation_type"
|
|
],
|
|
"writes": [
|
|
"s|enum|public.conversation_type",
|
|
"n|enum|public.conversation_type",
|
|
"e|enum|public.conversation_type",
|
|
"n|type|public.conversation_type"
|
|
],
|
|
"reads": [
|
|
"n|sch|public"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_enum",
|
|
"statementTarget": [
|
|
"enum",
|
|
"public",
|
|
"friendship_status"
|
|
],
|
|
"writes": [
|
|
"s|enum|public.friendship_status",
|
|
"n|enum|public.friendship_status",
|
|
"e|enum|public.friendship_status",
|
|
"n|type|public.friendship_status"
|
|
],
|
|
"reads": [
|
|
"n|sch|public"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_table",
|
|
"statementTarget": [
|
|
"table",
|
|
"public",
|
|
"conversation"
|
|
],
|
|
"writes": [
|
|
"s|tbl|public.conversation",
|
|
"n|tbl|public.conversation",
|
|
"e|tbl|public.conversation",
|
|
"n|rel|public.conversation",
|
|
"n|type|public.conversation",
|
|
"n|rel|public.conversation_pkey",
|
|
"n|rel|public.conversation_direct_key_key"
|
|
],
|
|
"reads": [
|
|
"n|sch|public",
|
|
"n|enum|public.conversation_type"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_table",
|
|
"statementTarget": [
|
|
"table",
|
|
"public",
|
|
"conversation_member"
|
|
],
|
|
"writes": [
|
|
"s|tbl|public.conversation_member",
|
|
"n|tbl|public.conversation_member",
|
|
"e|tbl|public.conversation_member",
|
|
"n|rel|public.conversation_member",
|
|
"n|type|public.conversation_member",
|
|
"n|rel|public.conversation_member_pkey"
|
|
],
|
|
"reads": [
|
|
"n|sch|public"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_table",
|
|
"statementTarget": [
|
|
"table",
|
|
"public",
|
|
"message"
|
|
],
|
|
"writes": [
|
|
"s|tbl|public.message",
|
|
"n|tbl|public.message",
|
|
"e|tbl|public.message",
|
|
"n|rel|public.message",
|
|
"n|type|public.message",
|
|
"n|rel|public.message_pkey"
|
|
],
|
|
"reads": [
|
|
"n|sch|public"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_table",
|
|
"statementTarget": [
|
|
"table",
|
|
"public",
|
|
"friendship"
|
|
],
|
|
"writes": [
|
|
"s|tbl|public.friendship",
|
|
"n|tbl|public.friendship",
|
|
"e|tbl|public.friendship",
|
|
"n|rel|public.friendship",
|
|
"n|type|public.friendship",
|
|
"n|rel|public.friendship_pkey"
|
|
],
|
|
"reads": [
|
|
"n|sch|public",
|
|
"n|enum|public.friendship_status"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_index",
|
|
"statementTarget": [
|
|
"index",
|
|
"public",
|
|
"conversation_member",
|
|
"conversation_member_user_id_idx"
|
|
],
|
|
"writes": [
|
|
"s|idx|public.conversation_member_user_id_idx",
|
|
"n|idx|public.conversation_member_user_id_idx",
|
|
"e|idx|public.conversation_member_user_id_idx",
|
|
"n|rel|public.conversation_member_user_id_idx"
|
|
],
|
|
"reads": [
|
|
"n|tbl|public.conversation_member",
|
|
"n|sch|public",
|
|
"n|col|public.conversation_member.user_id"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_index",
|
|
"statementTarget": [
|
|
"index",
|
|
"public",
|
|
"message",
|
|
"message_conversation_id_id_idx"
|
|
],
|
|
"writes": [
|
|
"s|idx|public.message_conversation_id_id_idx",
|
|
"n|idx|public.message_conversation_id_id_idx",
|
|
"e|idx|public.message_conversation_id_id_idx",
|
|
"n|rel|public.message_conversation_id_id_idx"
|
|
],
|
|
"reads": [
|
|
"n|tbl|public.message",
|
|
"n|sch|public",
|
|
"n|col|public.message.conversation_id",
|
|
"n|col|public.message.id"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_index",
|
|
"statementTarget": [
|
|
"index",
|
|
"public",
|
|
"friendship",
|
|
"friendship_user_high_id_idx"
|
|
],
|
|
"writes": [
|
|
"s|idx|public.friendship_user_high_id_idx",
|
|
"n|idx|public.friendship_user_high_id_idx",
|
|
"e|idx|public.friendship_user_high_id_idx",
|
|
"n|rel|public.friendship_user_high_id_idx"
|
|
],
|
|
"reads": [
|
|
"n|tbl|public.friendship",
|
|
"n|sch|public",
|
|
"n|col|public.friendship.user_high_id"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_fk",
|
|
"statementTarget": [
|
|
"table",
|
|
"public",
|
|
"conversation_member"
|
|
],
|
|
"writes": [
|
|
"s|fk|public.conversation_member.conversation_member_conversation_id_conversation_id_fkey",
|
|
"n|fk|public.conversation_member.conversation_member_conversation_id_conversation_id_fkey",
|
|
"e|fk|public.conversation_member.conversation_member_conversation_id_conversation_id_fkey",
|
|
"n|con|public.conversation_member.conversation_member_conversation_id_conversation_id_fkey"
|
|
],
|
|
"reads": [
|
|
"n|tbl|public.conversation_member",
|
|
"n|sch|public",
|
|
"n|tbl|public.conversation",
|
|
"n|sch|public",
|
|
"n|col|public.conversation_member.conversation_id",
|
|
"n|col|public.conversation.id",
|
|
"e|uniqueness|public.conversation.id"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_fk",
|
|
"statementTarget": [
|
|
"table",
|
|
"public",
|
|
"conversation_member"
|
|
],
|
|
"writes": [
|
|
"s|fk|public.conversation_member.conversation_member_user_id_user_id_fkey",
|
|
"n|fk|public.conversation_member.conversation_member_user_id_user_id_fkey",
|
|
"e|fk|public.conversation_member.conversation_member_user_id_user_id_fkey",
|
|
"n|con|public.conversation_member.conversation_member_user_id_user_id_fkey"
|
|
],
|
|
"reads": [
|
|
"n|tbl|public.conversation_member",
|
|
"n|sch|public",
|
|
"n|tbl|public.user",
|
|
"n|sch|public",
|
|
"n|col|public.conversation_member.user_id",
|
|
"n|col|public.user.id",
|
|
"e|uniqueness|public.user.id"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_fk",
|
|
"statementTarget": [
|
|
"table",
|
|
"public",
|
|
"message"
|
|
],
|
|
"writes": [
|
|
"s|fk|public.message.message_conversation_id_conversation_id_fkey",
|
|
"n|fk|public.message.message_conversation_id_conversation_id_fkey",
|
|
"e|fk|public.message.message_conversation_id_conversation_id_fkey",
|
|
"n|con|public.message.message_conversation_id_conversation_id_fkey"
|
|
],
|
|
"reads": [
|
|
"n|tbl|public.message",
|
|
"n|sch|public",
|
|
"n|tbl|public.conversation",
|
|
"n|sch|public",
|
|
"n|col|public.message.conversation_id",
|
|
"n|col|public.conversation.id",
|
|
"e|uniqueness|public.conversation.id"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_fk",
|
|
"statementTarget": [
|
|
"table",
|
|
"public",
|
|
"message"
|
|
],
|
|
"writes": [
|
|
"s|fk|public.message.message_author_id_user_id_fkey",
|
|
"n|fk|public.message.message_author_id_user_id_fkey",
|
|
"e|fk|public.message.message_author_id_user_id_fkey",
|
|
"n|con|public.message.message_author_id_user_id_fkey"
|
|
],
|
|
"reads": [
|
|
"n|tbl|public.message",
|
|
"n|sch|public",
|
|
"n|tbl|public.user",
|
|
"n|sch|public",
|
|
"n|col|public.message.author_id",
|
|
"n|col|public.user.id",
|
|
"e|uniqueness|public.user.id"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_fk",
|
|
"statementTarget": [
|
|
"table",
|
|
"public",
|
|
"friendship"
|
|
],
|
|
"writes": [
|
|
"s|fk|public.friendship.friendship_user_low_id_user_id_fkey",
|
|
"n|fk|public.friendship.friendship_user_low_id_user_id_fkey",
|
|
"e|fk|public.friendship.friendship_user_low_id_user_id_fkey",
|
|
"n|con|public.friendship.friendship_user_low_id_user_id_fkey"
|
|
],
|
|
"reads": [
|
|
"n|tbl|public.friendship",
|
|
"n|sch|public",
|
|
"n|tbl|public.user",
|
|
"n|sch|public",
|
|
"n|col|public.friendship.user_low_id",
|
|
"n|col|public.user.id",
|
|
"e|uniqueness|public.user.id"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_fk",
|
|
"statementTarget": [
|
|
"table",
|
|
"public",
|
|
"friendship"
|
|
],
|
|
"writes": [
|
|
"s|fk|public.friendship.friendship_user_high_id_user_id_fkey",
|
|
"n|fk|public.friendship.friendship_user_high_id_user_id_fkey",
|
|
"e|fk|public.friendship.friendship_user_high_id_user_id_fkey",
|
|
"n|con|public.friendship.friendship_user_high_id_user_id_fkey"
|
|
],
|
|
"reads": [
|
|
"n|tbl|public.friendship",
|
|
"n|sch|public",
|
|
"n|tbl|public.user",
|
|
"n|sch|public",
|
|
"n|col|public.friendship.user_high_id",
|
|
"n|col|public.user.id",
|
|
"e|uniqueness|public.user.id"
|
|
]
|
|
},
|
|
{
|
|
"statementType": "create_fk",
|
|
"statementTarget": [
|
|
"table",
|
|
"public",
|
|
"friendship"
|
|
],
|
|
"writes": [
|
|
"s|fk|public.friendship.friendship_requested_by_id_user_id_fkey",
|
|
"n|fk|public.friendship.friendship_requested_by_id_user_id_fkey",
|
|
"e|fk|public.friendship.friendship_requested_by_id_user_id_fkey",
|
|
"n|con|public.friendship.friendship_requested_by_id_user_id_fkey"
|
|
],
|
|
"reads": [
|
|
"n|tbl|public.friendship",
|
|
"n|sch|public",
|
|
"n|tbl|public.user",
|
|
"n|sch|public",
|
|
"n|col|public.friendship.requested_by_id",
|
|
"n|col|public.user.id",
|
|
"e|uniqueness|public.user.id"
|
|
]
|
|
}
|
|
],
|
|
"deltas": [
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"name": "conversation",
|
|
"isRlsEnabled": false,
|
|
"entityType": "tables"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"name": "conversation_member",
|
|
"isRlsEnabled": false,
|
|
"entityType": "tables"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"name": "message",
|
|
"isRlsEnabled": false,
|
|
"entityType": "tables"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"name": "friendship",
|
|
"isRlsEnabled": false,
|
|
"entityType": "tables"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"name": "conversation_type",
|
|
"values": [
|
|
"direct"
|
|
],
|
|
"entityType": "enums"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"name": "friendship_status",
|
|
"values": [
|
|
"pending",
|
|
"accepted"
|
|
],
|
|
"entityType": "enums"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "conversation",
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"typeSchema": null,
|
|
"notNull": true,
|
|
"dimensions": 0,
|
|
"default": "uuidv7()",
|
|
"generated": null,
|
|
"identity": null,
|
|
"entityType": "columns"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "conversation",
|
|
"name": "type",
|
|
"type": "conversation_type",
|
|
"typeSchema": "public",
|
|
"notNull": true,
|
|
"dimensions": 0,
|
|
"default": null,
|
|
"generated": null,
|
|
"identity": null,
|
|
"entityType": "columns"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "conversation",
|
|
"name": "direct_key",
|
|
"type": "text",
|
|
"typeSchema": null,
|
|
"notNull": false,
|
|
"dimensions": 0,
|
|
"default": null,
|
|
"generated": null,
|
|
"identity": null,
|
|
"entityType": "columns"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "conversation",
|
|
"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": "conversation",
|
|
"name": "last_activity_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": "conversation_member",
|
|
"name": "conversation_id",
|
|
"type": "uuid",
|
|
"typeSchema": null,
|
|
"notNull": true,
|
|
"dimensions": 0,
|
|
"default": null,
|
|
"generated": null,
|
|
"identity": null,
|
|
"entityType": "columns"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "conversation_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": "conversation_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": "message",
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"typeSchema": null,
|
|
"notNull": true,
|
|
"dimensions": 0,
|
|
"default": "uuidv7()",
|
|
"generated": null,
|
|
"identity": null,
|
|
"entityType": "columns"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "message",
|
|
"name": "conversation_id",
|
|
"type": "uuid",
|
|
"typeSchema": null,
|
|
"notNull": true,
|
|
"dimensions": 0,
|
|
"default": null,
|
|
"generated": null,
|
|
"identity": null,
|
|
"entityType": "columns"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "message",
|
|
"name": "author_id",
|
|
"type": "text",
|
|
"typeSchema": null,
|
|
"notNull": true,
|
|
"dimensions": 0,
|
|
"default": null,
|
|
"generated": null,
|
|
"identity": null,
|
|
"entityType": "columns"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "message",
|
|
"name": "content",
|
|
"type": "text",
|
|
"typeSchema": null,
|
|
"notNull": true,
|
|
"dimensions": 0,
|
|
"default": null,
|
|
"generated": null,
|
|
"identity": null,
|
|
"entityType": "columns"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "message",
|
|
"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": "friendship",
|
|
"name": "user_low_id",
|
|
"type": "text",
|
|
"typeSchema": null,
|
|
"notNull": true,
|
|
"dimensions": 0,
|
|
"default": null,
|
|
"generated": null,
|
|
"identity": null,
|
|
"entityType": "columns"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "friendship",
|
|
"name": "user_high_id",
|
|
"type": "text",
|
|
"typeSchema": null,
|
|
"notNull": true,
|
|
"dimensions": 0,
|
|
"default": null,
|
|
"generated": null,
|
|
"identity": null,
|
|
"entityType": "columns"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "friendship",
|
|
"name": "requested_by_id",
|
|
"type": "text",
|
|
"typeSchema": null,
|
|
"notNull": true,
|
|
"dimensions": 0,
|
|
"default": null,
|
|
"generated": null,
|
|
"identity": null,
|
|
"entityType": "columns"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "friendship",
|
|
"name": "status",
|
|
"type": "friendship_status",
|
|
"typeSchema": "public",
|
|
"notNull": true,
|
|
"dimensions": 0,
|
|
"default": "'pending'",
|
|
"generated": null,
|
|
"identity": null,
|
|
"entityType": "columns"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "friendship",
|
|
"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": "friendship",
|
|
"name": "accepted_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": "conversation_member",
|
|
"name": "conversation_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": "message",
|
|
"name": "message_conversation_id_id_idx",
|
|
"nameExplicit": true,
|
|
"columns": [
|
|
{
|
|
"value": "conversation_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nullsFirst": false,
|
|
"opclass": null
|
|
},
|
|
{
|
|
"value": "id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nullsFirst": false,
|
|
"opclass": null
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"where": null,
|
|
"with": "",
|
|
"method": "btree",
|
|
"entityType": "indexes"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "friendship",
|
|
"name": "friendship_user_high_id_idx",
|
|
"nameExplicit": true,
|
|
"columns": [
|
|
{
|
|
"value": "user_high_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nullsFirst": false,
|
|
"opclass": null
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"where": null,
|
|
"with": "",
|
|
"method": "btree",
|
|
"entityType": "indexes"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "conversation_member",
|
|
"name": "conversation_member_conversation_id_conversation_id_fkey",
|
|
"nameExplicit": false,
|
|
"columns": [
|
|
"conversation_id"
|
|
],
|
|
"schemaTo": "public",
|
|
"tableTo": "conversation",
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onUpdate": "NO ACTION",
|
|
"onDelete": "CASCADE",
|
|
"entityType": "fks"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "conversation_member",
|
|
"name": "conversation_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": "message",
|
|
"name": "message_conversation_id_conversation_id_fkey",
|
|
"nameExplicit": false,
|
|
"columns": [
|
|
"conversation_id"
|
|
],
|
|
"schemaTo": "public",
|
|
"tableTo": "conversation",
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onUpdate": "NO ACTION",
|
|
"onDelete": "CASCADE",
|
|
"entityType": "fks"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "message",
|
|
"name": "message_author_id_user_id_fkey",
|
|
"nameExplicit": false,
|
|
"columns": [
|
|
"author_id"
|
|
],
|
|
"schemaTo": "public",
|
|
"tableTo": "user",
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onUpdate": "NO ACTION",
|
|
"onDelete": "CASCADE",
|
|
"entityType": "fks"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "friendship",
|
|
"name": "friendship_user_low_id_user_id_fkey",
|
|
"nameExplicit": false,
|
|
"columns": [
|
|
"user_low_id"
|
|
],
|
|
"schemaTo": "public",
|
|
"tableTo": "user",
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onUpdate": "NO ACTION",
|
|
"onDelete": "CASCADE",
|
|
"entityType": "fks"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "friendship",
|
|
"name": "friendship_user_high_id_user_id_fkey",
|
|
"nameExplicit": false,
|
|
"columns": [
|
|
"user_high_id"
|
|
],
|
|
"schemaTo": "public",
|
|
"tableTo": "user",
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onUpdate": "NO ACTION",
|
|
"onDelete": "CASCADE",
|
|
"entityType": "fks"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "friendship",
|
|
"name": "friendship_requested_by_id_user_id_fkey",
|
|
"nameExplicit": false,
|
|
"columns": [
|
|
"requested_by_id"
|
|
],
|
|
"schemaTo": "public",
|
|
"tableTo": "user",
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onUpdate": "NO ACTION",
|
|
"onDelete": "CASCADE",
|
|
"entityType": "fks"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "conversation_member",
|
|
"name": "conversation_member_pkey",
|
|
"columns": [
|
|
"conversation_id",
|
|
"user_id"
|
|
],
|
|
"nameExplicit": false,
|
|
"entityType": "pks"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "friendship",
|
|
"name": "friendship_pkey",
|
|
"columns": [
|
|
"user_low_id",
|
|
"user_high_id"
|
|
],
|
|
"nameExplicit": false,
|
|
"entityType": "pks"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "conversation",
|
|
"name": "conversation_pkey",
|
|
"columns": [
|
|
"id"
|
|
],
|
|
"nameExplicit": false,
|
|
"entityType": "pks"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "message",
|
|
"name": "message_pkey",
|
|
"columns": [
|
|
"id"
|
|
],
|
|
"nameExplicit": false,
|
|
"entityType": "pks"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "conversation",
|
|
"name": "conversation_direct_key_key",
|
|
"nameExplicit": false,
|
|
"columns": [
|
|
"direct_key"
|
|
],
|
|
"nullsNotDistinct": false,
|
|
"entityType": "uniques"
|
|
}
|
|
},
|
|
{
|
|
"op": "create",
|
|
"row": {
|
|
"schema": "public",
|
|
"table": "friendship",
|
|
"name": "friendship_ordered_pair",
|
|
"value": "\"user_low_id\" < \"user_high_id\" COLLATE \"C\"",
|
|
"entityType": "checks"
|
|
}
|
|
}
|
|
]
|
|
} |