Add postgres sql file formatting via pg_format

This commit is contained in:
thiloho
2024-08-08 22:29:04 +02:00
parent 8534b2d783
commit 2fd934ed86
9 changed files with 526 additions and 397 deletions

View File

@@ -1,14 +1,19 @@
-- migrate:up
CREATE FUNCTION pgrst_watch() RETURNS event_trigger AS $$
CREATE FUNCTION pgrst_watch ()
RETURNS event_trigger
AS $$
BEGIN
NOTIFY pgrst, 'reload schema';
NOTIFY pgrst,
'reload schema';
END;
$$ LANGUAGE plpgsql;
$$
LANGUAGE plpgsql;
CREATE EVENT TRIGGER pgrst_watch
ON ddl_command_end
EXECUTE FUNCTION pgrst_watch();
CREATE EVENT TRIGGER pgrst_watch ON ddl_command_end
EXECUTE FUNCTION pgrst_watch ();
-- migrate:down
DROP EVENT TRIGGER pgrst_watch;
DROP FUNCTION pgrst_watch();
DROP FUNCTION pgrst_watch ();