| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,290 +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 Doctrine\DBAL\Types\Type; |
|
| 31 |
-use OCP\DB\ISchemaWrapper; |
|
| 32 |
-use OCP\Migration\IOutput; |
|
| 33 |
-use OCP\Migration\SimpleMigrationStep; |
|
| 34 |
- |
|
| 35 |
- |
|
| 36 |
-class Version108Date20220820204512 extends SimpleMigrationStep {
|
|
| 37 |
- /** |
|
| 38 |
- * @param IOutput $output |
|
| 39 |
- * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 40 |
- * @param array $options |
|
| 41 |
- * @return null|ISchemaWrapper |
|
| 42 |
- */ |
|
| 43 |
- public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
|
|
| 44 |
- /** @var ISchemaWrapper $schema */ |
|
| 45 |
- $schema = $schemaClosure(); |
|
| 46 |
- |
|
| 47 |
- if (!$schema->hasTable('sms_relent_settings')) {
|
|
| 48 |
- $table = $schema->createTable('sms_relent_settings');
|
|
| 49 |
- $table->addColumn('id', 'bigint', [
|
|
| 50 |
- 'autoincrement' => true, |
|
| 51 |
- 'notnull' => true, |
|
| 52 |
- 'length' => 11, |
|
| 53 |
- 'unsigned' => true, |
|
| 54 |
- ]); |
|
| 55 |
- $table->addColumn('user_id', 'string', [
|
|
| 56 |
- 'notnull' => true, |
|
| 57 |
- 'length' => 128, |
|
| 58 |
- ]); |
|
| 59 |
- $table->addColumn('telapi_key', 'string', [
|
|
| 60 |
- 'notnull' => true, |
|
| 61 |
- 'length' => 512, |
|
| 62 |
- ]); |
|
| 63 |
- $table->addColumn('tel_pub_key', 'string', [
|
|
| 64 |
- 'notnull' => true, |
|
| 65 |
- 'length' => 512, |
|
| 66 |
- ]); |
|
| 67 |
- $table->addColumn('telapi_url_rec', 'string', [
|
|
| 68 |
- 'notnull' => true, |
|
| 69 |
- 'length' => 512, |
|
| 70 |
- ]); |
|
| 71 |
- $table->addColumn('telapi_url', 'string', [
|
|
| 72 |
- 'notnull' => true, |
|
| 73 |
- 'length' => 512, |
|
| 74 |
- ]); |
|
| 75 |
- $table->addColumn('messaging_profile_id', 'string', [
|
|
| 76 |
- 'notnull' => true, |
|
| 77 |
- 'length' => 512, |
|
| 78 |
- ]); |
|
| 79 |
- $table->addColumn('nexapi_key', 'string', [
|
|
| 80 |
- 'notnull' => true, |
|
| 81 |
- 'length' => 512, |
|
| 82 |
- ]); |
|
| 83 |
- $table->addColumn('nexapi_secret', 'string', [
|
|
| 84 |
- 'notnull' => true, |
|
| 85 |
- 'length' => 512, |
|
| 86 |
- ]); |
|
| 87 |
- $table->addColumn('nexapi_url_rec', 'string', [
|
|
| 88 |
- 'notnull' => true, |
|
| 89 |
- 'length' => 512, |
|
| 90 |
- ]); |
|
| 91 |
- $table->addColumn('nexapi_url', 'string', [
|
|
| 92 |
- 'notnull' => true, |
|
| 93 |
- 'length' => 512, |
|
| 94 |
- ]); |
|
| 95 |
- $table->addColumn('twilapi_key', 'string', [
|
|
| 96 |
- 'notnull' => true, |
|
| 97 |
- 'length' => 512, |
|
| 98 |
- ]); |
|
| 99 |
- $table->addColumn('twilapi_secret', 'string', [
|
|
| 100 |
- 'notnull' => true, |
|
| 101 |
- 'length' => 512, |
|
| 102 |
- ]); |
|
| 103 |
- $table->addColumn('twilapi_url_rec', 'string', [
|
|
| 104 |
- 'notnull' => true, |
|
| 105 |
- 'length' => 512, |
|
| 106 |
- ]); |
|
| 107 |
- $table->addColumn('twilapi_url', 'string', [
|
|
| 108 |
- 'notnull' => true, |
|
| 109 |
- 'length' => 512, |
|
| 110 |
- ]); |
|
| 111 |
- $table->addColumn('flowapi_key', 'string', [
|
|
| 112 |
- 'notnull' => true, |
|
| 113 |
- 'length' => 512, |
|
| 114 |
- ]); |
|
| 115 |
- $table->addColumn('flowapi_secret', 'string', [
|
|
| 116 |
- 'notnull' => true, |
|
| 117 |
- 'length' => 512, |
|
| 118 |
- ]); |
|
| 119 |
- $table->addColumn('flowapi_url_rec', 'string', [
|
|
| 120 |
- 'notnull' => true, |
|
| 121 |
- 'length' => 512, |
|
| 122 |
- ]); |
|
| 123 |
- $table->addColumn('flowapi_url', 'string', [
|
|
| 124 |
- 'notnull' => true, |
|
| 125 |
- 'length' => 512, |
|
| 126 |
- ]); |
|
| 127 |
- $table->addColumn('tel_sender_name', 'string', [
|
|
| 128 |
- 'notnull' => false, |
|
| 129 |
- 'length' => 48, |
|
| 130 |
- 'default' => '', |
|
| 131 |
- ]); |
|
| 132 |
- $table->addColumn('nex_sender_name', 'string', [
|
|
| 133 |
- 'notnull' => false, |
|
| 134 |
- 'length' => 48, |
|
| 135 |
- 'default' => '', |
|
| 136 |
- ]); |
|
| 137 |
- $table->addColumn('twil_sender_name', 'string', [
|
|
| 138 |
- 'notnull' => false, |
|
| 139 |
- 'length' => 48, |
|
| 140 |
- 'default' => '', |
|
| 141 |
- ]); |
|
| 142 |
- $table->addColumn('flow_sender_name', 'string', [
|
|
| 143 |
- 'notnull' => false, |
|
| 144 |
- 'length' => 48, |
|
| 145 |
- 'default' => '', |
|
| 146 |
- ]); |
|
| 147 |
- $table->addColumn('messagesperpage', 'integer', [
|
|
| 148 |
- 'notnull' => false, |
|
| 149 |
- 'length' => 11, |
|
| 150 |
- 'unsigned' => true, |
|
| 151 |
- ]); |
|
| 152 |
- $table->addColumn('get_notify', 'smallint', [
|
|
| 153 |
- 'notnull' => false, |
|
| 154 |
- 'length' => 1, |
|
| 155 |
- ]); |
|
| 156 |
- $table->addColumn('notification_email', 'string', [
|
|
| 157 |
- 'notnull' => false, |
|
| 158 |
- 'length' => 512, |
|
| 159 |
- 'default' => '', |
|
| 160 |
- ]); |
|
| 161 |
- $table->addColumn('getsmsinemail', 'smallint', [
|
|
| 162 |
- 'notnull' => false, |
|
| 163 |
- 'length' => 1, |
|
| 164 |
- ]); |
|
| 165 |
- $table->setPrimaryKey(['id']); |
|
| 166 |
- $table->addUniqueIndex(['id']); |
|
| 167 |
- |
|
| 168 |
- } else {
|
|
| 169 |
- |
|
| 170 |
- $table = $schema->getTable('sms_relent_settings');
|
|
| 171 |
- |
|
| 172 |
- $table->addColumn('flowapi_key', 'string', [
|
|
| 173 |
- 'notnull' => true, |
|
| 174 |
- 'length' => 512, |
|
| 175 |
- ]); |
|
| 176 |
- $table->addColumn('flowapi_secret', 'string', [
|
|
| 177 |
- 'notnull' => true, |
|
| 178 |
- 'length' => 512, |
|
| 179 |
- ]); |
|
| 180 |
- $table->addColumn('flowapi_url_rec', 'string', [
|
|
| 181 |
- 'notnull' => true, |
|
| 182 |
- 'length' => 512, |
|
| 183 |
- ]); |
|
| 184 |
- $table->addColumn('flowapi_url', 'string', [
|
|
| 185 |
- 'notnull' => true, |
|
| 186 |
- 'length' => 512, |
|
| 187 |
- ]); |
|
| 188 |
- $table->addColumn('flow_sender_name', 'string', [
|
|
| 189 |
- 'notnull' => false, |
|
| 190 |
- 'length' => 48, |
|
| 191 |
- 'default' => '', |
|
| 192 |
- ]); |
|
| 193 |
- |
|
| 194 |
- } |
|
| 195 |
- |
|
| 196 |
- if (!$schema->hasTable('sms_relent_received')) {
|
|
| 197 |
- $table = $schema->createTable('sms_relent_received');
|
|
| 198 |
- $table->addColumn('id', 'bigint', [
|
|
| 199 |
- 'autoincrement' => true, |
|
| 200 |
- 'notnull' => true, |
|
| 201 |
- 'length' => 11, |
|
| 202 |
- 'unsigned' => true, |
|
| 203 |
- ]); |
|
| 204 |
- $table->addColumn('user_id', 'string', [
|
|
| 205 |
- 'notnull' => true, |
|
| 206 |
- 'length' => 64, |
|
| 207 |
- ]); |
|
| 208 |
- $table->addColumn('message_id', 'string', [
|
|
| 209 |
- 'notnull' => true, |
|
| 210 |
- 'length' => 512, |
|
| 211 |
- ]); |
|
| 212 |
- $table->addColumn('date', 'datetime', [
|
|
| 213 |
- 'notnull' => true, |
|
| 214 |
- ]); |
|
| 215 |
- $table->addColumn('from', 'string', [
|
|
| 216 |
- 'notnull' => true, |
|
| 217 |
- 'length' => 128, |
|
| 218 |
- ]); |
|
| 219 |
- $table->addColumn('to', 'string', [
|
|
| 220 |
- 'notnull' => true, |
|
| 221 |
- 'length' => 128, |
|
| 222 |
- ]); |
|
| 223 |
- $table->addColumn('message', 'text', [
|
|
| 224 |
- 'notnull' => false, |
|
| 225 |
- 'default' => '', |
|
| 226 |
- ]); |
|
| 227 |
- $table->setPrimaryKey(['id']); |
|
| 228 |
- $table->addUniqueIndex(['id']); |
|
| 229 |
- |
|
| 230 |
- } |
|
| 231 |
- |
|
| 232 |
- if (!$schema->hasTable('sms_relent_sent')) {
|
|
| 233 |
- $table = $schema->createTable('sms_relent_sent');
|
|
| 234 |
- $table->addColumn('id', 'bigint', [
|
|
| 235 |
- 'autoincrement' => true, |
|
| 236 |
- 'notnull' => true, |
|
| 237 |
- 'length' => 11, |
|
| 238 |
- 'unsigned' => true, |
|
| 239 |
- ]); |
|
| 240 |
- $table->addColumn('user_id', 'string', [
|
|
| 241 |
- 'notnull' => true, |
|
| 242 |
- 'length' => 64, |
|
| 243 |
- ]); |
|
| 244 |
- $table->addColumn('message_id', 'string', [
|
|
| 245 |
- 'notnull' => true, |
|
| 246 |
- 'length' => 512, |
|
| 247 |
- ]); |
|
| 248 |
- $table->addColumn('date', 'datetime', [
|
|
| 249 |
- 'notnull' => true, |
|
| 250 |
- ]); |
|
| 251 |
- $table->addColumn('from', 'string', [
|
|
| 252 |
- 'notnull' => true, |
|
| 253 |
- 'length' => 128, |
|
| 254 |
- ]); |
|
| 255 |
- $table->addColumn('to', 'string', [
|
|
| 256 |
- 'notnull' => true, |
|
| 257 |
- 'length' => 128, |
|
| 258 |
- ]); |
|
| 259 |
- $table->addColumn('network ', 'string', [
|
|
| 260 |
- 'notnull' => false, |
|
| 261 |
- 'length' => 64, |
|
| 262 |
- 'default' => '', |
|
| 263 |
- ]); |
|
| 264 |
- $table->addColumn('price', 'string', [
|
|
| 265 |
- 'notnull' => false, |
|
| 266 |
- 'length' => 64, |
|
| 267 |
- 'default' => '', |
|
| 268 |
- ]); |
|
| 269 |
- $table->addColumn('status', 'string', [
|
|
| 270 |
- 'notnull' => false, |
|
| 271 |
- 'length' => 512, |
|
| 272 |
- 'default' => '', |
|
| 273 |
- ]); |
|
| 274 |
- $table->addColumn('deliveryreceipt', 'string', [
|
|
| 275 |
- 'notnull' => false, |
|
| 276 |
- 'length' => 64, |
|
| 277 |
- 'default' => '', |
|
| 278 |
- ]); |
|
| 279 |
- $table->addColumn('message', 'text', [
|
|
| 280 |
- 'notnull' => false, |
|
| 281 |
- 'default' => '', |
|
| 282 |
- ]); |
|
| 283 |
- $table->setPrimaryKey(['id']); |
|
| 284 |
- $table->addUniqueIndex(['id']); |
|
| 285 |
- |
|
| 286 |
- } |
|
| 287 |
- |
|
| 288 |
- return $schema; |
|
| 289 |
- } |
|
| 290 |
-} |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,290 @@ |
| 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 Doctrine\DBAL\Types\Type; |
|
| 31 |
+use OCP\DB\ISchemaWrapper; |
|
| 32 |
+use OCP\Migration\IOutput; |
|
| 33 |
+use OCP\Migration\SimpleMigrationStep; |
|
| 34 |
+ |
|
| 35 |
+ |
|
| 36 |
+class Version108Date20220820204512 extends SimpleMigrationStep {
|
|
| 37 |
+ /** |
|
| 38 |
+ * @param IOutput $output |
|
| 39 |
+ * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 40 |
+ * @param array $options |
|
| 41 |
+ * @return null|ISchemaWrapper |
|
| 42 |
+ */ |
|
| 43 |
+ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
|
|
| 44 |
+ /** @var ISchemaWrapper $schema */ |
|
| 45 |
+ $schema = $schemaClosure(); |
|
| 46 |
+ |
|
| 47 |
+ if (!$schema->hasTable('sms_relent_settings')) {
|
|
| 48 |
+ $table = $schema->createTable('sms_relent_settings');
|
|
| 49 |
+ $table->addColumn('id', 'bigint', [
|
|
| 50 |
+ 'autoincrement' => true, |
|
| 51 |
+ 'notnull' => true, |
|
| 52 |
+ 'length' => 11, |
|
| 53 |
+ 'unsigned' => true, |
|
| 54 |
+ ]); |
|
| 55 |
+ $table->addColumn('user_id', 'string', [
|
|
| 56 |
+ 'notnull' => true, |
|
| 57 |
+ 'length' => 128, |
|
| 58 |
+ ]); |
|
| 59 |
+ $table->addColumn('telapi_key', 'string', [
|
|
| 60 |
+ 'notnull' => true, |
|
| 61 |
+ 'length' => 512, |
|
| 62 |
+ ]); |
|
| 63 |
+ $table->addColumn('tel_pub_key', 'string', [
|
|
| 64 |
+ 'notnull' => true, |
|
| 65 |
+ 'length' => 512, |
|
| 66 |
+ ]); |
|
| 67 |
+ $table->addColumn('telapi_url_rec', 'string', [
|
|
| 68 |
+ 'notnull' => true, |
|
| 69 |
+ 'length' => 512, |
|
| 70 |
+ ]); |
|
| 71 |
+ $table->addColumn('telapi_url', 'string', [
|
|
| 72 |
+ 'notnull' => true, |
|
| 73 |
+ 'length' => 512, |
|
| 74 |
+ ]); |
|
| 75 |
+ $table->addColumn('messaging_profile_id', 'string', [
|
|
| 76 |
+ 'notnull' => true, |
|
| 77 |
+ 'length' => 512, |
|
| 78 |
+ ]); |
|
| 79 |
+ $table->addColumn('nexapi_key', 'string', [
|
|
| 80 |
+ 'notnull' => true, |
|
| 81 |
+ 'length' => 512, |
|
| 82 |
+ ]); |
|
| 83 |
+ $table->addColumn('nexapi_secret', 'string', [
|
|
| 84 |
+ 'notnull' => true, |
|
| 85 |
+ 'length' => 512, |
|
| 86 |
+ ]); |
|
| 87 |
+ $table->addColumn('nexapi_url_rec', 'string', [
|
|
| 88 |
+ 'notnull' => true, |
|
| 89 |
+ 'length' => 512, |
|
| 90 |
+ ]); |
|
| 91 |
+ $table->addColumn('nexapi_url', 'string', [
|
|
| 92 |
+ 'notnull' => true, |
|
| 93 |
+ 'length' => 512, |
|
| 94 |
+ ]); |
|
| 95 |
+ $table->addColumn('twilapi_key', 'string', [
|
|
| 96 |
+ 'notnull' => true, |
|
| 97 |
+ 'length' => 512, |
|
| 98 |
+ ]); |
|
| 99 |
+ $table->addColumn('twilapi_secret', 'string', [
|
|
| 100 |
+ 'notnull' => true, |
|
| 101 |
+ 'length' => 512, |
|
| 102 |
+ ]); |
|
| 103 |
+ $table->addColumn('twilapi_url_rec', 'string', [
|
|
| 104 |
+ 'notnull' => true, |
|
| 105 |
+ 'length' => 512, |
|
| 106 |
+ ]); |
|
| 107 |
+ $table->addColumn('twilapi_url', 'string', [
|
|
| 108 |
+ 'notnull' => true, |
|
| 109 |
+ 'length' => 512, |
|
| 110 |
+ ]); |
|
| 111 |
+ $table->addColumn('flowapi_key', 'string', [
|
|
| 112 |
+ 'notnull' => true, |
|
| 113 |
+ 'length' => 512, |
|
| 114 |
+ ]); |
|
| 115 |
+ $table->addColumn('flowapi_secret', 'string', [
|
|
| 116 |
+ 'notnull' => true, |
|
| 117 |
+ 'length' => 512, |
|
| 118 |
+ ]); |
|
| 119 |
+ $table->addColumn('flowapi_url_rec', 'string', [
|
|
| 120 |
+ 'notnull' => true, |
|
| 121 |
+ 'length' => 512, |
|
| 122 |
+ ]); |
|
| 123 |
+ $table->addColumn('flowapi_url', 'string', [
|
|
| 124 |
+ 'notnull' => true, |
|
| 125 |
+ 'length' => 512, |
|
| 126 |
+ ]); |
|
| 127 |
+ $table->addColumn('tel_sender_name', 'string', [
|
|
| 128 |
+ 'notnull' => false, |
|
| 129 |
+ 'length' => 48, |
|
| 130 |
+ 'default' => '', |
|
| 131 |
+ ]); |
|
| 132 |
+ $table->addColumn('nex_sender_name', 'string', [
|
|
| 133 |
+ 'notnull' => false, |
|
| 134 |
+ 'length' => 48, |
|
| 135 |
+ 'default' => '', |
|
| 136 |
+ ]); |
|
| 137 |
+ $table->addColumn('twil_sender_name', 'string', [
|
|
| 138 |
+ 'notnull' => false, |
|
| 139 |
+ 'length' => 48, |
|
| 140 |
+ 'default' => '', |
|
| 141 |
+ ]); |
|
| 142 |
+ $table->addColumn('flow_sender_name', 'string', [
|
|
| 143 |
+ 'notnull' => false, |
|
| 144 |
+ 'length' => 48, |
|
| 145 |
+ 'default' => '', |
|
| 146 |
+ ]); |
|
| 147 |
+ $table->addColumn('messagesperpage', 'integer', [
|
|
| 148 |
+ 'notnull' => false, |
|
| 149 |
+ 'length' => 11, |
|
| 150 |
+ 'unsigned' => true, |
|
| 151 |
+ ]); |
|
| 152 |
+ $table->addColumn('get_notify', 'smallint', [
|
|
| 153 |
+ 'notnull' => false, |
|
| 154 |
+ 'length' => 1, |
|
| 155 |
+ ]); |
|
| 156 |
+ $table->addColumn('notification_email', 'string', [
|
|
| 157 |
+ 'notnull' => false, |
|
| 158 |
+ 'length' => 512, |
|
| 159 |
+ 'default' => '', |
|
| 160 |
+ ]); |
|
| 161 |
+ $table->addColumn('getsmsinemail', 'smallint', [
|
|
| 162 |
+ 'notnull' => false, |
|
| 163 |
+ 'length' => 1, |
|
| 164 |
+ ]); |
|
| 165 |
+ $table->setPrimaryKey(['id']); |
|
| 166 |
+ $table->addUniqueIndex(['id']); |
|
| 167 |
+ |
|
| 168 |
+ } else {
|
|
| 169 |
+ |
|
| 170 |
+ $table = $schema->getTable('sms_relent_settings');
|
|
| 171 |
+ |
|
| 172 |
+ $table->addColumn('flowapi_key', 'string', [
|
|
| 173 |
+ 'notnull' => true, |
|
| 174 |
+ 'length' => 512, |
|
| 175 |
+ ]); |
|
| 176 |
+ $table->addColumn('flowapi_secret', 'string', [
|
|
| 177 |
+ 'notnull' => true, |
|
| 178 |
+ 'length' => 512, |
|
| 179 |
+ ]); |
|
| 180 |
+ $table->addColumn('flowapi_url_rec', 'string', [
|
|
| 181 |
+ 'notnull' => true, |
|
| 182 |
+ 'length' => 512, |
|
| 183 |
+ ]); |
|
| 184 |
+ $table->addColumn('flowapi_url', 'string', [
|
|
| 185 |
+ 'notnull' => true, |
|
| 186 |
+ 'length' => 512, |
|
| 187 |
+ ]); |
|
| 188 |
+ $table->addColumn('flow_sender_name', 'string', [
|
|
| 189 |
+ 'notnull' => false, |
|
| 190 |
+ 'length' => 48, |
|
| 191 |
+ 'default' => '', |
|
| 192 |
+ ]); |
|
| 193 |
+ |
|
| 194 |
+ } |
|
| 195 |
+ |
|
| 196 |
+ if (!$schema->hasTable('sms_relent_received')) {
|
|
| 197 |
+ $table = $schema->createTable('sms_relent_received');
|
|
| 198 |
+ $table->addColumn('id', 'bigint', [
|
|
| 199 |
+ 'autoincrement' => true, |
|
| 200 |
+ 'notnull' => true, |
|
| 201 |
+ 'length' => 11, |
|
| 202 |
+ 'unsigned' => true, |
|
| 203 |
+ ]); |
|
| 204 |
+ $table->addColumn('user_id', 'string', [
|
|
| 205 |
+ 'notnull' => true, |
|
| 206 |
+ 'length' => 64, |
|
| 207 |
+ ]); |
|
| 208 |
+ $table->addColumn('message_id', 'string', [
|
|
| 209 |
+ 'notnull' => true, |
|
| 210 |
+ 'length' => 512, |
|
| 211 |
+ ]); |
|
| 212 |
+ $table->addColumn('date', 'datetime', [
|
|
| 213 |
+ 'notnull' => true, |
|
| 214 |
+ ]); |
|
| 215 |
+ $table->addColumn('from', 'string', [
|
|
| 216 |
+ 'notnull' => true, |
|
| 217 |
+ 'length' => 128, |
|
| 218 |
+ ]); |
|
| 219 |
+ $table->addColumn('to', 'string', [
|
|
| 220 |
+ 'notnull' => true, |
|
| 221 |
+ 'length' => 128, |
|
| 222 |
+ ]); |
|
| 223 |
+ $table->addColumn('message', 'text', [
|
|
| 224 |
+ 'notnull' => false, |
|
| 225 |
+ 'default' => '', |
|
| 226 |
+ ]); |
|
| 227 |
+ $table->setPrimaryKey(['id']); |
|
| 228 |
+ $table->addUniqueIndex(['id']); |
|
| 229 |
+ |
|
| 230 |
+ } |
|
| 231 |
+ |
|
| 232 |
+ if (!$schema->hasTable('sms_relent_sent')) {
|
|
| 233 |
+ $table = $schema->createTable('sms_relent_sent');
|
|
| 234 |
+ $table->addColumn('id', 'bigint', [
|
|
| 235 |
+ 'autoincrement' => true, |
|
| 236 |
+ 'notnull' => true, |
|
| 237 |
+ 'length' => 11, |
|
| 238 |
+ 'unsigned' => true, |
|
| 239 |
+ ]); |
|
| 240 |
+ $table->addColumn('user_id', 'string', [
|
|
| 241 |
+ 'notnull' => true, |
|
| 242 |
+ 'length' => 64, |
|
| 243 |
+ ]); |
|
| 244 |
+ $table->addColumn('message_id', 'string', [
|
|
| 245 |
+ 'notnull' => true, |
|
| 246 |
+ 'length' => 512, |
|
| 247 |
+ ]); |
|
| 248 |
+ $table->addColumn('date', 'datetime', [
|
|
| 249 |
+ 'notnull' => true, |
|
| 250 |
+ ]); |
|
| 251 |
+ $table->addColumn('from', 'string', [
|
|
| 252 |
+ 'notnull' => true, |
|
| 253 |
+ 'length' => 128, |
|
| 254 |
+ ]); |
|
| 255 |
+ $table->addColumn('to', 'string', [
|
|
| 256 |
+ 'notnull' => true, |
|
| 257 |
+ 'length' => 128, |
|
| 258 |
+ ]); |
|
| 259 |
+ $table->addColumn('network ', 'string', [
|
|
| 260 |
+ 'notnull' => false, |
|
| 261 |
+ 'length' => 64, |
|
| 262 |
+ 'default' => '', |
|
| 263 |
+ ]); |
|
| 264 |
+ $table->addColumn('price', 'string', [
|
|
| 265 |
+ 'notnull' => false, |
|
| 266 |
+ 'length' => 64, |
|
| 267 |
+ 'default' => '', |
|
| 268 |
+ ]); |
|
| 269 |
+ $table->addColumn('status', 'string', [
|
|
| 270 |
+ 'notnull' => false, |
|
| 271 |
+ 'length' => 512, |
|
| 272 |
+ 'default' => '', |
|
| 273 |
+ ]); |
|
| 274 |
+ $table->addColumn('deliveryreceipt', 'string', [
|
|
| 275 |
+ 'notnull' => false, |
|
| 276 |
+ 'length' => 64, |
|
| 277 |
+ 'default' => '', |
|
| 278 |
+ ]); |
|
| 279 |
+ $table->addColumn('message', 'text', [
|
|
| 280 |
+ 'notnull' => false, |
|
| 281 |
+ 'default' => '', |
|
| 282 |
+ ]); |
|
| 283 |
+ $table->setPrimaryKey(['id']); |
|
| 284 |
+ $table->addUniqueIndex(['id']); |
|
| 285 |
+ |
|
| 286 |
+ } |
|
| 287 |
+ |
|
| 288 |
+ return $schema; |
|
| 289 |
+ } |
|
| 290 |
+} |