The custom `metis` table defined in metis.install has no primary key and no unique key on `code_public`.
Right now duplicate protection is handled only in application code during import. A database-level uniqueness constraint would make the module more robust and easier to maintain on current core.
Proposed change:
- Add a unique key for `code_public` in `hook_schema()`.
- Provide an update hook for existing installs.
- Decide how to handle pre-existing duplicate rows during the update path.
Suggested acceptance criteria:
- New installs create the table with a uniqueness constraint on `code_public`.
- Existing installs can update cleanly through update hooks.
- Duplicate code insertion is prevented at the database layer.
Issue fork metis-3511194
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
sanduhrsComment #3
sanduhrs//edit: n7a
Comment #4
sanduhrsComment #5
sanduhrsComment #8
yan commentedComment #10
yan commentedComment #12
yan commentedTurns out Drupal requires a primary key, not only unique. With current code, status page shows an error message about READ-COMMITTED setting.
Comment #15
yan commented