oex2003 commited on
Commit
5e518ea
·
0 Parent(s):

Deploy Evolution API to Hugging Face Space

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. Dockerfile +222 -0
  2. README.md +29 -0
  3. manager/dist/assets/images/evolution-logo.png +0 -0
  4. manager/dist/assets/index-CXH2BdD4.css +1 -0
  5. manager/dist/assets/index-D-oOjDYe.js +0 -0
  6. manager/dist/index.html +14 -0
  7. package-lock.json +0 -0
  8. package.json +130 -0
  9. prisma/mysql-migrations/20240809105427_init/migration.sql +588 -0
  10. prisma/mysql-migrations/20240813153900_add_unique_index_for_remoted_jid_and_instance_in_contacts/migration.sql +173 -0
  11. prisma/mysql-migrations/20240814173138_add_ignore_jids_chatwoot/migration.sql +150 -0
  12. prisma/mysql-migrations/20240814214314_integrations_unification/migration.sql +208 -0
  13. prisma/mysql-migrations/20240821203259_add_postgres_migrations/migration.sql +269 -0
  14. prisma/mysql-migrations/20240824162012_add_type_on_integration_sessions/migration.sql +159 -0
  15. prisma/mysql-migrations/20240825131301_change_to_evolution_bot/migration.sql +219 -0
  16. prisma/mysql-migrations/20241001172800_add_message_status/migration.sql +174 -0
  17. prisma/mysql-migrations/20241108101333_fix_message_status_as_string/migration.sql +232 -0
  18. prisma/mysql-migrations/20250214181954_add_wavoip_token_column/migration.sql +175 -0
  19. prisma/mysql-migrations/20250225180031_add_nats_integration/migration.sql +17 -0
  20. prisma/mysql-migrations/20250510035200_add_wavoip_token_to_settings_table/migration.sql +26 -0
  21. prisma/mysql-migrations/20250514232744_add_n8n_table/migration.sql +62 -0
  22. prisma/mysql-migrations/20250515211815_add_evoai_table/migration.sql +61 -0
  23. prisma/mysql-migrations/20250516012152_remove_unique_atribute_for_file_name_in_media/migration.sql +2 -0
  24. prisma/mysql-migrations/20250612155048_add_coluns_trypebot_tables/migration.sql +7 -0
  25. prisma/mysql-migrations/20250613143000_add_lid_column_to_is_onwhatsapp/migration.sql +2 -0
  26. prisma/mysql-migrations/migration_lock.toml +3 -0
  27. prisma/mysql-schema.prisma +743 -0
  28. prisma/postgresql-migrations/20240609181238_init/migration.sql +375 -0
  29. prisma/postgresql-migrations/20240610144159_create_column_profile_name_instance/migration.sql +2 -0
  30. prisma/postgresql-migrations/20240611125754_create_columns_whitelabel_chatwoot/migration.sql +3 -0
  31. prisma/postgresql-migrations/20240611202817_create_columns_debounce_time_typebot/migration.sql +5 -0
  32. prisma/postgresql-migrations/20240712144948_add_business_id_column_to_instances/migration.sql +2 -0
  33. prisma/postgresql-migrations/20240712150256_create_templates_table/migration.sql +21 -0
  34. prisma/postgresql-migrations/20240712155950_adjusts_in_templates_table/migration.sql +2 -0
  35. prisma/postgresql-migrations/20240712162206_remove_templates_table/migration.sql +11 -0
  36. prisma/postgresql-migrations/20240712223655_column_fallback_typebot/migration.sql +8 -0
  37. prisma/postgresql-migrations/20240712230631_column_ignore_jids_typebot/migration.sql +5 -0
  38. prisma/postgresql-migrations/20240713184337_add_media_table/migration.sql +24 -0
  39. prisma/postgresql-migrations/20240718121437_add_openai_tables/migration.sql +118 -0
  40. prisma/postgresql-migrations/20240718123923_adjusts_openai_tables/migration.sql +2 -0
  41. prisma/postgresql-migrations/20240722173259_add_name_column_to_openai_creds/migration.sql +12 -0
  42. prisma/postgresql-migrations/20240722173518_add_name_column_to_openai_creds/migration.sql +2 -0
  43. prisma/postgresql-migrations/20240723152648_adjusts_in_column_openai_creds/migration.sql +8 -0
  44. prisma/postgresql-migrations/20240723200254_add_webhookurl_on_message/migration.sql +2 -0
  45. prisma/postgresql-migrations/20240725184147_create_template_table/migration.sql +21 -0
  46. prisma/postgresql-migrations/20240725202651_add_webhook_url_template_table/migration.sql +2 -0
  47. prisma/postgresql-migrations/20240725221646_modify_token_instance_table/migration.sql +2 -0
  48. prisma/postgresql-migrations/20240729115127_modify_trigger_type_openai_typebot_table/migration.sql +2 -0
  49. prisma/postgresql-migrations/20240729180347_modify_typebot_session_status_openai_typebot_table/migration.sql +20 -0
  50. prisma/postgresql-migrations/20240730152156_create_dify_tables/migration.sql +103 -0
