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

get rid of partial key reference #58

Closed
OlliL opened this issue Dec 5, 2024 · 1 comment
Closed

get rid of partial key reference #58

OlliL opened this issue Dec 5, 2024 · 1 comment

Comments

@OlliL
Copy link
Owner

OlliL commented Dec 5, 2024

Issue description

The primary key of the table capitalsources is currently a composite key consisting of

  • capitalsourceid
  • mag_groupid

Several tables having a foreign key to capitalsources but only referencing one part capitalsourceid of the primary key (partial reference).

  • mmf_mcs_pk - table moneyflows
  • mms_mcs_pk - table monthlysettlements
  • mpm_mcs_pk - table predefmoneyflows
  • mim_mcs_pk - table impmoneyflows
  • mis_mcs_pk - table impmonthlysettlements

Future versions of MySQL will drop support for this.

2024-12-05T13:22:42.810587Z 1 [Warning] [MY-015129] [Server] Foreign key 'mim_mcs_pk' on table 'moneyflow'.'capitalsources' refers to non-unique key or partial key. This is deprecated and will be removed in a future release.
2024-12-05T13:22:42.811649Z 1 [Warning] [MY-015129] [Server] Foreign key 'mis_mcs_pk' on table 'moneyflow'.'capitalsources' refers to non-unique key or partial key. This is deprecated and will be removed in a future release.
2024-12-05T13:22:42.815495Z 1 [Warning] [MY-015129] [Server] Foreign key 'mmf_mcs_pk' on table 'moneyflow'.'capitalsources' refers to non-unique key or partial key. This is deprecated and will be removed in a future release.
2024-12-05T13:22:42.817658Z 1 [Warning] [MY-015129] [Server] Foreign key 'mms_mcs_pk' on table 'moneyflow'.'capitalsources' refers to non-unique key or partial key. This is deprecated and will be removed in a future release.
2024-12-05T13:22:42.819960Z 1 [Warning] [MY-015129] [Server] Foreign key 'mpm_mcs_pk' on table 'moneyflow'.'capitalsources' refers to non-unique key or partial key. This is deprecated and will be removed in a future release.
2024-12-05T13:22:43.062568Z 1 [Warning] [MY-014070] [Server] Deprecated 'foreign key referring to a non-unique or partial key' used 5 times, last time used 'during upgrade'.

Solution

To most of the foreign keys mag_groupid can't be added because its just not there. Think about a way to drop the mag_groupid column which is probably not that easy because its currently used to allow access to the capitalsources of other members of your current group. The whole concept of having unique capitalsource IDs but also supporting users switching groups and taking "their" capitalsources with them is obviously not completely thought trough. This needs some attention first before designing a solution.

@OlliL OlliL closed this as completed in 995efd9 Dec 8, 2024
@OlliL
Copy link
Owner Author

OlliL commented Dec 8, 2024

Just made the existing capitalsourceid's unique. A users group change in general means, that they need to recreate there own personal capitalsources. Access the the contractpartners of the old group are also not permitted. Predefined moneyflows become unusable after a group change and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant