Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bigint update case #28590

Merged
merged 12 commits into from
Aug 8, 2017
Merged

Bigint update case #28590

merged 12 commits into from
Aug 8, 2017

Conversation

VicDeo
Copy link
Member

@VicDeo VicDeo commented Aug 4, 2017

Description

It appeared that old-fashioned MDB2 schema ignores changing length and doesn't migrate it to bigint.
Due to issue with migrations on postgres minor supported version for apps was increased

Related Issue

#26901

How Has This Been Tested?

Manual update from 10.0.2

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@VicDeo
Copy link
Member Author

VicDeo commented Aug 4, 2017

@VicDeo
Copy link
Member Author

VicDeo commented Aug 4, 2017

A new bunch of surprises. Files_sharing is installed before files and contains another gift inside....

@VicDeo VicDeo force-pushed the bigint-update-case branch from 1fe80dd to 15bea4e Compare August 5, 2017 00:04
\OC::$server->getConfig(),
\OC::$server->getDatabaseConnection()->getDatabasePlatform()
);
$schemaReader->loadSchemaFromFile(__DIR__ . '/../database.xml', $schema);
Copy link
Contributor

Choose a reason for hiding this comment

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

just port the table to a migration ?

Copy link
Member Author

Choose a reason for hiding this comment

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

@PVince81 done

@VicDeo VicDeo force-pushed the bigint-update-case branch 3 times, most recently from baa91a3 to 42cc0ea Compare August 7, 2017 16:26
@VicDeo VicDeo force-pushed the bigint-update-case branch from 42cc0ea to fb132dc Compare August 7, 2017 18:35
Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍 looks good

@VicDeo did you test installing, upgrading this time ?
Diffed the schema dumps to confirm that they are the same when using migrations ?

@VicDeo
Copy link
Member Author

VicDeo commented Aug 8, 2017

@PVince81 with Mysql only so far

@VicDeo
Copy link
Member Author

VicDeo commented Aug 8, 2017

Comparing 10.0.2 with this branch:

mysql> use o1002;
Database changed
mysql> describe oc_federated_reshares;
+-----------+---------+------+-----+---------+-------+
| Field     | Type    | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+-------+
| share_id  | int(11) | NO   | PRI | NULL    |       |
| remote_id | int(11) | NO   |     | NULL    |       |
+-----------+---------+------+-----+---------+-------+
2 rows in set (0.00 sec)

mysql> use biginttest;
Database changed
mysql> describe oc_federated_reshares;
+-----------+------------+------+-----+---------+-------+
| Field     | Type       | Null | Key | Default | Extra |
+-----------+------------+------+-----+---------+-------+
| share_id  | bigint(20) | NO   | PRI | NULL    |       |
| remote_id | bigint(20) | NO   |     | NULL    |       |
+-----------+------------+------+-----+---------+-------+
2 rows in set (0.00 sec)

