This commit is contained in:
Dull Bananas 2024-05-27 23:36:49 +00:00
parent b6102dcbf2
commit 1a18350aca
3 changed files with 525 additions and 517 deletions

View file

@ -252,11 +252,18 @@ fn remove_skipped_item_from_beginning(s: &str) -> Option<&str> {
Some(after_first_occurence(after, "\n"))
}
// Skip old views and fast table triggers
else if let Some(after) = s.strip_prefix("CREATE VIEW ")
else if let Some(after) = s
.strip_prefix("CREATE VIEW ")
.or_else(|| s.strip_prefix("CREATE OR REPLACE VIEW "))
.or_else(|| s.strip_prefix("CREATE MATERIALIZED VIEW "))
.or_else(|| s.strip_prefix("CREATE FUNCTION public.").and_then(after_skipped_trigger_name)/*.and_then(|a| a.strip_prefix("()"))*/)
.or_else(|| s.strip_prefix("CREATE TRIGGER ").and_then(after_skipped_trigger_name)/*.and_then(|a| a.strip_prefix(' '))*/)
.or_else(|| {
s.strip_prefix("CREATE FUNCTION public.")
.and_then(after_skipped_trigger_name)
} /* .and_then(|a| a.strip_prefix("()")) */)
.or_else(|| {
s.strip_prefix("CREATE TRIGGER ")
.and_then(after_skipped_trigger_name)
} /* .and_then(|a| a.strip_prefix(' ')) */)
{
Some(after_first_occurence(after, "\n\n"))
} else {

View file

@ -143,3 +143,4 @@ SELECT
NULL AS subscribed
FROM
all_community ac;