-
Notifications
You must be signed in to change notification settings - Fork 32
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
Feature/delete cascade #503
Feature/delete cascade #503
Conversation
DB-PRUNING.md
Outdated
@@ -60,11 +60,11 @@ mysql> show tables; | |||
|
|||
Conveniently the auxiliary tables contain [ON DELETE CASCADE referential actions](https://dev.mysql.com/doc/refman/8.3/en/create-table-foreign-keys.html#foreign-key-referential-actions) on the respective [FOREIGN KEYS](https://dev.mysql.com/doc/refman/8.3/en/create-table-foreign-keys.html). | |||
|
|||
Therefore, we can focus on pruning rows from the three 'main' tables (```clients```,```messages``` and ```broadcasts```) to wip our Fleetspeak database back in shape. MySQL will ensure that the related tables and their entries will get cleared up accordingly. | |||
Therefore, we can focus on pruning rows from the three 'main' tables (```clients```,```messages``` and ```broadcasts```) to wip our Fleetspeak database back into shape. MySQL will ensure that the related tables and their entries will get cleaned up accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also a typo in "wip" (but maybe it would be better to just use a different word ;-))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch. Thanks heaps.
Will update accordingly.
@@ -87,11 +87,11 @@ mysql> DESCRIBE clients; | |||
|
|||
### 3.2. Pruning clients | |||
|
|||
In the example ```DELETE``` command below we delete all the rows that have been created 148h (7 days) ago or older. Feel free to adjust the time according to your needs. | |||
With the example ```DELETE``` command below we delete all the rows that have been created 168h (7 days) ago or older. Feel free to adjust the time according to your needs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch with the number! o_O
This seems OK to me, although I am not a MySQL expert, admittedly. If there are points where you are unsure, I'd suggest looping in @torsm ; otherwise we can also go ahead with it |
This PR proposes to introduce ON DELETE CASCADE referential actions on the auxiliary tables to enable database pruning.
See the new DB-PRUNINIG.md file with a description on how the proposed database pruning could be achieved leveraging the delete cascade relations.