@@ -323,49 +323,81 @@ The removable tables are prefixed with `ses_` and `sve_`.
323323
324324=== "MySQL"
325325
326- To list the removable tables :
326+ To be on the right database, adapt the following command :
327327 ` ` ` sql
328- SHOW TABLES FROM ` <database_name>` WHERE `Tables_in_<database_name>` LIKE 'ses_%' OR `Tables_in_<database_name>` LIKE 'sve_%' ;
328+ USE <database_name>;
329329 ` ` `
330330
331- To build a query to drop all those tables and execute it as a statement :
331+ Then, to remove all the old tables, run the following queries :
332332 ` ` ` sql
333- SELECT CONCAT('DROP TABLE ', GROUP_CONCAT('` ' , `table_schema`, ' ` .` ' , `table_name`, ' ` ' SEPARATOR ', '))
334- INTO @drop_query
335- FROM ` information_schema`.`tables`
336- WHERE `table_schema` = '<database_name>' AND (`table_name` LIKE 'ses_%' OR `table_name` LIKE 'sve_%')
337- ;
338-
339- PREPARE drop_stmt FROM @drop_query;
340- EXECUTE drop_stmt;
341- DEALLOCATE PREPARE drop_stmt;
333+ DROP TABLE IF EXISTS ses_basket;
334+ DROP TABLE IF EXISTS ses_basket_line;
335+ DROP TABLE IF EXISTS ses_content_modification_queue;
336+ DROP TABLE IF EXISTS ses_customer_prices;
337+ DROP TABLE IF EXISTS ses_customer_sku;
338+ DROP TABLE IF EXISTS ses_download;
339+ DROP TABLE IF EXISTS ses_externaldata;
340+ DROP TABLE IF EXISTS ses_gdpr_log;
341+ DROP TABLE IF EXISTS ses_invoice;
342+ DROP TABLE IF EXISTS ses_log_erp;
343+ DROP TABLE IF EXISTS ses_log_mail;
344+ DROP TABLE IF EXISTS ses_log_search;
345+ DROP TABLE IF EXISTS ses_payment_basket_map;
346+ DROP TABLE IF EXISTS ses_price;
347+ DROP TABLE IF EXISTS ses_shipping_cost;
348+ DROP TABLE IF EXISTS ses_stat_sessions;
349+ DROP TABLE IF EXISTS ses_stock;
350+ DROP TABLE IF EXISTS ses_token;
351+ DROP TABLE IF EXISTS sve_class;
352+ DROP TABLE IF EXISTS sve_class_attributes;
353+ DROP TABLE IF EXISTS sve_object;
354+ DROP TABLE IF EXISTS sve_object_attributes;
355+ DROP TABLE IF EXISTS sve_object_attributes_tmp;
356+ DROP TABLE IF EXISTS sve_object_catalog;
357+ DROP TABLE IF EXISTS sve_object_catalog_tmp;
358+ DROP TABLE IF EXISTS sve_object_tmp;
359+ DROP TABLE IF EXISTS sve_object_urls;
360+ DROP TABLE IF EXISTS sve_object_urls_tmp;
342361 ` ` `
343362
344363=== "PostgreSQL"
345364
346- To list the removable tables :
347- ` ` ` sql
348- SELECT tableowner, tablename
349- FROM pg_catalog.pg_tables
350- WHERE schemaname='public' AND tableowner='<database_name>' AND (tablename LIKE 'ses_%' OR tablename LIKE 'sve_%');
365+ To be on the right database, adapt the following command :
366+ ` ` ` sql
367+ \c onnect <database_name>;
351368 ` ` `
352369
353- To loop through the tables to drop them (be sure to use the right database with `\connect <database_name>;`.) :
354- ` ` ` sql
355- DO $drop$
356- DECLARE table_row RECORD;
357- BEGIN
358- FOR table_row IN
359- SELECT table_catalog, table_name
360- FROM information_schema.tables
361- WHERE table_schema = 'public' AND table_type = 'BASE TABLE'
362- AND table_catalog = 'db' AND (table_name LIKE ('ses_%') OR table_name LIKE ('sve_%'))
363- LOOP
364- EXECUTE 'DROP TABLE ' || table_row.table_name;
365- END LOOP
366- ;
367- END
368- $drop$;
370+
371+ Then, to remove all the old tables, run the following queries :
372+ ` ` ` sql
373+ DROP TABLE IF EXISTS ses_basket;
374+ DROP TABLE IF EXISTS ses_basket_line;
375+ DROP TABLE IF EXISTS ses_content_modification_queue;
376+ DROP TABLE IF EXISTS ses_customer_prices;
377+ DROP TABLE IF EXISTS ses_customer_sku;
378+ DROP TABLE IF EXISTS ses_download;
379+ DROP TABLE IF EXISTS ses_externaldata;
380+ DROP TABLE IF EXISTS ses_gdpr_log;
381+ DROP TABLE IF EXISTS ses_invoice;
382+ DROP TABLE IF EXISTS ses_log_erp;
383+ DROP TABLE IF EXISTS ses_log_mail;
384+ DROP TABLE IF EXISTS ses_log_search;
385+ DROP TABLE IF EXISTS ses_payment_basket_map;
386+ DROP TABLE IF EXISTS ses_price;
387+ DROP TABLE IF EXISTS ses_shipping_cost;
388+ DROP TABLE IF EXISTS ses_stat_sessions;
389+ DROP TABLE IF EXISTS ses_stock;
390+ DROP TABLE IF EXISTS ses_token;
391+ DROP TABLE IF EXISTS sve_class;
392+ DROP TABLE IF EXISTS sve_class_attributes;
393+ DROP TABLE IF EXISTS sve_object;
394+ DROP TABLE IF EXISTS sve_object_attributes;
395+ DROP TABLE IF EXISTS sve_object_attributes_tmp;
396+ DROP TABLE IF EXISTS sve_object_catalog;
397+ DROP TABLE IF EXISTS sve_object_catalog_tmp;
398+ DROP TABLE IF EXISTS sve_object_tmp;
399+ DROP TABLE IF EXISTS sve_object_urls;
400+ DROP TABLE IF EXISTS sve_object_urls_tmp;
369401 ` ` `
370402
371403# ### Ibexa Open Source
0 commit comments