Browse code

added appinfo/info.xml appinfo/signature.json CHANGELOG.txt css/style.css js/settings.js js/adminsettings.js lib/Controller/AuthorApiController.php lib/Controller/SmsrelentlessController.php lib/Service/SmsrelentlessService.php templates/settings/personal.php templates/settings/admin.php lib/Migration/Version135Date20240420221527.php lib/Migration/Version136Date20240502081941.php

DoubleBastionAdmin authored on 02/05/2024 04:12:37
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,631 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+namespace OCA\SMSRelentless\Migration;
27
+
28
+use Closure;
29
+use OCP\DB\Types;
30
+use OCP\DB\ISchemaWrapper;
31
+use OCP\IDBConnection;
32
+use OCP\Migration\IOutput;
33
+use OCP\Migration\SimpleMigrationStep;
34
+
35
+
36
+class Version135Date20240420221527 extends SimpleMigrationStep {
37
+
38
+        /** @var IDBConnection */
39
+        private $connection;
40
+
41
+        /**
42
+         * @param IDBConnection $connection
43
+         */
44
+        public function __construct(IDBConnection $connection) {
45
+                $this->connection = $connection;
46
+        }
47
+
48
+	/**
49
+	 * @param IOutput $output
50
+	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
51
+	 * @param array $options
52
+	 * @return null|ISchemaWrapper
53
+	 */
54
+	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
55
+		/** @var ISchemaWrapper $schema */
56
+		$schema = $schemaClosure();
57
+
58
+		if (!$schema->hasTable('sms_relent_settings')) {
59
+			$table = $schema->createTable('sms_relent_settings');
60
+			$table->addColumn('id', Types::BIGINT, [
61
+				'autoincrement' => true,
62
+				'notnull' => true,
63
+                                'length' => 11,
64
+                                'unsigned' => true,
65
+			]);
66
+			$table->addColumn('user_id', Types::STRING, [
67
+				'notnull' => true,
68
+				'length' => 128,
69
+			]);
70
+			$table->addColumn('telapi_key', Types::STRING, [
71
+				'notnull' => true,
72
+				'length' => 512,
73
+			]);
74
+			$table->addColumn('tel_pub_key', Types::STRING, [
75
+				'notnull' => true,
76
+				'length' => 512,
77
+			]);
78
+			$table->addColumn('telapi_url_rec', Types::STRING, [
79
+				'notnull' => true,
80
+				'length' => 512,
81
+			]);
82
+			$table->addColumn('telapi_url', Types::STRING, [
83
+				'notnull' => true,
84
+				'length' => 512,
85
+			]);
86
+			$table->addColumn('messaging_profile_id', Types::STRING, [
87
+				'notnull' => true,
88
+				'length' => 512,
89
+			]);
90
+			$table->addColumn('nexapi_key', Types::STRING, [
91
+				'notnull' => true,
92
+				'length' => 512,
93
+			]);
94
+			$table->addColumn('nexapi_secret', Types::STRING, [
95
+				'notnull' => true,
96
+				'length' => 512,
97
+			]);
98
+			$table->addColumn('nexapi_url_rec', Types::STRING, [
99
+				'notnull' => true,
100
+				'length' => 512,
101
+			]);
102
+			$table->addColumn('nexapi_url', Types::STRING, [
103
+				'notnull' => true,
104
+				'length' => 512,
105
+			]);
106
+			$table->addColumn('twilapi_key', Types::STRING, [
107
+				'notnull' => true,
108
+				'length' => 512,
109
+			]);
110
+			$table->addColumn('twilapi_secret', Types::STRING, [
111
+				'notnull' => true,
112
+				'length' => 512,
113
+			]);
114
+			$table->addColumn('twilapi_url_rec', Types::STRING, [
115
+				'notnull' => true,
116
+				'length' => 512,
117
+			]);
118
+			$table->addColumn('twilapi_url', Types::STRING, [
119
+				'notnull' => true,
120
+				'length' => 512,
121
+			]);
122
+			$table->addColumn('flowapi_key', Types::STRING, [
123
+				'notnull' => true,
124
+				'length' => 512,
125
+			]);
126
+			$table->addColumn('flowapi_secret', Types::STRING, [
127
+				'notnull' => true,
128
+				'length' => 512,
129
+			]);
130
+			$table->addColumn('flowapi_url_rec', Types::STRING, [
131
+				'notnull' => true,
132
+				'length' => 512,
133
+			]);
134
+			$table->addColumn('flowapi_url', Types::STRING, [
135
+				'notnull' => true,
136
+				'length' => 512,
137
+			]);
138
+			$table->addColumn('tel_sender_name', Types::STRING, [
139
+				'notnull' => false,
140
+				'length' => 48,
141
+				'default' => '',
142
+			]);
143
+			$table->addColumn('nex_sender_name', Types::STRING, [
144
+				'notnull' => false,
145
+				'length' => 48,
146
+				'default' => '',
147
+			]);
148
+			$table->addColumn('twil_sender_name', Types::STRING, [
149
+				'notnull' => false,
150
+				'length' => 48,
151
+				'default' => '',
152
+			]);
153
+			$table->addColumn('flow_sender_name', Types::STRING, [
154
+				'notnull' => false,
155
+				'length' => 48,
156
+				'default' => '',
157
+			]);
158
+			$table->addColumn('messagesperpage', Types::INTEGER, [
159
+				'notnull' => false,
160
+				'length' => 10,
161
+                                'unsigned' => true,
162
+			]);
163
+			$table->addColumn('get_notify', Types::SMALLINT, [
164
+				'notnull' => false,
165
+				'length' => 1,
166
+			]);
167
+			$table->addColumn('notification_email', Types::STRING, [
168
+				'notnull' => false,
169
+				'length' => 512,
170
+				'default' => '',
171
+			]);
172
+			$table->addColumn('getsmsinemail', Types::SMALLINT, [
173
+				'notnull' => false,
174
+				'length' => 1,
175
+			]);
176
+			$table->addColumn('show_all_messages', Types::SMALLINT, [
177
+				'notnull' => false,
178
+				'length' => 1,
179
+			]);
180
+			$table->addColumn('show_display_names', Types::SMALLINT, [
181
+				'notnull' => false,
182
+				'length' => 1,
183
+			]);
184
+			$table->addColumn('add_display_names', Types::SMALLINT, [
185
+				'notnull' => false,
186
+				'length' => 1,
187
+			]);
188
+			$table->addColumn('available_numbers', Types::TEXT, [
189
+				'notnull' => false,
190
+                                'default' => '',
191
+			]);
192
+			$table->addColumn('msg_check_interval', Types::INTEGER, [
193
+				'notnull' => false,
194
+				'length' => 10,
195
+                                'unsigned' => true,
196
+			]);
197
+			$table->addColumn('new_message_rcd', Types::SMALLINT, [
198
+				'notnull' => false,
199
+				'length' => 1,
200
+			]);
201
+			$table->addColumn('archived_conv_nmbr', Types::INTEGER, [
202
+				'notnull' => false,
203
+				'length' => 10,
204
+                                'unsigned' => true,
205
+			]);
206
+                        $table->setPrimaryKey(['id']);
207
+                        $table->addUniqueIndex(['id']);
208
+
209
+		}
210
+
211
+
212
+		if (!$schema->hasTable('sms_relent_received')) {
213
+			$table = $schema->createTable('sms_relent_received');
214
+			$table->addColumn('id', Types::BIGINT, [
215
+				'autoincrement' => true,
216
+				'notnull' => true,
217
+                                'length' => 11,
218
+                                'unsigned' => true,
219
+			]);
220
+			$table->addColumn('user_id', Types::STRING, [
221
+				'notnull' => true,
222
+				'length' => 64,
223
+			]);
224
+			$table->addColumn('message_id', Types::STRING, [
225
+				'notnull' => true,
226
+				'length' => 512,
227
+			]);
228
+			$table->addColumn('date', Types::DATETIME, [
229
+				'notnull' => true,
230
+			]);
231
+			$table->addColumn('from', Types::STRING, [
232
+				'notnull' => true,
233
+				'length' => 128,
234
+			]);
235
+			$table->addColumn('to', Types::STRING, [
236
+				'notnull' => true,
237
+				'length' => 128,
238
+			]);
239
+			$table->addColumn('message', Types::TEXT, [
240
+				'notnull' => false,
241
+				'default' => '',
242
+			]);
243
+			$table->addColumn('author_displayname', Types::STRING, [
244
+				'notnull' => true,
245
+				'length' => 255,
246
+			]);
247
+			$table->addColumn('internal_sender', Types::SMALLINT, [
248
+				'notnull' => false,
249
+				'length' => 1,
250
+			]);
251
+			$table->addColumn('conversation_id', Types::STRING, [
252
+				'notnull' => false,
253
+				'length' => 255,
254
+			]);
255
+                        $table->setPrimaryKey(['id']);
256
+                        $table->addUniqueIndex(['id']);
257
+
258
+		}
259
+
260
+
261
+		if (!$schema->hasTable('sms_relent_sent')) {
262
+			$table = $schema->createTable('sms_relent_sent');
263
+			$table->addColumn('id', Types::BIGINT, [
264
+				'autoincrement' => true,
265
+				'notnull' => true,
266
+                                'length' => 11,
267
+                                'unsigned' => true,
268
+			]);
269
+			$table->addColumn('user_id', Types::STRING, [
270
+				'notnull' => true,
271
+				'length' => 64,
272
+			]);
273
+			$table->addColumn('message_id', Types::STRING, [
274
+				'notnull' => true,
275
+				'length' => 512,
276
+			]);
277
+			$table->addColumn('date', Types::DATETIME, [
278
+				'notnull' => true,
279
+			]);
280
+			$table->addColumn('from', Types::STRING, [
281
+				'notnull' => true,
282
+				'length' => 128,
283
+			]);
284
+			$table->addColumn('to', Types::STRING, [
285
+				'notnull' => true,
286
+				'length' => 128,
287
+			]);
288
+			$table->addColumn('network ', Types::STRING, [
289
+				'notnull' => false,
290
+				'length' => 64,
291
+				'default' => '',
292
+			]);
293
+			$table->addColumn('price', Types::STRING, [
294
+				'notnull' => false,
295
+				'length' => 64,
296
+				'default' => '',
297
+			]);
298
+			$table->addColumn('status', Types::STRING, [
299
+				'notnull' => false,
300
+				'length' => 512,
301
+				'default' => '',
302
+			]);
303
+			$table->addColumn('deliveryreceipt', Types::STRING, [
304
+				'notnull' => false,
305
+				'length' => 64,
306
+				'default' => '',
307
+			]);
308
+			$table->addColumn('message', Types::TEXT, [
309
+				'notnull' => false,
310
+                                'default' => '',
311
+			]);
312
+			$table->addColumn('author_displayname', Types::STRING, [
313
+				'notnull' => true,
314
+				'length' => 255,
315
+			]);
316
+			$table->addColumn('conversation_id', Types::STRING, [
317
+				'notnull' => false,
318
+				'length' => 255,
319
+			]);
320
+                        $table->setPrimaryKey(['id']);
321
+                        $table->addUniqueIndex(['id']);
322
+
323
+		}
324
+
325
+
326
+		if (!$schema->hasTable('sms_relent_autorply')) {
327
+			$table = $schema->createTable('sms_relent_autorply');
328
+			$table->addColumn('id', Types::BIGINT, [
329
+				'autoincrement' => true,
330
+				'notnull' => true,
331
+                                'length' => 11,
332
+                                'unsigned' => true,
333
+			]);
334
+			$table->addColumn('user_id', Types::STRING, [
335
+				'notnull' => true,
336
+				'length' => 128,
337
+			]);
338
+			$table->addColumn('saved_by_dsplname', Types::STRING, [
339
+				'notnull' => true,
340
+				'length' => 255,
341
+			]);
342
+			$table->addColumn('phone_number', Types::STRING, [
343
+				'notnull' => true,
344
+				'length' => 128,
345
+			]);
346
+			$table->addColumn('days_of_week', Types::STRING, [
347
+				'notnull' => false,
348
+				'length' => 64,
349
+                                'default' => '',
350
+			]);
351
+			$table->addColumn('daily_start', Types::STRING, [
352
+				'notnull' => false,
353
+				'length' => 8,
354
+                                'default' => '',
355
+			]);
356
+			$table->addColumn('daily_end', Types::STRING, [
357
+				'notnull' => false,
358
+				'length' => 8,
359
+                                'default' => '',
360
+			]);
361
+			$table->addColumn('vacation_start', Types::DATETIME, [
362
+				'notnull' => false,
363
+			]);
364
+			$table->addColumn('vacation_end', Types::DATETIME, [
365
+				'notnull' => false,
366
+			]);
367
+			$table->addColumn('message_text', Types::TEXT, [
368
+				'notnull' => false,
369
+                                'default' => '',
370
+			]);
371
+                        $table->setPrimaryKey(['id']);
372
+                        $table->addUniqueIndex(['id']);
373
+		}
374
+
375
+
376
+		if (!$schema->hasTable('sms_relent_restrict')) {
377
+			$table = $schema->createTable('sms_relent_restrict');
378
+			$table->addColumn('id', Types::BIGINT, [
379
+				'autoincrement' => true,
380
+				'notnull' => true,
381
+                                'length' => 11,
382
+                                'unsigned' => true,
383
+			]);
384
+			$table->addColumn('user_id', Types::STRING, [
385
+				'notnull' => true,
386
+				'length' => 128,
387
+			]);
388
+			$table->addColumn('saved_by_dsplname', Types::STRING, [
389
+				'notnull' => true,
390
+				'length' => 255,
391
+			]);
392
+			$table->addColumn('phone_number', Types::STRING, [
393
+				'notnull' => true,
394
+				'length' => 128,
395
+			]);
396
+			$table->addColumn('groups', Types::STRING, [
397
+				'notnull' => true,
398
+				'length' => 2048,
399
+			]);
400
+			$table->addColumn('users', Types::STRING, [
401
+				'notnull' => true,
402
+				'length' => 2048,
403
+			]);
404
+                        $table->setPrimaryKey(['id']);
405
+                        $table->addUniqueIndex(['id']);
406
+		}
407
+
408
+
409
+		if (!$schema->hasTable('sms_relent_subac')) {
410
+			$table = $schema->createTable('sms_relent_subac');
411
+			$table->addColumn('id', Types::BIGINT, [
412
+				'autoincrement' => true,
413
+				'notnull' => true,
414
+                                'length' => 11,
415
+                                'unsigned' => true,
416
+			]);
417
+			$table->addColumn('user_id', Types::STRING, [
418
+				'notnull' => true,
419
+				'length' => 128,
420
+			]);
421
+			$table->addColumn('tnx_groups_allowed', Types::TEXT, [
422
+				'notnull' => false,
423
+                                'default' => '',
424
+			]);
425
+			$table->addColumn('tnx_users_allowed', Types::TEXT, [
426
+				'notnull' => false,
427
+                                'default' => '',
428
+			]);
429
+			$table->addColumn('plv_groups_allowed', Types::TEXT, [
430
+				'notnull' => false,
431
+                                'default' => '',
432
+			]);
433
+			$table->addColumn('plv_users_allowed', Types::TEXT, [
434
+				'notnull' => false,
435
+                                'default' => '',
436
+			]);
437
+			$table->addColumn('twl_groups_allowed', Types::TEXT, [
438
+				'notnull' => false,
439
+                                'default' => '',
440
+			]);
441
+			$table->addColumn('twl_users_allowed', Types::TEXT, [
442
+				'notnull' => false,
443
+                                'default' => '',
444
+			]);
445
+			$table->addColumn('flr_groups_allowed', Types::TEXT, [
446
+				'notnull' => false,
447
+                                'default' => '',
448
+			]);
449
+			$table->addColumn('flr_users_allowed', Types::TEXT, [
450
+				'notnull' => false,
451
+                                'default' => '',
452
+			]);
453
+			$table->addColumn('tnx_groups_del', Types::SMALLINT, [
454
+				'notnull' => false,
455
+				'length' => 1,
456
+			]);
457
+			$table->addColumn('tnx_users_del', Types::SMALLINT, [
458
+				'notnull' => false,
459
+				'length' => 1,
460
+			]);
461
+			$table->addColumn('plv_groups_del', Types::SMALLINT, [
462
+				'notnull' => false,
463
+				'length' => 1,
464
+			]);
465
+			$table->addColumn('plv_users_del', Types::SMALLINT, [
466
+				'notnull' => false,
467
+				'length' => 1,
468
+			]);
469
+			$table->addColumn('twl_groups_del', Types::SMALLINT, [
470
+				'notnull' => false,
471
+				'length' => 1,
472
+			]);
473
+			$table->addColumn('twl_users_del', Types::SMALLINT, [
474
+				'notnull' => false,
475
+				'length' => 1,
476
+			]);
477
+			$table->addColumn('flr_groups_del', Types::SMALLINT, [
478
+				'notnull' => false,
479
+				'length' => 1,
480
+			]);
481
+			$table->addColumn('flr_users_del', Types::SMALLINT, [
482
+				'notnull' => false,
483
+				'length' => 1,
484
+			]);
485
+                        $table->setPrimaryKey(['id']);
486
+                        $table->addUniqueIndex(['id']);
487
+
488
+		} else {
489
+
490
+                        $table = $schema->getTable('sms_relent_subac');
491
+
492
+			$table->addColumn('tnx_groups_del', Types::SMALLINT, [
493
+				'notnull' => false,
494
+				'length' => 1,
495
+			]);
496
+			$table->addColumn('tnx_users_del', Types::SMALLINT, [
497
+				'notnull' => false,
498
+				'length' => 1,
499
+			]);
500
+			$table->addColumn('plv_groups_del', Types::SMALLINT, [
501
+				'notnull' => false,
502
+				'length' => 1,
503
+			]);
504
+			$table->addColumn('plv_users_del', Types::SMALLINT, [
505
+				'notnull' => false,
506
+				'length' => 1,
507
+			]);
508
+			$table->addColumn('twl_groups_del', Types::SMALLINT, [
509
+				'notnull' => false,
510
+				'length' => 1,
511
+			]);
512
+			$table->addColumn('twl_users_del', Types::SMALLINT, [
513
+				'notnull' => false,
514
+				'length' => 1,
515
+			]);
516
+			$table->addColumn('flr_groups_del', Types::SMALLINT, [
517
+				'notnull' => false,
518
+				'length' => 1,
519
+			]);
520
+			$table->addColumn('flr_users_del', Types::SMALLINT, [
521
+				'notnull' => false,
522
+				'length' => 1,
523
+			]);
524
+                }
525
+
526
+
527
+		if (!$schema->hasTable('sms_relent_conv')) {
528
+			$table = $schema->createTable('sms_relent_conv');
529
+			$table->addColumn('id', Types::BIGINT, [
530
+				'autoincrement' => true,
531
+				'notnull' => true,
532
+                                'length' => 11,
533
+                                'unsigned' => true,
534
+			]);
535
+			$table->addColumn('conversation_id', Types::STRING, [
536
+				'notnull' => false,
537
+				'length' => 255,
538
+			]);
539
+			$table->addColumn('archived', Types::SMALLINT, [
540
+				'notnull' => false,
541
+				'length' => 1,
542
+			]);
543
+			$table->addColumn('last_archived', Types::DATETIME, [
544
+				'notnull' => false,
545
+			]);
546
+			$table->addColumn('last_unarchived', Types::DATETIME, [
547
+				'notnull' => false,
548
+			]);
549
+			$table->addColumn('archived_by', Types::STRING, [
550
+				'notnull' => false,
551
+				'length' => 128,
552
+			]);
553
+			$table->addColumn('unarchived_by', Types::STRING, [
554
+				'notnull' => false,
555
+				'length' => 128,
556
+			]);
557
+			$table->addColumn('last_msg_date', Types::DATETIME, [
558
+				'notnull' => true,
559
+			]);
560
+			$table->addColumn('last_msg_from', Types::STRING, [
561
+				'notnull' => true,
562
+				'length' => 128,
563
+			]);
564
+			$table->addColumn('last_msg_to', Types::STRING, [
565
+				'notnull' => true,
566
+				'length' => 128,
567
+			]);
568
+			$table->addColumn('last_message', Types::TEXT, [
569
+				'notnull' => false,
570
+				'default' => '',
571
+			]);
572
+			$table->addColumn('lastmsgdisplayname', Types::STRING, [
573
+				'notnull' => true,
574
+				'length' => 255,
575
+			]);
576
+			$table->addColumn('flagged', Types::SMALLINT, [
577
+				'notnull' => false,
578
+				'length' => 1,
579
+			]);
580
+			$table->addColumn('flagunflagby', Types::STRING, [
581
+				'notnull' => false,
582
+				'length' => 128,
583
+			]);
584
+			$table->addColumn('flagunflagdate', Types::DATETIME, [
585
+				'notnull' => false,
586
+			]);
587
+			$table->addColumn('tag', Types::STRING, [
588
+				'notnull' => false,
589
+				'length' => 100,
590
+			]);
591
+			$table->addColumn('taguntagby', Types::STRING, [
592
+				'notnull' => false,
593
+				'length' => 128,
594
+			]);
595
+			$table->addColumn('taguntagdate', Types::DATETIME, [
596
+				'notnull' => false,
597
+			]);
598
+			$table->addColumn('description', Types::TEXT, [
599
+				'notnull' => false,
600
+                                'default' => '',
601
+			]);
602
+			$table->addColumn('descriptionby', Types::STRING, [
603
+				'notnull' => false,
604
+				'length' => 128,
605
+			]);
606
+			$table->addColumn('descriptiondate', Types::DATETIME, [
607
+				'notnull' => false,
608
+			]);
609
+			$table->addColumn('lastmsgprovid', Types::STRING, [
610
+				'notnull' => false,
611
+				'length' => 512,
612
+                                'default' => '',
613
+			]);
614
+                        $table->setPrimaryKey(['id']);
615
+                        $table->addUniqueIndex(['id']);
616
+
617
+		} else {
618
+
619
+                        $table = $schema->getTable('sms_relent_conv');
620
+
621
+			$table->addColumn('lastmsgprovid', Types::STRING, [
622
+				'notnull' => false,
623
+				'length' => 512,
624
+                                'default' => '',
625
+			]);
626
+               }
627
+
628
+		return $schema;
629
+	}
630
+
631
+}
Browse code

