-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
447 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
schedoc.control | ||
*.zip | ||
test/sql/*.sql | ||
test/*.sql | ||
test/*.sql | ||
exclude.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,27 @@ CREATE TABLE @[email protected]_column_log ( | |
-- | ||
-- | ||
-- | ||
CREATE TABLE @[email protected]_table_exclusion ( | ||
schema_name name, | ||
table_name name, | ||
tag text, | ||
created_at timestamp with time zone DEFAULT current_timestamp, | ||
created_by text DEFAULT current_user, | ||
PRIMARY KEY (schema_name, table_name) | ||
); | ||
|
||
CREATE TABLE @[email protected]_table_exclusion_templates ( | ||
schema_name name, | ||
table_name name, | ||
tags text[], | ||
created_at timestamp with time zone DEFAULT current_timestamp, | ||
created_by text DEFAULT current_user, | ||
PRIMARY KEY (schema_name, table_name) | ||
); | ||
|
||
-- | ||
-- | ||
-- | ||
CREATE VIEW @[email protected]_column_comments AS | ||
|
||
SELECT current_database() as databasename, c.relname as tablename, a.attname as columnname, status | ||
|
@@ -67,6 +87,28 @@ CREATE VIEW @[email protected]_column_comments AS | |
-- | ||
-- | ||
-- | ||
CREATE OR REPLACE FUNCTION @[email protected]_exclude_tool(tool text) | ||
RETURNS text | ||
LANGUAGE plpgsql AS | ||
$EOF$ | ||
DECLARE | ||
nbrows bigint; | ||
BEGIN | ||
-- | ||
-- | ||
-- | ||
INSERT INTO @[email protected]_table_exclusion (schema_name, table_name, tag) | ||
SELECT schema_name, table_name, tool FROM @[email protected]_table_exclusion_templates | ||
WHERE tags @> ARRAY[tool]; | ||
|
||
SELECT count(1) FROM @[email protected]_table_exclusion WHERE tag = tool INTO nbrows; | ||
|
||
RETURN format ('Inserted %s row(s) in schedoc_table_exclusion', nbrows); | ||
END; | ||
$EOF$; | ||
-- | ||
-- | ||
-- | ||
CREATE OR REPLACE FUNCTION @[email protected]_start() | ||
RETURNS void | ||
LANGUAGE plpgsql AS | ||
|
@@ -238,6 +280,66 @@ BEGIN | |
END; | ||
$EOF$; | ||
-- | ||
-- Debezium | ||
-- | ||
|
||
INSERT INTO @[email protected]_table_exclusion_templates (schema_name, table_name, tags) | ||
VALUES | ||
|
||
('public', 'celery_results_taskresult', ARRAY['celery']), | ||
('public', 'celery_taskmeta', ARRAY['celery']), | ||
('public', 'celery_tasksetmeta', ARRAY['celery']), | ||
|
||
('public', 'djcelery_crontabschedule', ARRAY['celery']), | ||
('public', 'djcelery_intervalschedule', ARRAY['celery']), | ||
('public', 'djcelery_periodictask', ARRAY['celery']), | ||
('public', 'djcelery_taskstate', ARRAY['celery']), | ||
('public', 'djcelery_workerstate', ARRAY['celery']); | ||
-- | ||
-- Debezium | ||
-- | ||
|
||
INSERT INTO @[email protected]_table_exclusion_templates (schema_name, table_name, tags) | ||
VALUES | ||
|
||
('public', 'dbz_signal', ARRAY['debezium']), | ||
('public', 'dbz_heartbeat', ARRAY['debezium']); | ||
-- | ||
-- Exclude tables created by Django Framework | ||
-- | ||
-- https://www.djangoproject.com/ | ||
-- | ||
INSERT INTO @[email protected]_table_exclusion_templates (schema_name, table_name, tags) | ||
VALUES | ||
('public', 'auth_group', ARRAY['django']), | ||
('public', 'auth_group_permissions', ARRAY['django']), | ||
('public', 'auth_permissions', ARRAY['django']), | ||
('public', 'auth_user', ARRAY['django']), | ||
('public', 'auth_user_user_permissions', ARRAY['django']), | ||
('public', 'django_admin_log', ARRAY['django']), | ||
('public', 'django_content_type', ARRAY['django']), | ||
('public', 'django_migrations', ARRAY['django']), | ||
('public', 'django_session', ARRAY['django']); | ||
-- | ||
-- Debezium | ||
-- | ||
|
||
INSERT INTO @[email protected]_table_exclusion_templates (schema_name, table_name, tags) | ||
VALUES | ||
|
||
('public', 'procrastinate_events', ARRAY['procrastinate']), | ||
('public', 'procrastinate_jobs', ARRAY['procrastinate']), | ||
('public', 'procrastinate_periodic_defers', ARRAY['procrastinate']); | ||
-- | ||
-- | ||
-- | ||
|
||
INSERT INTO @[email protected]_table_exclusion_templates (schema_name, table_name, tags) | ||
VALUES | ||
|
||
('public', 'tastypie_apiaccess', ARRAY['tastypie']), | ||
('public', 'tastypie_apikey', ARRAY['tastypie']); | ||
-- | ||
-- Check the schema of installation for schedoc | ||
-- | ||
DO | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,27 @@ CREATE TABLE @[email protected]_column_log ( | |
-- | ||
-- | ||
-- | ||
CREATE TABLE @[email protected]_table_exclusion ( | ||
schema_name name, | ||
table_name name, | ||
tag text, | ||
created_at timestamp with time zone DEFAULT current_timestamp, | ||
created_by text DEFAULT current_user, | ||
PRIMARY KEY (schema_name, table_name) | ||
); | ||
|
||
CREATE TABLE @[email protected]_table_exclusion_templates ( | ||
schema_name name, | ||
table_name name, | ||
tags text[], | ||
created_at timestamp with time zone DEFAULT current_timestamp, | ||
created_by text DEFAULT current_user, | ||
PRIMARY KEY (schema_name, table_name) | ||
); | ||
|
||
-- | ||
-- | ||
-- | ||
CREATE VIEW @[email protected]_column_comments AS | ||
|
||
SELECT current_database() as databasename, c.relname as tablename, a.attname as columnname, status | ||
|
@@ -61,6 +81,28 @@ CREATE VIEW @[email protected]_column_comments AS | |
-- | ||
-- | ||
-- | ||
CREATE OR REPLACE FUNCTION @[email protected]_exclude_tool(tool text) | ||
RETURNS text | ||
LANGUAGE plpgsql AS | ||
$EOF$ | ||
DECLARE | ||
nbrows bigint; | ||
BEGIN | ||
-- | ||
-- | ||
-- | ||
INSERT INTO @[email protected]_table_exclusion (schema_name, table_name, tag) | ||
SELECT schema_name, table_name, tool FROM @[email protected]_table_exclusion_templates | ||
WHERE tags @> ARRAY[tool]; | ||
|
||
SELECT count(1) FROM @[email protected]_table_exclusion WHERE tag = tool INTO nbrows; | ||
|
||
RETURN format ('Inserted %s row(s) in schedoc_table_exclusion', nbrows); | ||
END; | ||
$EOF$; | ||
-- | ||
-- | ||
-- | ||
CREATE OR REPLACE FUNCTION @[email protected]_start() | ||
RETURNS void | ||
LANGUAGE plpgsql AS | ||
|
@@ -232,6 +274,66 @@ BEGIN | |
END; | ||
$EOF$; | ||
-- | ||
-- Debezium | ||
-- | ||
|
||
INSERT INTO @[email protected]_table_exclusion_templates (schema_name, table_name, tags) | ||
VALUES | ||
|
||
('public', 'celery_results_taskresult', ARRAY['celery']), | ||
('public', 'celery_taskmeta', ARRAY['celery']), | ||
('public', 'celery_tasksetmeta', ARRAY['celery']), | ||
|
||
('public', 'djcelery_crontabschedule', ARRAY['celery']), | ||
('public', 'djcelery_intervalschedule', ARRAY['celery']), | ||
('public', 'djcelery_periodictask', ARRAY['celery']), | ||
('public', 'djcelery_taskstate', ARRAY['celery']), | ||
('public', 'djcelery_workerstate', ARRAY['celery']); | ||
-- | ||
-- Debezium | ||
-- | ||
|
||
INSERT INTO @[email protected]_table_exclusion_templates (schema_name, table_name, tags) | ||
VALUES | ||
|
||
('public', 'dbz_signal', ARRAY['debezium']), | ||
('public', 'dbz_heartbeat', ARRAY['debezium']); | ||
-- | ||
-- Exclude tables created by Django Framework | ||
-- | ||
-- https://www.djangoproject.com/ | ||
-- | ||
INSERT INTO @[email protected]_table_exclusion_templates (schema_name, table_name, tags) | ||
VALUES | ||
('public', 'auth_group', ARRAY['django']), | ||
('public', 'auth_group_permissions', ARRAY['django']), | ||
('public', 'auth_permissions', ARRAY['django']), | ||
('public', 'auth_user', ARRAY['django']), | ||
('public', 'auth_user_user_permissions', ARRAY['django']), | ||
('public', 'django_admin_log', ARRAY['django']), | ||
('public', 'django_content_type', ARRAY['django']), | ||
('public', 'django_migrations', ARRAY['django']), | ||
('public', 'django_session', ARRAY['django']); | ||
-- | ||
-- Debezium | ||
-- | ||
|
||
INSERT INTO @[email protected]_table_exclusion_templates (schema_name, table_name, tags) | ||
VALUES | ||
|
||
('public', 'procrastinate_events', ARRAY['procrastinate']), | ||
('public', 'procrastinate_jobs', ARRAY['procrastinate']), | ||
('public', 'procrastinate_periodic_defers', ARRAY['procrastinate']); | ||
-- | ||
-- | ||
-- | ||
|
||
INSERT INTO @[email protected]_table_exclusion_templates (schema_name, table_name, tags) | ||
VALUES | ||
|
||
('public', 'tastypie_apiaccess', ARRAY['tastypie']), | ||
('public', 'tastypie_apikey', ARRAY['tastypie']); | ||
-- | ||
-- Check the schema of installation for schedoc | ||
-- | ||
DO | ||
|
Oops, something went wrong.