materio-d9/patches/flag_lists_cleaning.md

45 lines
1008 B
Markdown
Raw Permalink Normal View History

2022-02-07 20:08:54 +01:00
get each flagging_collection id wich related_flag does not exists
```sql
SELECT * FROM `flagging_collection`;
SELECT * FROM `flagging`;
```
for each flagging_collection
get the flag_lists_items ids form flag_list_item_field_data
```sql
SELECT * FROM `flag_list_item_field_data` WHERE `flag_list` LIKE 'FLAG_LIST_ID'
```
remove flag_list_items
```sql
DELETE FROM `flag_list_item` WHERE `id` = FLAG_LIST_ITEM_ID;
```
remove flag_list_item_field_data
```sql
DELETE FROM `flag_list_item_field_data` WHERE `id` = FLAG_LIST_ITEM_ID;
```
remove flagging_collection_revision
```sql
DELETE FROM `flagging_collection_revision` WHERE `id` = FLAG_LIST_ID;
```
remove flagging_collection_field_revision
```sql
DELETE FROM `flagging_collection_field_revision` WHERE `id` = FLAG_LIST_ID;
```
remove flagging_collection_field_data
```sql
DELETE FROM `flagging_collection_field_data` WHERE `id` = FLAG_LIST_ID;
```
remove flagging_collection
```sql
DELETE FROM `flagging_collection` WHERE `id` = FLAG_LIST_ID;
```