removed appinfo/info.xml appinfo/signature.json CHANGELOG.txt css/style.css js/settings.js js/adminsettings.js lib/Controller/AuthorApiController.php lib/Controller/SmsrelentlessController.php lib/Service/SmsrelentlessService.php templates/settings/personal.php templates/settings/admin.php lib/Migration/Version135Date20240420221527.php

DoubleBastionAdmin authored on 02/05/2024 04:04:23
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,599 +0,0 @@
1
-<?php
2
-/**
3
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
- *
5
- * @author Double Bastion LLC
6
- *
7
- * @license GNU AGPL version 3 or any later version
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
- * License as published by the Free Software Foundation; either
12
- * version 3 of the License, or any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public
20
- * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
- *
22
- */
23
-
24
-declare(strict_types=1);
25
-
26
-namespace OCA\SMSRelentless\Migration;
27
-
28
-use Closure;
29
-use OCP\DB\Types;
30
-use OCP\DB\ISchemaWrapper;
31
-use OCP\IDBConnection;
32
-use OCP\Migration\IOutput;
33
-use OCP\Migration\SimpleMigrationStep;
34
-
35
-
36
-class Version135Date20240420221527 extends SimpleMigrationStep {
37
-
38
-        /** @var IDBConnection */
39
-        private $connection;
40
-
41
-        /**
42
-         * @param IDBConnection $connection
43
-         */
44
-        public function __construct(IDBConnection $connection) {
45
-                $this->connection = $connection;
46
-        }
47
-
48
-	/**
49
-	 * @param IOutput $output
50
-	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
51
-	 * @param array $options
52
-	 * @return null|ISchemaWrapper
53
-	 */
54
-	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
55
-		/** @var ISchemaWrapper $schema */
56
-		$schema = $schemaClosure();
57
-
58
-		if (!$schema->hasTable('sms_relent_settings')) {
59
-			$table = $schema->createTable('sms_relent_settings');
60
-			$table->addColumn('id', Types::BIGINT, [
61
-				'autoincrement' => true,
62
-				'notnull' => true,
63
-                                'length' => 11,
64
-                                'unsigned' => true,
65
-			]);
66
-			$table->addColumn('user_id', Types::STRING, [
67
-				'notnull' => true,
68
-				'length' => 128,
69
-			]);
70
-			$table->addColumn('telapi_key', Types::STRING, [
71
-				'notnull' => true,
72
-				'length' => 512,
73
-			]);
74
-			$table->addColumn('tel_pub_key', Types::STRING, [
75
-				'notnull' => true,
76
-				'length' => 512,
77
-			]);
78
-			$table->addColumn('telapi_url_rec', Types::STRING, [
79
-				'notnull' => true,
80
-				'length' => 512,
81
-			]);
82
-			$table->addColumn('telapi_url', Types::STRING, [
83
-				'notnull' => true,
84
-				'length' => 512,
85
-			]);
86
-			$table->addColumn('messaging_profile_id', Types::STRING, [
87
-				'notnull' => true,
88
-				'length' => 512,
89
-			]);
90
-			$table->addColumn('nexapi_key', Types::STRING, [
91
-				'notnull' => true,
92
-				'length' => 512,
93
-			]);
94
-			$table->addColumn('nexapi_secret', Types::STRING, [
95
-				'notnull' => true,
96
-				'length' => 512,
97
-			]);
98
-			$table->addColumn('nexapi_url_rec', Types::STRING, [
99
-				'notnull' => true,
100
-				'length' => 512,
101
-			]);
102
-			$table->addColumn('nexapi_url', Types::STRING, [
103
-				'notnull' => true,
104
-				'length' => 512,
105
-			]);
106
-			$table->addColumn('twilapi_key', Types::STRING, [
107
-				'notnull' => true,
108
-				'length' => 512,
109
-			]);
110
-			$table->addColumn('twilapi_secret', Types::STRING, [
111
-				'notnull' => true,
112
-				'length' => 512,
113
-			]);
114
-			$table->addColumn('twilapi_url_rec', Types::STRING, [
115
-				'notnull' => true,
116
-				'length' => 512,
117
-			]);
118
-			$table->addColumn('twilapi_url', Types::STRING, [
119
-				'notnull' => true,
120
-				'length' => 512,
121
-			]);
122
-			$table->addColumn('flowapi_key', Types::STRING, [
123
-				'notnull' => true,
124
-				'length' => 512,
125
-			]);
126
-			$table->addColumn('flowapi_secret', Types::STRING, [
127
-				'notnull' => true,
128
-				'length' => 512,
129
-			]);
130
-			$table->addColumn('flowapi_url_rec', Types::STRING, [
131
-				'notnull' => true,
132
-				'length' => 512,
133
-			]);
134
-			$table->addColumn('flowapi_url', Types::STRING, [
135
-				'notnull' => true,
136
-				'length' => 512,
137
-			]);
138
-			$table->addColumn('tel_sender_name', Types::STRING, [
139
-				'notnull' => false,
140
-				'length' => 48,
141
-				'default' => '',
142
-			]);
143
-			$table->addColumn('nex_sender_name', Types::STRING, [
144
-				'notnull' => false,
145
-				'length' => 48,
146
-				'default' => '',
147
-			]);
148
-			$table->addColumn('twil_sender_name', Types::STRING, [
149
-				'notnull' => false,
150
-				'length' => 48,
151
-				'default' => '',
152
-			]);
153
-			$table->addColumn('flow_sender_name', Types::STRING, [
154
-				'notnull' => false,
155
-				'length' => 48,
156
-				'default' => '',
157
-			]);
158
-			$table->addColumn('messagesperpage', Types::INTEGER, [
159
-				'notnull' => false,
160
-				'length' => 10,
161
-                                'unsigned' => true,
162
-			]);
163
-			$table->addColumn('get_notify', Types::SMALLINT, [
164
-				'notnull' => false,
165
-				'length' => 1,
166
-			]);
167
-			$table->addColumn('notification_email', Types::STRING, [
168
-				'notnull' => false,
169
-				'length' => 512,
170
-				'default' => '',
171
-			]);
172
-			$table->addColumn('getsmsinemail', Types::SMALLINT, [
173
-				'notnull' => false,
174
-				'length' => 1,
175
-			]);
176
-			$table->addColumn('show_all_messages', Types::SMALLINT, [
177
-				'notnull' => false,
178
-				'length' => 1,
179
-			]);
180
-			$table->addColumn('show_display_names', Types::SMALLINT, [
181
-				'notnull' => false,
182
-				'length' => 1,
183
-			]);
184
-			$table->addColumn('add_display_names', Types::SMALLINT, [
185
-				'notnull' => false,
186
-				'length' => 1,
187
-			]);
188
-			$table->addColumn('available_numbers', Types::TEXT, [
189
-				'notnull' => false,
190
-                                'default' => '',
191
-			]);
192
-			$table->addColumn('msg_check_interval', Types::INTEGER, [
193
-				'notnull' => false,
194
-				'length' => 10,
195
-                                'unsigned' => true,
196
-			]);
197
-			$table->addColumn('new_message_rcd', Types::SMALLINT, [
198
-				'notnull' => false,
199
-				'length' => 1,
200
-			]);
201
-			$table->addColumn('archived_conv_nmbr', Types::INTEGER, [
202
-				'notnull' => false,
203
-				'length' => 10,
204
-                                'unsigned' => true,
205
-			]);
206
-                        $table->setPrimaryKey(['id']);
207
-                        $table->addUniqueIndex(['id']);
208
-
209
-		}
210
-
211
-
212
-		if (!$schema->hasTable('sms_relent_received')) {
213
-			$table = $schema->createTable('sms_relent_received');
214
-			$table->addColumn('id', Types::BIGINT, [
215
-				'autoincrement' => true,
216
-				'notnull' => true,
217
-                                'length' => 11,
218
-                                'unsigned' => true,
219
-			]);
220
-			$table->addColumn('user_id', Types::STRING, [
221
-				'notnull' => true,
222
-				'length' => 64,
223
-			]);
224
-			$table->addColumn('message_id', Types::STRING, [
225
-				'notnull' => true,
226
-				'length' => 512,
227
-			]);
228
-			$table->addColumn('date', Types::DATETIME, [
229
-				'notnull' => true,
230
-			]);
231
-			$table->addColumn('from', Types::STRING, [
232
-				'notnull' => true,
233
-				'length' => 128,
234
-			]);
235
-			$table->addColumn('to', Types::STRING, [
236
-				'notnull' => true,
237
-				'length' => 128,
238
-			]);
239
-			$table->addColumn('message', Types::TEXT, [
240
-				'notnull' => false,
241
-				'default' => '',
242
-			]);
243
-			$table->addColumn('author_displayname', Types::STRING, [
244
-				'notnull' => true,
245
-				'length' => 255,
246
-			]);
247
-			$table->addColumn('internal_sender', Types::SMALLINT, [
248
-				'notnull' => false,
249
-				'length' => 1,
250
-			]);
251
-			$table->addColumn('conversation_id', Types::STRING, [
252
-				'notnull' => false,
253
-				'length' => 255,
254
-			]);
255
-                        $table->setPrimaryKey(['id']);
256
-                        $table->addUniqueIndex(['id']);
257
-
258
-		}
259
-
260
-
261
-		if (!$schema->hasTable('sms_relent_sent')) {
262
-			$table = $schema->createTable('sms_relent_sent');
263
-			$table->addColumn('id', Types::BIGINT, [
264
-				'autoincrement' => true,
265
-				'notnull' => true,
266
-                                'length' => 11,
267
-                                'unsigned' => true,
268
-			]);
269
-			$table->addColumn('user_id', Types::STRING, [
270
-				'notnull' => true,
271
-				'length' => 64,
272
-			]);
273
-			$table->addColumn('message_id', Types::STRING, [
274
-				'notnull' => true,
275
-				'length' => 512,
276
-			]);
277
-			$table->addColumn('date', Types::DATETIME, [
278
-				'notnull' => true,
279
-			]);
280
-			$table->addColumn('from', Types::STRING, [
281
-				'notnull' => true,
282
-				'length' => 128,
283
-			]);
284
-			$table->addColumn('to', Types::STRING, [
285
-				'notnull' => true,
286
-				'length' => 128,
287
-			]);
288
-			$table->addColumn('network ', Types::STRING, [
289
-				'notnull' => false,
290
-				'length' => 64,
291
-				'default' => '',
292
-			]);
293
-			$table->addColumn('price', Types::STRING, [
294
-				'notnull' => false,
295
-				'length' => 64,
296
-				'default' => '',
297
-			]);
298
-			$table->addColumn('status', Types::STRING, [
299
-				'notnull' => false,
300
-				'length' => 512,
301
-				'default' => '',
302
-			]);
303
-			$table->addColumn('deliveryreceipt', Types::STRING, [
304
-				'notnull' => false,
305
-				'length' => 64,
306
-				'default' => '',
307
-			]);
308
-			$table->addColumn('message', Types::TEXT, [
309
-				'notnull' => false,
310
-                                'default' => '',
311
-			]);
312
-			$table->addColumn('author_displayname', Types::STRING, [
313
-				'notnull' => true,
314
-				'length' => 255,
315
-			]);
316
-			$table->addColumn('conversation_id', Types::STRING, [
317
-				'notnull' => false,
318
-				'length' => 255,
319
-			]);
320
-                        $table->setPrimaryKey(['id']);
321
-                        $table->addUniqueIndex(['id']);
322
-
323
-		}
324
-
325
-
326
-		if (!$schema->hasTable('sms_relent_autorply')) {
327
-			$table = $schema->createTable('sms_relent_autorply');
328
-			$table->addColumn('id', Types::BIGINT, [
329
-				'autoincrement' => true,
330
-				'notnull' => true,
331
-                                'length' => 11,
332
-                                'unsigned' => true,
333
-			]);
334
-			$table->addColumn('user_id', Types::STRING, [
335
-				'notnull' => true,
336
-				'length' => 128,
337
-			]);
338
-			$table->addColumn('saved_by_dsplname', Types::STRING, [
339
-				'notnull' => true,
340
-				'length' => 255,
341
-			]);
342
-			$table->addColumn('phone_number', Types::STRING, [
343
-				'notnull' => true,
344
-				'length' => 128,
345
-			]);
346
-			$table->addColumn('days_of_week', Types::STRING, [
347
-				'notnull' => false,
348
-				'length' => 64,
349
-                                'default' => '',
350
-			]);
351
-			$table->addColumn('daily_start', Types::STRING, [
352
-				'notnull' => false,
353
-				'length' => 8,
354
-                                'default' => '',
355
-			]);
356
-			$table->addColumn('daily_end', Types::STRING, [
357
-				'notnull' => false,
358
-				'length' => 8,
359
-                                'default' => '',
360
-			]);
361
-			$table->addColumn('vacation_start', Types::DATETIME, [
362
-				'notnull' => false,
363
-			]);
364
-			$table->addColumn('vacation_end', Types::DATETIME, [
365
-				'notnull' => false,
366
-			]);
367
-			$table->addColumn('message_text', Types::TEXT, [
368
-				'notnull' => false,
369
-                                'default' => '',
370
-			]);
371
-                        $table->setPrimaryKey(['id']);
372
-                        $table->addUniqueIndex(['id']);
373
-		}
374
-
375
-
376
-		if (!$schema->hasTable('sms_relent_restrict')) {
377
-			$table = $schema->createTable('sms_relent_restrict');
378
-			$table->addColumn('id', Types::BIGINT, [
379
-				'autoincrement' => true,
380
-				'notnull' => true,
381
-                                'length' => 11,
382
-                                'unsigned' => true,
383
-			]);
384
-			$table->addColumn('user_id', Types::STRING, [
385
-				'notnull' => true,
386
-				'length' => 128,
387
-			]);
388
-			$table->addColumn('saved_by_dsplname', Types::STRING, [
389
-				'notnull' => true,
390
-				'length' => 255,
391
-			]);
392
-			$table->addColumn('phone_number', Types::STRING, [
393
-				'notnull' => true,
394
-				'length' => 128,
395
-			]);
396
-			$table->addColumn('groups', Types::STRING, [
397
-				'notnull' => true,
398
-				'length' => 2048,
399
-			]);
400
-			$table->addColumn('users', Types::STRING, [
401
-				'notnull' => true,
402
-				'length' => 2048,
403
-			]);
404
-                        $table->setPrimaryKey(['id']);
405
-                        $table->addUniqueIndex(['id']);
406
-		}
407
-
408
-
409
-		if (!$schema->hasTable('sms_relent_subac')) {
410
-			$table = $schema->createTable('sms_relent_subac');
411
-			$table->addColumn('id', Types::BIGINT, [
412
-				'autoincrement' => true,
413
-				'notnull' => true,
414
-                                'length' => 11,
415
-                                'unsigned' => true,
416
-			]);
417
-			$table->addColumn('user_id', Types::STRING, [
418
-				'notnull' => true,
419
-				'length' => 128,
420
-			]);
421
-			$table->addColumn('tnx_groups_allowed', Types::TEXT, [
422
-				'notnull' => false,
423
-                                'default' => '',
424
-			]);
425
-			$table->addColumn('tnx_users_allowed', Types::TEXT, [
426
-				'notnull' => false,
427
-                                'default' => '',
428
-			]);
429
-			$table->addColumn('plv_groups_allowed', Types::TEXT, [
430
-				'notnull' => false,
431
-                                'default' => '',
432
-			]);
433
-			$table->addColumn('plv_users_allowed', Types::TEXT, [
434
-				'notnull' => false,
435
-                                'default' => '',
436
-			]);
437
-			$table->addColumn('twl_groups_allowed', Types::TEXT, [
438
-				'notnull' => false,
439
-                                'default' => '',
440
-			]);
441
-			$table->addColumn('twl_users_allowed', Types::TEXT, [
442
-				'notnull' => false,
443
-                                'default' => '',
444
-			]);
445
-			$table->addColumn('flr_groups_allowed', Types::TEXT, [
446
-				'notnull' => false,
447
-                                'default' => '',
448
-			]);
449
-			$table->addColumn('flr_users_allowed', Types::TEXT, [
450
-				'notnull' => false,
451
-                                'default' => '',
452
-			]);
453
-                        $table->setPrimaryKey(['id']);
454
-                        $table->addUniqueIndex(['id']);
455
-
456
-		} else {
457
-
458
-                        $table = $schema->getTable('sms_relent_subac');
459
-
460
-			$table->addColumn('tnx_groups_del', Types::SMALLINT, [
461
-				'notnull' => false,
462
-				'length' => 1,
463
-			]);
464
-			$table->addColumn('tnx_users_del', Types::SMALLINT, [
465
-				'notnull' => false,
466
-				'length' => 1,
467
-			]);
468
-			$table->addColumn('plv_groups_del', Types::SMALLINT, [
469
-				'notnull' => false,
470
-				'length' => 1,
471
-			]);
472
-			$table->addColumn('plv_users_del', Types::SMALLINT, [
473
-				'notnull' => false,
474
-				'length' => 1,
475
-			]);
476
-			$table->addColumn('twl_groups_del', Types::SMALLINT, [
477
-				'notnull' => false,
478
-				'length' => 1,
479
-			]);
480
-			$table->addColumn('twl_users_del', Types::SMALLINT, [
481
-				'notnull' => false,
482
-				'length' => 1,
483
-			]);
484
-			$table->addColumn('flr_groups_del', Types::SMALLINT, [
485
-				'notnull' => false,
486
-				'length' => 1,
487
-			]);
488
-			$table->addColumn('flr_users_del', Types::SMALLINT, [
489
-				'notnull' => false,
490
-				'length' => 1,
491
-			]);
492
-                }
493
-
494
-
495
-		if (!$schema->hasTable('sms_relent_conv')) {
496
-			$table = $schema->createTable('sms_relent_conv');
497
-			$table->addColumn('id', Types::BIGINT, [
498
-				'autoincrement' => true,
499
-				'notnull' => true,
500
-                                'length' => 11,
501
-                                'unsigned' => true,
502
-			]);
503
-			$table->addColumn('conversation_id', Types::STRING, [
504
-				'notnull' => false,
505
-				'length' => 255,
506
-			]);
507
-			$table->addColumn('archived', Types::SMALLINT, [
508
-				'notnull' => false,
509
-				'length' => 1,
510
-			]);
511
-			$table->addColumn('last_archived', Types::DATETIME, [
512
-				'notnull' => false,
513
-			]);
514
-			$table->addColumn('last_unarchived', Types::DATETIME, [
515
-				'notnull' => false,
516
-			]);
517
-			$table->addColumn('archived_by', Types::STRING, [
518
-				'notnull' => false,
519
-				'length' => 128,
520
-			]);
521
-			$table->addColumn('unarchived_by', Types::STRING, [
522
-				'notnull' => false,
523
-				'length' => 128,
524
-			]);
525
-			$table->addColumn('last_msg_date', Types::DATETIME, [
526
-				'notnull' => true,
527
-			]);
528
-			$table->addColumn('last_msg_from', Types::STRING, [
529
-				'notnull' => true,
530
-				'length' => 128,
531
-			]);
532
-			$table->addColumn('last_msg_to', Types::STRING, [
533
-				'notnull' => true,
534
-				'length' => 128,
535
-			]);
536
-			$table->addColumn('last_message', Types::TEXT, [
537
-				'notnull' => false,
538
-				'default' => '',
539
-			]);
540
-			$table->addColumn('lastmsgdisplayname', Types::STRING, [
541
-				'notnull' => true,
542
-				'length' => 255,
543
-			]);
544
-			$table->addColumn('flagged', Types::SMALLINT, [
545
-				'notnull' => false,
546
-				'length' => 1,
547
-			]);
548
-			$table->addColumn('flagunflagby', Types::STRING, [
549
-				'notnull' => false,
550
-				'length' => 128,
551
-			]);
552
-			$table->addColumn('flagunflagdate', Types::DATETIME, [
553
-				'notnull' => false,
554
-			]);
555
-			$table->addColumn('tag', Types::STRING, [
556
-				'notnull' => false,
557
-				'length' => 100,
558
-			]);
559
-			$table->addColumn('taguntagby', Types::STRING, [
560
-				'notnull' => false,
561
-				'length' => 128,
562
-			]);
563
-			$table->addColumn('taguntagdate', Types::DATETIME, [
564
-				'notnull' => false,
565
-			]);
566
-			$table->addColumn('description', Types::TEXT, [
567
-				'notnull' => false,
568
-                                'default' => '',
569
-			]);
570
-			$table->addColumn('descriptionby', Types::STRING, [
571
-				'notnull' => false,
572
-				'length' => 128,
573
-			]);
574
-			$table->addColumn('descriptiondate', Types::DATETIME, [
575
-				'notnull' => false,
576
-			]);
577
-			$table->addColumn('lastmsgprovid', Types::STRING, [
578
-				'notnull' => false,
579
-				'length' => 512,
580
-                                'default' => '',
581
-			]);
582
-                        $table->setPrimaryKey(['id']);
583
-                        $table->addUniqueIndex(['id']);
584
-
585
-		} else {
586
-
587
-                        $table = $schema->getTable('sms_relent_conv');
588
-
589
-			$table->addColumn('lastmsgprovid', Types::STRING, [
590
-				'notnull' => false,
591
-				'length' => 512,
592
-                                'default' => '',
593
-			]);
594
-               }
595
-
596
-		return $schema;
597
-	}
598
-
599
-}
Browse code

