File tree Expand file tree Collapse file tree 3 files changed +79
-1
lines changed
Expand file tree Collapse file tree 3 files changed +79
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * @author Sujith Haridasan <sharidasan@owncloud.com>
4+ *
5+ * @copyright Copyright (c) 2019, ownCloud GmbH
6+ * @license AGPL-3.0
7+ *
8+ * This code is free software: you can redistribute it and/or modify
9+ * it under the terms of the GNU Affero General Public License, version 3,
10+ * as published by the Free Software Foundation.
11+ *
12+ * This program is distributed in the hope that it will be useful,
13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+ * GNU Affero General Public License for more details.
16+ *
17+ * You should have received a copy of the GNU Affero General Public License, version 3,
18+ * along with this program. If not, see <http://www.gnu.org/licenses/>
19+ *
20+ */
21+
22+ namespace OCA \dav \Migrations ;
23+
24+ use OCP \IDBConnection ;
25+ use OCP \Migration \ISqlMigration ;
26+
27+ /**
28+ * Remove null fileid's from the properties table.
29+ */
30+ class Version20190822150226 implements ISqlMigration {
31+
32+ public function sql (IDBConnection $ connection ) {
33+ $ qb = $ connection ->getQueryBuilder ();
34+ $ qb ->delete ('properties ' )
35+ ->where ($ qb ->expr ()->isNull ('fileid ' ));
36+ $ qb ->execute ();
37+ }
38+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * @author Sujith Haridasan <sharidasan@owncloud.com>
4+ *
5+ * @copyright Copyright (c) 2019, ownCloud GmbH
6+ * @license AGPL-3.0
7+ *
8+ * This code is free software: you can redistribute it and/or modify
9+ * it under the terms of the GNU Affero General Public License, version 3,
10+ * as published by the Free Software Foundation.
11+ *
12+ * This program is distributed in the hope that it will be useful,
13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+ * GNU Affero General Public License for more details.
16+ *
17+ * You should have received a copy of the GNU Affero General Public License, version 3,
18+ * along with this program. If not, see <http://www.gnu.org/licenses/>
19+ *
20+ */
21+
22+ namespace OCA \dav \Migrations ;
23+
24+ use Doctrine \DBAL \Schema \Schema ;
25+ use OCP \Migration \ISchemaMigration ;
26+
27+ /**
28+ * Add NULL constraint to fileid column for properties table.
29+ */
30+ class Version20190823065724 implements ISchemaMigration {
31+
32+ public function changeSchema (Schema $ schema , array $ options ) {
33+ $ prefix = $ options ['tablePrefix ' ];
34+
35+ $ table = $ schema ->getTable ("$ {prefix}properties " );
36+ $ table ->changeColumn ('fileid ' , [
37+ 'notnull ' => true ,
38+ ]);
39+ }
40+ }
Original file line number Diff line number Diff line change 55 <description >ownCloud WebDAV endpoint</description >
66 <licence >AGPL</licence >
77 <author >owncloud.org</author >
8- <version >0.4 .0</version >
8+ <version >0.5 .0</version >
99 <default_enable />
1010 <use-migrations >true</use-migrations >
1111 <types >
You can’t perform that action at this time.
0 commit comments