This commit is contained in:
Oscar
2026-06-02 16:22:53 +03:00
parent dc44cdd639
commit bc3e48bcad
37 changed files with 973 additions and 1894 deletions

View File

@@ -1,5 +1,5 @@
{
"id": "3d66c7d2-fc68-4c66-ad86-4f558d519225",
"id": "7caebd65-9149-400c-92fa-1981f0e4ea72",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "7",
"dialect": "postgresql",
@@ -206,144 +206,6 @@
"checkConstraints": {},
"isRLSEnabled": false
},
"public.chat": {
"name": "chat",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"profile1_id": {
"name": "profile1_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"profile2_id": {
"name": "profile2_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "chat_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'active'"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.greetings": {
"name": "greetings",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"text": {
"name": "text",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.message": {
"name": "message",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"chat_id": {
"name": "chat_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"text": {
"name": "text",
"type": "text",
"primaryKey": false,
"notNull": false
},
"media_url": {
"name": "media_url",
"type": "text",
"primaryKey": false,
"notNull": false
},
"media_type": {
"name": "media_type",
"type": "media_type",
"typeSchema": "public",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"message_chat_id_chat_id_fk": {
"name": "message_chat_id_chat_id_fk",
"tableFrom": "message",
"tableTo": "chat",
"columnsFrom": [
"chat_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.payment": {
"name": "payment",
"schema": "",
@@ -445,12 +307,6 @@
"primaryKey": false,
"notNull": false
},
"active_chat_id": {
"name": "active_chat_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"fcm_token": {
"name": "fcm_token",
"type": "text",
@@ -501,58 +357,6 @@
"checkConstraints": {},
"isRLSEnabled": false
},
"public.media": {
"name": "media",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"path": {
"name": "path",
"type": "text",
"primaryKey": false,
"notNull": true
},
"type": {
"name": "type",
"type": "varchar(10)",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"media_user_id_user_id_fk": {
"name": "media_user_id_user_id_fk",
"tableFrom": "media",
"tableTo": "user",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.profile": {
"name": "profile",
"schema": "",
@@ -582,6 +386,13 @@
"primaryKey": false,
"notNull": true
},
"gender": {
"name": "gender",
"type": "gender",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"city_id": {
"name": "city_id",
"type": "uuid",
@@ -617,6 +428,12 @@
"type": "double precision",
"primaryKey": false,
"notNull": false
},
"active_chat_id": {
"name": "active_chat_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
@@ -662,15 +479,67 @@
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"profile_user_id_unique": {
"name": "profile_user_id_unique",
"nullsNotDistinct": false,
"columns": [
"user_id"
]
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.profile_media": {
"name": "profile_media",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"profile_id": {
"name": "profile_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"path": {
"name": "path",
"type": "text",
"primaryKey": false,
"notNull": true
},
"type": {
"name": "type",
"type": "profile_media_type",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"sort_order": {
"name": "sort_order",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
}
},
"indexes": {},
"foreignKeys": {
"profile_media_profile_id_profile_id_fk": {
"name": "profile_media_profile_id_profile_id_fk",
"tableFrom": "profile_media",
"tableTo": "profile",
"columnsFrom": [
"profile_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
@@ -772,14 +641,14 @@
"notNull": true,
"default": "gen_random_uuid()"
},
"source_user": {
"name": "source_user",
"source_profile_id": {
"name": "source_profile_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"target_user": {
"name": "target_user",
"target_profile_id": {
"name": "target_profile_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
@@ -801,12 +670,12 @@
},
"indexes": {},
"foreignKeys": {
"like_source_user_user_id_fk": {
"name": "like_source_user_user_id_fk",
"like_source_profile_id_profile_id_fk": {
"name": "like_source_profile_id_profile_id_fk",
"tableFrom": "like",
"tableTo": "user",
"tableTo": "profile",
"columnsFrom": [
"source_user"
"source_profile_id"
],
"columnsTo": [
"id"
@@ -814,12 +683,12 @@
"onDelete": "cascade",
"onUpdate": "no action"
},
"like_target_user_user_id_fk": {
"name": "like_target_user_user_id_fk",
"like_target_profile_id_profile_id_fk": {
"name": "like_target_profile_id_profile_id_fk",
"tableFrom": "like",
"tableTo": "user",
"tableTo": "profile",
"columnsFrom": [
"target_user"
"target_profile_id"
],
"columnsTo": [
"id"
@@ -845,14 +714,14 @@
"notNull": true,
"default": "gen_random_uuid()"
},
"user1_id": {
"name": "user1_id",
"profile1_id": {
"name": "profile1_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"user2_id": {
"name": "user2_id",
"profile2_id": {
"name": "profile2_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
@@ -867,12 +736,12 @@
},
"indexes": {},
"foreignKeys": {
"match_user1_id_user_id_fk": {
"name": "match_user1_id_user_id_fk",
"match_profile1_id_profile_id_fk": {
"name": "match_profile1_id_profile_id_fk",
"tableFrom": "match",
"tableTo": "user",
"tableTo": "profile",
"columnsFrom": [
"user1_id"
"profile1_id"
],
"columnsTo": [
"id"
@@ -880,12 +749,190 @@
"onDelete": "cascade",
"onUpdate": "no action"
},
"match_user2_id_user_id_fk": {
"name": "match_user2_id_user_id_fk",
"match_profile2_id_profile_id_fk": {
"name": "match_profile2_id_profile_id_fk",
"tableFrom": "match",
"tableTo": "user",
"tableTo": "profile",
"columnsFrom": [
"user2_id"
"profile2_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.chat": {
"name": "chat",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"profile1_id": {
"name": "profile1_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"profile2_id": {
"name": "profile2_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "chat_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'active'"
}
},
"indexes": {},
"foreignKeys": {
"chat_profile1_id_profile_id_fk": {
"name": "chat_profile1_id_profile_id_fk",
"tableFrom": "chat",
"tableTo": "profile",
"columnsFrom": [
"profile1_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"chat_profile2_id_profile_id_fk": {
"name": "chat_profile2_id_profile_id_fk",
"tableFrom": "chat",
"tableTo": "profile",
"columnsFrom": [
"profile2_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.greetings": {
"name": "greetings",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"text": {
"name": "text",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.message": {
"name": "message",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"chat_id": {
"name": "chat_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"profile_id": {
"name": "profile_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"text": {
"name": "text",
"type": "text",
"primaryKey": false,
"notNull": false
},
"media_url": {
"name": "media_url",
"type": "text",
"primaryKey": false,
"notNull": false
},
"media_type": {
"name": "media_type",
"type": "message_media_type",
"typeSchema": "public",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"message_chat_id_chat_id_fk": {
"name": "message_chat_id_chat_id_fk",
"tableFrom": "message",
"tableTo": "chat",
"columnsFrom": [
"chat_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"message_profile_id_profile_id_fk": {
"name": "message_profile_id_profile_id_fk",
"tableFrom": "message",
"tableTo": "profile",
"columnsFrom": [
"profile_id"
],
"columnsTo": [
"id"
@@ -911,14 +958,14 @@
"notNull": true,
"default": "gen_random_uuid()"
},
"user1_id": {
"name": "user1_id",
"profile1_id": {
"name": "profile1_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"user2_id": {
"name": "user2_id",
"profile2_id": {
"name": "profile2_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
@@ -950,12 +997,12 @@
},
"indexes": {},
"foreignKeys": {
"date_user1_id_user_id_fk": {
"name": "date_user1_id_user_id_fk",
"date_profile1_id_profile_id_fk": {
"name": "date_profile1_id_profile_id_fk",
"tableFrom": "date",
"tableTo": "user",
"tableTo": "profile",
"columnsFrom": [
"user1_id"
"profile1_id"
],
"columnsTo": [
"id"
@@ -963,12 +1010,12 @@
"onDelete": "cascade",
"onUpdate": "no action"
},
"date_user2_id_user_id_fk": {
"name": "date_user2_id_user_id_fk",
"date_profile2_id_profile_id_fk": {
"name": "date_profile2_id_profile_id_fk",
"tableFrom": "date",
"tableTo": "user",
"tableTo": "profile",
"columnsFrom": [
"user2_id"
"profile2_id"
],
"columnsTo": [
"id"
@@ -1033,8 +1080,8 @@
"notNull": true,
"default": "gen_random_uuid()"
},
"source_user": {
"name": "source_user",
"source_profile_id": {
"name": "source_profile_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
@@ -1061,12 +1108,12 @@
},
"indexes": {},
"foreignKeys": {
"report_source_user_user_id_fk": {
"name": "report_source_user_user_id_fk",
"report_source_profile_id_profile_id_fk": {
"name": "report_source_profile_id_profile_id_fk",
"tableFrom": "report",
"tableTo": "user",
"tableTo": "profile",
"columnsFrom": [
"source_user"
"source_profile_id"
],
"columnsTo": [
"id"
@@ -1083,23 +1130,6 @@
}
},
"enums": {
"public.chat_status": {
"name": "chat_status",
"schema": "public",
"values": [
"active",
"closed"
]
},
"public.media_type": {
"name": "media_type",
"schema": "public",
"values": [
"photo",
"voice",
"video"
]
},
"public.user_status": {
"name": "user_status",
"schema": "public",
@@ -1109,6 +1139,23 @@
"pending"
]
},
"public.gender": {
"name": "gender",
"schema": "public",
"values": [
"male",
"female"
]
},
"public.profile_media_type": {
"name": "profile_media_type",
"schema": "public",
"values": [
"photo",
"video",
"audio"
]
},
"public.like_type": {
"name": "like_type",
"schema": "public",
@@ -1117,6 +1164,23 @@
"dislike"
]
},
"public.chat_status": {
"name": "chat_status",
"schema": "public",
"values": [
"active",
"closed"
]
},
"public.message_media_type": {
"name": "message_media_type",
"schema": "public",
"values": [
"photo",
"voice",
"video"
]
},
"public.report_entity_type": {
"name": "report_entity_type",
"schema": "public",