added appinfo/info.xml appinfo/signature.json CHANGELOG.txt js/showsmstables.js js/adminsettings.js css/style.css lib/Controller/AuthorApiController.php lib/Controller/SmsrelentlessController.php lib/Service/SmsrelentlessService.php templates/settings/admin.php lib/Migration/Version135Date20240420221527.php

DoubleBastionAdmin authored on 20/04/2024 03:36:59
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,599 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+namespace OCA\SMSRelentless\Migration;
27
+
28
+use Closure;
29
+use OCP\DB\Types;
30
+use OCP\DB\ISchemaWrapper;
31
+use OCP\IDBConnection;
32
+use OCP\Migration\IOutput;
33
+use OCP\Migration\SimpleMigrationStep;
34
+
35
+
36
+class Version135Date20240420221527 extends SimpleMigrationStep {
37
+
38
+        /** @var IDBConnection */
39
+        private $connection;
40
+
41
+        /**
42
+         * @param IDBConnection $connection
43
+         */
44
+        public function __construct(IDBConnection $connection) {
45
+                $this->connection = $connection;
46
+        }
47
+
48
+	/**
49
+	 * @param IOutput $output
50
+	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
51
+	 * @param array $options
52
+	 * @return null|ISchemaWrapper
53
+	 */
54
+	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
55
+		/** @var ISchemaWrapper $schema */
56
+		$schema = $schemaClosure();
57
+
58
+		if (!$schema->hasTable('sms_relent_settings')) {
59
+			$table = $schema->createTable('sms_relent_settings');
60
+			$table->addColumn('id', Types::BIGINT, [
61
+				'autoincrement' => true,
62
+				'notnull' => true,
63
+                                'length' => 11,
64
+                                'unsigned' => true,
65
+			]);
66
+			$table->addColumn('user_id', Types::STRING, [
67
+				'notnull' => true,
68
+				'length' => 128,
69
+			]);
70
+			$table->addColumn('telapi_key', Types::STRING, [
71
+				'notnull' => true,
72
+				'length' => 512,
73
+			]);
74
+			$table->addColumn('tel_pub_key', Types::STRING, [
75
+				'notnull' => true,
76
+				'length' => 512,
77
+			]);
78
+			$table->addColumn('telapi_url_rec', Types::STRING, [
79
+				'notnull' => true,
80
+				'length' => 512,
81
+			]);
82
+			$table->addColumn('telapi_url', Types::STRING, [
83
+				'notnull' => true,
84
+				'length' => 512,
85
+			]);
86
+			$table->addColumn('messaging_profile_id', Types::STRING, [
87
+				'notnull' => true,
88
+				'length' => 512,
89
+			]);
90
+			$table->addColumn('nexapi_key', Types::STRING, [
91
+				'notnull' => true,
92
+				'length' => 512,
93
+			]);
94
+			$table->addColumn('nexapi_secret', Types::STRING, [
95
+				'notnull' => true,
96
+				'length' => 512,
97
+			]);
98
+			$table->addColumn('nexapi_url_rec', Types::STRING, [
99
+				'notnull' => true,
100
+				'length' => 512,
101
+			]);
102
+			$table->addColumn('nexapi_url', Types::STRING, [
103
+				'notnull' => true,
104
+				'length' => 512,
105
+			]);
106
+			$table->addColumn('twilapi_key', Types::STRING, [
107
+				'notnull' => true,
108
+				'length' => 512,
109
+			]);
110
+			$table->addColumn('twilapi_secret', Types::STRING, [
111
+				'notnull' => true,
112
+				'length' => 512,
113
+			]);
114
+			$table->addColumn('twilapi_url_rec', Types::STRING, [
115
+				'notnull' => true,
116
+				'length' => 512,
117
+			]);
118
+			$table->addColumn('twilapi_url', Types::STRING, [
119
+				'notnull' => true,
120
+				'length' => 512,
121
+			]);
122
+			$table->addColumn('flowapi_key', Types::STRING, [
123
+				'notnull' => true,
124
+				'length' => 512,
125
+			]);
126
+			$table->addColumn('flowapi_secret', Types::STRING, [
127
+				'notnull' => true,
128
+				'length' => 512,
129
+			]);
130
+			$table->addColumn('flowapi_url_rec', Types::STRING, [
131
+				'notnull' => true,
132
+				'length' => 512,
133
+			]);
134
+			$table->addColumn('flowapi_url', Types::STRING, [
135
+				'notnull' => true,
136
+				'length' => 512,
137
+			]);
138
+			$table->addColumn('tel_sender_name', Types::STRING, [
139
+				'notnull' => false,
140
+				'length' => 48,
141
+				'default' => '',
142
+			]);
143
+			$table->addColumn('nex_sender_name', Types::STRING, [
144
+				'notnull' => false,
145
+				'length' => 48,
146
+				'default' => '',
147
+			]);
148
+			$table->addColumn('twil_sender_name', Types::STRING, [
149
+				'notnull' => false,
150
+				'length' => 48,
151
+				'default' => '',
152
+			]);
153
+			$table->addColumn('flow_sender_name', Types::STRING, [
154
+				'notnull' => false,
155
+				'length' => 48,
156
+				'default' => '',
157
+			]);
158
+			$table->addColumn('messagesperpage', Types::INTEGER, [
159
+				'notnull' => false,
160
+				'length' => 10,
161
+                                'unsigned' => true,
162
+			]);
163
+			$table->addColumn('get_notify', Types::SMALLINT, [
164
+				'notnull' => false,
165
+				'length' => 1,
166
+			]);
167
+			$table->addColumn('notification_email', Types::STRING, [
168
+				'notnull' => false,
169
+				'length' => 512,
170
+				'default' => '',
171
+			]);
172
+			$table->addColumn('getsmsinemail', Types::SMALLINT, [
173
+				'notnull' => false,
174
+				'length' => 1,
175
+			]);
176
+			$table->addColumn('show_all_messages', Types::SMALLINT, [
177
+				'notnull' => false,
178
+				'length' => 1,
179
+			]);
180
+			$table->addColumn('show_display_names', Types::SMALLINT, [
181
+				'notnull' => false,
182
+				'length' => 1,
183
+			]);
184
+			$table->addColumn('add_display_names', Types::SMALLINT, [
185
+				'notnull' => false,
186
+				'length' => 1,
187
+			]);
188
+			$table->addColumn('available_numbers', Types::TEXT, [
189
+				'notnull' => false,
190
+                                'default' => '',
191
+			]);
192
+			$table->addColumn('msg_check_interval', Types::INTEGER, [
193
+				'notnull' => false,
194
+				'length' => 10,
195
+                                'unsigned' => true,
196
+			]);
197
+			$table->addColumn('new_message_rcd', Types::SMALLINT, [
198
+				'notnull' => false,
199
+				'length' => 1,
200
+			]);
201
+			$table->addColumn('archived_conv_nmbr', Types::INTEGER, [
202
+				'notnull' => false,
203
+				'length' => 10,
204
+                                'unsigned' => true,
205
+			]);
206
+                        $table->setPrimaryKey(['id']);
207
+                        $table->addUniqueIndex(['id']);
208
+
209
+		}
210
+
211
+
212
+		if (!$schema->hasTable('sms_relent_received')) {
213
+			$table = $schema->createTable('sms_relent_received');
214
+			$table->addColumn('id', Types::BIGINT, [
215
+				'autoincrement' => true,
216
+				'notnull' => true,
217
+                                'length' => 11,
218
+                                'unsigned' => true,
219
+			]);
220
+			$table->addColumn('user_id', Types::STRING, [
221
+				'notnull' => true,
222
+				'length' => 64,
223
+			]);
224
+			$table->addColumn('message_id', Types::STRING, [
225
+				'notnull' => true,
226
+				'length' => 512,
227
+			]);
228
+			$table->addColumn('date', Types::DATETIME, [
229
+				'notnull' => true,
230
+			]);
231
+			$table->addColumn('from', Types::STRING, [
232
+				'notnull' => true,
233
+				'length' => 128,
234
+			]);
235
+			$table->addColumn('to', Types::STRING, [
236
+				'notnull' => true,
237
+				'length' => 128,
238
+			]);
239
+			$table->addColumn('message', Types::TEXT, [
240
+				'notnull' => false,
241
+				'default' => '',
242
+			]);
243
+			$table->addColumn('author_displayname', Types::STRING, [
244
+				'notnull' => true,
245
+				'length' => 255,
246
+			]);
247
+			$table->addColumn('internal_sender', Types::SMALLINT, [
248
+				'notnull' => false,
249
+				'length' => 1,
250
+			]);
251
+			$table->addColumn('conversation_id', Types::STRING, [
252
+				'notnull' => false,
253
+				'length' => 255,
254
+			]);
255
+                        $table->setPrimaryKey(['id']);
256
+                        $table->addUniqueIndex(['id']);
257
+
258
+		}
259
+
260
+
261
+		if (!$schema->hasTable('sms_relent_sent')) {
262
+			$table = $schema->createTable('sms_relent_sent');
263
+			$table->addColumn('id', Types::BIGINT, [
264
+				'autoincrement' => true,
265
+				'notnull' => true,
266
+                                'length' => 11,
267
+                                'unsigned' => true,
268
+			]);
269
+			$table->addColumn('user_id', Types::STRING, [
270
+				'notnull' => true,
271
+				'length' => 64,
272
+			]);
273
+			$table->addColumn('message_id', Types::STRING, [
274
+				'notnull' => true,
275
+				'length' => 512,
276
+			]);
277
+			$table->addColumn('date', Types::DATETIME, [
278
+				'notnull' => true,
279
+			]);
280
+			$table->addColumn('from', Types::STRING, [
281
+				'notnull' => true,
282
+				'length' => 128,
283
+			]);
284
+			$table->addColumn('to', Types::STRING, [
285
+				'notnull' => true,
286
+				'length' => 128,
287
+			]);
288
+			$table->addColumn('network ', Types::STRING, [
289
+				'notnull' => false,
290
+				'length' => 64,
291
+				'default' => '',
292
+			]);
293
+			$table->addColumn('price', Types::STRING, [
294
+				'notnull' => false,
295
+				'length' => 64,
296
+				'default' => '',
297
+			]);
298
+			$table->addColumn('status', Types::STRING, [
299
+				'notnull' => false,
300
+				'length' => 512,
301
+				'default' => '',
302
+			]);
303
+			$table->addColumn('deliveryreceipt', Types::STRING, [
304
+				'notnull' => false,
305
+				'length' => 64,
306
+				'default' => '',
307
+			]);
308
+			$table->addColumn('message', Types::TEXT, [
309
+				'notnull' => false,
310
+                                'default' => '',
311
+			]);
312
+			$table->addColumn('author_displayname', Types::STRING, [
313
+				'notnull' => true,
314
+				'length' => 255,
315
+			]);
316
+			$table->addColumn('conversation_id', Types::STRING, [
317
+				'notnull' => false,
318
+				'length' => 255,
319
+			]);
320
+                        $table->setPrimaryKey(['id']);
321
+                        $table->addUniqueIndex(['id']);
322
+
323
+		}
324
+
325
+
326
+		if (!$schema->hasTable('sms_relent_autorply')) {
327
+			$table = $schema->createTable('sms_relent_autorply');
328
+			$table->addColumn('id', Types::BIGINT, [
329
+				'autoincrement' => true,
330
+				'notnull' => true,
331
+                                'length' => 11,
332
+                                'unsigned' => true,
333
+			]);
334
+			$table->addColumn('user_id', Types::STRING, [
335
+				'notnull' => true,
336
+				'length' => 128,
337
+			]);
338
+			$table->addColumn('saved_by_dsplname', Types::STRING, [
339
+				'notnull' => true,
340
+				'length' => 255,
341
+			]);
342
+			$table->addColumn('phone_number', Types::STRING, [
343
+				'notnull' => true,
344
+				'length' => 128,
345
+			]);
346
+			$table->addColumn('days_of_week', Types::STRING, [
347
+				'notnull' => false,
348
+				'length' => 64,
349
+                                'default' => '',
350
+			]);
351
+			$table->addColumn('daily_start', Types::STRING, [
352
+				'notnull' => false,
353
+				'length' => 8,
354
+                                'default' => '',
355
+			]);
356
+			$table->addColumn('daily_end', Types::STRING, [
357
+				'notnull' => false,
358
+				'length' => 8,
359
+                                'default' => '',
360
+			]);
361
+			$table->addColumn('vacation_start', Types::DATETIME, [
362
+				'notnull' => false,
363
+			]);
364
+			$table->addColumn('vacation_end', Types::DATETIME, [
365
+				'notnull' => false,
366
+			]);
367
+			$table->addColumn('message_text', Types::TEXT, [
368
+				'notnull' => false,
369
+                                'default' => '',
370
+			]);
371
+                        $table->setPrimaryKey(['id']);
372
+                        $table->addUniqueIndex(['id']);
373
+		}
374
+
375
+
376
+		if (!$schema->hasTable('sms_relent_restrict')) {
377
+			$table = $schema->createTable('sms_relent_restrict');
378
+			$table->addColumn('id', Types::BIGINT, [
379
+				'autoincrement' => true,
380
+				'notnull' => true,
381
+                                'length' => 11,
382
+                                'unsigned' => true,
383
+			]);
384
+			$table->addColumn('user_id', Types::STRING, [
385
+				'notnull' => true,
386
+				'length' => 128,
387
+			]);
388
+			$table->addColumn('saved_by_dsplname', Types::STRING, [
389
+				'notnull' => true,
390
+				'length' => 255,
391
+			]);
392
+			$table->addColumn('phone_number', Types::STRING, [
393
+				'notnull' => true,
394
+				'length' => 128,
395
+			]);
396
+			$table->addColumn('groups', Types::STRING, [
397
+				'notnull' => true,
398
+				'length' => 2048,
399
+			]);
400
+			$table->addColumn('users', Types::STRING, [
401
+				'notnull' => true,
402
+				'length' => 2048,
403
+			]);
404
+                        $table->setPrimaryKey(['id']);
405
+                        $table->addUniqueIndex(['id']);
406
+		}
407
+
408
+
409
+		if (!$schema->hasTable('sms_relent_subac')) {
410
+			$table = $schema->createTable('sms_relent_subac');
411
+			$table->addColumn('id', Types::BIGINT, [
412
+				'autoincrement' => true,
413
+				'notnull' => true,
414
+                                'length' => 11,
415
+                                'unsigned' => true,
416
+			]);
417
+			$table->addColumn('user_id', Types::STRING, [
418
+				'notnull' => true,
419
+				'length' => 128,
420
+			]);
421
+			$table->addColumn('tnx_groups_allowed', Types::TEXT, [
422
+				'notnull' => false,
423
+                                'default' => '',
424
+			]);
425
+			$table->addColumn('tnx_users_allowed', Types::TEXT, [
426
+				'notnull' => false,
427
+                                'default' => '',
428
+			]);
429
+			$table->addColumn('plv_groups_allowed', Types::TEXT, [
430
+				'notnull' => false,
431
+                                'default' => '',
432
+			]);
433
+			$table->addColumn('plv_users_allowed', Types::TEXT, [
434
+				'notnull' => false,
435
+                                'default' => '',
436
+			]);
437
+			$table->addColumn('twl_groups_allowed', Types::TEXT, [
438
+				'notnull' => false,
439
+                                'default' => '',
440
+			]);
441
+			$table->addColumn('twl_users_allowed', Types::TEXT, [
442
+				'notnull' => false,
443
+                                'default' => '',
444
+			]);
445
+			$table->addColumn('flr_groups_allowed', Types::TEXT, [
446
+				'notnull' => false,
447
+                                'default' => '',
448
+			]);
449
+			$table->addColumn('flr_users_allowed', Types::TEXT, [
450
+				'notnull' => false,
451
+                                'default' => '',
452
+			]);
453
+                        $table->setPrimaryKey(['id']);
454
+                        $table->addUniqueIndex(['id']);
455
+
456
+		} else {
457
+
458
+                        $table = $schema->getTable('sms_relent_subac');
459
+
460
+			$table->addColumn('tnx_groups_del', Types::SMALLINT, [
461
+				'notnull' => false,
462
+				'length' => 1,
463
+			]);
464
+			$table->addColumn('tnx_users_del', Types::SMALLINT, [
465
+				'notnull' => false,
466
+				'length' => 1,
467
+			]);
468
+			$table->addColumn('plv_groups_del', Types::SMALLINT, [
469
+				'notnull' => false,
470
+				'length' => 1,
471
+			]);
472
+			$table->addColumn('plv_users_del', Types::SMALLINT, [
473
+				'notnull' => false,
474
+				'length' => 1,
475
+			]);
476
+			$table->addColumn('twl_groups_del', Types::SMALLINT, [
477
+				'notnull' => false,
478
+				'length' => 1,
479
+			]);
480
+			$table->addColumn('twl_users_del', Types::SMALLINT, [
481
+				'notnull' => false,
482
+				'length' => 1,
483
+			]);
484
+			$table->addColumn('flr_groups_del', Types::SMALLINT, [
485
+				'notnull' => false,
486
+				'length' => 1,
487
+			]);
488
+			$table->addColumn('flr_users_del', Types::SMALLINT, [
489
+				'notnull' => false,
490
+				'length' => 1,
491
+			]);
492
+                }
493
+
494
+
495
+		if (!$schema->hasTable('sms_relent_conv')) {
496
+			$table = $schema->createTable('sms_relent_conv');
497
+			$table->addColumn('id', Types::BIGINT, [
498
+				'autoincrement' => true,
499
+				'notnull' => true,
500
+                                'length' => 11,
501
+                                'unsigned' => true,
502
+			]);
503
+			$table->addColumn('conversation_id', Types::STRING, [
504
+				'notnull' => false,
505
+				'length' => 255,
506
+			]);
507
+			$table->addColumn('archived', Types::SMALLINT, [
508
+				'notnull' => false,
509
+				'length' => 1,
510
+			]);
511
+			$table->addColumn('last_archived', Types::DATETIME, [
512
+				'notnull' => false,
513
+			]);
514
+			$table->addColumn('last_unarchived', Types::DATETIME, [
515
+				'notnull' => false,
516
+			]);
517
+			$table->addColumn('archived_by', Types::STRING, [
518
+				'notnull' => false,
519
+				'length' => 128,
520
+			]);
521
+			$table->addColumn('unarchived_by', Types::STRING, [
522
+				'notnull' => false,
523
+				'length' => 128,
524
+			]);
525
+			$table->addColumn('last_msg_date', Types::DATETIME, [
526
+				'notnull' => true,
527
+			]);
528
+			$table->addColumn('last_msg_from', Types::STRING, [
529
+				'notnull' => true,
530
+				'length' => 128,
531
+			]);
532
+			$table->addColumn('last_msg_to', Types::STRING, [
533
+				'notnull' => true,
534
+				'length' => 128,
535
+			]);
536
+			$table->addColumn('last_message', Types::TEXT, [
537
+				'notnull' => false,
538
+				'default' => '',
539
+			]);
540
+			$table->addColumn('lastmsgdisplayname', Types::STRING, [
541
+				'notnull' => true,
542
+				'length' => 255,
543
+			]);
544
+			$table->addColumn('flagged', Types::SMALLINT, [
545
+				'notnull' => false,
546
+				'length' => 1,
547
+			]);
548
+			$table->addColumn('flagunflagby', Types::STRING, [
549
+				'notnull' => false,
550
+				'length' => 128,
551
+			]);
552
+			$table->addColumn('flagunflagdate', Types::DATETIME, [
553
+				'notnull' => false,
554
+			]);
555
+			$table->addColumn('tag', Types::STRING, [
556
+				'notnull' => false,
557
+				'length' => 100,
558
+			]);
559
+			$table->addColumn('taguntagby', Types::STRING, [
560
+				'notnull' => false,
561
+				'length' => 128,
562
+			]);
563
+			$table->addColumn('taguntagdate', Types::DATETIME, [
564
+				'notnull' => false,
565
+			]);
566
+			$table->addColumn('description', Types::TEXT, [
567
+				'notnull' => false,
568
+                                'default' => '',
569
+			]);
570
+			$table->addColumn('descriptionby', Types::STRING, [
571
+				'notnull' => false,
572
+				'length' => 128,
573
+			]);
574
+			$table->addColumn('descriptiondate', Types::DATETIME, [
575
+				'notnull' => false,
576
+			]);
577
+			$table->addColumn('lastmsgprovid', Types::STRING, [
578
+				'notnull' => false,
579
+				'length' => 512,
580
+                                'default' => '',
581
+			]);
582
+                        $table->setPrimaryKey(['id']);
583
+                        $table->addUniqueIndex(['id']);
584
+
585
+		} else {
586
+
587
+                        $table = $schema->getTable('sms_relent_conv');
588
+
589
+			$table->addColumn('lastmsgprovid', Types::STRING, [
590
+				'notnull' => false,
591
+				'length' => 512,
592
+                                'default' => '',
593
+			]);
594
+               }
595
+
596
+		return $schema;
597
+	}
598
+
599
+}