mysql> use o1002;
Database changed
mysql> describe oc_share_external;
+-----------------+---------------+------+-----+---------+----------------+
| Field           | Type          | Null | Key | Default | Extra          |
+-----------------+---------------+------+-----+---------+----------------+
| id              | int(11)       | NO   | PRI | NULL    | auto_increment |
| remote          | varchar(512)  | NO   |     | NULL    |                |
| remote_id       | int(11)       | NO   |     | -1      |                |
| share_token     | varchar(64)   | NO   |     | NULL    |                |
| password        | varchar(64)   | YES  |     | NULL    |                |
| name            | varchar(64)   | NO   |     | NULL    |                |
| owner           | varchar(64)   | NO   |     | NULL    |                |
| user            | varchar(64)   | NO   | MUL | NULL    |                |
| mountpoint      | varchar(4000) | NO   |     | NULL    |                |
| mountpoint_hash | varchar(32)   | NO   |     | NULL    |                |
| accepted        | int(11)       | NO   |     | 0       |                |
+-----------------+---------------+------+-----+---------+----------------+
11 rows in set (0.00 sec)
mysql> use biginttest;
Database changed
mysql> describe oc_share_external;
+-----------------+---------------+------+-----+---------+----------------+
| Field           | Type          | Null | Key | Default | Extra          |
+-----------------+---------------+------+-----+---------+----------------+
| id              | bigint(20)    | NO   | PRI | NULL    | auto_increment |
| remote          | varchar(512)  | NO   |     | NULL    |                |
| remote_id       | bigint(20)    | NO   |     | -1      |                |
| share_token     | varchar(64)   | NO   |     | NULL    |                |
| password        | varchar(64)   | YES  |     | NULL    |                |
| name            | varchar(64)   | NO   |     | NULL    |                |
| owner           | varchar(64)   | NO   |     | NULL    |                |
| user            | varchar(64)   | NO   | MUL | NULL    |                |
| mountpoint      | varchar(4000) | NO   |     | NULL    |                |
| mountpoint_hash | varchar(32)   | NO   |     | NULL    |                |
| accepted        | int(11)       | NO   |     | 0       |                |
+-----------------+---------------+------+-----+---------+----------------+
11 rows in set (0.00 sec)


mysql> use o1002;
Database changed
mysql> describe oc_files_trash;
+-----------+--------------+------+-----+---------+----------------+
| Field     | Type         | Null | Key | Default | Extra          |
+-----------+--------------+------+-----+---------+----------------+
| auto_id   | int(11)      | NO   | PRI | NULL    | auto_increment |
| id        | varchar(250) | NO   | MUL |         |                |
| user      | varchar(64)  | NO   | MUL |         |                |
| timestamp | varchar(12)  | NO   | MUL |         |                |
| location  | varchar(512) | NO   |     |         |                |
| type      | varchar(4)   | YES  |     | NULL    |                |
| mime      | varchar(255) | YES  |     | NULL    |                |
+-----------+--------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)

mysql> use biginttest;
Database changed
mysql> describe oc_files_trash;
+-----------+--------------+------+-----+---------+----------------+
| Field     | Type         | Null | Key | Default | Extra          |
+-----------+--------------+------+-----+---------+----------------+
| auto_id   | int(11)      | NO   | PRI | NULL    | auto_increment |
| id        | varchar(250) | NO   | MUL |         |                |
| user      | varchar(64)  | NO   | MUL |         |                |
| timestamp | varchar(12)  | NO   | MUL |         |                |
| location  | varchar(512) | NO   |     |         |                |
| type      | varchar(4)   | YES  |     | NULL    |                |
| mime      | varchar(255) | YES  |     | NULL    |                |
+-----------+--------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)

@PVince81
Copy link
Contributor

PVince81 commented Aug 8, 2017

@VicDeo better use "mysqldump" instead as it contains more details and also contains the indices.

@VicDeo
Copy link
Member Author

VicDeo commented Aug 8, 2017

mysql> use o1002;
Database changed
 show create table oc_federated_reshares;
