Skip to content

Commit 27f416e

Browse files
authored
Merge pull request #570 from USACE/User-region
print flyway table
2 parents 96718cc + 3024e0b commit 27f416e

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

sql/common/R__08_functions_user_regions.sql

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@
44
-- User Regions
55
-------------------------
66

7+
-- DEBUG: Show Flyway migration history in logs
8+
DO $$
9+
DECLARE
10+
migration_history TEXT;
11+
BEGIN
12+
SELECT string_agg(
13+
format('installed_rank: %s | version: %s | description: %s | type: %s | script: %s | checksum: %s | installed_on: %s | execution_time: %s | success: %s',
14+
installed_rank,
15+
COALESCE(version, 'NULL'),
16+
description,
17+
type,
18+
script,
19+
COALESCE(checksum::TEXT, 'NULL'),
20+
installed_on,
21+
execution_time,
22+
success
23+
),
24+
E'\n'
25+
ORDER BY installed_rank DESC
26+
)
27+
INTO migration_history
28+
FROM flyway_schema_history
29+
ORDER BY installed_rank DESC
30+
LIMIT 20;
31+
32+
RAISE EXCEPTION E'FLYWAY MIGRATION HISTORY (last 20):\n%', migration_history;
33+
END $$;
34+
735
-- Function to validate GeoJSON before saving
836
CREATE OR REPLACE FUNCTION validate_user_region_geojson()
937
RETURNS TRIGGER AS $$

0 commit comments

Comments
 (0)