Dockerfile ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:20-bullseye
2
+
3
+ # 1. تثبيت متطلبات النظام
4
+ RUN apt-get update \
5
+ && apt-get install -y --no-install-recommends \
6
+ git \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # 2. نسخ ملفات المشروع
10
+ WORKDIR /app
11
+ COPY package*.json ./
12
+ COPY tsconfig.json ./
13
+ COPY tsup.config.ts ./
14
+ COPY prisma ./prisma/
15
+ COPY src ./src/
16
+ COPY manager ./manager/
17
+
18
+ # 3. تضمين متغيرات البيئة من .env.example
19
+ ENV SERVER_TYPE=http
20
+ ENV SERVER_PORT=7860
21
+ ENV SERVER_URL=https://oex2003-evolution_api.hf.space
22
+ ENV SSL_CONF_PRIVKEY=/path/to/cert.key
23
+ ENV SSL_CONF_FULLCHAIN=/path/to/cert.crt
24
+ ENV SENTRY_DSN=
25
+ ENV CORS_ORIGIN=*
26
+ ENV CORS_METHODS=GET,POST,PUT,DELETE
27
+ ENV CORS_CREDENTIALS=true
28
+ ENV LOG_LEVEL=ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS,WEBSOCKET
29
+ ENV LOG_COLOR=true
30
+ ENV LOG_BAILEYS=verbose
31
+ ENV EVENT_EMITTER_MAX_LISTENERS=50
32
+ ENV DEL_INSTANCE=false
33
+ ENV DATABASE_PROVIDER=postgresql
34
+ ENV DATABASE_URL="postgresql://postgres.spnhuzaclgccmmunhmfc:DATABASE_PASSWORD_PLACEHOLDER@aws-0-eu-north-1.pooler.supabase.com:5432/postgres?pgbouncer=true&statement_cache_size=0"
35
+ ENV DATABASE_CONNECTION_URI="postgresql://postgres.spnhuzaclgccmmunhmfc:DATABASE_PASSWORD_PLACEHOLDER@aws-0-eu-north-1.pooler.supabase.com:5432/postgres?pgbouncer=true&statement_cache_size=0"
36
+ ENV DATABASE_CONNECTION_CLIENT_NAME=evolution_exchange
37
+ ENV DATABASE_SAVE_DATA_INSTANCE=true
38
+ ENV DATABASE_SAVE_DATA_NEW_MESSAGE=true
39
+ ENV DATABASE_SAVE_MESSAGE_UPDATE=true
40
+ ENV DATABASE_SAVE_DATA_CONTACTS=true
41
+ ENV DATABASE_SAVE_DATA_CHATS=true
42
+ ENV DATABASE_SAVE_DATA_LABELS=true
43
+ ENV DATABASE_SAVE_DATA_HISTORIC=true
44
+ ENV DATABASE_SAVE_IS_ON_WHATSAPP=true
45
+ ENV DATABASE_SAVE_IS_ON_WHATSAPP_DAYS=7
46
+ ENV DATABASE_DELETE_MESSAGE=true
47
+ ENV RABBITMQ_ENABLED=false
48
+ ENV RABBITMQ_URI=amqp://localhost
49
+ ENV RABBITMQ_EXCHANGE_NAME=evolution
50
+ ENV RABBITMQ_FRAME_MAX=8192
51
+ ENV RABBITMQ_GLOBAL_ENABLED=false
52
+ ENV RABBITMQ_PREFIX_KEY=evolution
53
+ ENV RABBITMQ_EVENTS_APPLICATION_STARTUP=false
54
+ ENV RABBITMQ_EVENTS_INSTANCE_CREATE=false
55
+ ENV RABBITMQ_EVENTS_INSTANCE_DELETE=false
56
+ ENV RABBITMQ_EVENTS_QRCODE_UPDATED=false
57
+ ENV RABBITMQ_EVENTS_MESSAGES_SET=false
58
+ ENV RABBITMQ_EVENTS_MESSAGES_UPSERT=false
59
+ ENV RABBITMQ_EVENTS_MESSAGES_EDITED=false
60
+ ENV RABBITMQ_EVENTS_MESSAGES_UPDATE=false
61
+ ENV RABBITMQ_EVENTS_MESSAGES_DELETE=false
62
+ ENV RABBITMQ_EVENTS_SEND_MESSAGE=false
63
+ ENV RABBITMQ_EVENTS_SEND_MESSAGE_UPDATE=false
64
+ ENV RABBITMQ_EVENTS_CONTACTS_SET=false
65
+ ENV RABBITMQ_EVENTS_CONTACTS_UPSERT=false
66
+ ENV RABBITMQ_EVENTS_CONTACTS_UPDATE=false
67
+ ENV RABBITMQ_EVENTS_PRESENCE_UPDATE=false
68
+ ENV RABBITMQ_EVENTS_CHATS_SET=false
69
+ ENV RABBITMQ_EVENTS_CHATS_UPSERT=false
70
+ ENV RABBITMQ_EVENTS_CHATS_UPDATE=false
71
+ ENV RABBITMQ_EVENTS_CHATS_DELETE=false
72
+ ENV RABBITMQ_EVENTS_GROUPS_UPSERT=false
73
+ ENV RABBITMQ_EVENTS_GROUPS_UPDATE=false
74
+ ENV RABBITMQ_EVENTS_GROUP_PARTICIPANTS_UPDATE=false
75
+ ENV RABBITMQ_EVENTS_CONNECTION_UPDATE=false
76
+ ENV RABBITMQ_EVENTS_REMOVE_INSTANCE=false
77
+ ENV RABBITMQ_EVENTS_LOGOUT_INSTANCE=false
78
+ ENV RABBITMQ_EVENTS_CALL=false
79
+ ENV RABBITMQ_EVENTS_TYPEBOT_START=false
80
+ ENV RABBITMQ_EVENTS_TYPEBOT_CHANGE_STATUS=false
81
+ ENV SQS_ENABLED=false
82
+ ENV SQS_ACCESS_KEY_ID=
83
+ ENV SQS_SECRET_ACCESS_KEY=
84
+ ENV SQS_ACCOUNT_ID=
85
+ ENV SQS_REGION=
86
+ ENV WEBSOCKET_ENABLED=true
87
+ ENV WEBSOCKET_GLOBAL_EVENTS=true
88
+ ENV PUSHER_ENABLED=false
89
+ ENV PUSHER_GLOBAL_ENABLED=false
90
+ ENV PUSHER_GLOBAL_APP_ID=
91
+ ENV PUSHER_GLOBAL_KEY=
92
+ ENV PUSHER_GLOBAL_SECRET=
93
+ ENV PUSHER_GLOBAL_CLUSTER=
94
+ ENV PUSHER_GLOBAL_USE_TLS=true
95
+ ENV PUSHER_EVENTS_APPLICATION_STARTUP=true
96
+ ENV PUSHER_EVENTS_QRCODE_UPDATED=true
97
+ ENV PUSHER_EVENTS_MESSAGES_SET=true
98
+ ENV PUSHER_EVENTS_MESSAGES_UPSERT=true
99
+ ENV PUSHER_EVENTS_MESSAGES_EDITED=true
100
+ ENV PUSHER_EVENTS_MESSAGES_UPDATE=true
101
+ ENV PUSHER_EVENTS_MESSAGES_DELETE=true
102
+ ENV PUSHER_EVENTS_SEND_MESSAGE=true
103
+ ENV PUSHER_EVENTS_SEND_MESSAGE_UPDATE=true
104
+ ENV PUSHER_EVENTS_CONTACTS_SET=true
105
+ ENV PUSHER_EVENTS_CONTACTS_UPSERT=true
106
+ ENV PUSHER_EVENTS_CONTACTS_UPDATE=true
107
+ ENV PUSHER_EVENTS_PRESENCE_UPDATE=true
108
+ ENV PUSHER_EVENTS_CHATS_SET=true
109
+ ENV PUSHER_EVENTS_CHATS_UPSERT=true
110
+ ENV PUSHER_EVENTS_CHATS_UPDATE=true
111
+ ENV PUSHER_EVENTS_CHATS_DELETE=true
112
+ ENV PUSHER_EVENTS_GROUPS_UPSERT=true
113
+ ENV PUSHER_EVENTS_GROUPS_UPDATE=true
114
+ ENV PUSHER_EVENTS_GROUP_PARTICIPANTS_UPDATE=true
115
+ ENV PUSHER_EVENTS_CONNECTION_UPDATE=true
116
+ ENV PUSHER_EVENTS_LABELS_EDIT=true
117
+ ENV PUSHER_EVENTS_LABELS_ASSOCIATION=true
118
+ ENV PUSHER_EVENTS_CALL=true
119
+ ENV PUSHER_EVENTS_TYPEBOT_START=false
120
+ ENV PUSHER_EVENTS_TYPEBOT_CHANGE_STATUS=false
121
+ ENV WA_BUSINESS_TOKEN_WEBHOOK=evolution
122
+ ENV WA_BUSINESS_URL=https://graph.facebook.com
123
+ ENV WA_BUSINESS_VERSION=v20.0
124
+ ENV WA_BUSINESS_LANGUAGE=en_US
125
+ ENV WEBHOOK_GLOBAL_ENABLED=false
126
+ ENV WEBHOOK_GLOBAL_URL=
127
+ ENV WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false
128
+ ENV WEBHOOK_EVENTS_APPLICATION_STARTUP=false
129
+ ENV WEBHOOK_EVENTS_QRCODE_UPDATED=true
130
+ ENV WEBHOOK_EVENTS_MESSAGES_SET=true
131
+ ENV WEBHOOK_EVENTS_MESSAGES_UPSERT=true
132
+ ENV WEBHOOK_EVENTS_MESSAGES_EDITED=true
133
+ ENV WEBHOOK_EVENTS_MESSAGES_UPDATE=true
134
+ ENV WEBHOOK_EVENTS_MESSAGES_DELETE=true
135
+ ENV WEBHOOK_EVENTS_SEND_MESSAGE=true
136
+ ENV WEBHOOK_EVENTS_SEND_MESSAGE_UPDATE=true
137
+ ENV WEBHOOK_EVENTS_CONTACTS_SET=true
138
+ ENV WEBHOOK_EVENTS_CONTACTS_UPSERT=true
139
+ ENV WEBHOOK_EVENTS_CONTACTS_UPDATE=true
140
+ ENV WEBHOOK_EVENTS_PRESENCE_UPDATE=true
141
+ ENV WEBHOOK_EVENTS_CHATS_SET=true
142
+ ENV WEBHOOK_EVENTS_CHATS_UPSERT=true
143
+ ENV WEBHOOK_EVENTS_CHATS_UPDATE=true
144
+ ENV WEBHOOK_EVENTS_CHATS_DELETE=true
145
+ ENV WEBHOOK_EVENTS_GROUPS_UPSERT=true
146
+ ENV WEBHOOK_EVENTS_GROUPS_UPDATE=true
147
+ ENV WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true
148
+ ENV WEBHOOK_EVENTS_CONNECTION_UPDATE=true
149
+ ENV WEBHOOK_EVENTS_REMOVE_INSTANCE=false
150
+ ENV WEBHOOK_EVENTS_LOGOUT_INSTANCE=false
151
+ ENV WEBHOOK_EVENTS_LABELS_EDIT=true
152
+ ENV WEBHOOK_EVENTS_LABELS_ASSOCIATION=true
153
+ ENV WEBHOOK_EVENTS_CALL=true
154
+ ENV WEBHOOK_EVENTS_TYPEBOT_START=false
155
+ ENV WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS=false
156
+ ENV WEBHOOK_EVENTS_ERRORS=false
157
+ ENV WEBHOOK_EVENTS_ERRORS_WEBHOOK=
158
+ ENV WEBHOOK_REQUEST_TIMEOUT_MS=60000
159
+ ENV WEBHOOK_RETRY_MAX_ATTEMPTS=10
160
+ ENV WEBHOOK_RETRY_INITIAL_DELAY_SECONDS=5
161
+ ENV WEBHOOK_RETRY_USE_EXPONENTIAL_BACKOFF=true
162
+ ENV WEBHOOK_RETRY_MAX_DELAY_SECONDS=300
163
+ ENV WEBHOOK_RETRY_JITTER_FACTOR=0.2
164
+ ENV WEBHOOK_RETRY_NON_RETRYABLE_STATUS_CODES=400,401,403,404,422
165
+ ENV CONFIG_SESSION_PHONE_NAME=Chrome
166
+ ENV CONFIG_SESSION_PHONE_VERSION=2.3000.1023223821
167
+ ENV QRCODE_LIMIT=30
168
+ ENV QRCODE_COLOR=#000000
169
+ ENV TYPEBOT_ENABLED=false
170
+ ENV TYPEBOT_API_VERSION=latest
171
+ ENV CHATWOOT_ENABLED=false
172
+ ENV CHATWOOT_MESSAGE_READ=true
173
+ ENV CHATWOOT_MESSAGE_DELETE=true
174
+ ENV CHATWOOT_BOT_CONTACT=true
175
+ ENV CHATWOOT_IMPORT_DATABASE_CONNECTION_URI=
176
+ ENV CHATWOOT_IMPORT_PLACEHOLDER_MEDIA_MESSAGE=true
177
+ ENV OPENAI_ENABLED=false
178
+ ENV DIFY_ENABLED=false
179
+ ENV N8N_ENABLED=false
180
+ ENV EVOAI_ENABLED=false
181
+ ENV CACHE_REDIS_ENABLED=true
182
+ ENV CACHE_REDIS_URI=rediss://default:REDIS_PASSWORD_PLACEHOLDER@related-ant-6145.upstash.io:6379
183
+ ENV CACHE_REDIS_TTL=604800
184
+ ENV CACHE_REDIS_PREFIX_KEY=evolution
185
+ ENV CACHE_REDIS_SAVE_INSTANCES=true
186
+ ENV CACHE_LOCAL_ENABLED=false
187
+ ENV S3_ENABLED=false
188
+ ENV S3_ACCESS_KEY=
189
+ ENV S3_SECRET_KEY=
190
+ ENV S3_BUCKET=evolution
191
+ ENV S3_PORT=443
192
+ ENV S3_ENDPOINT=s3.domain.com
193
+ ENV S3_REGION=eu-west-3
194
+ ENV S3_USE_SSL=true
195
+ ENV AUTHENTICATION_API_KEY=429683C4C977415CAAFCCE10F7D57E11
196
+ ENV AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
197
+ ENV LANGUAGE=en
198
+ ENV PROXY_HOST=
199
+ #ENV PROXY_PORT=80
200
+ ENV PROXY_PROTOCOL=http
201
+ ENV PROXY_USERNAME=
202
+ ENV PROXY_PASSWORD=""
203
+
204
+ # 4. تثبيت، إعداد مخطط Prisma، إنشاء العميل، والبناء
205
+ RUN npm install \
206
+ && npm install \
207
+ && mkdir -p prisma \
208
+ && cp prisma/postgresql-schema.prisma prisma/schema.prisma \
209
+ && npx prisma generate \
210
+ && npm run build
211
+
212
+ # 5. كشف منفذ Huggingface ونسخ سكريبت بدء التشغيل
213
+ EXPOSE 7860
214
+ COPY run.sh /app/run.sh
215
+ RUN chmod +x /app/run.sh
216
+
217
+ # 6. إصلاح الأذونات والتبديل إلى مستخدم غير جذري
218
+ RUN chown -R node:node /app
219
+ USER node
220
+ WORKDIR /app
221
+
222
+ ENTRYPOINT ["bash", "/app/run.sh"]
README.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Evolution API
3
+ emoji: 📱
4
+ colorFrom: green
5
+ colorTo: blue
6
+ sdk: docker
7
+ app_port: 7860
8
+ pinned: false
9
+ ---
10
+
11
+ # Evolution API on Hugging Face Space
12
+
13
+ This is a deployment of [Evolution API](https://github.com/EvolutionAPI/evolution-api), an open-source WhatsApp integration API.
14
+
15
+ ## Features
16
+
17
+ - WhatsApp Web API based on Baileys library
18
+ - PostgreSQL database integration with Supabase
19
+ - Redis cache with Upstash
20
+ - Multiple instance management
21
+ - Various integrations (Typebot, Chatwoot, etc.)
22
+
23
+ ## Configuration
24
+
25
+ This deployment uses the following services:
26
+ - Supabase for PostgreSQL database
27
+ - Upstash for Redis cache
28
+
29
+ Environment variables are configured through Hugging Face Space secrets.
manager/dist/assets/images/evolution-logo.png ADDED
manager/dist/assets/index-CXH2BdD4.css ADDED
@@ -0,0 +1 @@
 
 
1
+ @import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--gradient: #093028;--background: 178 98.4% 98.22%;--foreground: 178 6.800000000000001% .44%;--muted: 178 6.800000000000001% 91.1%;--muted-foreground: 178 3.4000000000000004% 41.1%;--popover: 178 35.599999999999994% 91.1%;--popover-foreground: 178 6.800000000000001% .55%;--card: 178 35.599999999999994% 91.1%;--card-foreground: 178 6.800000000000001% .55%;--border: 178 11.8% 89.44%;--input: 178 11.8% 89.44%;--primary: 178 68% 11%;--primary-foreground: 178 1.36% 91.1%;--secondary: 178 3.4000000000000004% 95.55%;--secondary-foreground: 178 5.08% 11.1%;--accent: 178 3.4000000000000004% 95.55%;--accent-foreground: 178 5.08% 11.1%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--ring: 178 68% 11%;--radius: .5rem}.dark{--gradient: #189d68;--background: 166 47.449999999999996% 2.88%;--foreground: 166 7.3% 96.8%;--muted: 166 36.5% 10.799999999999999%;--muted-foreground: 166 7.3% 53.6%;--popover: 166 50.4% 4.68%;--popover-foreground: 166 7.3% 96.8%;--card: 166 50.4% 4.68%;--card-foreground: 166 7.3% 96.8%;--border: 166 36.5% 10.799999999999999%;--input: 166 36.5% 10.799999999999999%;--primary: 166 73% 36%;--primary-foreground: 166 7.3% 96.8%;--secondary: 166 36.5% 10.799999999999999%;--secondary-foreground: 166 7.3% 96.8%;--accent: 166 36.5% 10.799999999999999%;--accent-foreground: 166 7.3% 96.8%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 166 7.3% 96.8%;--ring: 166 73% 36%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-family:Inter,sans-serif;scrollbar-width:thin;scrollbar-color:transparent transparent}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-3{bottom:.75rem}.left-2{left:.5rem}.left-3{left:.75rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-4{top:1rem}.z-10{z-index:10}.z-50{z-index:50}.m-4{margin:1rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-16{margin-right:4rem}.mr-2{margin-right:.5rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-24{height:6rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[1\.2rem\]{height:1.2rem}.h-\[1px\]{height:1px}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-96{max-height:24rem}.max-h-\[240px\]{max-height:240px}.max-h-\[300px\]{max-height:300px}.min-h-\[48px\]{min-height:48px}.min-h-\[80px\]{min-height:80px}.min-h-\[calc\(100vh_-_56px\)\]{min-height:calc(100vh - 56px)}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-1{width:.25rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-\[1\.2rem\]{width:1.2rem}.w-\[1px\]{width:1px}.w-\[350px\]{width:350px}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-\[300px\]{max-width:300px}.max-w-lg{max-width:32rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.translate-y-1{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-0{--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.grid-cols-\[repeat\(auto-fit\,_minmax\(15rem\,_1fr\)\)\]{grid-template-columns:repeat(auto-fit,minmax(15rem,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-wrap{text-wrap:wrap}.break-all{word-break:break-all}.rounded-3xl{border-radius:1.5rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-500\/20{border-color:#f59e0b33}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-emerald-500\/20{border-color:#10b98133}.border-gray-600\/50{border-color:#4b556380}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-red-500\/20{border-color:#ef444433}.border-sky-500\/20{border-color:#0ea5e933}.border-transparent{border-color:transparent}.border-zinc-500\/20{border-color:#71717a33}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-amber-50\/50{background-color:#fffbeb80}.bg-amber-600{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity))}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-emerald-50\/50{background-color:#ecfdf580}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/30{background-color:hsl(var(--primary) / .3)}.bg-red-50\/50{background-color:#fef2f280}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sky-50\/50{background-color:#f0f9ff80}.bg-transparent{background-color:transparent}.bg-zinc-50\/50{background-color:#fafafa80}.fill-current{fill:currentColor}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-3{padding-bottom:.75rem}.pl-12{padding-left:3rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-amber-100{--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-900{--tw-text-opacity: 1;color:rgb(6 78 59 / var(--tw-text-opacity))}.text-foreground{color:hsl(var(--foreground))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/80{color:hsl(var(--muted-foreground) / .8)}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-900{--tw-text-opacity: 1;color:rgb(127 29 29 / var(--tw-text-opacity))}.text-rose-600{--tw-text-opacity: 1;color:rgb(225 29 72 / var(--tw-text-opacity))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sky-900{--tw-text-opacity: 1;color:rgb(12 74 110 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-zinc-900{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.caret-transparent{caret-color:transparent}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-muted-foreground{--tw-ring-color: hsl(var(--muted-foreground))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-200{animation-duration:.2s}.paused{animation-play-state:paused}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:.25rem}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\:bg-border:after{content:var(--tw-content);background-color:hsl(var(--border))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-amber-600\/80:hover{background-color:#d97706cc}.hover\:bg-amber-600\/90:hover{background-color:#d97706e6}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:stroke-destructive:hover{stroke:hsl(var(--destructive))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-muted[data-state=open],.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-slate-400[data-state=unchecked]{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:0}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:.25rem}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:-rotate-90:is(.dark *){--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:rotate-0:is(.dark *){--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:scale-0:is(.dark *){--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:scale-100:is(.dark *){--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:border-amber-500\/30:is(.dark *){border-color:#f59e0b4d}.dark\:border-emerald-500\/30:is(.dark *){border-color:#10b9814d}.dark\:border-red-500\/30:is(.dark *){border-color:#ef44444d}.dark\:border-sky-500\/30:is(.dark *){border-color:#0ea5e94d}.dark\:border-zinc-500\/30:is(.dark *){border-color:#71717a4d}.dark\:bg-amber-500\/10:is(.dark *){background-color:#f59e0b1a}.dark\:bg-emerald-500\/10:is(.dark *){background-color:#10b9811a}.dark\:bg-red-500\/10:is(.dark *){background-color:#ef44441a}.dark\:bg-sky-500\/10:is(.dark *){background-color:#0ea5e91a}.dark\:bg-zinc-500\/10:is(.dark *){background-color:#71717a1a}.dark\:text-amber-200:is(.dark *){--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity))}.dark\:text-emerald-200:is(.dark *){--tw-text-opacity: 1;color:rgb(167 243 208 / var(--tw-text-opacity))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity))}.dark\:text-sky-200:is(.dark *){--tw-text-opacity: 1;color:rgb(186 230 253 / var(--tw-text-opacity))}.dark\:text-zinc-300:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\:m-4{margin:1rem}.sm\:inline{display:inline}.sm\:max-h-\[600px\]{max-height:600px}.sm\:max-w-\[650px\]{max-width:650px}.sm\:max-w-\[740px\]{max-width:740px}.sm\:max-w-\[950px\]{max-width:950px}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-\[10rem_1fr_10rem\]{grid-template-columns:10rem 1fr 10rem}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (min-width: 768px){.md\:inline{display:inline}.md\:flex{display:flex}.md\:w-64{width:16rem}.md\:w-full{width:100%}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-8{gap:2rem}}@media (min-width: 1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>\*\]\:p-4>*{padding:1rem}.\[\&\>\*\]\:px-4>*{padding-left:1rem;padding-right:1rem}.\[\&\>\*\]\:py-2>*{padding-top:.5rem;padding-bottom:.5rem}.\[\&\>div\[style\]\]\:\!block>div[style]{display:block!important}.\[\&\>div\[style\]\]\:h-full>div[style]{height:100%}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:fill-rose-600>svg{fill:#e11d48}.\[\&\>svg\]\:text-amber-500>svg{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-emerald-600>svg{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\]\:text-red-600>svg{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-sky-500>svg{--tw-text-opacity: 1;color:rgb(14 165 233 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-zinc-400>svg{--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity))}.hover\:\[\&\>svg\]\:fill-rose-700>svg:hover{fill:#be123c}.dark\:\[\&\>svg\]\:text-emerald-400\/80>svg:is(.dark *){color:#34d399cc}.dark\:\[\&\>svg\]\:text-red-400\/80>svg:is(.dark *){color:#f87171cc}.dark\:\[\&\>svg\]\:text-zinc-300>svg:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_strong\]\:text-foreground strong{color:hsl(var(--foreground))}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: #e74c3c;--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient( to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55 );--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%)}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right)}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%)}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right)}@media only screen and (max-width : 480px){.Toastify__toast-container{width:100vw;padding:0;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}}.Toastify__toast{--y: 0;position:relative;touch-action:none;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:var(--toastify-toast-bd-radius);box-shadow:0 4px 12px #0000001a;display:flex;justify-content:space-between;max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);cursor:default;direction:ltr;z-index:0;overflow:hidden}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-body{margin:auto 0;flex:1 1 auto;padding:6px;display:flex;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;flex:1}.Toastify__toast-icon{margin-inline-end:10px;width:20px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width : 480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;align-self:flex-start;z-index:1}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial;border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp{position:absolute;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.tabs-chat{background-color:transparent;width:100%;border-radius:0}.chat-item{display:flex;padding:10px;cursor:pointer;background-color:hsl(var(--background))}.chat-item:hover,.chat-item.active{background-color:#2f2f2f}.bubble{border-radius:16px;padding:12px;word-wrap:break-word}.bubble-right .bubble{background-color:#0a0a0a;text-align:right;max-width:100%}.bubble-left .bubble{background-color:#1b1b1b;max-width:100%}.bubble-right{align-self:flex-end;display:flex;justify-content:flex-end;width:80%}.bubble-left{align-self:flex-start;display:flex;justify-content:flex-start;width:80%}.input-message textarea{background-color:#2f2f2f;padding-left:48px}.input-message textarea:focus{outline:none;border:none;box-shadow:none}.message-container{flex:1;overflow-y:auto;max-height:calc(100vh - 110px);padding-top:50px}
manager/dist/assets/index-D-oOjDYe.js ADDED
The diff for this file is too large to render. See raw diff
 
manager/dist/index.html ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/png" href="https://evolution-api.com/files/evo/favicon.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Evolution Manager</title>
8
+ <script type="module" crossorigin src="/assets/index-D-oOjDYe.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-CXH2BdD4.css">
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+ </html>
package-lock.json ADDED
The diff for this file is too large to render. See raw diff
 
package.json ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "evolution-api",
3
+ "version": "2.3.1",
4
+ "description": "Rest api for communication with WhatsApp",
5
+ "main": "./dist/main.js",
6
+ "type": "commonjs",
7
+ "scripts": {
8
+ "build": "tsc --noEmit && tsup",
9
+ "start": "tsx ./src/main.ts",
10
+ "start:prod": "node dist/main",
11
+ "dev:server": "tsx watch ./src/main.ts",
12
+ "test": "tsx watch ./test/all.test.ts",
13
+ "lint": "eslint --fix --ext .ts src",
14
+ "lint:check": "eslint --ext .ts src",
15
+ "db:generate": "node runWithProvider.js \"npx prisma generate --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"",
16
+ "db:deploy": "node runWithProvider.js \"rm -rf ./prisma/migrations && cp -r ./prisma/DATABASE_PROVIDER-migrations ./prisma/migrations && npx prisma migrate deploy --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"",
17
+ "db:deploy:win": "node runWithProvider.js \"xcopy /E /I prisma\\DATABASE_PROVIDER-migrations prisma\\migrations && npx prisma migrate deploy --schema prisma\\DATABASE_PROVIDER-schema.prisma\"",
18
+ "db:studio": "node runWithProvider.js \"npx prisma studio --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"",
19
+ "db:migrate:dev": "node runWithProvider.js \"rm -rf ./prisma/migrations && cp -r ./prisma/DATABASE_PROVIDER-migrations ./prisma/migrations && npx prisma migrate dev --schema ./prisma/DATABASE_PROVIDER-schema.prisma && cp -r ./prisma/migrations/* ./prisma/DATABASE_PROVIDER-migrations\"",
20
+ "db:migrate:dev:win": "node runWithProvider.js \"xcopy /E /I prisma\\DATABASE_PROVIDER-migrations prisma\\migrations && npx prisma migrate dev --schema prisma\\DATABASE_PROVIDER-schema.prisma\""
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/EvolutionAPI/evolution-api.git"
25
+ },
26
+ "keywords": [
27
+ "chat",
28
+ "communication",
29
+ "message",
30
+ "send message",
31
+ "whatsapp",
32
+ "js-whatsapp",
33
+ "whatsapp-api",
34
+ "whatsapp-web",
35
+ "whatsapp",
36
+ "whatsapp-chat",
37
+ "whatsapp-group",
38
+ "automation",
39
+ "multi-device",
40
+ "bot"
41
+ ],
42
+ "author": {
43
+ "name": "Davidson Gomes",
44
+ "email": "contato@evolution-api.com"
45
+ },
46
+ "license": "Apache-2.0",
47
+ "bugs": {
48
+ "url": "https://github.com/EvolutionAPI/evolution-api/issues"
49
+ },
50
+ "homepage": "https://github.com/EvolutionAPI/evolution-api#readme",
51
+ "dependencies": {
52
+ "@adiwajshing/keyed-db": "^0.2.4",
53
+ "@aws-sdk/client-sqs": "^3.723.0",
54
+ "@ffmpeg-installer/ffmpeg": "^1.1.0",
55
+ "@figuro/chatwoot-sdk": "^1.1.16",
56
+ "@hapi/boom": "^10.0.1",
57
+ "@paralleldrive/cuid2": "^2.2.2",
58
+ "@prisma/client": "^6.1.0",
59
+ "@sentry/node": "^8.47.0",
60
+ "amqplib": "^0.10.5",
61
+ "audio-decode": "^2.2.3",
62
+ "axios": "^1.7.9",
63
+ "baileys": "github:WhiskeySockets/Baileys",
64
+ "class-validator": "^0.14.1",
65
+ "compression": "^1.7.5",
66
+ "cors": "^2.8.5",
67
+ "dayjs": "^1.11.13",
68
+ "dotenv": "^16.4.7",
69
+ "emoji-regex": "^10.4.0",
70
+ "eventemitter2": "^6.4.9",
71
+ "express": "^4.21.2",
72
+ "express-async-errors": "^3.1.1",
73
+ "fluent-ffmpeg": "^2.1.3",
74
+ "form-data": "^4.0.1",
75
+ "https-proxy-agent": "^7.0.6",
76
+ "i18next": "^23.7.19",
77
+ "jimp": "^1.6.0",
78
+ "json-schema": "^0.4.0",
79
+ "jsonschema": "^1.4.1",
80
+ "jsonwebtoken": "^9.0.2",
81
+ "link-preview-js": "^3.0.13",
82
+ "long": "^5.2.3",
83
+ "mediainfo.js": "^0.3.4",
84
+ "mime": "^4.0.0",
85
+ "mime-types": "^2.1.35",
86
+ "minio": "^8.0.3",
87
+ "multer": "^1.4.5-lts.1",
88
+ "nats": "^2.29.1",
89
+ "node-cache": "^5.1.2",
90
+ "node-cron": "^3.0.3",
91
+ "openai": "^4.77.3",
92
+ "pg": "^8.13.1",
93
+ "pino": "^8.11.0",
94
+ "prisma": "^6.1.0",
95
+ "pusher": "^5.2.0",
96
+ "qrcode": "^1.5.4",
97
+ "qrcode-terminal": "^0.12.0",
98
+ "redis": "^4.7.0",
99
+ "rxjs": "^7.8.2",
100
+ "sharp": "^0.34.2",
101
+ "socket.io": "^4.8.1",
102
+ "socket.io-client": "^4.8.1",
103
+ "swagger-ui-express": "^5.0.1",
104
+ "tsup": "^8.3.5"
105
+ },
106
+ "devDependencies": {
107
+ "@types/compression": "^1.7.5",
108
+ "@types/cors": "^2.8.17",
109
+ "@types/express": "^4.17.18",
110
+ "@types/json-schema": "^7.0.15",
111
+ "@types/mime": "^4.0.0",
112
+ "@types/mime-types": "^2.1.4",
113
+ "@types/node": "^22.10.5",
114
+ "@types/node-cron": "^3.0.11",
115
+ "@types/qrcode": "^1.5.5",
116
+ "@types/qrcode-terminal": "^0.12.2",
117
+ "@types/uuid": "^10.0.0",
118
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
119
+ "@typescript-eslint/parser": "^6.21.0",
120
+ "eslint": "^8.45.0",
121
+ "eslint-config-prettier": "^9.1.0",
122
+ "eslint-plugin-import": "^2.31.0",
123
+ "eslint-plugin-prettier": "^5.2.1",
124
+ "eslint-plugin-simple-import-sort": "^10.0.0",
125
+ "prettier": "^3.4.2",
126
+ "tsconfig-paths": "^4.2.0",
127
+ "tsx": "^4.20.3",
128
+ "typescript": "^5.7.2"
129
+ }
130
+ }
prisma/mysql-migrations/20240809105427_init/migration.sql ADDED
@@ -0,0 +1,588 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -- CreateTable
2
+ CREATE TABLE `Instance` (
3
+ `id` VARCHAR(191) NOT NULL,
4
+ `name` VARCHAR(255) NOT NULL,
5
+ `connectionStatus` ENUM('open', 'close', 'connecting') NOT NULL DEFAULT 'open',
6
+ `ownerJid` VARCHAR(100) NULL,
7
+ `profileName` VARCHAR(100) NULL,
8
+ `profilePicUrl` VARCHAR(500) NULL,
9
+ `integration` VARCHAR(100) NULL,
10
+ `number` VARCHAR(100) NULL,
11
+ `businessId` VARCHAR(100) NULL,
12
+ `token` VARCHAR(255) NULL,
13
+ `clientName` VARCHAR(100) NULL,
14
+ `disconnectionReasonCode` INTEGER NULL,
15
+ `disconnectionObject` JSON NULL,
16
+ `disconnectionAt` TIMESTAMP NULL,
17
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
18
+ `updatedAt` TIMESTAMP NULL,
19
+
20
+ UNIQUE INDEX `Instance_name_key`(`name`),
21
+ PRIMARY KEY (`id`)
22
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
23
+
24
+ -- CreateTable
25
+ CREATE TABLE `Session` (
26
+ `id` VARCHAR(191) NOT NULL,
27
+ `sessionId` VARCHAR(191) NOT NULL,
28
+ `creds` TEXT NULL,
29
+ `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
30
+
31
+ UNIQUE INDEX `Session_sessionId_key`(`sessionId`),
32
+ PRIMARY KEY (`id`)
33
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
34
+
35
+ -- CreateTable
36
+ CREATE TABLE `Chat` (
37
+ `id` VARCHAR(191) NOT NULL,
38
+ `remoteJid` VARCHAR(100) NOT NULL,
39
+ `labels` JSON NULL,
40
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
41
+ `updatedAt` TIMESTAMP NULL,
42
+ `instanceId` VARCHAR(191) NOT NULL,
43
+
44
+ PRIMARY KEY (`id`)
45
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
46
+
47
+ -- CreateTable
48
+ CREATE TABLE `Contact` (
49
+ `id` VARCHAR(191) NOT NULL,
50
+ `remoteJid` VARCHAR(100) NOT NULL,
51
+ `pushName` VARCHAR(100) NULL,
52
+ `profilePicUrl` VARCHAR(500) NULL,
53
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
54
+ `updatedAt` TIMESTAMP NULL,
55
+ `instanceId` VARCHAR(191) NOT NULL,
56
+
57
+ PRIMARY KEY (`id`)
58
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
59
+
60
+ -- CreateTable
61
+ CREATE TABLE `Message` (
62
+ `id` VARCHAR(191) NOT NULL,
63
+ `key` JSON NOT NULL,
64
+ `pushName` VARCHAR(100) NULL,
65
+ `participant` VARCHAR(100) NULL,
66
+ `messageType` VARCHAR(100) NOT NULL,
67
+ `message` JSON NOT NULL,
68
+ `contextInfo` JSON NULL,
69
+ `source` ENUM('ios', 'android', 'web', 'unknown', 'desktop') NOT NULL,
70
+ `messageTimestamp` INTEGER NOT NULL,
71
+ `chatwootMessageId` INTEGER NULL,
72
+ `chatwootInboxId` INTEGER NULL,
73
+ `chatwootConversationId` INTEGER NULL,
74
+ `chatwootContactInboxSourceId` VARCHAR(100) NULL,
75
+ `chatwootIsRead` BOOLEAN NULL DEFAULT false,
76
+ `instanceId` VARCHAR(191) NOT NULL,
77
+ `typebotSessionId` VARCHAR(191) NULL,
78
+ `openaiSessionId` VARCHAR(191) NULL,
79
+ `webhookUrl` VARCHAR(500) NULL,
80
+ `difySessionId` VARCHAR(191) NULL,
81
+
82
+ PRIMARY KEY (`id`)
83
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
84
+
85
+ -- CreateTable
86
+ CREATE TABLE `MessageUpdate` (
87
+ `id` VARCHAR(191) NOT NULL,
88
+ `keyId` VARCHAR(100) NOT NULL,
89
+ `remoteJid` VARCHAR(100) NOT NULL,
90
+ `fromMe` BOOLEAN NOT NULL,
91
+ `participant` VARCHAR(100) NULL,
92
+ `pollUpdates` JSON NULL,
93
+ `status` VARCHAR(30) NOT NULL,
94
+ `messageId` VARCHAR(191) NOT NULL,
95
+ `instanceId` VARCHAR(191) NOT NULL,
96
+
97
+ PRIMARY KEY (`id`)
98
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
99
+
100
+ -- CreateTable
101
+ CREATE TABLE `Webhook` (
102
+ `id` VARCHAR(191) NOT NULL,
103
+ `url` VARCHAR(500) NOT NULL,
104
+ `enabled` BOOLEAN NULL DEFAULT true,
105
+ `events` JSON NULL,
106
+ `webhookByEvents` BOOLEAN NULL DEFAULT false,
107
+ `webhookBase64` BOOLEAN NULL DEFAULT false,
108
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
109
+ `updatedAt` TIMESTAMP NOT NULL,
110
+ `instanceId` VARCHAR(191) NOT NULL,
111
+
112
+ UNIQUE INDEX `Webhook_instanceId_key`(`instanceId`),
113
+ PRIMARY KEY (`id`)
114
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
115
+
116
+ -- CreateTable
117
+ CREATE TABLE `Chatwoot` (
118
+ `id` VARCHAR(191) NOT NULL,
119
+ `enabled` BOOLEAN NULL DEFAULT true,
120
+ `accountId` VARCHAR(100) NULL,
121
+ `token` VARCHAR(100) NULL,
122
+ `url` VARCHAR(500) NULL,
123
+ `nameInbox` VARCHAR(100) NULL,
124
+ `signMsg` BOOLEAN NULL DEFAULT false,
125
+ `signDelimiter` VARCHAR(100) NULL,
126
+ `number` VARCHAR(100) NULL,
127
+ `reopenConversation` BOOLEAN NULL DEFAULT false,
128
+ `conversationPending` BOOLEAN NULL DEFAULT false,
129
+ `mergeBrazilContacts` BOOLEAN NULL DEFAULT false,
130
+ `importContacts` BOOLEAN NULL DEFAULT false,
131
+ `importMessages` BOOLEAN NULL DEFAULT false,
132
+ `daysLimitImportMessages` INTEGER NULL,
133
+ `organization` VARCHAR(100) NULL,
134
+ `logo` VARCHAR(500) NULL,
135
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
136
+ `updatedAt` TIMESTAMP NOT NULL,
137
+ `instanceId` VARCHAR(191) NOT NULL,
138
+
139
+ UNIQUE INDEX `Chatwoot_instanceId_key`(`instanceId`),
140
+ PRIMARY KEY (`id`)
141
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
142
+
143
+ -- CreateTable
144
+ CREATE TABLE `Label` (
145
+ `id` VARCHAR(191) NOT NULL,
146
+ `labelId` VARCHAR(100) NULL,
147
+ `name` VARCHAR(100) NOT NULL,
148
+ `color` VARCHAR(100) NOT NULL,
149
+ `predefinedId` VARCHAR(100) NULL,
150
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
151
+ `updatedAt` TIMESTAMP NOT NULL,
152
+ `instanceId` VARCHAR(191) NOT NULL,
153
+
154
+ UNIQUE INDEX `Label_labelId_key`(`labelId`),
155
+ PRIMARY KEY (`id`)
156
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
157
+
158
+ -- CreateTable
159
+ CREATE TABLE `Proxy` (
160
+ `id` VARCHAR(191) NOT NULL,
161
+ `enabled` BOOLEAN NOT NULL DEFAULT false,
162
+ `host` VARCHAR(100) NOT NULL,
163
+ `port` VARCHAR(100) NOT NULL,
164
+ `protocol` VARCHAR(100) NOT NULL,
165
+ `username` VARCHAR(100) NOT NULL,
166
+ `password` VARCHAR(100) NOT NULL,
167
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
168
+ `updatedAt` TIMESTAMP NOT NULL,
169
+ `instanceId` VARCHAR(191) NOT NULL,
170
+
171
+ UNIQUE INDEX `Proxy_instanceId_key`(`instanceId`),
172
+ PRIMARY KEY (`id`)
173
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
174
+
175
+ -- CreateTable
176
+ CREATE TABLE `Setting` (
177
+ `id` VARCHAR(191) NOT NULL,
178
+ `rejectCall` BOOLEAN NOT NULL DEFAULT false,
179
+ `msgCall` VARCHAR(100) NULL,
180
+ `groupsIgnore` BOOLEAN NOT NULL DEFAULT false,
181
+ `alwaysOnline` BOOLEAN NOT NULL DEFAULT false,
182
+ `readMessages` BOOLEAN NOT NULL DEFAULT false,
183
+ `readStatus` BOOLEAN NOT NULL DEFAULT false,
184
+ `syncFullHistory` BOOLEAN NOT NULL DEFAULT false,
185
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
186
+ `updatedAt` TIMESTAMP NOT NULL,
187
+ `instanceId` VARCHAR(191) NOT NULL,
188
+
189
+ UNIQUE INDEX `Setting_instanceId_key`(`instanceId`),
190
+ PRIMARY KEY (`id`)
191
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
192
+
193
+ -- CreateTable
194
+ CREATE TABLE `Rabbitmq` (
195
+ `id` VARCHAR(191) NOT NULL,
196
+ `enabled` BOOLEAN NOT NULL DEFAULT false,
197
+ `events` JSON NOT NULL,
198
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
199
+ `updatedAt` TIMESTAMP NOT NULL,
200
+ `instanceId` VARCHAR(191) NOT NULL,
201
+
202
+ UNIQUE INDEX `Rabbitmq_instanceId_key`(`instanceId`),
203
+ PRIMARY KEY (`id`)
204
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
205
+
206
+ -- CreateTable
207
+ CREATE TABLE `Sqs` (
208
+ `id` VARCHAR(191) NOT NULL,
209
+ `enabled` BOOLEAN NOT NULL DEFAULT false,
210
+ `events` JSON NOT NULL,
211
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
212
+ `updatedAt` TIMESTAMP NOT NULL,
213
+ `instanceId` VARCHAR(191) NOT NULL,
214
+
215
+ UNIQUE INDEX `Sqs_instanceId_key`(`instanceId`),
216
+ PRIMARY KEY (`id`)
217
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
218
+
219
+ -- CreateTable
220
+ CREATE TABLE `Websocket` (
221
+ `id` VARCHAR(191) NOT NULL,
222
+ `enabled` BOOLEAN NOT NULL DEFAULT false,
223
+ `events` JSON NOT NULL,
224
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
225
+ `updatedAt` TIMESTAMP NOT NULL,
226
+ `instanceId` VARCHAR(191) NOT NULL,
227
+
228
+ UNIQUE INDEX `Websocket_instanceId_key`(`instanceId`),
229
+ PRIMARY KEY (`id`)
230
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
231
+
232
+ -- CreateTable
233
+ CREATE TABLE `Typebot` (
234
+ `id` VARCHAR(191) NOT NULL,
235
+ `enabled` BOOLEAN NOT NULL DEFAULT true,
236
+ `description` VARCHAR(255) NULL,
237
+ `url` VARCHAR(500) NOT NULL,
238
+ `typebot` VARCHAR(100) NOT NULL,
239
+ `expire` INTEGER NULL DEFAULT 0,
240
+ `keywordFinish` VARCHAR(100) NULL,
241
+ `delayMessage` INTEGER NULL,
242
+ `unknownMessage` VARCHAR(100) NULL,
243
+ `listeningFromMe` BOOLEAN NULL DEFAULT false,
244
+ `stopBotFromMe` BOOLEAN NULL DEFAULT false,
245
+ `keepOpen` BOOLEAN NULL DEFAULT false,
246
+ `debounceTime` INTEGER NULL,
247
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
248
+ `updatedAt` TIMESTAMP NULL,
249
+ `ignoreJids` JSON NULL,
250
+ `triggerType` ENUM('all', 'keyword', 'none') NULL,
251
+ `triggerOperator` ENUM('contains', 'equals', 'startsWith', 'endsWith', 'regex') NULL,
252
+ `triggerValue` VARCHAR(191) NULL,
253
+ `instanceId` VARCHAR(191) NOT NULL,
254
+
255
+ PRIMARY KEY (`id`)
256
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
257
+
258
+ -- CreateTable
259
+ CREATE TABLE `TypebotSession` (
260
+ `id` VARCHAR(191) NOT NULL,
261
+ `remoteJid` VARCHAR(100) NOT NULL,
262
+ `pushName` VARCHAR(100) NULL,
263
+ `sessionId` VARCHAR(100) NOT NULL,
264
+ `status` ENUM('opened', 'closed', 'paused') NOT NULL,
265
+ `prefilledVariables` JSON NULL,
266
+ `awaitUser` BOOLEAN NOT NULL DEFAULT false,
267
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
268
+ `updatedAt` TIMESTAMP NOT NULL,
269
+ `typebotId` VARCHAR(191) NOT NULL,
270
+ `instanceId` VARCHAR(191) NOT NULL,
271
+
272
+ PRIMARY KEY (`id`)
273
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
274
+
275
+ -- CreateTable
276
+ CREATE TABLE `TypebotSetting` (
277
+ `id` VARCHAR(191) NOT NULL,
278
+ `expire` INTEGER NULL DEFAULT 0,
279
+ `keywordFinish` VARCHAR(100) NULL,
280
+ `delayMessage` INTEGER NULL,
281
+ `unknownMessage` VARCHAR(100) NULL,
282
+ `listeningFromMe` BOOLEAN NULL DEFAULT false,
283
+ `stopBotFromMe` BOOLEAN NULL DEFAULT false,
284
+ `keepOpen` BOOLEAN NULL DEFAULT false,
285
+ `debounceTime` INTEGER NULL,
286
+ `typebotIdFallback` VARCHAR(100) NULL,
287
+ `ignoreJids` JSON NULL,
288
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
289
+ `updatedAt` TIMESTAMP NOT NULL,
290
+ `instanceId` VARCHAR(191) NOT NULL,
291
+
292
+ UNIQUE INDEX `TypebotSetting_instanceId_key`(`instanceId`),
293
+ PRIMARY KEY (`id`)
294
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
295
+
296
+ -- CreateTable
297
+ CREATE TABLE `Media` (
298
+ `id` VARCHAR(191) NOT NULL,
299
+ `fileName` VARCHAR(500) NOT NULL,
300
+ `type` VARCHAR(100) NOT NULL,
301
+ `mimetype` VARCHAR(100) NOT NULL,
302
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
303
+ `messageId` VARCHAR(191) NOT NULL,
304
+ `instanceId` VARCHAR(191) NOT NULL,
305
+
306
+ UNIQUE INDEX `Media_fileName_key`(`fileName`),
307
+ UNIQUE INDEX `Media_messageId_key`(`messageId`),
308
+ PRIMARY KEY (`id`)
309
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
310
+
311
+ -- CreateTable
312
+ CREATE TABLE `OpenaiCreds` (
313
+ `id` VARCHAR(191) NOT NULL,
314
+ `name` VARCHAR(255) NULL,
315
+ `apiKey` VARCHAR(255) NULL,
316
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
317
+ `updatedAt` TIMESTAMP NOT NULL,
318
+ `instanceId` VARCHAR(191) NOT NULL,
319
+
320
+ UNIQUE INDEX `OpenaiCreds_name_key`(`name`),
321
+ UNIQUE INDEX `OpenaiCreds_apiKey_key`(`apiKey`),
322
+ PRIMARY KEY (`id`)
323
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
324
+
325
+ -- CreateTable
326
+ CREATE TABLE `OpenaiBot` (
327
+ `id` VARCHAR(191) NOT NULL,
328
+ `enabled` BOOLEAN NOT NULL DEFAULT true,
329
+ `description` VARCHAR(255) NULL,
330
+ `botType` ENUM('assistant', 'chatCompletion') NOT NULL,
331
+ `assistantId` VARCHAR(255) NULL,
332
+ `functionUrl` VARCHAR(500) NULL,
333
+ `model` VARCHAR(100) NULL,
334
+ `systemMessages` JSON NULL,
335
+ `assistantMessages` JSON NULL,
336
+ `userMessages` JSON NULL,
337
+ `maxTokens` INTEGER NULL,
338
+ `expire` INTEGER NULL DEFAULT 0,
339
+ `keywordFinish` VARCHAR(100) NULL,
340
+ `delayMessage` INTEGER NULL,
341
+ `unknownMessage` VARCHAR(100) NULL,
342
+ `listeningFromMe` BOOLEAN NULL DEFAULT false,
343
+ `stopBotFromMe` BOOLEAN NULL DEFAULT false,
344
+ `keepOpen` BOOLEAN NULL DEFAULT false,
345
+ `debounceTime` INTEGER NULL,
346
+ `ignoreJids` JSON NULL,
347
+ `triggerType` ENUM('all', 'keyword', 'none') NULL,
348
+ `triggerOperator` ENUM('contains', 'equals', 'startsWith', 'endsWith', 'regex') NULL,
349
+ `triggerValue` VARCHAR(191) NULL,
350
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
351
+ `updatedAt` TIMESTAMP NOT NULL,
352
+ `openaiCredsId` VARCHAR(191) NOT NULL,
353
+ `instanceId` VARCHAR(191) NOT NULL,
354
+
355
+ PRIMARY KEY (`id`)
356
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
357
+
358
+ -- CreateTable
359
+ CREATE TABLE `OpenaiSession` (
360
+ `id` VARCHAR(191) NOT NULL,
361
+ `sessionId` VARCHAR(255) NOT NULL,
362
+ `remoteJid` VARCHAR(100) NOT NULL,
363
+ `status` ENUM('opened', 'closed', 'paused') NOT NULL,
364
+ `awaitUser` BOOLEAN NOT NULL DEFAULT false,
365
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
366
+ `updatedAt` TIMESTAMP NOT NULL,
367
+ `openaiBotId` VARCHAR(191) NOT NULL,
368
+ `instanceId` VARCHAR(191) NOT NULL,
369
+
370
+ PRIMARY KEY (`id`)
371
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
372
+
373
+ -- CreateTable
374
+ CREATE TABLE `OpenaiSetting` (
375
+ `id` VARCHAR(191) NOT NULL,
376
+ `expire` INTEGER NULL DEFAULT 0,
377
+ `keywordFinish` VARCHAR(100) NULL,
378
+ `delayMessage` INTEGER NULL,
379
+ `unknownMessage` VARCHAR(100) NULL,
380
+ `listeningFromMe` BOOLEAN NULL DEFAULT false,
381
+ `stopBotFromMe` BOOLEAN NULL DEFAULT false,
382
+ `keepOpen` BOOLEAN NULL DEFAULT false,
383
+ `debounceTime` INTEGER NULL,
384
+ `ignoreJids` JSON NULL,
385
+ `speechToText` BOOLEAN NULL DEFAULT false,
386
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
387
+ `updatedAt` TIMESTAMP NOT NULL,
388
+ `openaiCredsId` VARCHAR(191) NOT NULL,
389
+ `openaiIdFallback` VARCHAR(100) NULL,
390
+ `instanceId` VARCHAR(191) NOT NULL,
391
+
392
+ UNIQUE INDEX `OpenaiSetting_openaiCredsId_key`(`openaiCredsId`),
393
+ UNIQUE INDEX `OpenaiSetting_instanceId_key`(`instanceId`),
394
+ PRIMARY KEY (`id`)
395
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
396
+
397
+ -- CreateTable
398
+ CREATE TABLE `Template` (
399
+ `id` VARCHAR(191) NOT NULL,
400
+ `templateId` VARCHAR(255) NOT NULL,
401
+ `name` VARCHAR(255) NOT NULL,
402
+ `template` JSON NOT NULL,
403
+ `webhookUrl` VARCHAR(500) NULL,
404
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
405
+ `updatedAt` TIMESTAMP NOT NULL,
406
+ `instanceId` VARCHAR(191) NOT NULL,
407
+
408
+ UNIQUE INDEX `Template_templateId_key`(`templateId`),
409
+ UNIQUE INDEX `Template_name_key`(`name`),
410
+ PRIMARY KEY (`id`)
411
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
412
+
413
+ -- CreateTable
414
+ CREATE TABLE `Dify` (
415
+ `id` VARCHAR(191) NOT NULL,
416
+ `enabled` BOOLEAN NOT NULL DEFAULT true,
417
+ `description` VARCHAR(255) NULL,
418
+ `botType` ENUM('chatBot', 'textGenerator', 'agent', 'workflow') NOT NULL,
419
+ `apiUrl` VARCHAR(255) NULL,
420
+ `apiKey` VARCHAR(255) NULL,
421
+ `expire` INTEGER NULL DEFAULT 0,
422
+ `keywordFinish` VARCHAR(100) NULL,
423
+ `delayMessage` INTEGER NULL,
424
+ `unknownMessage` VARCHAR(100) NULL,
425
+ `listeningFromMe` BOOLEAN NULL DEFAULT false,
426
+ `stopBotFromMe` BOOLEAN NULL DEFAULT false,
427
+ `keepOpen` BOOLEAN NULL DEFAULT false,
428
+ `debounceTime` INTEGER NULL,
429
+ `ignoreJids` JSON NULL,
430
+ `triggerType` ENUM('all', 'keyword', 'none') NULL,
431
+ `triggerOperator` ENUM('contains', 'equals', 'startsWith', 'endsWith', 'regex') NULL,
432
+ `triggerValue` VARCHAR(191) NULL,
433
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
434
+ `updatedAt` TIMESTAMP NOT NULL,
435
+ `instanceId` VARCHAR(191) NOT NULL,
436
+
437
+ PRIMARY KEY (`id`)
438
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
439
+
440
+ -- CreateTable
441
+ CREATE TABLE `DifySession` (
442
+ `id` VARCHAR(191) NOT NULL,
443
+ `sessionId` VARCHAR(255) NOT NULL,
444
+ `remoteJid` VARCHAR(100) NOT NULL,
445
+ `status` ENUM('opened', 'closed', 'paused') NOT NULL,
446
+ `awaitUser` BOOLEAN NOT NULL DEFAULT false,
447
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
448
+ `updatedAt` TIMESTAMP NOT NULL,
449
+ `difyId` VARCHAR(191) NOT NULL,
450
+ `instanceId` VARCHAR(191) NOT NULL,
451
+
452
+ PRIMARY KEY (`id`)
453
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
454
+
455
+ -- CreateTable
456
+ CREATE TABLE `DifySetting` (
457
+ `id` VARCHAR(191) NOT NULL,
458
+ `expire` INTEGER NULL DEFAULT 0,
459
+ `keywordFinish` VARCHAR(100) NULL,
460
+ `delayMessage` INTEGER NULL,
461
+ `unknownMessage` VARCHAR(100) NULL,
462
+ `listeningFromMe` BOOLEAN NULL DEFAULT false,
463
+ `stopBotFromMe` BOOLEAN NULL DEFAULT false,
464
+ `keepOpen` BOOLEAN NULL DEFAULT false,
465
+ `debounceTime` INTEGER NULL,
466
+ `ignoreJids` JSON NULL,
467
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
468
+ `updatedAt` TIMESTAMP NOT NULL,
469
+ `difyIdFallback` VARCHAR(100) NULL,
470
+ `instanceId` VARCHAR(191) NOT NULL,
471
+
472
+ UNIQUE INDEX `DifySetting_instanceId_key`(`instanceId`),
473
+ PRIMARY KEY (`id`)
474
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
475
+
476
+ -- AddForeignKey
477
+ ALTER TABLE `Session` ADD CONSTRAINT `Session_sessionId_fkey` FOREIGN KEY (`sessionId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
478
+
479
+ -- AddForeignKey
480
+ ALTER TABLE `Chat` ADD CONSTRAINT `Chat_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
481
+
482
+ -- AddForeignKey
483
+ ALTER TABLE `Contact` ADD CONSTRAINT `Contact_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
484
+
485
+ -- AddForeignKey
486
+ ALTER TABLE `Message` ADD CONSTRAINT `Message_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
487
+
488
+ -- AddForeignKey
489
+ ALTER TABLE `Message` ADD CONSTRAINT `Message_typebotSessionId_fkey` FOREIGN KEY (`typebotSessionId`) REFERENCES `TypebotSession`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
490
+
491
+ -- AddForeignKey
492
+ ALTER TABLE `Message` ADD CONSTRAINT `Message_openaiSessionId_fkey` FOREIGN KEY (`openaiSessionId`) REFERENCES `OpenaiSession`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
493
+
494
+ -- AddForeignKey
495
+ ALTER TABLE `Message` ADD CONSTRAINT `Message_difySessionId_fkey` FOREIGN KEY (`difySessionId`) REFERENCES `DifySession`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
496
+
497
+ -- AddForeignKey
498
+ ALTER TABLE `MessageUpdate` ADD CONSTRAINT `MessageUpdate_messageId_fkey` FOREIGN KEY (`messageId`) REFERENCES `Message`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
499
+
500
+ -- AddForeignKey
501
+ ALTER TABLE `MessageUpdate` ADD CONSTRAINT `MessageUpdate_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
502
+
503
+ -- AddForeignKey
504
+ ALTER TABLE `Webhook` ADD CONSTRAINT `Webhook_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
505
+
506
+ -- AddForeignKey
507
+ ALTER TABLE `Chatwoot` ADD CONSTRAINT `Chatwoot_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
508
+
509
+ -- AddForeignKey
510
+ ALTER TABLE `Label` ADD CONSTRAINT `Label_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
511
+
512
+ -- AddForeignKey
513
+ ALTER TABLE `Proxy` ADD CONSTRAINT `Proxy_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
514
+
515
+ -- AddForeignKey
516
+ ALTER TABLE `Setting` ADD CONSTRAINT `Setting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
517
+
518
+ -- AddForeignKey
519
+ ALTER TABLE `Rabbitmq` ADD CONSTRAINT `Rabbitmq_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
520
+
521
+ -- AddForeignKey
522
+ ALTER TABLE `Sqs` ADD CONSTRAINT `Sqs_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
523
+
524
+ -- AddForeignKey
525
+ ALTER TABLE `Websocket` ADD CONSTRAINT `Websocket_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
526
+
527
+ -- AddForeignKey
528
+ ALTER TABLE `Typebot` ADD CONSTRAINT `Typebot_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
529
+
530
+ -- AddForeignKey
531
+ ALTER TABLE `TypebotSession` ADD CONSTRAINT `TypebotSession_typebotId_fkey` FOREIGN KEY (`typebotId`) REFERENCES `Typebot`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
532
+
533
+ -- AddForeignKey
534
+ ALTER TABLE `TypebotSession` ADD CONSTRAINT `TypebotSession_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
535
+
536
+ -- AddForeignKey
537
+ ALTER TABLE `TypebotSetting` ADD CONSTRAINT `TypebotSetting_typebotIdFallback_fkey` FOREIGN KEY (`typebotIdFallback`) REFERENCES `Typebot`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
538
+
539
+ -- AddForeignKey
540
+ ALTER TABLE `TypebotSetting` ADD CONSTRAINT `TypebotSetting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
541
+
542
+ -- AddForeignKey
543
+ ALTER TABLE `Media` ADD CONSTRAINT `Media_messageId_fkey` FOREIGN KEY (`messageId`) REFERENCES `Message`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
544
+
545
+ -- AddForeignKey
546
+ ALTER TABLE `Media` ADD CONSTRAINT `Media_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
547
+
548
+ -- AddForeignKey
549
+ ALTER TABLE `OpenaiCreds` ADD CONSTRAINT `OpenaiCreds_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
550
+
551
+ -- AddForeignKey
552
+ ALTER TABLE `OpenaiBot` ADD CONSTRAINT `OpenaiBot_openaiCredsId_fkey` FOREIGN KEY (`openaiCredsId`) REFERENCES `OpenaiCreds`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
553
+
554
+ -- AddForeignKey
555
+ ALTER TABLE `OpenaiBot` ADD CONSTRAINT `OpenaiBot_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
556
+
557
+ -- AddForeignKey
558
+ ALTER TABLE `OpenaiSession` ADD CONSTRAINT `OpenaiSession_openaiBotId_fkey` FOREIGN KEY (`openaiBotId`) REFERENCES `OpenaiBot`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
559
+
560
+ -- AddForeignKey
561
+ ALTER TABLE `OpenaiSession` ADD CONSTRAINT `OpenaiSession_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
562
+
563
+ -- AddForeignKey
564
+ ALTER TABLE `OpenaiSetting` ADD CONSTRAINT `OpenaiSetting_openaiCredsId_fkey` FOREIGN KEY (`openaiCredsId`) REFERENCES `OpenaiCreds`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
565
+
566
+ -- AddForeignKey
567
+ ALTER TABLE `OpenaiSetting` ADD CONSTRAINT `OpenaiSetting_openaiIdFallback_fkey` FOREIGN KEY (`openaiIdFallback`) REFERENCES `OpenaiBot`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
568
+
569
+ -- AddForeignKey
570
+ ALTER TABLE `OpenaiSetting` ADD CONSTRAINT `OpenaiSetting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
571
+
572
+ -- AddForeignKey
573
+ ALTER TABLE `Template` ADD CONSTRAINT `Template_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
574
+
575
+ -- AddForeignKey
576
+ ALTER TABLE `Dify` ADD CONSTRAINT `Dify_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
577
+
578
+ -- AddForeignKey
579
+ ALTER TABLE `DifySession` ADD CONSTRAINT `DifySession_difyId_fkey` FOREIGN KEY (`difyId`) REFERENCES `Dify`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
580
+
581
+ -- AddForeignKey
582
+ ALTER TABLE `DifySession` ADD CONSTRAINT `DifySession_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
583
+
584
+ -- AddForeignKey
585
+ ALTER TABLE `DifySetting` ADD CONSTRAINT `DifySetting_difyIdFallback_fkey` FOREIGN KEY (`difyIdFallback`) REFERENCES `Dify`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
586
+
587
+ -- AddForeignKey
588
+ ALTER TABLE `DifySetting` ADD CONSTRAINT `DifySetting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
prisma/mysql-migrations/20240813153900_add_unique_index_for_remoted_jid_and_instance_in_contacts/migration.sql ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+ - You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
4
+ - You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
5
+ - You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
6
+ - You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
7
+ - You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
8
+ - You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
9
+ - You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
10
+ - You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
11
+ - You are about to alter the column `createdAt` on the `DifySession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
12
+ - You are about to alter the column `updatedAt` on the `DifySession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
13
+ - You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
14
+ - You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
15
+ - You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
16
+ - You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
17
+ - You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
18
+ - You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
19
+ - You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
20
+ - You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
21
+ - You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
22
+ - You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
23
+ - You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
24
+ - You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
25
+ - You are about to alter the column `createdAt` on the `OpenaiSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
26
+ - You are about to alter the column `updatedAt` on the `OpenaiSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
27
+ - You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
28
+ - You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
29
+ - You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
30
+ - You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
31
+ - You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
32
+ - You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
33
+ - You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
34
+ - You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
35
+ - You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
36
+ - You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
37
+ - You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
38
+ - You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
39
+ - You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
40
+ - You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
41
+ - You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
42
+ - You are about to alter the column `createdAt` on the `TypebotSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
43
+ - You are about to alter the column `updatedAt` on the `TypebotSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
44
+ - You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
45
+ - You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
46
+ - You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
47
+ - You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
48
+ - You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
49
+ - You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
50
+ - A unique constraint covering the columns `[remoteJid,instanceId]` on the table `Contact` will be added. If there are existing duplicate values, this will fail.
51
+ */
52
+ -- AlterTable
53
+ ALTER TABLE `Chat`
54
+ ADD COLUMN `name` VARCHAR(100) NULL,
55
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
56
+ MODIFY `updatedAt` TIMESTAMP NULL;
57
+
58
+ -- AlterTable
59
+ ALTER TABLE `Chatwoot`
60
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
61
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
62
+
63
+ -- AlterTable
64
+ ALTER TABLE `Contact`
65
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
66
+ MODIFY `updatedAt` TIMESTAMP NULL;
67
+
68
+ -- AlterTable
69
+ ALTER TABLE `Dify`
70
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
71
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
72
+
73
+ -- AlterTable
74
+ ALTER TABLE `DifySession`
75
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
76
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
77
+
78
+ -- AlterTable
79
+ ALTER TABLE `DifySetting`
80
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
81
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
82
+
83
+ -- AlterTable
84
+ ALTER TABLE `Instance`
85
+ MODIFY `disconnectionAt` TIMESTAMP NULL,
86
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
87
+ MODIFY `updatedAt` TIMESTAMP NULL;
88
+
89
+ -- AlterTable
90
+ ALTER TABLE `Label`
91
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
92
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
93
+
94
+ -- AlterTable
95
+ ALTER TABLE `Media`
96
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
97
+
98
+ -- AlterTable
99
+ ALTER TABLE `OpenaiBot`
100
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
101
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
102
+
103
+ -- AlterTable
104
+ ALTER TABLE `OpenaiCreds`
105
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
106
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
107
+
108
+ -- AlterTable
109
+ ALTER TABLE `OpenaiSession`
110
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
111
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
112
+
113
+ -- AlterTable
114
+ ALTER TABLE `OpenaiSetting`
115
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
116
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
117
+
118
+ -- AlterTable
119
+ ALTER TABLE `Proxy`
120
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
121
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
122
+
123
+ -- AlterTable
124
+ ALTER TABLE `Rabbitmq`
125
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
126
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
127
+
128
+ -- AlterTable
129
+ ALTER TABLE `Session`
130
+ MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
131
+
132
+ -- AlterTable
133
+ ALTER TABLE `Setting`
134
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
135
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
136
+
137
+ -- AlterTable
138
+ ALTER TABLE `Sqs`
139
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
140
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
141
+
142
+ -- AlterTable
143
+ ALTER TABLE `Template`
144
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
145
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
146
+
147
+ -- AlterTable
148
+ ALTER TABLE `Typebot`
149
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
150
+ MODIFY `updatedAt` TIMESTAMP NULL;
151
+
152
+ -- AlterTable
153
+ ALTER TABLE `TypebotSession`
154
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
155
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
156
+
157
+ -- AlterTable
158
+ ALTER TABLE `TypebotSetting`
159
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
160
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
161
+
162
+ -- AlterTable
163
+ ALTER TABLE `Webhook`
164
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
165
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
166
+
167
+ -- AlterTable
168
+ ALTER TABLE `Websocket`
169
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
170
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
171
+
172
+ -- CreateIndex
173
+ CREATE UNIQUE INDEX `Contact_remoteJid_instanceId_key` ON `Contact` (`remoteJid`, `instanceId`);
prisma/mysql-migrations/20240814173138_add_ignore_jids_chatwoot/migration.sql ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
5
+ - You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
6
+ - You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
7
+ - You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
8
+ - You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
9
+ - You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
10
+ - You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
11
+ - You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
12
+ - You are about to alter the column `createdAt` on the `DifySession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
13
+ - You are about to alter the column `updatedAt` on the `DifySession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
14
+ - You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
15
+ - You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
16
+ - You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
17
+ - You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
18
+ - You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
19
+ - You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
20
+ - You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
21
+ - You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
22
+ - You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
23
+ - You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
24
+ - You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
25
+ - You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
26
+ - You are about to alter the column `createdAt` on the `OpenaiSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
27
+ - You are about to alter the column `updatedAt` on the `OpenaiSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
28
+ - You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
29
+ - You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
30
+ - You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
31
+ - You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
32
+ - You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
33
+ - You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
34
+ - You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
35
+ - You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
36
+ - You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
37
+ - You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
38
+ - You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
39
+ - You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
40
+ - You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
41
+ - You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
42
+ - You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
43
+ - You are about to alter the column `createdAt` on the `TypebotSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
44
+ - You are about to alter the column `updatedAt` on the `TypebotSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
45
+ - You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
46
+ - You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
47
+ - You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
48
+ - You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
49
+ - You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
50
+ - You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
51
+
52
+ */
53
+ -- DropIndex
54
+ DROP INDEX `Label_labelId_key` ON `Label`;
55
+
56
+ -- AlterTable
57
+ ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
58
+ MODIFY `updatedAt` TIMESTAMP NULL;
59
+
60
+ -- AlterTable
61
+ ALTER TABLE `Chatwoot` ADD COLUMN `ignoreJids` JSON NULL,
62
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
63
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
64
+
65
+ -- AlterTable
66
+ ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
67
+ MODIFY `updatedAt` TIMESTAMP NULL;
68
+
69
+ -- AlterTable
70
+ ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
71
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
72
+
73
+ -- AlterTable
74
+ ALTER TABLE `DifySession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
75
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
76
+
77
+ -- AlterTable
78
+ ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
79
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
80
+
81
+ -- AlterTable
82
+ ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
83
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
84
+ MODIFY `updatedAt` TIMESTAMP NULL;
85
+
86
+ -- AlterTable
87
+ ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
88
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
89
+
90
+ -- AlterTable
91
+ ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
92
+
93
+ -- AlterTable
94
+ ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
95
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
96
+
97
+ -- AlterTable
98
+ ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
99
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
100
+
101
+ -- AlterTable
102
+ ALTER TABLE `OpenaiSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
103
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
104
+
105
+ -- AlterTable
106
+ ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
107
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
108
+
109
+ -- AlterTable
110
+ ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
111
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
112
+
113
+ -- AlterTable
114
+ ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
115
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
116
+
117
+ -- AlterTable
118
+ ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
119
+
120
+ -- AlterTable
121
+ ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
122
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
123
+
124
+ -- AlterTable
125
+ ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
126
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
127
+
128
+ -- AlterTable
129
+ ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
130
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
131
+
132
+ -- AlterTable
133
+ ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
134
+ MODIFY `updatedAt` TIMESTAMP NULL;
135
+
136
+ -- AlterTable
137
+ ALTER TABLE `TypebotSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
138
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
139
+
140
+ -- AlterTable
141
+ ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
142
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
143
+
144
+ -- AlterTable
145
+ ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
146
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
147
+
148
+ -- AlterTable
149
+ ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
150
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
prisma/mysql-migrations/20240814214314_integrations_unification/migration.sql ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
5
+ - You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
6
+ - You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
7
+ - You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
8
+ - You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
9
+ - You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
10
+ - You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
11
+ - You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
12
+ - You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
13
+ - You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
14
+ - You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
15
+ - You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
16
+ - You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
17
+ - You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
18
+ - You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
19
+ - You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
20
+ - You are about to drop the column `difySessionId` on the `Message` table. All the data in the column will be lost.
21
+ - You are about to drop the column `openaiSessionId` on the `Message` table. All the data in the column will be lost.
22
+ - You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
23
+ - You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
24
+ - You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
25
+ - You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
26
+ - You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
27
+ - You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
28
+ - You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
29
+ - You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
30
+ - You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
31
+ - You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
32
+ - You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
33
+ - You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
34
+ - You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
35
+ - You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
36
+ - You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
37
+ - You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
38
+ - You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
39
+ - You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
40
+ - You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
41
+ - You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
42
+ - You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
43
+ - You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
44
+ - You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
45
+ - You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
46
+ - You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
47
+ - You are about to drop the `DifySession` table. If the table is not empty, all the data it contains will be lost.
48
+ - You are about to drop the `OpenaiSession` table. If the table is not empty, all the data it contains will be lost.
49
+ - You are about to drop the `TypebotSession` table. If the table is not empty, all the data it contains will be lost.
50
+
51
+ */
52
+ -- DropForeignKey
53
+ ALTER TABLE `DifySession` DROP FOREIGN KEY `DifySession_difyId_fkey`;
54
+
55
+ -- DropForeignKey
56
+ ALTER TABLE `DifySession` DROP FOREIGN KEY `DifySession_instanceId_fkey`;
57
+
58
+ -- DropForeignKey
59
+ ALTER TABLE `Message` DROP FOREIGN KEY `Message_difySessionId_fkey`;
60
+
61
+ -- DropForeignKey
62
+ ALTER TABLE `Message` DROP FOREIGN KEY `Message_openaiSessionId_fkey`;
63
+
64
+ -- DropForeignKey
65
+ ALTER TABLE `Message` DROP FOREIGN KEY `Message_typebotSessionId_fkey`;
66
+
67
+ -- DropForeignKey
68
+ ALTER TABLE `OpenaiSession` DROP FOREIGN KEY `OpenaiSession_instanceId_fkey`;
69
+
70
+ -- DropForeignKey
71
+ ALTER TABLE `OpenaiSession` DROP FOREIGN KEY `OpenaiSession_openaiBotId_fkey`;
72
+
73
+ -- DropForeignKey
74
+ ALTER TABLE `TypebotSession` DROP FOREIGN KEY `TypebotSession_instanceId_fkey`;
75
+
76
+ -- DropForeignKey
77
+ ALTER TABLE `TypebotSession` DROP FOREIGN KEY `TypebotSession_typebotId_fkey`;
78
+
79
+ -- AlterTable
80
+ ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
81
+ MODIFY `updatedAt` TIMESTAMP NULL;
82
+
83
+ -- AlterTable
84
+ ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
85
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
86
+
87
+ -- AlterTable
88
+ ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
89
+ MODIFY `updatedAt` TIMESTAMP NULL;
90
+
91
+ -- AlterTable
92
+ ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
93
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
94
+
95
+ -- AlterTable
96
+ ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
97
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
98
+
99
+ -- AlterTable
100
+ ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
101
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
102
+ MODIFY `updatedAt` TIMESTAMP NULL;
103
+
104
+ -- AlterTable
105
+ ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
106
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
107
+
108
+ -- AlterTable
109
+ ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
110
+
111
+ -- AlterTable
112
+ ALTER TABLE `Message` DROP COLUMN `difySessionId`,
113
+ DROP COLUMN `openaiSessionId`,
114
+ ADD COLUMN `sessionId` VARCHAR(191) NULL;
115
+
116
+ -- AlterTable
117
+ ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
118
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
119
+
120
+ -- AlterTable
121
+ ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
122
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
123
+
124
+ -- AlterTable
125
+ ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
126
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
127
+
128
+ -- AlterTable
129
+ ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
130
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
131
+
132
+ -- AlterTable
133
+ ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
134
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
135
+
136
+ -- AlterTable
137
+ ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
138
+
139
+ -- AlterTable
140
+ ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
141
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
142
+
143
+ -- AlterTable
144
+ ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
145
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
146
+
147
+ -- AlterTable
148
+ ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
149
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
150
+
151
+ -- AlterTable
152
+ ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
153
+ MODIFY `updatedAt` TIMESTAMP NULL;
154
+
155
+ -- AlterTable
156
+ ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
157
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
158
+
159
+ -- AlterTable
160
+ ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
161
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
162
+
163
+ -- AlterTable
164
+ ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
165
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
166
+
167
+ -- DropTable
168
+ DROP TABLE `DifySession`;
169
+
170
+ -- DropTable
171
+ DROP TABLE `OpenaiSession`;
172
+
173
+ -- DropTable
174
+ DROP TABLE `TypebotSession`;
175
+
176
+ -- CreateTable
177
+ CREATE TABLE `IntegrationSession` (
178
+ `id` VARCHAR(191) NOT NULL,
179
+ `sessionId` VARCHAR(255) NOT NULL,
180
+ `remoteJid` VARCHAR(100) NOT NULL,
181
+ `pushName` VARCHAR(191) NULL,
182
+ `status` ENUM('opened', 'closed', 'paused') NOT NULL,
183
+ `awaitUser` BOOLEAN NOT NULL DEFAULT false,
184
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
185
+ `updatedAt` TIMESTAMP NOT NULL,
186
+ `instanceId` VARCHAR(191) NOT NULL,
187
+ `parameters` JSON NULL,
188
+ `openaiBotId` VARCHAR(191) NULL,
189
+ `difyId` VARCHAR(191) NULL,
190
+ `typebotId` VARCHAR(191) NULL,
191
+
192
+ PRIMARY KEY (`id`)
193
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
194
+
195
+ -- AddForeignKey
196
+ ALTER TABLE `Message` ADD CONSTRAINT `Message_sessionId_fkey` FOREIGN KEY (`sessionId`) REFERENCES `IntegrationSession`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
197
+
198
+ -- AddForeignKey
199
+ ALTER TABLE `IntegrationSession` ADD CONSTRAINT `IntegrationSession_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
200
+
201
+ -- AddForeignKey
202
+ ALTER TABLE `IntegrationSession` ADD CONSTRAINT `IntegrationSession_openaiBotId_fkey` FOREIGN KEY (`openaiBotId`) REFERENCES `OpenaiBot`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
203
+
204
+ -- AddForeignKey
205
+ ALTER TABLE `IntegrationSession` ADD CONSTRAINT `IntegrationSession_difyId_fkey` FOREIGN KEY (`difyId`) REFERENCES `Dify`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
206
+
207
+ -- AddForeignKey
208
+ ALTER TABLE `IntegrationSession` ADD CONSTRAINT `IntegrationSession_typebotId_fkey` FOREIGN KEY (`typebotId`) REFERENCES `Typebot`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
prisma/mysql-migrations/20240821203259_add_postgres_migrations/migration.sql ADDED
@@ -0,0 +1,269 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
5
+ - You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
6
+ - You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
7
+ - You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
8
+ - You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
9
+ - You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
10
+ - You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
11
+ - You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
12
+ - You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
13
+ - You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
14
+ - You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
15
+ - You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
16
+ - You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
17
+ - You are about to drop the column `difyId` on the `IntegrationSession` table. All the data in the column will be lost.
18
+ - You are about to drop the column `openaiBotId` on the `IntegrationSession` table. All the data in the column will be lost.
19
+ - You are about to drop the column `typebotId` on the `IntegrationSession` table. All the data in the column will be lost.
20
+ - You are about to alter the column `createdAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
21
+ - You are about to alter the column `updatedAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
22
+ - You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
23
+ - You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
24
+ - You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
25
+ - You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
26
+ - You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
27
+ - You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
28
+ - You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
29
+ - You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
30
+ - You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
31
+ - You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
32
+ - You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
33
+ - You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
34
+ - You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
35
+ - You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
36
+ - You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
37
+ - You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
38
+ - You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
39
+ - You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
40
+ - You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
41
+ - You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
42
+ - You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
43
+ - You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
44
+ - You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
45
+ - You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
46
+ - You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
47
+ - You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
48
+ - You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
49
+ - You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
50
+
51
+ */
52
+ -- DropForeignKey
53
+ ALTER TABLE `IntegrationSession` DROP FOREIGN KEY `IntegrationSession_difyId_fkey`;
54
+
55
+ -- DropForeignKey
56
+ ALTER TABLE `IntegrationSession` DROP FOREIGN KEY `IntegrationSession_openaiBotId_fkey`;
57
+
58
+ -- DropForeignKey
59
+ ALTER TABLE `IntegrationSession` DROP FOREIGN KEY `IntegrationSession_typebotId_fkey`;
60
+
61
+ -- DropIndex
62
+ DROP INDEX `Message_typebotSessionId_fkey` ON `Message`;
63
+
64
+ -- AlterTable
65
+ ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
66
+ MODIFY `updatedAt` TIMESTAMP NULL;
67
+
68
+ -- AlterTable
69
+ ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
70
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
71
+
72
+ -- AlterTable
73
+ ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
74
+ MODIFY `updatedAt` TIMESTAMP NULL;
75
+
76
+ -- AlterTable
77
+ ALTER TABLE `Dify` MODIFY `triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL,
78
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
79
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
80
+
81
+ -- AlterTable
82
+ ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
83
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
84
+
85
+ -- AlterTable
86
+ ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
87
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
88
+ MODIFY `updatedAt` TIMESTAMP NULL;
89
+
90
+ -- AlterTable
91
+ ALTER TABLE `IntegrationSession` DROP COLUMN `difyId`,
92
+ DROP COLUMN `openaiBotId`,
93
+ DROP COLUMN `typebotId`,
94
+ ADD COLUMN `botId` VARCHAR(191) NULL,
95
+ ADD COLUMN `context` JSON NULL,
96
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
97
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
98
+
99
+ -- AlterTable
100
+ ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
101
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
102
+
103
+ -- AlterTable
104
+ ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
105
+
106
+ -- AlterTable
107
+ ALTER TABLE `OpenaiBot` MODIFY `triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL,
108
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
109
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
110
+
111
+ -- AlterTable
112
+ ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
113
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
114
+
115
+ -- AlterTable
116
+ ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
117
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
118
+
119
+ -- AlterTable
120
+ ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
121
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
122
+
123
+ -- AlterTable
124
+ ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
125
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
126
+
127
+ -- AlterTable
128
+ ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
129
+
130
+ -- AlterTable
131
+ ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
132
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
133
+
134
+ -- AlterTable
135
+ ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
136
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
137
+
138
+ -- AlterTable
139
+ ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
140
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
141
+
142
+ -- AlterTable
143
+ ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
144
+ MODIFY `updatedAt` TIMESTAMP NULL,
145
+ MODIFY `triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL;
146
+
147
+ -- AlterTable
148
+ ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
149
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
150
+
151
+ -- AlterTable
152
+ ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
153
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
154
+
155
+ -- AlterTable
156
+ ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
157
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
158
+
159
+ -- CreateTable
160
+ CREATE TABLE `GenericBot` (
161
+ `id` VARCHAR(191) NOT NULL,
162
+ `enabled` BOOLEAN NOT NULL DEFAULT true,
163
+ `description` VARCHAR(255) NULL,
164
+ `apiUrl` VARCHAR(255) NULL,
165
+ `apiKey` VARCHAR(255) NULL,
166
+ `expire` INTEGER NULL DEFAULT 0,
167
+ `keywordFinish` VARCHAR(100) NULL,
168
+ `delayMessage` INTEGER NULL,
169
+ `unknownMessage` VARCHAR(100) NULL,
170
+ `listeningFromMe` BOOLEAN NULL DEFAULT false,
171
+ `stopBotFromMe` BOOLEAN NULL DEFAULT false,
172
+ `keepOpen` BOOLEAN NULL DEFAULT false,
173
+ `debounceTime` INTEGER NULL,
174
+ `ignoreJids` JSON NULL,
175
+ `triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL,
176
+ `triggerOperator` ENUM('contains', 'equals', 'startsWith', 'endsWith', 'regex') NULL,
177
+ `triggerValue` VARCHAR(191) NULL,
178
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
179
+ `updatedAt` TIMESTAMP NOT NULL,
180
+ `instanceId` VARCHAR(191) NOT NULL,
181
+
182
+ PRIMARY KEY (`id`)
183
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
184
+
185
+ -- CreateTable
186
+ CREATE TABLE `GenericSetting` (
187
+ `id` VARCHAR(191) NOT NULL,
188
+ `expire` INTEGER NULL DEFAULT 0,
189
+ `keywordFinish` VARCHAR(100) NULL,
190
+ `delayMessage` INTEGER NULL,
191
+ `unknownMessage` VARCHAR(100) NULL,
192
+ `listeningFromMe` BOOLEAN NULL DEFAULT false,
193
+ `stopBotFromMe` BOOLEAN NULL DEFAULT false,
194
+ `keepOpen` BOOLEAN NULL DEFAULT false,
195
+ `debounceTime` INTEGER NULL,
196
+ `ignoreJids` JSON NULL,
197
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
198
+ `updatedAt` TIMESTAMP NOT NULL,
199
+ `botIdFallback` VARCHAR(100) NULL,
200
+ `instanceId` VARCHAR(191) NOT NULL,
201
+
202
+ UNIQUE INDEX `GenericSetting_instanceId_key`(`instanceId`),
203
+ PRIMARY KEY (`id`)
204
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
205
+
206
+ -- CreateTable
207
+ CREATE TABLE `Flowise` (
208
+ `id` VARCHAR(191) NOT NULL,
209
+ `enabled` BOOLEAN NOT NULL DEFAULT true,
210
+ `description` VARCHAR(255) NULL,
211
+ `apiUrl` VARCHAR(255) NULL,
212
+ `apiKey` VARCHAR(255) NULL,
213
+ `expire` INTEGER NULL DEFAULT 0,
214
+ `keywordFinish` VARCHAR(100) NULL,
215
+ `delayMessage` INTEGER NULL,
216
+ `unknownMessage` VARCHAR(100) NULL,
217
+ `listeningFromMe` BOOLEAN NULL DEFAULT false,
218
+ `stopBotFromMe` BOOLEAN NULL DEFAULT false,
219
+ `keepOpen` BOOLEAN NULL DEFAULT false,
220
+ `debounceTime` INTEGER NULL,
221
+ `ignoreJids` JSON NULL,
222
+ `triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL,
223
+ `triggerOperator` ENUM('contains', 'equals', 'startsWith', 'endsWith', 'regex') NULL,
224
+ `triggerValue` VARCHAR(191) NULL,
225
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
226
+ `updatedAt` TIMESTAMP NOT NULL,
227
+ `instanceId` VARCHAR(191) NOT NULL,
228
+
229
+ PRIMARY KEY (`id`)
230
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
231
+
232
+ -- CreateTable
233
+ CREATE TABLE `FlowiseSetting` (
234
+ `id` VARCHAR(191) NOT NULL,
235
+ `expire` INTEGER NULL DEFAULT 0,
236
+ `keywordFinish` VARCHAR(100) NULL,
237
+ `delayMessage` INTEGER NULL,
238
+ `unknownMessage` VARCHAR(100) NULL,
239
+ `listeningFromMe` BOOLEAN NULL DEFAULT false,
240
+ `stopBotFromMe` BOOLEAN NULL DEFAULT false,
241
+ `keepOpen` BOOLEAN NULL DEFAULT false,
242
+ `debounceTime` INTEGER NULL,
243
+ `ignoreJids` JSON NULL,
244
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
245
+ `updatedAt` TIMESTAMP NOT NULL,
246
+ `flowiseIdFallback` VARCHAR(100) NULL,
247
+ `instanceId` VARCHAR(191) NOT NULL,
248
+
249
+ UNIQUE INDEX `FlowiseSetting_instanceId_key`(`instanceId`),
250
+ PRIMARY KEY (`id`)
251
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
252
+
253
+ -- AddForeignKey
254
+ ALTER TABLE `GenericBot` ADD CONSTRAINT `GenericBot_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
255
+
256
+ -- AddForeignKey
257
+ ALTER TABLE `GenericSetting` ADD CONSTRAINT `GenericSetting_botIdFallback_fkey` FOREIGN KEY (`botIdFallback`) REFERENCES `GenericBot`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
258
+
259
+ -- AddForeignKey
260
+ ALTER TABLE `GenericSetting` ADD CONSTRAINT `GenericSetting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
261
+
262
+ -- AddForeignKey
263
+ ALTER TABLE `Flowise` ADD CONSTRAINT `Flowise_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
264
+
265
+ -- AddForeignKey
266
+ ALTER TABLE `FlowiseSetting` ADD CONSTRAINT `FlowiseSetting_flowiseIdFallback_fkey` FOREIGN KEY (`flowiseIdFallback`) REFERENCES `Flowise`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
267
+
268
+ -- AddForeignKey
269
+ ALTER TABLE `FlowiseSetting` ADD CONSTRAINT `FlowiseSetting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
prisma/mysql-migrations/20240824162012_add_type_on_integration_sessions/migration.sql ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
5
+ - You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
6
+ - You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
7
+ - You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
8
+ - You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
9
+ - You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
10
+ - You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
11
+ - You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
12
+ - You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
13
+ - You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
14
+ - You are about to alter the column `createdAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
15
+ - You are about to alter the column `updatedAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
16
+ - You are about to alter the column `createdAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
17
+ - You are about to alter the column `updatedAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
18
+ - You are about to alter the column `createdAt` on the `GenericBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
19
+ - You are about to alter the column `updatedAt` on the `GenericBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
20
+ - You are about to alter the column `createdAt` on the `GenericSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
21
+ - You are about to alter the column `updatedAt` on the `GenericSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
22
+ - You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
23
+ - You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
24
+ - You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
25
+ - You are about to alter the column `createdAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
26
+ - You are about to alter the column `updatedAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
27
+ - You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
28
+ - You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
29
+ - You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
30
+ - You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
31
+ - You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
32
+ - You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
33
+ - You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
34
+ - You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
35
+ - You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
36
+ - You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
37
+ - You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
38
+ - You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
39
+ - You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
40
+ - You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
41
+ - You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
42
+ - You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
43
+ - You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
44
+ - You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
45
+ - You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
46
+ - You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
47
+ - You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
48
+ - You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
49
+ - You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
50
+ - You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
51
+ - You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
52
+ - You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
53
+ - You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
54
+ - You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
55
+
56
+ */
57
+ -- AlterTable
58
+ ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
59
+ MODIFY `updatedAt` TIMESTAMP NULL;
60
+
61
+ -- AlterTable
62
+ ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
63
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
64
+
65
+ -- AlterTable
66
+ ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
67
+ MODIFY `updatedAt` TIMESTAMP NULL;
68
+
69
+ -- AlterTable
70
+ ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
71
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
72
+
73
+ -- AlterTable
74
+ ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
75
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
76
+
77
+ -- AlterTable
78
+ ALTER TABLE `Flowise` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
79
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
80
+
81
+ -- AlterTable
82
+ ALTER TABLE `FlowiseSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
83
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
84
+
85
+ -- AlterTable
86
+ ALTER TABLE `GenericBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
87
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
88
+
89
+ -- AlterTable
90
+ ALTER TABLE `GenericSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
91
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
92
+
93
+ -- AlterTable
94
+ ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
95
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
96
+ MODIFY `updatedAt` TIMESTAMP NULL;
97
+
98
+ -- AlterTable
99
+ ALTER TABLE `IntegrationSession` ADD COLUMN `type` VARCHAR(100) NULL,
100
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
101
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
102
+
103
+ -- AlterTable
104
+ ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
105
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
106
+
107
+ -- AlterTable
108
+ ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
109
+
110
+ -- AlterTable
111
+ ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
112
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
113
+
114
+ -- AlterTable
115
+ ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
116
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
117
+
118
+ -- AlterTable
119
+ ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
120
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
121
+
122
+ -- AlterTable
123
+ ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
124
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
125
+
126
+ -- AlterTable
127
+ ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
128
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
129
+
130
+ -- AlterTable
131
+ ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
132
+
133
+ -- AlterTable
134
+ ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
135
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
136
+
137
+ -- AlterTable
138
+ ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
139
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
140
+
141
+ -- AlterTable
142
+ ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
143
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
144
+
145
+ -- AlterTable
146
+ ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
147
+ MODIFY `updatedAt` TIMESTAMP NULL;
148
+
149
+ -- AlterTable
150
+ ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
151
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
152
+
153
+ -- AlterTable
154
+ ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
155
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
156
+
157
+ -- AlterTable
158
+ ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
159
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
prisma/mysql-migrations/20240825131301_change_to_evolution_bot/migration.sql ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
5
+ - You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
6
+ - You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
7
+ - You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
8
+ - You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
9
+ - You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
10
+ - You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
11
+ - You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
12
+ - You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
13
+ - You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
14
+ - You are about to alter the column `createdAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
15
+ - You are about to alter the column `updatedAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
16
+ - You are about to alter the column `createdAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
17
+ - You are about to alter the column `updatedAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
18
+ - You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
19
+ - You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
20
+ - You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
21
+ - You are about to alter the column `createdAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
22
+ - You are about to alter the column `updatedAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
23
+ - You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
24
+ - You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
25
+ - You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
26
+ - You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
27
+ - You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
28
+ - You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
29
+ - You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
30
+ - You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
31
+ - You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
32
+ - You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
33
+ - You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
34
+ - You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
35
+ - You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
36
+ - You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
37
+ - You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
38
+ - You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
39
+ - You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
40
+ - You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
41
+ - You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
42
+ - You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
43
+ - You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
44
+ - You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
45
+ - You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
46
+ - You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
47
+ - You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
48
+ - You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
49
+ - You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
50
+ - You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
51
+ - You are about to drop the `GenericBot` table. If the table is not empty, all the data it contains will be lost.
52
+ - You are about to drop the `GenericSetting` table. If the table is not empty, all the data it contains will be lost.
53
+
54
+ */
55
+ -- DropForeignKey
56
+ ALTER TABLE `GenericBot` DROP FOREIGN KEY `GenericBot_instanceId_fkey`;
57
+
58
+ -- DropForeignKey
59
+ ALTER TABLE `GenericSetting` DROP FOREIGN KEY `GenericSetting_botIdFallback_fkey`;
60
+
61
+ -- DropForeignKey
62
+ ALTER TABLE `GenericSetting` DROP FOREIGN KEY `GenericSetting_instanceId_fkey`;
63
+
64
+ -- AlterTable
65
+ ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
66
+ MODIFY `updatedAt` TIMESTAMP NULL;
67
+
68
+ -- AlterTable
69
+ ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
70
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
71
+
72
+ -- AlterTable
73
+ ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
74
+ MODIFY `updatedAt` TIMESTAMP NULL;
75
+
76
+ -- AlterTable
77
+ ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
78
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
79
+
80
+ -- AlterTable
81
+ ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
82
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
83
+
84
+ -- AlterTable
85
+ ALTER TABLE `Flowise` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
86
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
87
+
88
+ -- AlterTable
89
+ ALTER TABLE `FlowiseSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
90
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
91
+
92
+ -- AlterTable
93
+ ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
94
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
95
+ MODIFY `updatedAt` TIMESTAMP NULL;
96
+
97
+ -- AlterTable
98
+ ALTER TABLE `IntegrationSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
99
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
100
+
101
+ -- AlterTable
102
+ ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
103
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
104
+
105
+ -- AlterTable
106
+ ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
107
+
108
+ -- AlterTable
109
+ ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
110
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
111
+
112
+ -- AlterTable
113
+ ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
114
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
115
+
116
+ -- AlterTable
117
+ ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
118
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
119
+
120
+ -- AlterTable
121
+ ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
122
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
123
+
124
+ -- AlterTable
125
+ ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
126
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
127
+
128
+ -- AlterTable
129
+ ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
130
+
131
+ -- AlterTable
132
+ ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
133
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
134
+
135
+ -- AlterTable
136
+ ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
137
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
138
+
139
+ -- AlterTable
140
+ ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
141
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
142
+
143
+ -- AlterTable
144
+ ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
145
+ MODIFY `updatedAt` TIMESTAMP NULL;
146
+
147
+ -- AlterTable
148
+ ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
149
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
150
+
151
+ -- AlterTable
152
+ ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
153
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
154
+
155
+ -- AlterTable
156
+ ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
157
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
158
+
159
+ -- DropTable
160
+ DROP TABLE `GenericBot`;
161
+
162
+ -- DropTable
163
+ DROP TABLE `GenericSetting`;
164
+
165
+ -- CreateTable
166
+ CREATE TABLE `EvolutionBot` (
167
+ `id` VARCHAR(191) NOT NULL,
168
+ `enabled` BOOLEAN NOT NULL DEFAULT true,
169
+ `description` VARCHAR(255) NULL,
170
+ `apiUrl` VARCHAR(255) NULL,
171
+ `apiKey` VARCHAR(255) NULL,
172
+ `expire` INTEGER NULL DEFAULT 0,
173
+ `keywordFinish` VARCHAR(100) NULL,
174
+ `delayMessage` INTEGER NULL,
175
+ `unknownMessage` VARCHAR(100) NULL,
176
+ `listeningFromMe` BOOLEAN NULL DEFAULT false,
177
+ `stopBotFromMe` BOOLEAN NULL DEFAULT false,
178
+ `keepOpen` BOOLEAN NULL DEFAULT false,
179
+ `debounceTime` INTEGER NULL,
180
+ `ignoreJids` JSON NULL,
181
+ `triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL,
182
+ `triggerOperator` ENUM('contains', 'equals', 'startsWith', 'endsWith', 'regex') NULL,
183
+ `triggerValue` VARCHAR(191) NULL,
184
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
185
+ `updatedAt` TIMESTAMP NOT NULL,
186
+ `instanceId` VARCHAR(191) NOT NULL,
187
+
188
+ PRIMARY KEY (`id`)
189
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
190
+
191
+ -- CreateTable
192
+ CREATE TABLE `EvolutionBotSetting` (
193
+ `id` VARCHAR(191) NOT NULL,
194
+ `expire` INTEGER NULL DEFAULT 0,
195
+ `keywordFinish` VARCHAR(100) NULL,
196
+ `delayMessage` INTEGER NULL,
197
+ `unknownMessage` VARCHAR(100) NULL,
198
+ `listeningFromMe` BOOLEAN NULL DEFAULT false,
199
+ `stopBotFromMe` BOOLEAN NULL DEFAULT false,
200
+ `keepOpen` BOOLEAN NULL DEFAULT false,
201
+ `debounceTime` INTEGER NULL,
202
+ `ignoreJids` JSON NULL,
203
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
204
+ `updatedAt` TIMESTAMP NOT NULL,
205
+ `botIdFallback` VARCHAR(100) NULL,
206
+ `instanceId` VARCHAR(191) NOT NULL,
207
+
208
+ UNIQUE INDEX `EvolutionBotSetting_instanceId_key`(`instanceId`),
209
+ PRIMARY KEY (`id`)
210
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
211
+
212
+ -- AddForeignKey
213
+ ALTER TABLE `EvolutionBot` ADD CONSTRAINT `EvolutionBot_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
214
+
215
+ -- AddForeignKey
216
+ ALTER TABLE `EvolutionBotSetting` ADD CONSTRAINT `EvolutionBotSetting_botIdFallback_fkey` FOREIGN KEY (`botIdFallback`) REFERENCES `EvolutionBot`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
217
+
218
+ -- AddForeignKey
219
+ ALTER TABLE `EvolutionBotSetting` ADD CONSTRAINT `EvolutionBotSetting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
prisma/mysql-migrations/20241001172800_add_message_status/migration.sql ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
5
+ - You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
6
+ - You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
7
+ - You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
8
+ - You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
9
+ - You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
10
+ - You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
11
+ - You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
12
+ - You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
13
+ - You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
14
+ - You are about to alter the column `createdAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
15
+ - You are about to alter the column `updatedAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
16
+ - You are about to alter the column `createdAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
17
+ - You are about to alter the column `updatedAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
18
+ - You are about to alter the column `createdAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
19
+ - You are about to alter the column `updatedAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
20
+ - You are about to alter the column `createdAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
21
+ - You are about to alter the column `updatedAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
22
+ - You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
23
+ - You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
24
+ - You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
25
+ - You are about to alter the column `createdAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
26
+ - You are about to alter the column `updatedAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
27
+ - You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
28
+ - You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
29
+ - You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
30
+ - You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
31
+ - You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
32
+ - You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
33
+ - You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
34
+ - You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
35
+ - You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
36
+ - You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
37
+ - You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
38
+ - You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
39
+ - You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
40
+ - You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
41
+ - You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
42
+ - You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
43
+ - You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
44
+ - You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
45
+ - You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
46
+ - You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
47
+ - You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
48
+ - You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
49
+ - You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
50
+ - You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
51
+ - You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
52
+ - You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
53
+ - You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
54
+ - You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
55
+
56
+ */
57
+ -- AlterTable
58
+ ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
59
+ MODIFY `updatedAt` TIMESTAMP NULL;
60
+
61
+ -- AlterTable
62
+ ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
63
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
64
+
65
+ -- AlterTable
66
+ ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
67
+ MODIFY `updatedAt` TIMESTAMP NULL;
68
+
69
+ -- AlterTable
70
+ ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
71
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
72
+
73
+ -- AlterTable
74
+ ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
75
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
76
+
77
+ -- AlterTable
78
+ ALTER TABLE `EvolutionBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
79
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
80
+
81
+ -- AlterTable
82
+ ALTER TABLE `EvolutionBotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
83
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
84
+
85
+ -- AlterTable
86
+ ALTER TABLE `Flowise` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
87
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
88
+
89
+ -- AlterTable
90
+ ALTER TABLE `FlowiseSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
91
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
92
+
93
+ -- AlterTable
94
+ ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
95
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
96
+ MODIFY `updatedAt` TIMESTAMP NULL;
97
+
98
+ -- AlterTable
99
+ ALTER TABLE `IntegrationSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
100
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
101
+
102
+ -- AlterTable
103
+ ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
104
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
105
+
106
+ -- AlterTable
107
+ ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
108
+
109
+ -- AlterTable
110
+ ALTER TABLE `Message` ADD COLUMN `status` INTEGER NULL;
111
+
112
+ -- AlterTable
113
+ ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
114
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
115
+
116
+ -- AlterTable
117
+ ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
118
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
119
+
120
+ -- AlterTable
121
+ ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
122
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
123
+
124
+ -- AlterTable
125
+ ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
126
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
127
+
128
+ -- AlterTable
129
+ ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
130
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
131
+
132
+ -- AlterTable
133
+ ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
134
+
135
+ -- AlterTable
136
+ ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
137
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
138
+
139
+ -- AlterTable
140
+ ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
141
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
142
+
143
+ -- AlterTable
144
+ ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
145
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
146
+
147
+ -- AlterTable
148
+ ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
149
+ MODIFY `updatedAt` TIMESTAMP NULL;
150
+
151
+ -- AlterTable
152
+ ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
153
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
154
+
155
+ -- AlterTable
156
+ ALTER TABLE `Webhook` ADD COLUMN `headers` JSON NULL,
157
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
158
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
159
+
160
+ -- AlterTable
161
+ ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
162
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
163
+
164
+ -- CreateTable
165
+ CREATE TABLE `IsOnWhatsapp` (
166
+ `id` VARCHAR(191) NOT NULL,
167
+ `remoteJid` VARCHAR(100) NOT NULL,
168
+ `jidOptions` VARCHAR(191) NOT NULL,
169
+ `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
170
+ `updatedAt` TIMESTAMP NOT NULL,
171
+
172
+ UNIQUE INDEX `IsOnWhatsapp_remoteJid_key`(`remoteJid`),
173
+ PRIMARY KEY (`id`)
174
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
prisma/mysql-migrations/20241108101333_fix_message_status_as_string/migration.sql ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
5
+ - You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
6
+ - You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
7
+ - You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
8
+ - You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
9
+ - You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
10
+ - You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
11
+ - You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
12
+ - You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
13
+ - You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
14
+ - You are about to alter the column `createdAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
15
+ - You are about to alter the column `updatedAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
16
+ - You are about to alter the column `createdAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
17
+ - You are about to alter the column `updatedAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
18
+ - You are about to alter the column `createdAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
19
+ - You are about to alter the column `updatedAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
20
+ - You are about to alter the column `createdAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
21
+ - You are about to alter the column `updatedAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
22
+ - You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
23
+ - You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
24
+ - You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
25
+ - You are about to alter the column `createdAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
26
+ - You are about to alter the column `updatedAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
27
+ - You are about to alter the column `createdAt` on the `IsOnWhatsapp` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
28
+ - You are about to alter the column `updatedAt` on the `IsOnWhatsapp` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
29
+ - You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
30
+ - You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
31
+ - You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
32
+ - You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
33
+ - You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
34
+ - You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
35
+ - You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
36
+ - You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
37
+ - You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
38
+ - You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
39
+ - You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
40
+ - You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
41
+ - You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
42
+ - You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
43
+ - You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
44
+ - You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
45
+ - You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
46
+ - You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
47
+ - You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
48
+ - You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
49
+ - You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
50
+ - You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
51
+ - You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
52
+ - You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
53
+ - You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
54
+ - You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
55
+ - You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
56
+ - You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
57
+
58
+ */
59
+ -- AlterTable
60
+ ALTER TABLE `Chat` ADD COLUMN `unreadMessages` INTEGER NOT NULL DEFAULT 0,
61
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
62
+ MODIFY `updatedAt` TIMESTAMP NULL;
63
+
64
+ -- AlterTable
65
+ ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
66
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
67
+
68
+ -- AlterTable
69
+ ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
70
+ MODIFY `updatedAt` TIMESTAMP NULL;
71
+
72
+ -- AlterTable
73
+ ALTER TABLE `Dify` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
74
+ ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
75
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
76
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
77
+
78
+ -- AlterTable
79
+ ALTER TABLE `DifySetting` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
80
+ ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
81
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
82
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
83
+
84
+ -- AlterTable
85
+ ALTER TABLE `EvolutionBot` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
86
+ ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
87
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
88
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
89
+
90
+ -- AlterTable
91
+ ALTER TABLE `EvolutionBotSetting` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
92
+ ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
93
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
94
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
95
+
96
+ -- AlterTable
97
+ ALTER TABLE `Flowise` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
98
+ ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
99
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
100
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
101
+
102
+ -- AlterTable
103
+ ALTER TABLE `FlowiseSetting` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
104
+ ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
105
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
106
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
107
+
108
+ -- AlterTable
109
+ ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
110
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
111
+ MODIFY `updatedAt` TIMESTAMP NULL;
112
+
113
+ -- AlterTable
114
+ ALTER TABLE `IntegrationSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
115
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
116
+
117
+ -- AlterTable
118
+ ALTER TABLE `IsOnWhatsapp` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
119
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
120
+
121
+ -- AlterTable
122
+ ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
123
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
124
+
125
+ -- AlterTable
126
+ ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
127
+
128
+ -- AlterTable
129
+ ALTER TABLE `Message` MODIFY `status` VARCHAR(30) NULL;
130
+
131
+ -- AlterTable
132
+ ALTER TABLE `OpenaiBot` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
133
+ ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
134
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
135
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
136
+
137
+ -- AlterTable
138
+ ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
139
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
140
+
141
+ -- AlterTable
142
+ ALTER TABLE `OpenaiSetting` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
143
+ ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
144
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
145
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
146
+
147
+ -- AlterTable
148
+ ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
149
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
150
+
151
+ -- AlterTable
152
+ ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
153
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
154
+
155
+ -- AlterTable
156
+ ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
157
+
158
+ -- AlterTable
159
+ ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
160
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
161
+
162
+ -- AlterTable
163
+ ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
164
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
165
+
166
+ -- AlterTable
167
+ ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
168
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
169
+
170
+ -- AlterTable
171
+ ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
172
+ MODIFY `updatedAt` TIMESTAMP NULL;
173
+
174
+ -- AlterTable
175
+ ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
176
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
177
+
178
+ -- AlterTable
179
+ ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
180
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
181
+
182
+ -- AlterTable
183
+ ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
184
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
185
+
186
+ -- CreateTable
187
+ CREATE TABLE `Pusher` (
188
+ `id` VARCHAR(191) NOT NULL,
189
+ `enabled` BOOLEAN NOT NULL DEFAULT false,
190
+ `appId` VARCHAR(100) NOT NULL,
191
+ `key` VARCHAR(100) NOT NULL,
192
+ `secret` VARCHAR(100) NOT NULL,
193
+ `cluster` VARCHAR(100) NOT NULL,
194
+ `useTLS` BOOLEAN NOT NULL DEFAULT false,
195
+ `events` JSON NOT NULL,
196
+ `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
197
+ `updatedAt` TIMESTAMP NOT NULL,
198
+ `instanceId` VARCHAR(191) NOT NULL,
199
+
200
+ UNIQUE INDEX `Pusher_instanceId_key`(`instanceId`),
201
+ PRIMARY KEY (`id`)
202
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
203
+
204
+ -- CreateIndex
205
+ CREATE INDEX `Chat_remoteJid_idx` ON `Chat`(`remoteJid`);
206
+
207
+ -- CreateIndex
208
+ CREATE INDEX `Contact_remoteJid_idx` ON `Contact`(`remoteJid`);
209
+
210
+ -- CreateIndex
211
+ CREATE INDEX `Setting_instanceId_idx` ON `Setting`(`instanceId`);
212
+
213
+ -- CreateIndex
214
+ CREATE INDEX `Webhook_instanceId_idx` ON `Webhook`(`instanceId`);
215
+
216
+ -- AddForeignKey
217
+ ALTER TABLE `Pusher` ADD CONSTRAINT `Pusher_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
218
+
219
+ -- RenameIndex
220
+ ALTER TABLE `Chat` RENAME INDEX `Chat_instanceId_fkey` TO `Chat_instanceId_idx`;
221
+
222
+ -- RenameIndex
223
+ ALTER TABLE `Contact` RENAME INDEX `Contact_instanceId_fkey` TO `Contact_instanceId_idx`;
224
+
225
+ -- RenameIndex
226
+ ALTER TABLE `Message` RENAME INDEX `Message_instanceId_fkey` TO `Message_instanceId_idx`;
227
+
228
+ -- RenameIndex
229
+ ALTER TABLE `MessageUpdate` RENAME INDEX `MessageUpdate_instanceId_fkey` TO `MessageUpdate_instanceId_idx`;
230
+
231
+ -- RenameIndex
232
+ ALTER TABLE `MessageUpdate` RENAME INDEX `MessageUpdate_messageId_fkey` TO `MessageUpdate_messageId_idx`;
prisma/mysql-migrations/20250214181954_add_wavoip_token_column/migration.sql ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
5
+ - You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
6
+ - You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
7
+ - You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
8
+ - You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
9
+ - You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
10
+ - You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
11
+ - You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
12
+ - You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
13
+ - You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
14
+ - You are about to alter the column `createdAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
15
+ - You are about to alter the column `updatedAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
16
+ - You are about to alter the column `createdAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
17
+ - You are about to alter the column `updatedAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
18
+ - You are about to alter the column `createdAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
19
+ - You are about to alter the column `updatedAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
20
+ - You are about to alter the column `createdAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
21
+ - You are about to alter the column `updatedAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
22
+ - You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
23
+ - You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
24
+ - You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
25
+ - You are about to alter the column `createdAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
26
+ - You are about to alter the column `updatedAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
27
+ - You are about to alter the column `createdAt` on the `IsOnWhatsapp` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
28
+ - You are about to alter the column `updatedAt` on the `IsOnWhatsapp` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
29
+ - You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
30
+ - You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
31
+ - You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
32
+ - You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
33
+ - You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
34
+ - You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
35
+ - You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
36
+ - You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
37
+ - You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
38
+ - You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
39
+ - You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
40
+ - You are about to alter the column `createdAt` on the `Pusher` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
41
+ - You are about to alter the column `updatedAt` on the `Pusher` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
42
+ - You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
43
+ - You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
44
+ - You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
45
+ - You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
46
+ - You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
47
+ - You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
48
+ - You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
49
+ - You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
50
+ - You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
51
+ - You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
52
+ - You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
53
+ - You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
54
+ - You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
55
+ - You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
56
+ - You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
57
+ - You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
58
+ - You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
59
+ - A unique constraint covering the columns `[instanceId,remoteJid]` on the table `Chat` will be added. If there are existing duplicate values, this will fail.
60
+
61
+ */
62
+ -- AlterTable
63
+ ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
64
+ MODIFY `updatedAt` TIMESTAMP NULL;
65
+
66
+ -- AlterTable
67
+ ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
68
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
69
+
70
+ -- AlterTable
71
+ ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
72
+ MODIFY `updatedAt` TIMESTAMP NULL;
73
+
74
+ -- AlterTable
75
+ ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
76
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
77
+
78
+ -- AlterTable
79
+ ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
80
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
81
+
82
+ -- AlterTable
83
+ ALTER TABLE `EvolutionBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
84
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
85
+
86
+ -- AlterTable
87
+ ALTER TABLE `EvolutionBotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
88
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
89
+
90
+ -- AlterTable
91
+ ALTER TABLE `Flowise` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
92
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
93
+
94
+ -- AlterTable
95
+ ALTER TABLE `FlowiseSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
96
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
97
+
98
+ -- AlterTable
99
+ ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
100
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
101
+ MODIFY `updatedAt` TIMESTAMP NULL;
102
+
103
+ -- AlterTable
104
+ ALTER TABLE `IntegrationSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
105
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
106
+
107
+ -- AlterTable
108
+ ALTER TABLE `IsOnWhatsapp` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
109
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
110
+
111
+ -- AlterTable
112
+ ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
113
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
114
+
115
+ -- AlterTable
116
+ ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
117
+
118
+ -- AlterTable
119
+ ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
120
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
121
+
122
+ -- AlterTable
123
+ ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
124
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
125
+
126
+ -- AlterTable
127
+ ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
128
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
129
+
130
+ -- AlterTable
131
+ ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
132
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
133
+
134
+ -- AlterTable
135
+ ALTER TABLE `Pusher` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
136
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
137
+
138
+ -- AlterTable
139
+ ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
140
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
141
+
142
+ -- AlterTable
143
+ ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
144
+
145
+ -- AlterTable
146
+ ALTER TABLE `Setting` ADD COLUMN `wavoipToken` VARCHAR(100) NULL,
147
+ MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
148
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
149
+
150
+ -- AlterTable
151
+ ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
152
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
153
+
154
+ -- AlterTable
155
+ ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
156
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
157
+
158
+ -- AlterTable
159
+ ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
160
+ MODIFY `updatedAt` TIMESTAMP NULL;
161
+
162
+ -- AlterTable
163
+ ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
164
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
165
+
166
+ -- AlterTable
167
+ ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
168
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
169
+
170
+ -- AlterTable
171
+ ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
172
+ MODIFY `updatedAt` TIMESTAMP NOT NULL;
173
+
174
+ -- CreateIndex
175
+ CREATE UNIQUE INDEX `Chat_instanceId_remoteJid_key` ON `Chat`(`instanceId`, `remoteJid`);
prisma/mysql-migrations/20250225180031_add_nats_integration/migration.sql ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -- CreateTable
2
+ CREATE TABLE `Nats` (
3
+ `id` VARCHAR(191) NOT NULL,
4
+ `enabled` BOOLEAN NOT NULL DEFAULT false,
5
+ `events` JSON NOT NULL,
6
+ `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
7
+ `updatedAt` TIMESTAMP NOT NULL,
8
+ `instanceId` VARCHAR(191) NOT NULL,
9
+
10
+ PRIMARY KEY (`id`)
11
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
12
+
13
+ -- CreateIndex
14
+ CREATE UNIQUE INDEX `Nats_instanceId_key` ON `Nats`(`instanceId`);
15
+
16
+ -- AddForeignKey
17
+ ALTER TABLE `Nats` ADD CONSTRAINT `Nats_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
prisma/mysql-migrations/20250510035200_add_wavoip_token_to_settings_table/migration.sql ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+
4
+ - A unique constraint covering the columns `[remoteJid,instanceId]` on the table `Chat` will be added. If there are existing duplicate values, this will fail.
5
+
6
+ */
7
+
8
+ -- AlterTable
9
+ SET @column_exists := (
10
+ SELECT COUNT(*)
11
+ FROM information_schema.columns
12
+ WHERE table_schema = DATABASE()
13
+ AND table_name = 'Setting'
14
+ AND column_name = 'wavoipToken'
15
+ );
16
+
17
+ SET @sql := IF(@column_exists = 0,
18
+ 'ALTER TABLE Setting ADD COLUMN wavoipToken VARCHAR(100);',
19
+ 'SELECT "Column already exists";'
20
+ );
21
+
22
+ PREPARE stmt FROM @sql;
23
+ EXECUTE stmt;
24
+ DEALLOCATE PREPARE stmt;
25
+
26
+ ALTER TABLE Chat ADD CONSTRAINT unique_remote_instance UNIQUE (remoteJid, instanceId);
prisma/mysql-migrations/20250514232744_add_n8n_table/migration.sql ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -- CreateTable
2
+ CREATE TABLE `N8n` (
3
+ `id` VARCHAR(191) NOT NULL,
4
+ `enabled` BOOLEAN NOT NULL DEFAULT true,
5
+ `description` VARCHAR(255),
6
+ `webhookUrl` VARCHAR(255),
7
+ `basicAuthUser` VARCHAR(255),
8
+ `basicAuthPass` VARCHAR(255),
9
+ `expire` INTEGER DEFAULT 0,
10
+ `keywordFinish` VARCHAR(100),
11
+ `delayMessage` INTEGER,
12
+ `unknownMessage` VARCHAR(100),
13
+ `listeningFromMe` BOOLEAN DEFAULT false,
14
+ `stopBotFromMe` BOOLEAN DEFAULT false,
15
+ `keepOpen` BOOLEAN DEFAULT false,
16
+ `debounceTime` INTEGER,
17
+ `ignoreJids` JSON,
18
+ `splitMessages` BOOLEAN DEFAULT false,
19
+ `timePerChar` INTEGER DEFAULT 50,
20
+ `triggerType` ENUM('all', 'keyword', 'none') NULL,
21
+ `triggerOperator` ENUM('contains', 'equals', 'startsWith', 'endsWith', 'regex') NULL,
22
+ `triggerValue` VARCHAR(191) NULL,
23
+ `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
24
+ `updatedAt` TIMESTAMP NOT NULL,
25
+ `instanceId` VARCHAR(191) NOT NULL,
26
+
27
+ PRIMARY KEY (`id`)
28
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
29
+
30
+ -- CreateTable
31
+ CREATE TABLE `N8nSetting` (
32
+ `id` VARCHAR(191) NOT NULL,
33
+ `expire` INTEGER DEFAULT 0,
34
+ `keywordFinish` VARCHAR(100),
35
+ `delayMessage` INTEGER,
36
+ `unknownMessage` VARCHAR(100),
37
+ `listeningFromMe` BOOLEAN DEFAULT false,
38
+ `stopBotFromMe` BOOLEAN DEFAULT false,
39
+ `keepOpen` BOOLEAN DEFAULT false,
40
+ `debounceTime` INTEGER,
41
+ `ignoreJids` JSON,
42
+ `splitMessages` BOOLEAN DEFAULT false,
43
+ `timePerChar` INTEGER DEFAULT 50,
44
+ `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
45
+ `updatedAt` TIMESTAMP NOT NULL,
46
+ `n8nIdFallback` VARCHAR(100),
47
+ `instanceId` VARCHAR(191) NOT NULL,
48
+
49
+ PRIMARY KEY (`id`)
50
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
51
+
52
+ -- CreateIndex
53
+ CREATE UNIQUE INDEX `N8nSetting_instanceId_key` ON `N8nSetting`(`instanceId`);
54
+
55
+ -- AddForeignKey
56
+ ALTER TABLE `N8n` ADD CONSTRAINT `N8n_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
57
+
58
+ -- AddForeignKey
59
+ ALTER TABLE `N8nSetting` ADD CONSTRAINT `N8nSetting_n8nIdFallback_fkey` FOREIGN KEY (`n8nIdFallback`) REFERENCES `N8n`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
60
+
61
+ -- AddForeignKey
62
+ ALTER TABLE `N8nSetting` ADD CONSTRAINT `N8nSetting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
prisma/mysql-migrations/20250515211815_add_evoai_table/migration.sql ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -- CreateTable
2
+ CREATE TABLE `Evoai` (
3
+ `id` VARCHAR(191) NOT NULL,
4
+ `enabled` BOOLEAN NOT NULL DEFAULT true,
5
+ `description` VARCHAR(255),
6
+ `agentUrl` VARCHAR(255),
7
+ `apiKey` VARCHAR(255),
8
+ `expire` INTEGER DEFAULT 0,
9
+ `keywordFinish` VARCHAR(100),
10
+ `delayMessage` INTEGER,
11
+ `unknownMessage` VARCHAR(100),
12
+ `listeningFromMe` BOOLEAN DEFAULT false,
13
+ `stopBotFromMe` BOOLEAN DEFAULT false,
14
+ `keepOpen` BOOLEAN DEFAULT false,
15
+ `debounceTime` INTEGER,
16
+ `ignoreJids` JSON,
17
+ `splitMessages` BOOLEAN DEFAULT false,
18
+ `timePerChar` INTEGER DEFAULT 50,
19
+ `triggerType` ENUM('all', 'keyword', 'none') NULL,
20
+ `triggerOperator` ENUM('contains', 'equals', 'startsWith', 'endsWith', 'regex') NULL,
21
+ `triggerValue` VARCHAR(191) NULL,
22
+ `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
23
+ `updatedAt` TIMESTAMP NOT NULL,
24
+ `instanceId` VARCHAR(191) NOT NULL,
25
+
26
+ PRIMARY KEY (`id`)
27
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
28
+
29
+ -- CreateTable
30
+ CREATE TABLE `EvoaiSetting` (
31
+ `id` VARCHAR(191) NOT NULL,
32
+ `expire` INTEGER DEFAULT 0,
33
+ `keywordFinish` VARCHAR(100),
34
+ `delayMessage` INTEGER,
35
+ `unknownMessage` VARCHAR(100),
36
+ `listeningFromMe` BOOLEAN DEFAULT false,
37
+ `stopBotFromMe` BOOLEAN DEFAULT false,
38
+ `keepOpen` BOOLEAN DEFAULT false,
39
+ `debounceTime` INTEGER,
40
+ `ignoreJids` JSON,
41
+ `splitMessages` BOOLEAN DEFAULT false,
42
+ `timePerChar` INTEGER DEFAULT 50,
43
+ `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
44
+ `updatedAt` TIMESTAMP NOT NULL,
45
+ `evoaiIdFallback` VARCHAR(100),
46
+ `instanceId` VARCHAR(191) NOT NULL,
47
+
48
+ PRIMARY KEY (`id`)
49
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
50
+
51
+ -- CreateIndex
52
+ CREATE UNIQUE INDEX `EvoaiSetting_instanceId_key` ON `EvoaiSetting`(`instanceId`);
53
+
54
+ -- AddForeignKey
55
+ ALTER TABLE `Evoai` ADD CONSTRAINT `Evoai_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
56
+
57
+ -- AddForeignKey
58
+ ALTER TABLE `EvoaiSetting` ADD CONSTRAINT `EvoaiSetting_evoaiIdFallback_fkey` FOREIGN KEY (`evoaiIdFallback`) REFERENCES `Evoai`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
59
+
60
+ -- AddForeignKey
61
+ ALTER TABLE `EvoaiSetting` ADD CONSTRAINT `EvoaiSetting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
prisma/mysql-migrations/20250516012152_remove_unique_atribute_for_file_name_in_media/migration.sql ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ -- DropIndex
2
+ ALTER TABLE `Media` DROP INDEX `Media_fileName_key`;
prisma/mysql-migrations/20250612155048_add_coluns_trypebot_tables/migration.sql ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ -- AlterTable
2
+ ALTER TABLE `Typebot` ADD COLUMN `splitMessages` BOOLEAN DEFAULT false,
3
+ ADD COLUMN `timePerChar` INTEGER DEFAULT 50;
4
+
5
+ -- AlterTable
6
+ ALTER TABLE `TypebotSetting` ADD COLUMN `splitMessages` BOOLEAN DEFAULT false,
7
+ ADD COLUMN `timePerChar` INTEGER DEFAULT 50;
prisma/mysql-migrations/20250613143000_add_lid_column_to_is_onwhatsapp/migration.sql ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ -- AlterTable
2
+ ALTER TABLE `IsOnWhatsapp` ADD COLUMN `lid` VARCHAR(100);
prisma/mysql-migrations/migration_lock.toml ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Please do not edit this file manually
2
+ # It should be added in your version-control system (e.g., Git)
3
+ provider = "mysql"
prisma/mysql-schema.prisma ADDED
@@ -0,0 +1,743 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // This is your Prisma schema file,
2
+ // learn more about it in the docs: https://pris.ly/d/prisma-schema
3
+
4
+ // Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
5
+ // Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
6
+
7
+ generator client {
8
+ provider = "prisma-client-js"
9
+ }
10
+
11
+ datasource db {
12
+ provider = "mysql"
13
+ url = env("DATABASE_CONNECTION_URI")
14
+ }
15
+
16
+ enum InstanceConnectionStatus {
17
+ open
18
+ close
19
+ connecting
20
+ }
21
+
22
+ enum DeviceMessage {
23
+ ios
24
+ android
25
+ web
26
+ unknown
27
+ desktop
28
+ }
29
+
30
+ enum SessionStatus {
31
+ opened
32
+ closed
33
+ paused
34
+ }
35
+
36
+ enum TriggerType {
37
+ all
38
+ keyword
39
+ none
40
+ advanced
41
+ }
42
+
43
+ enum TriggerOperator {
44
+ contains
45
+ equals
46
+ startsWith
47
+ endsWith
48
+ regex
49
+ }
50
+
51
+ enum OpenaiBotType {
52
+ assistant
53
+ chatCompletion
54
+ }
55
+
56
+ enum DifyBotType {
57
+ chatBot
58
+ textGenerator
59
+ agent
60
+ workflow
61
+ }
62
+
63
+ model Instance {
64
+ id String @id @default(cuid())
65
+ name String @unique @db.VarChar(255)
66
+ connectionStatus InstanceConnectionStatus @default(open)
67
+ ownerJid String? @db.VarChar(100)
68
+ profileName String? @db.VarChar(100)
69
+ profilePicUrl String? @db.VarChar(500)
70
+ integration String? @db.VarChar(100)
71
+ number String? @db.VarChar(100)
72
+ businessId String? @db.VarChar(100)
73
+ token String? @db.VarChar(255)
74
+ clientName String? @db.VarChar(100)
75
+ disconnectionReasonCode Int? @db.Int
76
+ disconnectionObject Json? @db.Json
77
+ disconnectionAt DateTime? @db.Timestamp
78
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
79
+ updatedAt DateTime? @updatedAt @db.Timestamp
80
+ Chat Chat[]
81
+ Contact Contact[]
82
+ Message Message[]
83
+ Webhook Webhook?
84
+ Chatwoot Chatwoot?
85
+ Label Label[]
86
+ Proxy Proxy?
87
+ Setting Setting?
88
+ Rabbitmq Rabbitmq?
89
+ Nats Nats?
90
+ Sqs Sqs?
91
+ Websocket Websocket?
92
+ Typebot Typebot[]
93
+ Session Session?
94
+ MessageUpdate MessageUpdate[]
95
+ TypebotSetting TypebotSetting?
96
+ Media Media[]
97
+ OpenaiCreds OpenaiCreds[]
98
+ OpenaiBot OpenaiBot[]
99
+ OpenaiSetting OpenaiSetting?
100
+ Template Template[]
101
+ Dify Dify[]
102
+ DifySetting DifySetting?
103
+ IntegrationSession IntegrationSession[]
104
+ EvolutionBot EvolutionBot[]
105
+ EvolutionBotSetting EvolutionBotSetting?
106
+ Flowise Flowise[]
107
+ FlowiseSetting FlowiseSetting?
108
+ Pusher Pusher?
109
+ N8n N8n[]
110
+ }
111
+
112
+ model Session {
113
+ id String @id @default(cuid())
114
+ sessionId String @unique
115
+ creds String? @db.Text
116
+ createdAt DateTime @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
117
+ Instance Instance @relation(fields: [sessionId], references: [id], onDelete: Cascade)
118
+ }
119
+
120
+ model Chat {
121
+ id String @id @default(cuid())
122
+ remoteJid String @db.VarChar(100)
123
+ name String? @db.VarChar(100)
124
+ labels Json? @db.Json
125
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
126
+ updatedAt DateTime? @updatedAt @db.Timestamp
127
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
128
+ instanceId String
129
+ unreadMessages Int @default(0)
130
+
131
+ @@unique([instanceId, remoteJid])
132
+ @@index([instanceId])
133
+ @@index([remoteJid])
134
+ }
135
+
136
+ model Contact {
137
+ id String @id @default(cuid())
138
+ remoteJid String @db.VarChar(100)
139
+ pushName String? @db.VarChar(100)
140
+ profilePicUrl String? @db.VarChar(500)
141
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
142
+ updatedAt DateTime? @updatedAt @db.Timestamp
143
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
144
+ instanceId String
145
+
146
+ @@unique([remoteJid, instanceId])
147
+ @@index([remoteJid])
148
+ @@index([instanceId])
149
+ }
150
+
151
+ model Message {
152
+ id String @id @default(cuid())
153
+ key Json @db.Json
154
+ pushName String? @db.VarChar(100)
155
+ participant String? @db.VarChar(100)
156
+ messageType String @db.VarChar(100)
157
+ message Json @db.Json
158
+ contextInfo Json? @db.Json
159
+ source DeviceMessage
160
+ messageTimestamp Int @db.Int
161
+ chatwootMessageId Int? @db.Int
162
+ chatwootInboxId Int? @db.Int
163
+ chatwootConversationId Int? @db.Int
164
+ chatwootContactInboxSourceId String? @db.VarChar(100)
165
+ chatwootIsRead Boolean? @default(false)
166
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
167
+ instanceId String
168
+ typebotSessionId String?
169
+ MessageUpdate MessageUpdate[]
170
+ Media Media?
171
+ webhookUrl String? @db.VarChar(500)
172
+ status String? @db.VarChar(30)
173
+
174
+ sessionId String?
175
+ session IntegrationSession? @relation(fields: [sessionId], references: [id])
176
+
177
+ @@index([instanceId])
178
+ }
179
+
180
+ model MessageUpdate {
181
+ id String @id @default(cuid())
182
+ keyId String @db.VarChar(100)
183
+ remoteJid String @db.VarChar(100)
184
+ fromMe Boolean
185
+ participant String? @db.VarChar(100)
186
+ pollUpdates Json? @db.Json
187
+ status String @db.VarChar(30)
188
+ Message Message @relation(fields: [messageId], references: [id], onDelete: Cascade)
189
+ messageId String
190
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
191
+ instanceId String
192
+
193
+ @@index([instanceId])
194
+ @@index([messageId])
195
+ }
196
+
197
+ model Webhook {
198
+ id String @id @default(cuid())
199
+ url String @db.VarChar(500)
200
+ headers Json? @db.Json
201
+ enabled Boolean? @default(true)
202
+ events Json? @db.Json
203
+ webhookByEvents Boolean? @default(false)
204
+ webhookBase64 Boolean? @default(false)
205
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
206
+ updatedAt DateTime @updatedAt @db.Timestamp
207
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
208
+ instanceId String @unique
209
+
210
+ @@index([instanceId])
211
+ }
212
+
213
+ model Chatwoot {
214
+ id String @id @default(cuid())
215
+ enabled Boolean? @default(true)
216
+ accountId String? @db.VarChar(100)
217
+ token String? @db.VarChar(100)
218
+ url String? @db.VarChar(500)
219
+ nameInbox String? @db.VarChar(100)
220
+ signMsg Boolean? @default(false)
221
+ signDelimiter String? @db.VarChar(100)
222
+ number String? @db.VarChar(100)
223
+ reopenConversation Boolean? @default(false)
224
+ conversationPending Boolean? @default(false)
225
+ mergeBrazilContacts Boolean? @default(false)
226
+ importContacts Boolean? @default(false)
227
+ importMessages Boolean? @default(false)
228
+ daysLimitImportMessages Int? @db.Int
229
+ organization String? @db.VarChar(100)
230
+ logo String? @db.VarChar(500)
231
+ ignoreJids Json?
232
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
233
+ updatedAt DateTime @updatedAt @db.Timestamp
234
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
235
+ instanceId String @unique
236
+ }
237
+
238
+ model Label {
239
+ id String @id @default(cuid())
240
+ labelId String? @db.VarChar(100)
241
+ name String @db.VarChar(100)
242
+ color String @db.VarChar(100)
243
+ predefinedId String? @db.VarChar(100)
244
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
245
+ updatedAt DateTime @updatedAt @db.Timestamp
246
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
247
+ instanceId String
248
+ }
249
+
250
+ model Proxy {
251
+ id String @id @default(cuid())
252
+ enabled Boolean @default(false)
253
+ host String @db.VarChar(100)
254
+ port String @db.VarChar(100)
255
+ protocol String @db.VarChar(100)
256
+ username String @db.VarChar(100)
257
+ password String @db.VarChar(100)
258
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
259
+ updatedAt DateTime @updatedAt @db.Timestamp
260
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
261
+ instanceId String @unique
262
+ }
263
+
264
+ model Setting {
265
+ id String @id @default(cuid())
266
+ rejectCall Boolean @default(false)
267
+ msgCall String? @db.VarChar(100)
268
+ groupsIgnore Boolean @default(false)
269
+ alwaysOnline Boolean @default(false)
270
+ readMessages Boolean @default(false)
271
+ readStatus Boolean @default(false)
272
+ syncFullHistory Boolean @default(false)
273
+ wavoipToken String? @db.VarChar(100)
274
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
275
+ updatedAt DateTime @updatedAt @db.Timestamp
276
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
277
+ instanceId String @unique
278
+
279
+ @@index([instanceId])
280
+ }
281
+
282
+ model Rabbitmq {
283
+ id String @id @default(cuid())
284
+ enabled Boolean @default(false)
285
+ events Json @db.Json
286
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
287
+ updatedAt DateTime @updatedAt @db.Timestamp
288
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
289
+ instanceId String @unique
290
+ }
291
+
292
+ model Nats {
293
+ id String @id @default(cuid())
294
+ enabled Boolean @default(false)
295
+ events Json @db.Json
296
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
297
+ updatedAt DateTime @updatedAt @db.Timestamp
298
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
299
+ instanceId String @unique
300
+ }
301
+
302
+ model Sqs {
303
+ id String @id @default(cuid())
304
+ enabled Boolean @default(false)
305
+ events Json @db.Json
306
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
307
+ updatedAt DateTime @updatedAt @db.Timestamp
308
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
309
+ instanceId String @unique
310
+ }
311
+
312
+ model Websocket {
313
+ id String @id @default(cuid())
314
+ enabled Boolean @default(false)
315
+ events Json @db.Json
316
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
317
+ updatedAt DateTime @updatedAt @db.Timestamp
318
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
319
+ instanceId String @unique
320
+ }
321
+
322
+ model Pusher {
323
+ id String @id @default(cuid())
324
+ enabled Boolean @default(false)
325
+ appId String @db.VarChar(100)
326
+ key String @db.VarChar(100)
327
+ secret String @db.VarChar(100)
328
+ cluster String @db.VarChar(100)
329
+ useTLS Boolean @default(false)
330
+ events Json @db.Json
331
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
332
+ updatedAt DateTime @updatedAt @db.Timestamp
333
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
334
+ instanceId String @unique
335
+ }
336
+
337
+ model Typebot {
338
+ id String @id @default(cuid())
339
+ enabled Boolean @default(true)
340
+ description String? @db.VarChar(255)
341
+ url String @db.VarChar(500)
342
+ typebot String @db.VarChar(100)
343
+ expire Int? @default(0) @db.Int
344
+ keywordFinish String? @db.VarChar(100)
345
+ delayMessage Int? @db.Int
346
+ unknownMessage String? @db.VarChar(100)
347
+ listeningFromMe Boolean? @default(false)
348
+ stopBotFromMe Boolean? @default(false)
349
+ keepOpen Boolean? @default(false)
350
+ debounceTime Int? @db.Int
351
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
352
+ updatedAt DateTime? @updatedAt @db.Timestamp
353
+ ignoreJids Json?
354
+ triggerType TriggerType?
355
+ triggerOperator TriggerOperator?
356
+ triggerValue String?
357
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
358
+ instanceId String
359
+ TypebotSetting TypebotSetting[]
360
+ }
361
+
362
+ model TypebotSetting {
363
+ id String @id @default(cuid())
364
+ expire Int? @default(0) @db.Int
365
+ keywordFinish String? @db.VarChar(100)
366
+ delayMessage Int? @db.Int
367
+ unknownMessage String? @db.VarChar(100)
368
+ listeningFromMe Boolean? @default(false)
369
+ stopBotFromMe Boolean? @default(false)
370
+ keepOpen Boolean? @default(false)
371
+ debounceTime Int? @db.Int
372
+ typebotIdFallback String? @db.VarChar(100)
373
+ ignoreJids Json?
374
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
375
+ updatedAt DateTime @updatedAt @db.Timestamp
376
+ Fallback Typebot? @relation(fields: [typebotIdFallback], references: [id])
377
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
378
+ instanceId String @unique
379
+ }
380
+
381
+ model IntegrationSession {
382
+ id String @id @default(cuid())
383
+ sessionId String @db.VarChar(255)
384
+ remoteJid String @db.VarChar(100)
385
+ pushName String?
386
+ status SessionStatus
387
+ awaitUser Boolean @default(false)
388
+ context Json?
389
+ type String? @db.VarChar(100)
390
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
391
+ updatedAt DateTime @updatedAt @db.Timestamp
392
+ Message Message[]
393
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
394
+ instanceId String
395
+ parameters Json?
396
+
397
+ botId String?
398
+ }
399
+
400
+ model Media {
401
+ id String @id @default(cuid())
402
+ fileName String @db.VarChar(500)
403
+ type String @db.VarChar(100)
404
+ mimetype String @db.VarChar(100)
405
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
406
+ Message Message @relation(fields: [messageId], references: [id], onDelete: Cascade)
407
+ messageId String @unique
408
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
409
+ instanceId String
410
+ }
411
+
412
+ model OpenaiCreds {
413
+ id String @id @default(cuid())
414
+ name String? @unique @db.VarChar(255)
415
+ apiKey String? @unique @db.VarChar(255)
416
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
417
+ updatedAt DateTime @updatedAt @db.Timestamp
418
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
419
+ instanceId String
420
+ OpenaiAssistant OpenaiBot[]
421
+ OpenaiSetting OpenaiSetting?
422
+ }
423
+
424
+ model OpenaiBot {
425
+ id String @id @default(cuid())
426
+ enabled Boolean @default(true)
427
+ description String? @db.VarChar(255)
428
+ botType OpenaiBotType
429
+ assistantId String? @db.VarChar(255)
430
+ functionUrl String? @db.VarChar(500)
431
+ model String? @db.VarChar(100)
432
+ systemMessages Json? @db.Json
433
+ assistantMessages Json? @db.Json
434
+ userMessages Json? @db.Json
435
+ maxTokens Int? @db.Int
436
+ expire Int? @default(0) @db.Int
437
+ keywordFinish String? @db.VarChar(100)
438
+ delayMessage Int? @db.Int
439
+ unknownMessage String? @db.VarChar(100)
440
+ listeningFromMe Boolean? @default(false)
441
+ stopBotFromMe Boolean? @default(false)
442
+ keepOpen Boolean? @default(false)
443
+ debounceTime Int? @db.Int
444
+ ignoreJids Json?
445
+ splitMessages Boolean? @default(false)
446
+ timePerChar Int? @default(50) @db.Int
447
+ triggerType TriggerType?
448
+ triggerOperator TriggerOperator?
449
+ triggerValue String?
450
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
451
+ updatedAt DateTime @updatedAt @db.Timestamp
452
+ OpenaiCreds OpenaiCreds @relation(fields: [openaiCredsId], references: [id], onDelete: Cascade)
453
+ openaiCredsId String
454
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
455
+ instanceId String
456
+ OpenaiSetting OpenaiSetting[]
457
+ }
458
+
459
+ model OpenaiSetting {
460
+ id String @id @default(cuid())
461
+ expire Int? @default(0) @db.Int
462
+ keywordFinish String? @db.VarChar(100)
463
+ delayMessage Int? @db.Int
464
+ unknownMessage String? @db.VarChar(100)
465
+ listeningFromMe Boolean? @default(false)
466
+ stopBotFromMe Boolean? @default(false)
467
+ keepOpen Boolean? @default(false)
468
+ debounceTime Int? @db.Int
469
+ ignoreJids Json?
470
+ splitMessages Boolean? @default(false)
471
+ timePerChar Int? @default(50) @db.Int
472
+ speechToText Boolean? @default(false)
473
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
474
+ updatedAt DateTime @updatedAt @db.Timestamp
475
+ OpenaiCreds OpenaiCreds? @relation(fields: [openaiCredsId], references: [id])
476
+ openaiCredsId String @unique
477
+ Fallback OpenaiBot? @relation(fields: [openaiIdFallback], references: [id])
478
+ openaiIdFallback String? @db.VarChar(100)
479
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
480
+ instanceId String @unique
481
+ }
482
+
483
+ model Template {
484
+ id String @id @default(cuid())
485
+ templateId String @unique @db.VarChar(255)
486
+ name String @unique @db.VarChar(255)
487
+ template Json @db.Json
488
+ webhookUrl String? @db.VarChar(500)
489
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
490
+ updatedAt DateTime @updatedAt @db.Timestamp
491
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
492
+ instanceId String
493
+ }
494
+
495
+ model Dify {
496
+ id String @id @default(cuid())
497
+ enabled Boolean @default(true)
498
+ description String? @db.VarChar(255)
499
+ botType DifyBotType
500
+ apiUrl String? @db.VarChar(255)
501
+ apiKey String? @db.VarChar(255)
502
+ expire Int? @default(0) @db.Int
503
+ keywordFinish String? @db.VarChar(100)
504
+ delayMessage Int? @db.Int
505
+ unknownMessage String? @db.VarChar(100)
506
+ listeningFromMe Boolean? @default(false)
507
+ stopBotFromMe Boolean? @default(false)
508
+ keepOpen Boolean? @default(false)
509
+ debounceTime Int? @db.Int
510
+ ignoreJids Json?
511
+ splitMessages Boolean? @default(false)
512
+ timePerChar Int? @default(50) @db.Int
513
+ triggerType TriggerType?
514
+ triggerOperator TriggerOperator?
515
+ triggerValue String?
516
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
517
+ updatedAt DateTime @updatedAt @db.Timestamp
518
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
519
+ instanceId String
520
+ DifySetting DifySetting[]
521
+ }
522
+
523
+ model DifySetting {
524
+ id String @id @default(cuid())
525
+ expire Int? @default(0) @db.Int
526
+ keywordFinish String? @db.VarChar(100)
527
+ delayMessage Int? @db.Int
528
+ unknownMessage String? @db.VarChar(100)
529
+ listeningFromMe Boolean? @default(false)
530
+ stopBotFromMe Boolean? @default(false)
531
+ keepOpen Boolean? @default(false)
532
+ debounceTime Int? @db.Int
533
+ ignoreJids Json?
534
+ splitMessages Boolean? @default(false)
535
+ timePerChar Int? @default(50) @db.Int
536
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
537
+ updatedAt DateTime @updatedAt @db.Timestamp
538
+ Fallback Dify? @relation(fields: [difyIdFallback], references: [id])
539
+ difyIdFallback String? @db.VarChar(100)
540
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
541
+ instanceId String @unique
542
+ }
543
+
544
+ model EvolutionBot {
545
+ id String @id @default(cuid())
546
+ enabled Boolean @default(true)
547
+ description String? @db.VarChar(255)
548
+ apiUrl String? @db.VarChar(255)
549
+ apiKey String? @db.VarChar(255)
550
+ expire Int? @default(0) @db.Int
551
+ keywordFinish String? @db.VarChar(100)
552
+ delayMessage Int? @db.Int
553
+ unknownMessage String? @db.VarChar(100)
554
+ listeningFromMe Boolean? @default(false)
555
+ stopBotFromMe Boolean? @default(false)
556
+ keepOpen Boolean? @default(false)
557
+ debounceTime Int? @db.Int
558
+ ignoreJids Json?
559
+ splitMessages Boolean? @default(false)
560
+ timePerChar Int? @default(50) @db.Int
561
+ triggerType TriggerType?
562
+ triggerOperator TriggerOperator?
563
+ triggerValue String?
564
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
565
+ updatedAt DateTime @updatedAt @db.Timestamp
566
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
567
+ instanceId String
568
+ EvolutionBotSetting EvolutionBotSetting[]
569
+ }
570
+
571
+ model EvolutionBotSetting {
572
+ id String @id @default(cuid())
573
+ expire Int? @default(0) @db.Int
574
+ keywordFinish String? @db.VarChar(100)
575
+ delayMessage Int? @db.Int
576
+ unknownMessage String? @db.VarChar(100)
577
+ listeningFromMe Boolean? @default(false)
578
+ stopBotFromMe Boolean? @default(false)
579
+ keepOpen Boolean? @default(false)
580
+ debounceTime Int? @db.Int
581
+ ignoreJids Json?
582
+ splitMessages Boolean? @default(false)
583
+ timePerChar Int? @default(50) @db.Int
584
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
585
+ updatedAt DateTime @updatedAt @db.Timestamp
586
+ Fallback EvolutionBot? @relation(fields: [botIdFallback], references: [id])
587
+ botIdFallback String? @db.VarChar(100)
588
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
589
+ instanceId String @unique
590
+ }
591
+
592
+ model Flowise {
593
+ id String @id @default(cuid())
594
+ enabled Boolean @default(true)
595
+ description String? @db.VarChar(255)
596
+ apiUrl String? @db.VarChar(255)
597
+ apiKey String? @db.VarChar(255)
598
+ expire Int? @default(0) @db.Int
599
+ keywordFinish String? @db.VarChar(100)
600
+ delayMessage Int? @db.Int
601
+ unknownMessage String? @db.VarChar(100)
602
+ listeningFromMe Boolean? @default(false)
603
+ stopBotFromMe Boolean? @default(false)
604
+ keepOpen Boolean? @default(false)
605
+ debounceTime Int? @db.Int
606
+ ignoreJids Json?
607
+ splitMessages Boolean? @default(false)
608
+ timePerChar Int? @default(50) @db.Int
609
+ triggerType TriggerType?
610
+ triggerOperator TriggerOperator?
611
+ triggerValue String?
612
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
613
+ updatedAt DateTime @updatedAt @db.Timestamp
614
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
615
+ instanceId String
616
+ FlowiseSetting FlowiseSetting[]
617
+ }
618
+
619
+ model FlowiseSetting {
620
+ id String @id @default(cuid())
621
+ expire Int? @default(0) @db.Int
622
+ keywordFinish String? @db.VarChar(100)
623
+ delayMessage Int? @db.Int
624
+ unknownMessage String? @db.VarChar(100)
625
+ listeningFromMe Boolean? @default(false)
626
+ stopBotFromMe Boolean? @default(false)
627
+ keepOpen Boolean? @default(false)
628
+ debounceTime Int? @db.Int
629
+ ignoreJids Json?
630
+ splitMessages Boolean? @default(false)
631
+ timePerChar Int? @default(50) @db.Int
632
+ createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
633
+ updatedAt DateTime @updatedAt @db.Timestamp
634
+ Fallback Flowise? @relation(fields: [flowiseIdFallback], references: [id])
635
+ flowiseIdFallback String? @db.VarChar(100)
636
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
637
+ instanceId String @unique
638
+ }
639
+
640
+ model IsOnWhatsapp {
641
+ id String @id @default(cuid())
642
+ remoteJid String @unique @db.VarChar(100)
643
+ jidOptions String
644
+ createdAt DateTime @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
645
+ updatedAt DateTime @updatedAt @db.Timestamp
646
+ }
647
+
648
+ model N8n {
649
+ id String @id @default(cuid())
650
+ enabled Boolean @default(true) @db.Boolean
651
+ description String? @db.VarChar(255)
652
+ webhookUrl String? @db.VarChar(255)
653
+ basicAuthUser String? @db.VarChar(255)
654
+ basicAuthPass String? @db.VarChar(255)
655
+ expire Int? @default(0) @db.Int
656
+ keywordFinish String? @db.VarChar(100)
657
+ delayMessage Int? @db.Integer
658
+ unknownMessage String? @db.VarChar(100)
659
+ listeningFromMe Boolean? @default(false)
660
+ stopBotFromMe Boolean? @default(false)
661
+ keepOpen Boolean? @default(false)
662
+ debounceTime Int? @db.Integer
663
+ ignoreJids Json?
664
+ splitMessages Boolean? @default(false)
665
+ timePerChar Int? @default(50) @db.Integer
666
+ triggerType TriggerType?
667
+ triggerOperator TriggerOperator?
668
+ triggerValue String?
669
+ createdAt DateTime? @default(now()) @db.Timestamp
670
+ updatedAt DateTime @updatedAt @db.Timestamp
671
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
672
+ instanceId String
673
+ N8nSetting N8nSetting[]
674
+ }
675
+
676
+ model N8nSetting {
677
+ id String @id @default(cuid())
678
+ expire Int? @default(0) @db.Int
679
+ keywordFinish String? @db.VarChar(100)
680
+ delayMessage Int? @db.Integer
681
+ unknownMessage String? @db.VarChar(100)
682
+ listeningFromMe Boolean? @default(false)
683
+ stopBotFromMe Boolean? @default(false)
684
+ keepOpen Boolean? @default(false)
685
+ debounceTime Int? @db.Integer
686
+ ignoreJids Json?
687
+ splitMessages Boolean? @default(false)
688
+ timePerChar Int? @default(50) @db.Integer
689
+ createdAt DateTime? @default(now()) @db.Timestamp
690
+ updatedAt DateTime @updatedAt @db.Timestamp
691
+ Fallback N8n? @relation(fields: [n8nIdFallback], references: [id])
692
+ n8nIdFallback String? @db.VarChar(100)
693
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
694
+ instanceId String @unique
695
+ }
696
+
697
+ model Evoai {
698
+ id String @id @default(cuid())
699
+ enabled Boolean @default(true) @db.Boolean
700
+ description String? @db.VarChar(255)
701
+ agentUrl String? @db.VarChar(255)
702
+ apiKey String? @db.VarChar(255)
703
+ expire Int? @default(0) @db.Int
704
+ keywordFinish String? @db.VarChar(100)
705
+ delayMessage Int? @db.Integer
706
+ unknownMessage String? @db.VarChar(100)
707
+ listeningFromMe Boolean? @default(false)
708
+ stopBotFromMe Boolean? @default(false)
709
+ keepOpen Boolean? @default(false)
710
+ debounceTime Int? @db.Integer
711
+ ignoreJids Json?
712
+ splitMessages Boolean? @default(false)
713
+ timePerChar Int? @default(50) @db.Integer
714
+ triggerType TriggerType?
715
+ triggerOperator TriggerOperator?
716
+ triggerValue String?
717
+ createdAt DateTime? @default(now()) @db.Timestamp
718
+ updatedAt DateTime @updatedAt @db.Timestamp
719
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
720
+ instanceId String
721
+ EvoaiSetting EvoaiSetting[]
722
+ }
723
+
724
+ model EvoaiSetting {
725
+ id String @id @default(cuid())
726
+ expire Int? @default(0) @db.Int
727
+ keywordFinish String? @db.VarChar(100)
728
+ delayMessage Int? @db.Integer
729
+ unknownMessage String? @db.VarChar(100)
730
+ listeningFromMe Boolean? @default(false)
731
+ stopBotFromMe Boolean? @default(false)
732
+ keepOpen Boolean? @default(false)
733
+ debounceTime Int? @db.Integer
734
+ ignoreJids Json?
735
+ splitMessages Boolean? @default(false)
736
+ timePerChar Int? @default(50) @db.Integer
737
+ createdAt DateTime? @default(now()) @db.Timestamp
738
+ updatedAt DateTime @updatedAt @db.Timestamp
739
+ Fallback Evoai? @relation(fields: [evoaiIdFallback], references: [id])
740
+ evoaiIdFallback String? @db.VarChar(100)
741
+ Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
742
+ instanceId String @unique
743
+ }
prisma/postgresql-migrations/20240609181238_init/migration.sql ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -- CreateEnum
2
+ CREATE TYPE "InstanceConnectionStatus" AS ENUM ('open', 'close', 'connecting');
3
+
4
+ -- CreateEnum
5
+ CREATE TYPE "DeviceMessage" AS ENUM ('ios', 'android', 'web', 'unknown', 'desktop');
6
+
7
+ -- CreateEnum
8
+ CREATE TYPE "TypebotSessionStatus" AS ENUM ('open', 'closed', 'paused');
9
+
10
+ -- CreateEnum
11
+ CREATE TYPE "TriggerType" AS ENUM ('all', 'keyword');
12
+
13
+ -- CreateEnum
14
+ CREATE TYPE "TriggerOperator" AS ENUM ('contains', 'equals', 'startsWith', 'endsWith');
15
+
16
+ -- CreateTable
17
+ CREATE TABLE "Instance" (
18
+ "id" TEXT NOT NULL,
19
+ "name" VARCHAR(255) NOT NULL,
20
+ "connectionStatus" "InstanceConnectionStatus" NOT NULL DEFAULT 'open',
21
+ "ownerJid" VARCHAR(100),
22
+ "profilePicUrl" VARCHAR(500),
23
+ "integration" VARCHAR(100),
24
+ "number" VARCHAR(100),
25
+ "token" VARCHAR(255),
26
+ "clientName" VARCHAR(100),
27
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
28
+ "updatedAt" TIMESTAMP,
29
+
30
+ CONSTRAINT "Instance_pkey" PRIMARY KEY ("id")
31
+ );
32
+
33
+ -- CreateTable
34
+ CREATE TABLE "Session" (
35
+ "id" TEXT NOT NULL,
36
+ "sessionId" TEXT NOT NULL,
37
+ "creds" TEXT,
38
+ "createdAt" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
39
+
40
+ CONSTRAINT "Session_pkey" PRIMARY KEY ("id")
41
+ );
42
+
43
+ -- CreateTable
44
+ CREATE TABLE "Chat" (
45
+ "id" TEXT NOT NULL,
46
+ "remoteJid" VARCHAR(100) NOT NULL,
47
+ "labels" JSONB,
48
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
49
+ "updatedAt" TIMESTAMP,
50
+ "instanceId" TEXT NOT NULL,
51
+
52
+ CONSTRAINT "Chat_pkey" PRIMARY KEY ("id")
53
+ );
54
+
55
+ -- CreateTable
56
+ CREATE TABLE "Contact" (
57
+ "id" TEXT NOT NULL,
58
+ "remoteJid" VARCHAR(100) NOT NULL,
59
+ "pushName" VARCHAR(100),
60
+ "profilePicUrl" VARCHAR(500),
61
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
62
+ "updatedAt" TIMESTAMP,
63
+ "instanceId" TEXT NOT NULL,
64
+
65
+ CONSTRAINT "Contact_pkey" PRIMARY KEY ("id")
66
+ );
67
+
68
+ -- CreateTable
69
+ CREATE TABLE "Message" (
70
+ "id" TEXT NOT NULL,
71
+ "key" JSONB NOT NULL,
72
+ "pushName" VARCHAR(100),
73
+ "participant" VARCHAR(100),
74
+ "messageType" VARCHAR(100) NOT NULL,
75
+ "message" JSONB NOT NULL,
76
+ "contextInfo" JSONB,
77
+ "source" "DeviceMessage" NOT NULL,
78
+ "messageTimestamp" INTEGER NOT NULL,
79
+ "chatwootMessageId" INTEGER,
80
+ "chatwootInboxId" INTEGER,
81
+ "chatwootConversationId" INTEGER,
82
+ "chatwootContactInboxSourceId" VARCHAR(100),
83
+ "chatwootIsRead" BOOLEAN,
84
+ "instanceId" TEXT NOT NULL,
85
+ "typebotSessionId" TEXT,
86
+
87
+ CONSTRAINT "Message_pkey" PRIMARY KEY ("id")
88
+ );
89
+
90
+ -- CreateTable
91
+ CREATE TABLE "MessageUpdate" (
92
+ "id" TEXT NOT NULL,
93
+ "keyId" VARCHAR(100) NOT NULL,
94
+ "remoteJid" VARCHAR(100) NOT NULL,
95
+ "fromMe" BOOLEAN NOT NULL,
96
+ "participant" VARCHAR(100),
97
+ "pollUpdates" JSONB,
98
+ "status" VARCHAR(30) NOT NULL,
99
+ "messageId" TEXT NOT NULL,
100
+ "instanceId" TEXT NOT NULL,
101
+
102
+ CONSTRAINT "MessageUpdate_pkey" PRIMARY KEY ("id")
103
+ );
104
+
105
+ -- CreateTable
106
+ CREATE TABLE "Webhook" (
107
+ "id" TEXT NOT NULL,
108
+ "url" VARCHAR(500) NOT NULL,
109
+ "enabled" BOOLEAN DEFAULT true,
110
+ "events" JSONB,
111
+ "webhookByEvents" BOOLEAN DEFAULT false,
112
+ "webhookBase64" BOOLEAN DEFAULT false,
113
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
114
+ "updatedAt" TIMESTAMP NOT NULL,
115
+ "instanceId" TEXT NOT NULL,
116
+
117
+ CONSTRAINT "Webhook_pkey" PRIMARY KEY ("id")
118
+ );
119
+
120
+ -- CreateTable
121
+ CREATE TABLE "Chatwoot" (
122
+ "id" TEXT NOT NULL,
123
+ "enabled" BOOLEAN DEFAULT true,
124
+ "accountId" VARCHAR(100),
125
+ "token" VARCHAR(100),
126
+ "url" VARCHAR(500),
127
+ "nameInbox" VARCHAR(100),
128
+ "signMsg" BOOLEAN DEFAULT false,
129
+ "signDelimiter" VARCHAR(100),
130
+ "number" VARCHAR(100),
131
+ "reopenConversation" BOOLEAN DEFAULT false,
132
+ "conversationPending" BOOLEAN DEFAULT false,
133
+ "mergeBrazilContacts" BOOLEAN DEFAULT false,
134
+ "importContacts" BOOLEAN DEFAULT false,
135
+ "importMessages" BOOLEAN DEFAULT false,
136
+ "daysLimitImportMessages" INTEGER,
137
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
138
+ "updatedAt" TIMESTAMP NOT NULL,
139
+ "instanceId" TEXT NOT NULL,
140
+
141
+ CONSTRAINT "Chatwoot_pkey" PRIMARY KEY ("id")
142
+ );
143
+
144
+ -- CreateTable
145
+ CREATE TABLE "Label" (
146
+ "id" TEXT NOT NULL,
147
+ "labelId" VARCHAR(100),
148
+ "name" VARCHAR(100) NOT NULL,
149
+ "color" VARCHAR(100) NOT NULL,
150
+ "predefinedId" VARCHAR(100),
151
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
152
+ "updatedAt" TIMESTAMP NOT NULL,
153
+ "instanceId" TEXT NOT NULL,
154
+
155
+ CONSTRAINT "Label_pkey" PRIMARY KEY ("id")
156
+ );
157
+
158
+ -- CreateTable
159
+ CREATE TABLE "Proxy" (
160
+ "id" TEXT NOT NULL,
161
+ "enabled" BOOLEAN NOT NULL DEFAULT false,
162
+ "host" VARCHAR(100) NOT NULL,
163
+ "port" VARCHAR(100) NOT NULL,
164
+ "protocol" VARCHAR(100) NOT NULL,
165
+ "username" VARCHAR(100) NOT NULL,
166
+ "password" VARCHAR(100) NOT NULL,
167
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
168
+ "updatedAt" TIMESTAMP NOT NULL,
169
+ "instanceId" TEXT NOT NULL,
170
+
171
+ CONSTRAINT "Proxy_pkey" PRIMARY KEY ("id")
172
+ );
173
+
174
+ -- CreateTable
175
+ CREATE TABLE "Setting" (
176
+ "id" TEXT NOT NULL,
177
+ "rejectCall" BOOLEAN NOT NULL DEFAULT false,
178
+ "msgCall" VARCHAR(100),
179
+ "groupsIgnore" BOOLEAN NOT NULL DEFAULT false,
180
+ "alwaysOnline" BOOLEAN NOT NULL DEFAULT false,
181
+ "readMessages" BOOLEAN NOT NULL DEFAULT false,
182
+ "readStatus" BOOLEAN NOT NULL DEFAULT false,
183
+ "syncFullHistory" BOOLEAN NOT NULL DEFAULT false,
184
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
185
+ "updatedAt" TIMESTAMP NOT NULL,
186
+ "instanceId" TEXT NOT NULL,
187
+
188
+ CONSTRAINT "Setting_pkey" PRIMARY KEY ("id")
189
+ );
190
+
191
+ -- CreateTable
192
+ CREATE TABLE "Rabbitmq" (
193
+ "id" TEXT NOT NULL,
194
+ "enabled" BOOLEAN NOT NULL DEFAULT false,
195
+ "events" JSONB NOT NULL,
196
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
197
+ "updatedAt" TIMESTAMP NOT NULL,
198
+ "instanceId" TEXT NOT NULL,
199
+
200
+ CONSTRAINT "Rabbitmq_pkey" PRIMARY KEY ("id")
201
+ );
202
+
203
+ -- CreateTable
204
+ CREATE TABLE "Sqs" (
205
+ "id" TEXT NOT NULL,
206
+ "enabled" BOOLEAN NOT NULL DEFAULT false,
207
+ "events" JSONB NOT NULL,
208
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
209
+ "updatedAt" TIMESTAMP NOT NULL,
210
+ "instanceId" TEXT NOT NULL,
211
+
212
+ CONSTRAINT "Sqs_pkey" PRIMARY KEY ("id")
213
+ );
214
+
215
+ -- CreateTable
216
+ CREATE TABLE "Websocket" (
217
+ "id" TEXT NOT NULL,
218
+ "enabled" BOOLEAN NOT NULL DEFAULT false,
219
+ "events" JSONB NOT NULL,
220
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
221
+ "updatedAt" TIMESTAMP NOT NULL,
222
+ "instanceId" TEXT NOT NULL,
223
+
224
+ CONSTRAINT "Websocket_pkey" PRIMARY KEY ("id")
225
+ );
226
+
227
+ -- CreateTable
228
+ CREATE TABLE "Typebot" (
229
+ "id" TEXT NOT NULL,
230
+ "enabled" BOOLEAN NOT NULL DEFAULT true,
231
+ "url" VARCHAR(500) NOT NULL,
232
+ "typebot" VARCHAR(100) NOT NULL,
233
+ "expire" INTEGER DEFAULT 0,
234
+ "keywordFinish" VARCHAR(100),
235
+ "delayMessage" INTEGER,
236
+ "unknownMessage" VARCHAR(100),
237
+ "listeningFromMe" BOOLEAN DEFAULT false,
238
+ "stopBotFromMe" BOOLEAN DEFAULT false,
239
+ "keepOpen" BOOLEAN DEFAULT false,
240
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
241
+ "updatedAt" TIMESTAMP,
242
+ "triggerType" "TriggerType",
243
+ "triggerOperator" "TriggerOperator",
244
+ "triggerValue" TEXT,
245
+ "instanceId" TEXT NOT NULL,
246
+
247
+ CONSTRAINT "Typebot_pkey" PRIMARY KEY ("id")
248
+ );
249
+
250
+ -- CreateTable
251
+ CREATE TABLE "TypebotSession" (
252
+ "id" TEXT NOT NULL,
253
+ "remoteJid" VARCHAR(100) NOT NULL,
254
+ "pushName" VARCHAR(100),
255
+ "sessionId" VARCHAR(100) NOT NULL,
256
+ "status" VARCHAR(100) NOT NULL,
257
+ "prefilledVariables" JSONB,
258
+ "awaitUser" BOOLEAN NOT NULL DEFAULT false,
259
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
260
+ "updatedAt" TIMESTAMP NOT NULL,
261
+ "typebotId" TEXT NOT NULL,
262
+ "instanceId" TEXT NOT NULL,
263
+
264
+ CONSTRAINT "TypebotSession_pkey" PRIMARY KEY ("id")
265
+ );
266
+
267
+ -- CreateTable
268
+ CREATE TABLE "TypebotSetting" (
269
+ "id" TEXT NOT NULL,
270
+ "expire" INTEGER DEFAULT 0,
271
+ "keywordFinish" VARCHAR(100),
272
+ "delayMessage" INTEGER,
273
+ "unknownMessage" VARCHAR(100),
274
+ "listeningFromMe" BOOLEAN DEFAULT false,
275
+ "stopBotFromMe" BOOLEAN DEFAULT false,
276
+ "keepOpen" BOOLEAN DEFAULT false,
277
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
278
+ "updatedAt" TIMESTAMP NOT NULL,
279
+ "instanceId" TEXT NOT NULL,
280
+
281
+ CONSTRAINT "TypebotSetting_pkey" PRIMARY KEY ("id")
282
+ );
283
+
284
+ -- CreateIndex
285
+ CREATE UNIQUE INDEX "Instance_name_key" ON "Instance"("name");
286
+
287
+ -- CreateIndex
288
+ CREATE UNIQUE INDEX "Instance_token_key" ON "Instance"("token");
289
+
290
+ -- CreateIndex
291
+ CREATE UNIQUE INDEX "Session_sessionId_key" ON "Session"("sessionId");
292
+
293
+ -- CreateIndex
294
+ CREATE UNIQUE INDEX "Webhook_instanceId_key" ON "Webhook"("instanceId");
295
+
296
+ -- CreateIndex
297
+ CREATE UNIQUE INDEX "Chatwoot_instanceId_key" ON "Chatwoot"("instanceId");
298
+
299
+ -- CreateIndex
300
+ CREATE UNIQUE INDEX "Label_labelId_key" ON "Label"("labelId");
301
+
302
+ -- CreateIndex
303
+ CREATE UNIQUE INDEX "Proxy_instanceId_key" ON "Proxy"("instanceId");
304
+
305
+ -- CreateIndex
306
+ CREATE UNIQUE INDEX "Setting_instanceId_key" ON "Setting"("instanceId");
307
+
308
+ -- CreateIndex
309
+ CREATE UNIQUE INDEX "Rabbitmq_instanceId_key" ON "Rabbitmq"("instanceId");
310
+
311
+ -- CreateIndex
312
+ CREATE UNIQUE INDEX "Sqs_instanceId_key" ON "Sqs"("instanceId");
313
+
314
+ -- CreateIndex
315
+ CREATE UNIQUE INDEX "Websocket_instanceId_key" ON "Websocket"("instanceId");
316
+
317
+ -- CreateIndex
318
+ CREATE UNIQUE INDEX "TypebotSetting_instanceId_key" ON "TypebotSetting"("instanceId");
319
+
320
+ -- AddForeignKey
321
+ ALTER TABLE "Session" ADD CONSTRAINT "Session_sessionId_fkey" FOREIGN KEY ("sessionId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
322
+
323
+ -- AddForeignKey
324
+ ALTER TABLE "Chat" ADD CONSTRAINT "Chat_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
325
+
326
+ -- AddForeignKey
327
+ ALTER TABLE "Contact" ADD CONSTRAINT "Contact_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
328
+
329
+ -- AddForeignKey
330
+ ALTER TABLE "Message" ADD CONSTRAINT "Message_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
331
+
332
+ -- AddForeignKey
333
+ ALTER TABLE "Message" ADD CONSTRAINT "Message_typebotSessionId_fkey" FOREIGN KEY ("typebotSessionId") REFERENCES "TypebotSession"("id") ON DELETE SET NULL ON UPDATE CASCADE;
334
+
335
+ -- AddForeignKey
336
+ ALTER TABLE "MessageUpdate" ADD CONSTRAINT "MessageUpdate_messageId_fkey" FOREIGN KEY ("messageId") REFERENCES "Message"("id") ON DELETE CASCADE ON UPDATE CASCADE;
337
+
338
+ -- AddForeignKey
339
+ ALTER TABLE "MessageUpdate" ADD CONSTRAINT "MessageUpdate_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
340
+
341
+ -- AddForeignKey
342
+ ALTER TABLE "Webhook" ADD CONSTRAINT "Webhook_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
343
+
344
+ -- AddForeignKey
345
+ ALTER TABLE "Chatwoot" ADD CONSTRAINT "Chatwoot_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
346
+
347
+ -- AddForeignKey
348
+ ALTER TABLE "Label" ADD CONSTRAINT "Label_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
349
+
350
+ -- AddForeignKey
351
+ ALTER TABLE "Proxy" ADD CONSTRAINT "Proxy_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
352
+
353
+ -- AddForeignKey
354
+ ALTER TABLE "Setting" ADD CONSTRAINT "Setting_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
355
+
356
+ -- AddForeignKey
357
+ ALTER TABLE "Rabbitmq" ADD CONSTRAINT "Rabbitmq_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
358
+
359
+ -- AddForeignKey
360
+ ALTER TABLE "Sqs" ADD CONSTRAINT "Sqs_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
361
+
362
+ -- AddForeignKey
363
+ ALTER TABLE "Websocket" ADD CONSTRAINT "Websocket_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
364
+
365
+ -- AddForeignKey
366
+ ALTER TABLE "Typebot" ADD CONSTRAINT "Typebot_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
367
+
368
+ -- AddForeignKey
369
+ ALTER TABLE "TypebotSession" ADD CONSTRAINT "TypebotSession_typebotId_fkey" FOREIGN KEY ("typebotId") REFERENCES "Typebot"("id") ON DELETE CASCADE ON UPDATE CASCADE;
370
+
371
+ -- AddForeignKey
372
+ ALTER TABLE "TypebotSession" ADD CONSTRAINT "TypebotSession_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
373
+
374
+ -- AddForeignKey
375
+ ALTER TABLE "TypebotSetting" ADD CONSTRAINT "TypebotSetting_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
prisma/postgresql-migrations/20240610144159_create_column_profile_name_instance/migration.sql ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ -- AlterTable
2
+ ALTER TABLE "Instance" ADD COLUMN "profileName" VARCHAR(100);
prisma/postgresql-migrations/20240611125754_create_columns_whitelabel_chatwoot/migration.sql ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ -- AlterTable
2
+ ALTER TABLE "Chatwoot" ADD COLUMN "logo" VARCHAR(500),
3
+ ADD COLUMN "organization" VARCHAR(100);
prisma/postgresql-migrations/20240611202817_create_columns_debounce_time_typebot/migration.sql ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ -- AlterTable
2
+ ALTER TABLE "Typebot" ADD COLUMN "debounceTime" INTEGER;
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "TypebotSetting" ADD COLUMN "debounceTime" INTEGER;
prisma/postgresql-migrations/20240712144948_add_business_id_column_to_instances/migration.sql ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ -- AlterTable
2
+ ALTER TABLE "Instance" ADD COLUMN "businessId" VARCHAR(100);
prisma/postgresql-migrations/20240712150256_create_templates_table/migration.sql ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -- CreateTable
2
+ CREATE TABLE "Template" (
3
+ "id" TEXT NOT NULL,
4
+ "name" VARCHAR(255) NOT NULL,
5
+ "language" VARCHAR(255) NOT NULL,
6
+ "templateId" VARCHAR(255) NOT NULL,
7
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
8
+ "updatedAt" TIMESTAMP NOT NULL,
9
+ "instanceId" TEXT NOT NULL,
10
+
11
+ CONSTRAINT "Template_pkey" PRIMARY KEY ("id")
12
+ );
13
+
14
+ -- CreateIndex
15
+ CREATE UNIQUE INDEX "Template_templateId_key" ON "Template"("templateId");
16
+
17
+ -- CreateIndex
18
+ CREATE UNIQUE INDEX "Template_instanceId_key" ON "Template"("instanceId");
19
+
20
+ -- AddForeignKey
21
+ ALTER TABLE "Template" ADD CONSTRAINT "Template_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
prisma/postgresql-migrations/20240712155950_adjusts_in_templates_table/migration.sql ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ -- DropIndex
2
+ DROP INDEX "Template_instanceId_key";
prisma/postgresql-migrations/20240712162206_remove_templates_table/migration.sql ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the `Template` table. If the table is not empty, all the data it contains will be lost.
5
+
6
+ */
7
+ -- DropForeignKey
8
+ ALTER TABLE "Template" DROP CONSTRAINT "Template_instanceId_fkey";
9
+
10
+ -- DropTable
11
+ DROP TABLE "Template";
prisma/postgresql-migrations/20240712223655_column_fallback_typebot/migration.sql ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ -- AlterEnum
2
+ ALTER TYPE "TriggerOperator" ADD VALUE 'regex';
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "TypebotSetting" ADD COLUMN "typebotIdFallback" VARCHAR(100);
6
+
7
+ -- AddForeignKey
8
+ ALTER TABLE "TypebotSetting" ADD CONSTRAINT "TypebotSetting_typebotIdFallback_fkey" FOREIGN KEY ("typebotIdFallback") REFERENCES "Typebot"("id") ON DELETE SET NULL ON UPDATE CASCADE;
prisma/postgresql-migrations/20240712230631_column_ignore_jids_typebot/migration.sql ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ -- AlterTable
2
+ ALTER TABLE "Typebot" ADD COLUMN "ignoreJids" JSONB;
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "TypebotSetting" ADD COLUMN "ignoreJids" JSONB;
prisma/postgresql-migrations/20240713184337_add_media_table/migration.sql ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -- CreateTable
2
+ CREATE TABLE "Media" (
3
+ "id" TEXT NOT NULL,
4
+ "fileName" VARCHAR(500) NOT NULL,
5
+ "type" VARCHAR(100) NOT NULL,
6
+ "mimetype" VARCHAR(100) NOT NULL,
7
+ "createdAt" DATE DEFAULT CURRENT_TIMESTAMP,
8
+ "messageId" TEXT NOT NULL,
9
+ "instanceId" TEXT NOT NULL,
10
+
11
+ CONSTRAINT "Media_pkey" PRIMARY KEY ("id")
12
+ );
13
+
14
+ -- CreateIndex
15
+ CREATE UNIQUE INDEX "Media_fileName_key" ON "Media"("fileName");
16
+
17
+ -- CreateIndex
18
+ CREATE UNIQUE INDEX "Media_messageId_key" ON "Media"("messageId");
19
+
20
+ -- AddForeignKey
21
+ ALTER TABLE "Media" ADD CONSTRAINT "Media_messageId_fkey" FOREIGN KEY ("messageId") REFERENCES "Message"("id") ON DELETE CASCADE ON UPDATE CASCADE;
22
+
23
+ -- AddForeignKey
24
+ ALTER TABLE "Media" ADD CONSTRAINT "Media_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
prisma/postgresql-migrations/20240718121437_add_openai_tables/migration.sql ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -- AlterTable
2
+ ALTER TABLE "Message" ADD COLUMN "openaiSessionId" TEXT;
3
+
4
+ -- CreateTable
5
+ CREATE TABLE "OpenaiCreds" (
6
+ "id" TEXT NOT NULL,
7
+ "apiKey" VARCHAR(255) NOT NULL,
8
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
9
+ "updatedAt" TIMESTAMP NOT NULL,
10
+ "instanceId" TEXT NOT NULL,
11
+
12
+ CONSTRAINT "OpenaiCreds_pkey" PRIMARY KEY ("id")
13
+ );
14
+
15
+ -- CreateTable
16
+ CREATE TABLE "OpenaiBot" (
17
+ "id" TEXT NOT NULL,
18
+ "botType" VARCHAR(100) NOT NULL,
19
+ "assistantId" VARCHAR(255),
20
+ "model" VARCHAR(100),
21
+ "systemMessages" JSONB,
22
+ "assistantMessages" JSONB,
23
+ "userMessages" JSONB,
24
+ "maxTokens" INTEGER,
25
+ "expire" INTEGER DEFAULT 0,
26
+ "keywordFinish" VARCHAR(100),
27
+ "delayMessage" INTEGER,
28
+ "unknownMessage" VARCHAR(100),
29
+ "listeningFromMe" BOOLEAN DEFAULT false,
30
+ "stopBotFromMe" BOOLEAN DEFAULT false,
31
+ "keepOpen" BOOLEAN DEFAULT false,
32
+ "debounceTime" INTEGER,
33
+ "ignoreJids" JSONB,
34
+ "triggerType" "TriggerType",
35
+ "triggerOperator" "TriggerOperator",
36
+ "triggerValue" TEXT,
37
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
38
+ "updatedAt" TIMESTAMP NOT NULL,
39
+ "openaiCredsId" TEXT NOT NULL,
40
+ "instanceId" TEXT NOT NULL,
41
+
42
+ CONSTRAINT "OpenaiBot_pkey" PRIMARY KEY ("id")
43
+ );
44
+
45
+ -- CreateTable
46
+ CREATE TABLE "OpenaiSession" (
47
+ "id" TEXT NOT NULL,
48
+ "sessionId" VARCHAR(255) NOT NULL,
49
+ "remoteJid" VARCHAR(100) NOT NULL,
50
+ "status" "TypebotSessionStatus" NOT NULL,
51
+ "awaitUser" BOOLEAN NOT NULL DEFAULT false,
52
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
53
+ "updatedAt" TIMESTAMP NOT NULL,
54
+ "openaiBotId" TEXT NOT NULL,
55
+ "instanceId" TEXT NOT NULL,
56
+
57
+ CONSTRAINT "OpenaiSession_pkey" PRIMARY KEY ("id")
58
+ );
59
+
60
+ -- CreateTable
61
+ CREATE TABLE "OpenaiSetting" (
62
+ "id" TEXT NOT NULL,
63
+ "expire" INTEGER DEFAULT 0,
64
+ "keywordFinish" VARCHAR(100),
65
+ "delayMessage" INTEGER,
66
+ "unknownMessage" VARCHAR(100),
67
+ "listeningFromMe" BOOLEAN DEFAULT false,
68
+ "stopBotFromMe" BOOLEAN DEFAULT false,
69
+ "keepOpen" BOOLEAN DEFAULT false,
70
+ "debounceTime" INTEGER,
71
+ "ignoreJids" JSONB,
72
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
73
+ "updatedAt" TIMESTAMP NOT NULL,
74
+ "openaiCredsId" TEXT NOT NULL,
75
+ "openaiIdFallback" VARCHAR(100),
76
+ "instanceId" TEXT NOT NULL,
77
+
78
+ CONSTRAINT "OpenaiSetting_pkey" PRIMARY KEY ("id")
79
+ );
80
+
81
+ -- CreateIndex
82
+ CREATE UNIQUE INDEX "OpenaiCreds_apiKey_key" ON "OpenaiCreds"("apiKey");
83
+
84
+ -- CreateIndex
85
+ CREATE UNIQUE INDEX "OpenaiCreds_instanceId_key" ON "OpenaiCreds"("instanceId");
86
+
87
+ -- CreateIndex
88
+ CREATE UNIQUE INDEX "OpenaiBot_assistantId_key" ON "OpenaiBot"("assistantId");
89
+
90
+ -- CreateIndex
91
+ CREATE UNIQUE INDEX "OpenaiSetting_instanceId_key" ON "OpenaiSetting"("instanceId");
92
+
93
+ -- AddForeignKey
94
+ ALTER TABLE "Message" ADD CONSTRAINT "Message_openaiSessionId_fkey" FOREIGN KEY ("openaiSessionId") REFERENCES "OpenaiSession"("id") ON DELETE SET NULL ON UPDATE CASCADE;
95
+
96
+ -- AddForeignKey
97
+ ALTER TABLE "OpenaiCreds" ADD CONSTRAINT "OpenaiCreds_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
98
+
99
+ -- AddForeignKey
100
+ ALTER TABLE "OpenaiBot" ADD CONSTRAINT "OpenaiBot_openaiCredsId_fkey" FOREIGN KEY ("openaiCredsId") REFERENCES "OpenaiCreds"("id") ON DELETE CASCADE ON UPDATE CASCADE;
101
+
102
+ -- AddForeignKey
103
+ ALTER TABLE "OpenaiBot" ADD CONSTRAINT "OpenaiBot_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
104
+
105
+ -- AddForeignKey
106
+ ALTER TABLE "OpenaiSession" ADD CONSTRAINT "OpenaiSession_openaiBotId_fkey" FOREIGN KEY ("openaiBotId") REFERENCES "OpenaiBot"("id") ON DELETE CASCADE ON UPDATE CASCADE;
107
+
108
+ -- AddForeignKey
109
+ ALTER TABLE "OpenaiSession" ADD CONSTRAINT "OpenaiSession_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
110
+
111
+ -- AddForeignKey
112
+ ALTER TABLE "OpenaiSetting" ADD CONSTRAINT "OpenaiSetting_openaiCredsId_fkey" FOREIGN KEY ("openaiCredsId") REFERENCES "OpenaiCreds"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
113
+
114
+ -- AddForeignKey
115
+ ALTER TABLE "OpenaiSetting" ADD CONSTRAINT "OpenaiSetting_openaiIdFallback_fkey" FOREIGN KEY ("openaiIdFallback") REFERENCES "OpenaiBot"("id") ON DELETE SET NULL ON UPDATE CASCADE;
116
+
117
+ -- AddForeignKey
118
+ ALTER TABLE "OpenaiSetting" ADD CONSTRAINT "OpenaiSetting_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
prisma/postgresql-migrations/20240718123923_adjusts_openai_tables/migration.sql ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ -- AlterTable
2
+ ALTER TABLE "OpenaiBot" ADD COLUMN "enabled" BOOLEAN NOT NULL DEFAULT true;
prisma/postgresql-migrations/20240722173259_add_name_column_to_openai_creds/migration.sql ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+
4
+ - A unique constraint covering the columns `[name]` on the table `OpenaiCreds` will be added. If there are existing duplicate values, this will fail.
5
+
6
+ */
7
+ -- AlterTable
8
+ ALTER TABLE "OpenaiCreds" ADD COLUMN "name" VARCHAR(255),
9
+ ALTER COLUMN "apiKey" DROP NOT NULL;
10
+
11
+ -- CreateIndex
12
+ CREATE UNIQUE INDEX "OpenaiCreds_name_key" ON "OpenaiCreds"("name");
prisma/postgresql-migrations/20240722173518_add_name_column_to_openai_creds/migration.sql ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ -- DropIndex
2
+ DROP INDEX "OpenaiCreds_instanceId_key";
prisma/postgresql-migrations/20240723152648_adjusts_in_column_openai_creds/migration.sql ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+
4
+ - A unique constraint covering the columns `[openaiCredsId]` on the table `OpenaiSetting` will be added. If there are existing duplicate values, this will fail.
5
+
6
+ */
7
+ -- CreateIndex
8
+ CREATE UNIQUE INDEX "OpenaiSetting_openaiCredsId_key" ON "OpenaiSetting"("openaiCredsId");
prisma/postgresql-migrations/20240723200254_add_webhookurl_on_message/migration.sql ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ -- AlterTable
2
+ ALTER TABLE "Message" ADD COLUMN "webhookUrl" VARCHAR(500);
prisma/postgresql-migrations/20240725184147_create_template_table/migration.sql ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -- CreateTable
2
+ CREATE TABLE "Template" (
3
+ "id" TEXT NOT NULL,
4
+ "templateId" VARCHAR(255) NOT NULL,
5
+ "name" VARCHAR(255) NOT NULL,
6
+ "template" JSONB NOT NULL,
7
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
8
+ "updatedAt" TIMESTAMP NOT NULL,
9
+ "instanceId" TEXT NOT NULL,
10
+
11
+ CONSTRAINT "Template_pkey" PRIMARY KEY ("id")
12
+ );
13
+
14
+ -- CreateIndex
15
+ CREATE UNIQUE INDEX "Template_templateId_key" ON "Template"("templateId");
16
+
17
+ -- CreateIndex
18
+ CREATE UNIQUE INDEX "Template_name_key" ON "Template"("name");
19
+
20
+ -- AddForeignKey
21
+ ALTER TABLE "Template" ADD CONSTRAINT "Template_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
prisma/postgresql-migrations/20240725202651_add_webhook_url_template_table/migration.sql ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ -- AlterTable
2
+ ALTER TABLE "Template" ADD COLUMN "webhookUrl" VARCHAR(500);
prisma/postgresql-migrations/20240725221646_modify_token_instance_table/migration.sql ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ -- DropIndex
2
+ DROP INDEX "Instance_token_key";
prisma/postgresql-migrations/20240729115127_modify_trigger_type_openai_typebot_table/migration.sql ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ -- AlterEnum
2
+ ALTER TYPE "TriggerType" ADD VALUE 'none';
prisma/postgresql-migrations/20240729180347_modify_typebot_session_status_openai_typebot_table/migration.sql ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+
4
+ - The values [open] on the enum `TypebotSessionStatus` will be removed. If these variants are still used in the database, this will fail.
5
+ - Changed the type of `status` on the `TypebotSession` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
6
+
7
+ */
8
+ -- AlterEnum
9
+ BEGIN;
10
+ CREATE TYPE "TypebotSessionStatus_new" AS ENUM ('opened', 'closed', 'paused');
11
+ ALTER TABLE "TypebotSession" ALTER COLUMN "status" TYPE "TypebotSessionStatus_new" USING ("status"::text::"TypebotSessionStatus_new");
12
+ ALTER TABLE "OpenaiSession" ALTER COLUMN "status" TYPE "TypebotSessionStatus_new" USING ("status"::text::"TypebotSessionStatus_new");
13
+ ALTER TYPE "TypebotSessionStatus" RENAME TO "TypebotSessionStatus_old";
14
+ ALTER TYPE "TypebotSessionStatus_new" RENAME TO "TypebotSessionStatus";
15
+ DROP TYPE "TypebotSessionStatus_old";
16
+ COMMIT;
17
+
18
+ -- AlterTable
19
+ ALTER TABLE "TypebotSession" DROP COLUMN "status",
20
+ ADD COLUMN "status" "TypebotSessionStatus" NOT NULL;
prisma/postgresql-migrations/20240730152156_create_dify_tables/migration.sql ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Warnings:
3
+
4
+ - Changed the type of `botType` on the `OpenaiBot` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
5
+
6
+ */
7
+ -- CreateEnum
8
+ CREATE TYPE "OpenaiBotType" AS ENUM ('assistant', 'chatCompletion');
9
+
10
+ -- CreateEnum
11
+ CREATE TYPE "DifyBotType" AS ENUM ('chatBot', 'textGenerator', 'agent', 'workflow');
12
+
13
+ -- DropIndex
14
+ DROP INDEX "OpenaiBot_assistantId_key";
15
+
16
+ -- AlterTable
17
+ ALTER TABLE "Message" ADD COLUMN "difySessionId" TEXT;
18
+
19
+ -- AlterTable
20
+ ALTER TABLE "OpenaiBot" DROP COLUMN "botType",
21
+ ADD COLUMN "botType" "OpenaiBotType" NOT NULL;
22
+
23
+ -- CreateTable
24
+ CREATE TABLE "Dify" (
25
+ "id" TEXT NOT NULL,
26
+ "enabled" BOOLEAN NOT NULL DEFAULT true,
27
+ "botType" "DifyBotType" NOT NULL,
28
+ "apiUrl" VARCHAR(255),
29
+ "apiKey" VARCHAR(255),
30
+ "expire" INTEGER DEFAULT 0,
31
+ "keywordFinish" VARCHAR(100),
32
+ "delayMessage" INTEGER,
33
+ "unknownMessage" VARCHAR(100),
34
+ "listeningFromMe" BOOLEAN DEFAULT false,
35
+ "stopBotFromMe" BOOLEAN DEFAULT false,
36
+ "keepOpen" BOOLEAN DEFAULT false,
37
+ "debounceTime" INTEGER,
38
+ "ignoreJids" JSONB,
39
+ "triggerType" "TriggerType",
40
+ "triggerOperator" "TriggerOperator",
41
+ "triggerValue" TEXT,
42
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
43
+ "updatedAt" TIMESTAMP NOT NULL,
44
+ "instanceId" TEXT NOT NULL,
45
+
46
+ CONSTRAINT "Dify_pkey" PRIMARY KEY ("id")
47
+ );
48
+
49
+ -- CreateTable
50
+ CREATE TABLE "DifySession" (
51
+ "id" TEXT NOT NULL,
52
+ "sessionId" VARCHAR(255) NOT NULL,
53
+ "remoteJid" VARCHAR(100) NOT NULL,
54
+ "status" "TypebotSessionStatus" NOT NULL,
55
+ "awaitUser" BOOLEAN NOT NULL DEFAULT false,
56
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
57
+ "updatedAt" TIMESTAMP NOT NULL,
58
+ "difyId" TEXT NOT NULL,
59
+ "instanceId" TEXT NOT NULL,
60
+
61
+ CONSTRAINT "DifySession_pkey" PRIMARY KEY ("id")
62
+ );
63
+
64
+ -- CreateTable
65
+ CREATE TABLE "DifySetting" (
66
+ "id" TEXT NOT NULL,
67
+ "expire" INTEGER DEFAULT 0,
68
+ "keywordFinish" VARCHAR(100),
69
+ "delayMessage" INTEGER,
70
+ "unknownMessage" VARCHAR(100),
71
+ "listeningFromMe" BOOLEAN DEFAULT false,
72
+ "stopBotFromMe" BOOLEAN DEFAULT false,
73
+ "keepOpen" BOOLEAN DEFAULT false,
74
+ "debounceTime" INTEGER,
75
+ "ignoreJids" JSONB,
76
+ "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
77
+ "updatedAt" TIMESTAMP NOT NULL,
78
+ "difyIdFallback" VARCHAR(100),
79
+ "instanceId" TEXT NOT NULL,
80
+
81
+ CONSTRAINT "DifySetting_pkey" PRIMARY KEY ("id")
82
+ );
83
+
84
+ -- CreateIndex
85
+ CREATE UNIQUE INDEX "DifySetting_instanceId_key" ON "DifySetting"("instanceId");
86
+
87
+ -- AddForeignKey
88
+ ALTER TABLE "Message" ADD CONSTRAINT "Message_difySessionId_fkey" FOREIGN KEY ("difySessionId") REFERENCES "DifySession"("id") ON DELETE SET NULL ON UPDATE CASCADE;
89
+
90
+ -- AddForeignKey
91
+ ALTER TABLE "Dify" ADD CONSTRAINT "Dify_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
92
+
93
+ -- AddForeignKey
94
+ ALTER TABLE "DifySession" ADD CONSTRAINT "DifySession_difyId_fkey" FOREIGN KEY ("difyId") REFERENCES "Dify"("id") ON DELETE CASCADE ON UPDATE CASCADE;
95
+
96
+ -- AddForeignKey
97
+ ALTER TABLE "DifySession" ADD CONSTRAINT "DifySession_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
98
+
99
+ -- AddForeignKey
100
+ ALTER TABLE "DifySetting" ADD CONSTRAINT "DifySetting_difyIdFallback_fkey" FOREIGN KEY ("difyIdFallback") REFERENCES "Dify"("id") ON DELETE SET NULL ON UPDATE CASCADE;
101
+
102
+ -- AddForeignKey
103
+ ALTER TABLE "DifySetting" ADD CONSTRAINT "DifySetting_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;