nextcloud / nextcloud/notes

Migrate notes_meta file_id to bigint

Open
#1,461 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug need to reproduce
Dominant language
JavaScript
Stars
738
Forks
162
Avg merge
6h 2m
Merged PRs (30d)
35

Description

int(11) is too small, we should use bigint for any file id referencing column:

CREATE TABLE `oc_notes_meta` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `file_id` int(11) NOT NULL,
  `user_id` varchar(64) NOT NULL,
  `last_update` int(11) NOT NULL,
  `etag` varchar(32) NOT NULL,
  `content_etag` varchar(32) NOT NULL,
  `file_etag` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `notes_meta_file_user_index` (`file_id`,`user_id`),
  KEY `notes_meta_file_id_index` (`file_id`),
  KEY `notes_meta_user_id_index` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5518 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPRESSED;

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the migration or schema definition for the oc_notes_meta table and inspect the file_id column and its indexes. Update the file ID type to bigint wherever this table defines it, then verify the migration applies cleanly and preserves the existing unique and secondary indexes.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
database
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.