| oc_federated_reshares | CREATE TABLE `oc_federated_reshares` (
  `share_id` int(11) NOT NULL,
  `remote_id` int(11) NOT NULL COMMENT 'share ID at the remote server',
  UNIQUE KEY `share_id_index` (`share_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |

mysql> use biginttest;
Database changed
mysql> show create table oc_federated_reshares;
| oc_federated_reshares | CREATE TABLE `oc_federated_reshares` (
  `share_id` bigint(20) NOT NULL,
  `remote_id` bigint(20) NOT NULL COMMENT 'share ID at the remote server',
  UNIQUE KEY `share_id_index` (`share_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |


mysql> use o1002;
Database changed
mysql> show create table oc_share_external;        
| oc_share_external | CREATE TABLE `oc_share_external` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `remote` varchar(512) COLLATE utf8_bin NOT NULL COMMENT 'Url of the remove owncloud instance',
  `remote_id` int(11) NOT NULL DEFAULT '-1',
  `share_token` varchar(64) COLLATE utf8_bin NOT NULL COMMENT 'Public share token',
  `password` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT 'Optional password for the public share',
  `name` varchar(64) COLLATE utf8_bin NOT NULL COMMENT 'Original name on the remote server',
  `owner` varchar(64) COLLATE utf8_bin NOT NULL COMMENT 'User that owns the public share on the remote server',
  `user` varchar(64) COLLATE utf8_bin NOT NULL COMMENT 'Local user which added the external share',
  `mountpoint` varchar(4000) COLLATE utf8_bin NOT NULL COMMENT 'Full path where the share is mounted',
  `mountpoint_hash` varchar(32) COLLATE utf8_bin NOT NULL COMMENT 'md5 hash of the mountpoint',
  `accepted` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `sh_external_mp` (`user`,`mountpoint_hash`),
  KEY `sh_external_user` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |

mysql> use biginttest;
Database changed
mysql> show create table oc_share_external;
oc_share_external | CREATE TABLE `oc_share_external` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `remote` varchar(512) COLLATE utf8_bin NOT NULL COMMENT 'Url of the remote owncloud instance',
  `remote_id` bigint(20) NOT NULL DEFAULT '-1',
  `share_token` varchar(64) COLLATE utf8_bin NOT NULL COMMENT 'Public share token',
  `password` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT 'Optional password for the public share',
  `name` varchar(64) COLLATE utf8_bin NOT NULL COMMENT 'Original name on the remote server',
  `owner` varchar(64) COLLATE utf8_bin NOT NULL COMMENT 'User that owns the public share on the remote server',
  `user` varchar(64) COLLATE utf8_bin NOT NULL COMMENT 'Local user which added the external share',
  `mountpoint` varchar(4000) COLLATE utf8_bin NOT NULL COMMENT 'Full path where the share is mounted',
  `mountpoint_hash` varchar(32) COLLATE utf8_bin NOT NULL COMMENT 'md5 hash of the mountpoint',
  `accepted` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `sh_external_mp` (`user`,`mountpoint_hash`),
  KEY `sh_external_user` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |

mysql> use o1002;
Database changed
mysql> show create table oc_files_trash;
| oc_files_trash | CREATE TABLE `oc_files_trash` (
  `auto_id` int(11) NOT NULL AUTO_INCREMENT,
  `id` varchar(250) COLLATE utf8_bin NOT NULL DEFAULT '',
  `user` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  `timestamp` varchar(12) COLLATE utf8_bin NOT NULL DEFAULT '',
  `location` varchar(512) COLLATE utf8_bin NOT NULL DEFAULT '',
  `type` varchar(4) COLLATE utf8_bin DEFAULT NULL,
  `mime` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`auto_id`),
  KEY `id_index` (`id`),
  KEY `timestamp_index` (`timestamp`),
  KEY `user_index` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |

mysql> use biginttest;
Database changed
mysql> show create table oc_files_trash;
| oc_files_trash | CREATE TABLE `oc_files_trash` (
  `auto_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `id` varchar(250) COLLATE utf8_bin NOT NULL DEFAULT '',
  `user` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  `timestamp` varchar(12) COLLATE utf8_bin NOT NULL DEFAULT '',
  `location` varchar(512) COLLATE utf8_bin NOT NULL DEFAULT '',
  `type` varchar(4) COLLATE utf8_bin DEFAULT NULL,
  `mime` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`auto_id`),
  KEY `id_index` (`id`),
  KEY `timestamp_index` (`timestamp`),
  KEY `user_index` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |

@VicDeo
Copy link
Member Author

VicDeo commented Aug 8, 2017

Tests are passed. Merging.

@VicDeo VicDeo merged commit 277496e into master Aug 8, 2017
@VicDeo VicDeo deleted the bigint-update-case branch August 8, 2017 22:44
@VicDeo
Copy link
Member Author

VicDeo commented Aug 9, 2017

Stable10: #28581

@lock
Copy link

lock bot commented Aug 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants