1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,94 @@ |
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\PaxFax\Migration; |
|
27 |
+ |
|
28 |
+use Closure; |
|
29 |
+use OCP\DB\Types; |
|
30 |
+use OCP\DB\ISchemaWrapper; |
|
31 |
+use OCP\Migration\IOutput; |
|
32 |
+use OCP\Migration\SimpleMigrationStep; |
|
33 |
+ |
|
34 |
+ |
|
35 |
+class Version100Date20211106170854 extends SimpleMigrationStep { |
|
36 |
+ /** |
|
37 |
+ * @param IOutput $output |
|
38 |
+ * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
39 |
+ * @param array $options |
|
40 |
+ * @return null|ISchemaWrapper |
|
41 |
+ */ |
|
42 |
+ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
43 |
+ /** @var ISchemaWrapper $schema */ |
|
44 |
+ $schema = $schemaClosure(); |
|
45 |
+ |
|
46 |
+ if (!$schema->hasTable('pax_fax')) { |
|
47 |
+ $table = $schema->createTable('pax_fax'); |
|
48 |
+ $table->addColumn('id', Types::BIGINT, [ |
|
49 |
+ 'autoincrement' => true, |
|
50 |
+ 'notnull' => true, |
|
51 |
+ 'length' => 11, |
|
52 |
+ 'unsigned' => true, |
|
53 |
+ ]); |
|
54 |
+ $table->addColumn('user_id', Types::STRING, [ |
|
55 |
+ 'notnull' => true, |
|
56 |
+ 'length' => 64, |
|
57 |
+ 'default' => '', |
|
58 |
+ ]); |
|
59 |
+ $table->addColumn('api_key', Types::STRING, [ |
|
60 |
+ 'notnull' => true, |
|
61 |
+ 'length' => 1024, |
|
62 |
+ 'default' => '', |
|
63 |
+ ]); |
|
64 |
+ $table->addColumn('api_secret', Types::STRING, [ |
|
65 |
+ 'notnull' => true, |
|
66 |
+ 'length' => 1024, |
|
67 |
+ 'default' => '', |
|
68 |
+ ]); |
|
69 |
+ $table->addColumn('webhook_token', Types::STRING, [ |
|
70 |
+ 'notnull' => true, |
|
71 |
+ 'length' => 1024, |
|
72 |
+ 'default' => '', |
|
73 |
+ ]); |
|
74 |
+ $table->addColumn('receive_url', Types::STRING, [ |
|
75 |
+ 'notnull' => true, |
|
76 |
+ 'length' => 1024, |
|
77 |
+ 'default' => '', |
|
78 |
+ ]); |
|
79 |
+ $table->addColumn('get_notification', Types::SMALLINT, [ |
|
80 |
+ 'notnull' => false, |
|
81 |
+ 'length' => 1, |
|
82 |
+ ]); |
|
83 |
+ $table->addColumn('notification_email', Types::STRING, [ |
|
84 |
+ 'notnull' => false, |
|
85 |
+ 'length' => 1024, |
|
86 |
+ 'default' => '', |
|
87 |
+ ]); |
|
88 |
+ $table->setPrimaryKey(['id']); |
|
89 |
+ $table->addUniqueIndex(['id']); |
|
90 |
+ } |
|
91 |
+ |
|
92 |
+ return $schema; |
|
93 |
+ } |
|
94 |
+} |
|
0 | 95 |
\ No newline at end of file |
1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,93 +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\PaxFax\Migration; |
|
27 |
- |
|
28 |
-use Closure; |
|
29 |
-use OCP\DB\Types; |
|
30 |
-use OCP\DB\ISchemaWrapper; |
|
31 |
-use OCP\Migration\IOutput; |
|
32 |
-use OCP\Migration\SimpleMigrationStep; |
|
33 |
- |
|
34 |
-class Version100Date20211106170854 extends SimpleMigrationStep { |
|
35 |
- /** |
|
36 |
- * @param IOutput $output |
|
37 |
- * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
38 |
- * @param array $options |
|
39 |
- * @return null|ISchemaWrapper |
|
40 |
- */ |
|
41 |
- public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
42 |
- /** @var ISchemaWrapper $schema */ |
|
43 |
- $schema = $schemaClosure(); |
|
44 |
- |
|
45 |
- if (!$schema->hasTable('pax_fax')) { |
|
46 |
- $table = $schema->createTable('pax_fax'); |
|
47 |
- $table->addColumn('id', Types::BIGINT, [ |
|
48 |
- 'autoincrement' => true, |
|
49 |
- 'notnull' => true, |
|
50 |
- 'length' => 11, |
|
51 |
- 'unsigned' => true, |
|
52 |
- ]); |
|
53 |
- $table->addColumn('user_id', Types::STRING, [ |
|
54 |
- 'notnull' => true, |
|
55 |
- 'length' => 64, |
|
56 |
- 'default' => '', |
|
57 |
- ]); |
|
58 |
- $table->addColumn('api_key', Types::STRING, [ |
|
59 |
- 'notnull' => true, |
|
60 |
- 'length' => 1024, |
|
61 |
- 'default' => '', |
|
62 |
- ]); |
|
63 |
- $table->addColumn('api_secret', Types::STRING, [ |
|
64 |
- 'notnull' => true, |
|
65 |
- 'length' => 1024, |
|
66 |
- 'default' => '', |
|
67 |
- ]); |
|
68 |
- $table->addColumn('webhook_token', Types::STRING, [ |
|
69 |
- 'notnull' => true, |
|
70 |
- 'length' => 1024, |
|
71 |
- 'default' => '', |
|
72 |
- ]); |
|
73 |
- $table->addColumn('receive_url', Types::STRING, [ |
|
74 |
- 'notnull' => true, |
|
75 |
- 'length' => 1024, |
|
76 |
- 'default' => '', |
|
77 |
- ]); |
|
78 |
- $table->addColumn('get_notification', Types::SMALLINT, [ |
|
79 |
- 'notnull' => false, |
|
80 |
- 'length' => 1, |
|
81 |
- ]); |
|
82 |
- $table->addColumn('notification_email', Types::STRING, [ |
|
83 |
- 'notnull' => false, |
|
84 |
- 'length' => 1024, |
|
85 |
- 'default' => '', |
|
86 |
- ]); |
|
87 |
- $table->setPrimaryKey(['id']); |
|
88 |
- $table->addUniqueIndex(['id']); |
|
89 |
- } |
|
90 |
- |
|
91 |
- return $schema; |
|
92 |
- } |
|
93 |
-} |
|
94 | 0 |
\ No newline at end of file |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,93 @@ |
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\PaxFax\Migration; |
|
27 |
+ |
|
28 |
+use Closure; |
|
29 |
+use OCP\DB\Types; |
|
30 |
+use OCP\DB\ISchemaWrapper; |
|
31 |
+use OCP\Migration\IOutput; |
|
32 |
+use OCP\Migration\SimpleMigrationStep; |
|
33 |
+ |
|
34 |
+class Version100Date20211106170854 extends SimpleMigrationStep { |
|
35 |
+ /** |
|
36 |
+ * @param IOutput $output |
|
37 |
+ * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
38 |
+ * @param array $options |
|
39 |
+ * @return null|ISchemaWrapper |
|
40 |
+ */ |
|
41 |
+ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
42 |
+ /** @var ISchemaWrapper $schema */ |
|
43 |
+ $schema = $schemaClosure(); |
|
44 |
+ |
|
45 |
+ if (!$schema->hasTable('pax_fax')) { |
|
46 |
+ $table = $schema->createTable('pax_fax'); |
|
47 |
+ $table->addColumn('id', Types::BIGINT, [ |
|
48 |
+ 'autoincrement' => true, |
|
49 |
+ 'notnull' => true, |
|
50 |
+ 'length' => 11, |
|
51 |
+ 'unsigned' => true, |
|
52 |
+ ]); |
|
53 |
+ $table->addColumn('user_id', Types::STRING, [ |
|
54 |
+ 'notnull' => true, |
|
55 |
+ 'length' => 64, |
|
56 |
+ 'default' => '', |
|
57 |
+ ]); |
|
58 |
+ $table->addColumn('api_key', Types::STRING, [ |
|
59 |
+ 'notnull' => true, |
|
60 |
+ 'length' => 1024, |
|
61 |
+ 'default' => '', |
|
62 |
+ ]); |
|
63 |
+ $table->addColumn('api_secret', Types::STRING, [ |
|
64 |
+ 'notnull' => true, |
|
65 |
+ 'length' => 1024, |
|
66 |
+ 'default' => '', |
|
67 |
+ ]); |
|
68 |
+ $table->addColumn('webhook_token', Types::STRING, [ |
|
69 |
+ 'notnull' => true, |
|
70 |
+ 'length' => 1024, |
|
71 |
+ 'default' => '', |
|
72 |
+ ]); |
|
73 |
+ $table->addColumn('receive_url', Types::STRING, [ |
|
74 |
+ 'notnull' => true, |
|
75 |
+ 'length' => 1024, |
|
76 |
+ 'default' => '', |
|
77 |
+ ]); |
|
78 |
+ $table->addColumn('get_notification', Types::SMALLINT, [ |
|
79 |
+ 'notnull' => false, |
|
80 |
+ 'length' => 1, |
|
81 |
+ ]); |
|
82 |
+ $table->addColumn('notification_email', Types::STRING, [ |
|
83 |
+ 'notnull' => false, |
|
84 |
+ 'length' => 1024, |
|
85 |
+ 'default' => '', |
|
86 |
+ ]); |
|
87 |
+ $table->setPrimaryKey(['id']); |
|
88 |
+ $table->addUniqueIndex(['id']); |
|
89 |
+ } |
|
90 |
+ |
|
91 |
+ return $schema; |
|
92 |
+ } |
|
93 |
+} |
|
0 | 94 |
\ No newline at end of file |