nextcloud / nextcloud/cookbook

Refactoring of the DB schema

Open
#300 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Backend enhancement php
Dominant language
HTML
Stars
641
Forks
113
Avg merge
21h 31m
Merged PRs (30d)
26

Description

Currently the DB schema seems non-optimal solved.

Describe the solution you'd like

  1. The keywords are associated with both a recipe and a user. A recipe would be sufficient.
  2. The category is (by the schem.org standard) only one entry per recipe. This should be in a nullable column in the recipe table.
  3. The recipes are indexed by the id of their parent folder and the user id. As the parent folder is already unique, the user id is not needed and should be dropped. This also makes the update faster as shared recipes are automatically updated for all users.
  4. Adding of indices if possible.
  5. Avoid storing of series of strings (keyword as column), better use separate table with indexed foreign key + joins
  6. Optionally enhance the schema to store more details for full-text search (see discussion on matrix channel from Aug 7th to 11th)

Potentially there are more optimizations to be carried out that come up during development.

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 reviewing the current database schema and the recipe, keyword, category, and folder relationships described in the issue. Clarify the full-text search requirements from the referenced Matrix discussion, then define migrations and validation for the normalized tables, nullable category, indexes, and updated associations.

Written by the indexing model from the issue text.

Assessment

Domain
database
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.