Skip to content

Move DAV app to migrations#6264

Merged
rullzer merged 1 commit into
masterfrom
dav-migrations
Sep 19, 2017
Merged

Move DAV app to migrations#6264
rullzer merged 1 commit into
masterfrom
dav-migrations

Conversation

@rullzer

@rullzer rullzer commented Aug 25, 2017

Copy link
Copy Markdown
Member

Need to touch the db schema for #6170
So better first move to migrations.

@rullzer rullzer added 2. developing Work in progress enhancement technical debt 🧱 🤔🚀 labels Aug 25, 2017
@rullzer rullzer added this to the Nextcloud 13 milestone Aug 25, 2017
@rullzer rullzer requested a review from nickvergessen August 25, 2017 15:00
@rullzer rullzer added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 25, 2017
@nickvergessen

nickvergessen commented Sep 6, 2017

Copy link
Copy Markdown
Member

Version on the migration should be 1004 or 1004002 and then the version in info.xml should be increased

@rullzer

rullzer commented Sep 7, 2017

Copy link
Copy Markdown
Member Author

@nickvergessen done

@MorrisJobke MorrisJobke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested update and install. Both resulted in a working DB structure. 👍

'notnull' => false,
'length' => 255,
]);
$table->addColumn('synctoken', 'integer', [

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this changed from 10 to 11 chars Oo
Also all int columns dropped UNSIGNED

@nickvergessen

Copy link
Copy Markdown
Member
--- /home/nickv/Schreibtisch/nextcloud13.sql
+++ /home/nickv/Schreibtisch/nextcloud13b.sql
@@ -38,9 +38,9 @@
 --
 
 CREATE TABLE `oc_addressbookchanges` (
-  `id` bigint(20) UNSIGNED NOT NULL,
-  `uri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
-  `synctoken` int(10) UNSIGNED NOT NULL DEFAULT '1',
+  `id` bigint(20) NOT NULL,
+  `uri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
+  `synctoken` int(11) NOT NULL DEFAULT '1',
   `addressbookid` int(11) NOT NULL,
   `operation` smallint(6) NOT NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPRESSED;
@@ -52,12 +52,12 @@
 --
 
 CREATE TABLE `oc_addressbooks` (
-  `id` bigint(20) UNSIGNED NOT NULL,
+  `id` bigint(20) NOT NULL,
   `principaluri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   `displayname` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   `uri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   `description` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
-  `synctoken` int(10) UNSIGNED NOT NULL DEFAULT '1'
+  `synctoken` int(11) NOT NULL DEFAULT '1'
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPRESSED;
 
 -- --------------------------------------------------------
@@ -67,9 +67,9 @@
 --
 
 CREATE TABLE `oc_calendarchanges` (
-  `id` bigint(20) UNSIGNED NOT NULL,
-  `uri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
-  `synctoken` int(10) UNSIGNED NOT NULL DEFAULT '1',
+  `id` bigint(20) NOT NULL,
+  `uri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
+  `synctoken` int(11) NOT NULL DEFAULT '1',
   `calendarid` int(11) NOT NULL,
   `operation` smallint(6) NOT NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPRESSED;
@@ -81,18 +81,18 @@
 --
 
 CREATE TABLE `oc_calendarobjects` (
-  `id` bigint(20) UNSIGNED NOT NULL,
+  `id` bigint(20) NOT NULL,
   `calendardata` longblob,
   `uri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
-  `calendarid` int(10) UNSIGNED NOT NULL,
-  `lastmodified` int(10) UNSIGNED DEFAULT NULL,
+  `calendarid` int(11) NOT NULL,
+  `lastmodified` int(11) DEFAULT NULL,
   `etag` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL,
-  `size` bigint(20) UNSIGNED NOT NULL,
+  `size` bigint(20) NOT NULL,
   `componenttype` varchar(8) COLLATE utf8mb4_bin DEFAULT NULL,
-  `firstoccurence` bigint(20) UNSIGNED DEFAULT NULL,
-  `lastoccurence` bigint(20) UNSIGNED DEFAULT NULL,
+  `firstoccurence` bigint(20) DEFAULT NULL,
+  `lastoccurence` bigint(20) DEFAULT NULL,
   `uid` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
-  `classification` int(11) DEFAULT '0' COMMENT '0 - public, 1 - private, 2 - confidential'
+  `classification` int(11) DEFAULT '0'
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPRESSED;
 
 -- --------------------------------------------------------
@@ -102,9 +102,9 @@
 --
 
 CREATE TABLE `oc_calendarobjects_props` (
-  `id` bigint(20) UNSIGNED NOT NULL,
+  `id` bigint(20) NOT NULL,
   `calendarid` bigint(20) NOT NULL DEFAULT '0',
-  `objectid` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
+  `objectid` bigint(20) NOT NULL DEFAULT '0',
   `name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL,
   `parameter` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL,
   `value` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL
@@ -117,13 +117,13 @@
 --
 
 CREATE TABLE `oc_calendars` (
-  `id` bigint(20) UNSIGNED NOT NULL,
+  `id` bigint(20) NOT NULL,
   `principaluri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   `displayname` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   `uri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
-  `synctoken` int(10) UNSIGNED NOT NULL DEFAULT '1',
+  `synctoken` int(11) NOT NULL DEFAULT '1',
   `description` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
-  `calendarorder` int(10) UNSIGNED NOT NULL DEFAULT '0',
+  `calendarorder` int(11) NOT NULL DEFAULT '0',
   `calendarcolor` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   `timezone` longtext COLLATE utf8mb4_bin,
   `components` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL,
@@ -137,18 +137,18 @@
 --
 
 CREATE TABLE `oc_calendarsubscriptions` (
-  `id` bigint(20) UNSIGNED NOT NULL,
+  `id` bigint(20) NOT NULL,
   `uri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   `principaluri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   `source` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   `displayname` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
   `refreshrate` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL,
-  `calendarorder` int(10) UNSIGNED NOT NULL DEFAULT '0',
+  `calendarorder` int(11) NOT NULL DEFAULT '0',
   `calendarcolor` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   `striptodos` smallint(6) DEFAULT NULL,
   `stripalarms` smallint(6) DEFAULT NULL,
   `stripattachments` smallint(6) DEFAULT NULL,
-  `lastmodified` int(10) UNSIGNED DEFAULT NULL
+  `lastmodified` int(11) DEFAULT NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPRESSED;
 
 -- --------------------------------------------------------
@@ -158,13 +158,13 @@
 --
 
 CREATE TABLE `oc_cards` (
-  `id` bigint(20) UNSIGNED NOT NULL,
+  `id` bigint(20) NOT NULL,
   `addressbookid` int(11) NOT NULL DEFAULT '0',
   `carddata` longblob,
   `uri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
-  `lastmodified` bigint(20) UNSIGNED DEFAULT NULL,
+  `lastmodified` bigint(20) DEFAULT NULL,
   `etag` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL,
-  `size` bigint(20) UNSIGNED NOT NULL
+  `size` bigint(20) NOT NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPRESSED;
 
 -- --------------------------------------------------------
@@ -174,9 +174,9 @@
 --
 
 CREATE TABLE `oc_cards_properties` (
-  `id` bigint(20) UNSIGNED NOT NULL,
+  `id` bigint(20) NOT NULL,
   `addressbookid` bigint(20) NOT NULL DEFAULT '0',
-  `cardid` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
+  `cardid` bigint(20) NOT NULL DEFAULT '0',
   `name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL,
   `value` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   `preferred` int(11) NOT NULL DEFAULT '1'
@@ -189,11 +189,11 @@
 --
 
 CREATE TABLE `oc_dav_shares` (
-  `id` bigint(20) UNSIGNED NOT NULL,
+  `id` bigint(20) NOT NULL,
   `principaluri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   `type` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   `access` smallint(6) DEFAULT NULL,
-  `resourceid` int(10) UNSIGNED NOT NULL,
+  `resourceid` int(11) NOT NULL,
   `publicuri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPRESSED;
 
@@ -204,13 +204,13 @@
 --
 
 CREATE TABLE `oc_schedulingobjects` (
-  `id` bigint(20) UNSIGNED NOT NULL,
+  `id` bigint(20) NOT NULL,
   `principaluri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   `calendardata` longblob,
   `uri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
-  `lastmodified` int(10) UNSIGNED DEFAULT NULL,
+  `lastmodified` int(11) DEFAULT NULL,
   `etag` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL,
-  `size` bigint(20) UNSIGNED NOT NULL
+  `size` bigint(20) NOT NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPRESSED;
 
 --

@codecov

codecov Bot commented Sep 7, 2017

Copy link
Copy Markdown

Codecov Report

Merging #6264 into master will decrease coverage by 0.19%.
The diff coverage is 0%.

@@             Coverage Diff             @@
##             master    #6264     +/-   ##
===========================================
- Coverage     53.36%   53.17%   -0.2%     
- Complexity    22576    22588     +12     
===========================================
  Files          1409     1410      +1     
  Lines         87338    87757    +419     
  Branches       1340     1340             
===========================================
+ Hits          46611    46665     +54     
- Misses        40727    41092    +365
Impacted Files Coverage Δ Complexity Δ
...lib/Migration/Version1004001Date20170825134824.php 0% <0%> (ø) 12 <12> (?)
...ib/private/Files/ObjectStore/S3ConnectionTrait.php 54.16% <0%> (+54.16%) 22% <0%> (ø) ⬇️
lib/private/Files/ObjectStore/S3.php 73.68% <0%> (+73.68%) 5% <0%> (ø) ⬇️

@MorrisJobke

Copy link
Copy Markdown
Member

@nickvergessen Mind to have another look?

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer

rullzer commented Sep 18, 2017

Copy link
Copy Markdown
Member Author

I just rebased to make sure CI is green for this

@rullzer rullzer merged commit 66698b2 into master Sep 19, 2017
@rullzer rullzer deleted the dav-migrations branch September 19, 2017 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement technical debt 🧱 🤔🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants