-
Notifications
You must be signed in to change notification settings - Fork 135
Produce updates to kafka #1443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Produce updates to kafka #1443
Conversation
| @@ -1,5 +1,5 @@ | |||
| __version__ = "0.32.7" | |||
| __db_version__ = 7 | |||
| __db_version__ = 8 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tab before operator
| AFTER INSERT OR UPDATE OR DELETE | ||
| ON ip_net_pool | ||
| FOR EACH ROW | ||
| EXECUTE PROCEDURE tf_kafka_produce_event(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| CREATE TRIGGER trigger_kafka_ip_net_pool | ||
| AFTER INSERT OR UPDATE OR DELETE | ||
| ON ip_net_pool | ||
| FOR EACH ROW |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| CREATE TRIGGER trigger_kafka_ip_net_pool | ||
| AFTER INSERT OR UPDATE OR DELETE | ||
| ON ip_net_pool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| EXECUTE PROCEDURE tf_kafka_produce_event(); | ||
| CREATE TRIGGER trigger_kafka_ip_net_pool | ||
| AFTER INSERT OR UPDATE OR DELETE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| -- Triggers that write to kafka_produce_event | ||
| CREATE TRIGGER trigger_kafka_ip_net_plan | ||
| AFTER INSERT OR UPDATE OR DELETE | ||
| ON ip_net_plan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| -- Triggers that write to kafka_produce_event | ||
| CREATE TRIGGER trigger_kafka_ip_net_plan | ||
| AFTER INSERT OR UPDATE OR DELETE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| ELSIF OLD IS DISTINCT FROM NEW THEN | ||
| INSERT INTO kafka_produce_event (table_name, event_type, payload) VALUES (TG_TABLE_NAME, TG_OP, row_to_json(NEW)::jsonb); | ||
| END IF; | ||
| RETURN NEW; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| INSERT INTO kafka_produce_event (table_name, event_type, payload) VALUES (TG_TABLE_NAME, TG_OP, row_to_json(OLD)::jsonb); | ||
| ELSIF OLD IS DISTINCT FROM NEW THEN | ||
| INSERT INTO kafka_produce_event (table_name, event_type, payload) VALUES (TG_TABLE_NAME, TG_OP, row_to_json(NEW)::jsonb); | ||
| END IF; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| IF TG_OP = 'DELETE' THEN | ||
| INSERT INTO kafka_produce_event (table_name, event_type, payload) VALUES (TG_TABLE_NAME, TG_OP, row_to_json(OLD)::jsonb); | ||
| ELSIF OLD IS DISTINCT FROM NEW THEN | ||
| INSERT INTO kafka_produce_event (table_name, event_type, payload) VALUES (TG_TABLE_NAME, TG_OP, row_to_json(NEW)::jsonb); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
line too long (123 > 79 characters)
| BEGIN | ||
| IF TG_OP = 'DELETE' THEN | ||
| INSERT INTO kafka_produce_event (table_name, event_type, payload) VALUES (TG_TABLE_NAME, TG_OP, row_to_json(OLD)::jsonb); | ||
| ELSIF OLD IS DISTINCT FROM NEW THEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| CREATE OR REPLACE FUNCTION tf_kafka_produce_event() RETURNS trigger AS $$ | ||
| BEGIN | ||
| IF TG_OP = 'DELETE' THEN | ||
| INSERT INTO kafka_produce_event (table_name, event_type, payload) VALUES (TG_TABLE_NAME, TG_OP, row_to_json(OLD)::jsonb); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
line too long (123 > 79 characters)
| CREATE OR REPLACE FUNCTION tf_kafka_produce_event() RETURNS trigger AS $$ | ||
| BEGIN | ||
| IF TG_OP = 'DELETE' THEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| event_type TEXT NOT NULL, | ||
| payload JSONB, | ||
| processed BOOLEAN DEFAULT FALSE, | ||
| created_at TIMESTAMP WITH TIME ZONE DEFAULT now() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| table_name TEXT NOT NULL, | ||
| event_type TEXT NOT NULL, | ||
| payload JSONB, | ||
| processed BOOLEAN DEFAULT FALSE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| CREATE TRIGGER trigger_kafka_ip_net_pool | ||
| AFTER INSERT OR UPDATE OR DELETE | ||
| ON ip_net_pool | ||
| FOR EACH ROW |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| CREATE TRIGGER trigger_kafka_ip_net_pool | ||
| AFTER INSERT OR UPDATE OR DELETE | ||
| ON ip_net_pool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| EXECUTE PROCEDURE tf_kafka_produce_event(); | ||
| CREATE TRIGGER trigger_kafka_ip_net_pool | ||
| AFTER INSERT OR UPDATE OR DELETE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| AFTER INSERT OR UPDATE OR DELETE | ||
| ON ip_net_vrf | ||
| FOR EACH ROW | ||
| EXECUTE PROCEDURE tf_kafka_produce_event(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
| CREATE TRIGGER trigger_kafka_ip_net_vrf | ||
| AFTER INSERT OR UPDATE OR DELETE | ||
| ON ip_net_vrf | ||
| FOR EACH ROW |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
No description provided.