Skip to content

Commit 1f78dc0

Browse files
committed
update_from_4.3_new_commerce.md: Drop old tables: PostgreSQL query
1 parent 4521cdb commit 1f78dc0

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

docs/update_and_migration/from_4.3/update_from_4.3_new_commerce.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,29 @@ The removable table are prefixed with `ses_` and `sve_`.
344344
=== "PostgreSQL"
345345

346346
```sql
347-
TODO
347+
SHOW TABLES FROM <database_name> WHERE Tables_in_<database_name> LIKE 'ses_%' OR Tables_in_<database_name> LIKE 'sve_%';
348+
```
349+
350+
```sql
351+
FOR table_row IN
352+
SELECT
353+
table_schema,
354+
table_name
355+
FROM
356+
information_schema.tables
357+
WHERE
358+
table_type = 'BASE TABLE'
359+
AND
360+
table_schema = '<database_name>'
361+
AND
362+
(
363+
table_name LIKE ('ses_%')
364+
OR
365+
table_name LIKE ('sve_%')
366+
)
367+
LOOP
368+
EXECUTE 'DROP TABLE ' || table_row.table_schema || '.' || table_row.table_name;
369+
END LOOP;
348370
```
349371

350372
#### Ibexa Open Source

0 commit comments

Comments
 (0)