deck icon indicating copy to clipboard operation
deck copied to clipboard

Removed Decks' data aren't deleted from database

Open neerro opened this issue 3 years ago • 8 comments

Describe the bug All decks which were removed from web console or app are still has their data in SQL database and weren't removed from it.

To Reproduce Steps to reproduce the behavior: I just go inside to database and still can observe those data in the base 'oc_deck_cards'.

Expected behavior After some decks were deleted from web console or app the data have to be removed from SQL database immediatly.

Screenshots

Client details:

  • OS: Windows or Android
  • Browser Firefox web-interface or Deck app
  • Version 99.0 or 1.20.0
  • Device: Desktop or smartphone
Server details

Operating system: Ubuntu 20.04

Web server: Apache 2.41

Database: 10.3.34-MariaDB

PHP version: PHP: 7.4.3

Nextcloud version: (see Nextcloud admin page) Nextcloud Hub II 23.0.3

Where did you install Nextcloud from: From general site www.nextcloud.com

Signing status:

Login as admin user into your Nextcloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here.

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or

Insert your config.php content here
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

Logs

Nextcloud log (data/nextcloud.log)

Insert your Nextcloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

neerro avatar Apr 12 '22 11:04 neerro

Do you have set up a cron job? I think (please don't nail me) that the data is kept on the database on purpose to be able providing an Undo option. The data should be deleted with some cron job in the future.

stefan-niedermann avatar Apr 12 '22 12:04 stefan-niedermann

Yes, a proper cronjob is required for the cleanup (and would generally be a good idea to have it on the Nextcloud setup).

juliusknorr avatar Apr 12 '22 13:04 juliusknorr

Do you have set up a cron job? I think (please don't nail me) that the data is kept on the database on purpose to be able providing an Undo option. The data should be deleted with some cron job in the future.

Yes, I have cron job for my Nextcloud, but I haven't see any changes. Data still keep on the Database.

neerro avatar Apr 14 '22 09:04 neerro

Yes, a proper cronjob is required for the cleanup (and would generally be a good idea to have it on the Nextcloud setup).

I'm quite agree with you, but it doesn't work for me. And I don't know what the reason. I had my cron set-up in according with tutorial from nexcloud team: https://docs.nextcloud.com/server/23/admin_manual/configuration_server/background_jobs_configuration.html

neerro avatar Apr 14 '22 09:04 neerro

For me deleted decks are still suggested in the dialog to add/move cards, which is highly annoying, this is probably related?

xeruf avatar Apr 25 '22 13:04 xeruf

I write this script for an cronjob:

# delete old data really
delete from oc_deck_boards where deleted_at > 0;
delete from oc_deck_stacks where deleted_at > 0;
delete from oc_deck_cards where deleted_at > 0;
delete from oc_deck_attachment where deleted_at > 0;

# missing foreign key workaround
delete from oc_deck_stacks where board_id not in (select id from oc_deck_boards);
delete from oc_deck_labels where board_id not in (select id from oc_deck_boards);
delete from oc_deck_board_acl where board_id not in (select id from oc_deck_boards);
delete from oc_deck_cards where stack_id not in (select id from oc_deck_stacks);
delete from oc_deck_attachment where card_id not in (select id from oc_deck_cards);
delete from oc_deck_assigned_users where card_id not in (select id from oc_deck_cards);
delete from oc_deck_assigned_labels where card_id not in (select id from oc_deck_cards);

wrenix avatar Feb 15 '24 05:02 wrenix

I write this script for an cronjob:

Thanks a lot for your work :) How do I correctly set up and use this script?

neerro avatar Feb 15 '24 11:02 neerro

That is just the sql - run with psql -c '...' or psql -f file.sql

wrenix avatar Feb 15 '24 14:02 wrenix