We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d141dc commit add0806Copy full SHA for add0806
1 file changed
aidbox_python_sdk/db_migrations.py
@@ -20,6 +20,26 @@
20
"sql": """
21
DROP FUNCTION IF EXISTS drop_before_all(integer);
22
23
+CREATE FUNCTION drop_before_all(integer) RETURNS VOID AS $$
24
+declare
25
+e record;
26
+BEGIN
27
+FOR e IN (
28
+ SELECT table_name
29
+ FROM information_schema.columns
30
+ WHERE column_name = 'txid' AND table_schema = 'public' AND table_name NOT LIKE '%_history'
31
+) LOOP
32
+ EXECUTE 'DELETE FROM "' || e.table_name || '" WHERE txid > ' || $1 ;
33
+END LOOP;
34
+END;
35
+
36
+$$ LANGUAGE plpgsql;""",
37
+ },
38
+ {
39
+ "id": "20251126_fix_drop_before_all_for_history_resources",
40
+ "sql": """
41
+DROP FUNCTION IF EXISTS drop_before_all(integer);
42
43
CREATE FUNCTION drop_before_all(integer) RETURNS VOID AS $$
44
declare
45
e record;
0 commit comments