Skip to content

Commit 0103634

Browse files
committed
Trim grant and stable timestamps
1 parent 209dbf6 commit 0103634

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

__tests__/schema.sql

+19-19
Original file line numberDiff line numberDiff line change
@@ -376,23 +376,23 @@ ALTER TABLE graphile_worker._private_known_crontabs ENABLE ROW LEVEL SECURITY;
376376
ALTER TABLE graphile_worker._private_tasks ENABLE ROW LEVEL SECURITY;
377377
SELECT pg_catalog.set_config('search_path', '', false);
378378
COPY graphile_worker.migrations (id, ts, breaking) FROM stdin;
379-
1 2024-12-11 16:33:34.832099+00 t
380-
2 2024-12-11 16:33:34.869094+00 f
381-
3 2024-12-11 16:33:34.879306+00 t
382-
4 2024-12-11 16:33:34.881577+00 f
383-
5 2024-12-11 16:33:34.885313+00 f
384-
6 2024-12-11 16:33:34.888433+00 f
385-
7 2024-12-11 16:33:34.903467+00 f
386-
8 2024-12-11 16:33:34.906565+00 f
387-
9 2024-12-11 16:33:34.922042+00 f
388-
10 2024-12-11 16:33:34.924261+00 f
389-
11 2024-12-11 16:33:34.926218+00 t
390-
12 2024-12-11 16:33:35.036279+00 f
391-
13 2024-12-11 16:33:35.039057+00 t
392-
14 2024-12-11 16:33:35.042399+00 t
393-
15 2024-12-11 16:33:35.044275+00 f
394-
16 2024-12-11 16:33:35.045737+00 t
395-
17 2024-12-11 16:33:35.048717+00 f
396-
18 2024-12-11 16:33:35.051647+00 f
397-
19 2024-12-11 16:33:35.054562+00 t
379+
1 1970-01-01 00:00:00.000000+00 t
380+
2 1970-01-01 00:00:00.000000+00 f
381+
3 1970-01-01 00:00:00.000000+00 t
382+
4 1970-01-01 00:00:00.000000+00 f
383+
5 1970-01-01 00:00:00.000000+00 f
384+
6 1970-01-01 00:00:00.000000+00 f
385+
7 1970-01-01 00:00:00.000000+00 f
386+
8 1970-01-01 00:00:00.000000+00 f
387+
9 1970-01-01 00:00:00.000000+00 f
388+
10 1970-01-01 00:00:00.000000+00 f
389+
11 1970-01-01 00:00:00.000000+00 t
390+
12 1970-01-01 00:00:00.000000+00 f
391+
13 1970-01-01 00:00:00.000000+00 t
392+
14 1970-01-01 00:00:00.000000+00 t
393+
15 1970-01-01 00:00:00.000000+00 f
394+
16 1970-01-01 00:00:00.000000+00 t
395+
17 1970-01-01 00:00:00.000000+00 f
396+
18 1970-01-01 00:00:00.000000+00 f
397+
19 1970-01-01 00:00:00.000000+00 t
398398
\.

scripts/dump_db

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dropuser graphile_worker_role || true
66
psql template1 -c "CREATE USER graphile_worker_role WITH SUPERUSER PASSWORD 'password';"
77
createdb graphile_worker_dump -O graphile_worker_role
88
PGUSER=graphile_worker_role PGPASSWORD=password PGHOST=127.0.0.1 ts-node src/cli.ts -c postgres:///graphile_worker_dump --schema-only
9-
pg_dump --schema-only --no-owner graphile_worker_dump | sed -e '/^--/d' -e '/^\s*$/d' -e '/^SET /d' -e 's/EXECUTE FUNCTION/EXECUTE PROCEDURE/g' > __tests__/schema.sql
10-
pg_dump --data-only --no-owner --table graphile_worker.migrations graphile_worker_dump | sed -e '/^--/d' -e '/^\s*$/d' -e '/^SET /d' -e 's/EXECUTE FUNCTION/EXECUTE PROCEDURE/g' >> __tests__/schema.sql
9+
pg_dump --schema-only --no-owner graphile_worker_dump | sed -E -e '/^--/d' -e '/^\s*$/d' -e '/^SET /d' -e 's/EXECUTE FUNCTION/EXECUTE PROCEDURE/g' -e '/^(REVOKE|GRANT) .* ON SCHEMA public (FROM|TO) PUBLIC;$/d' > __tests__/schema.sql
10+
pg_dump --data-only --no-owner graphile_worker_dump --table=graphile_worker.migrations --table=graphile_worker._private_pro_migrations | sed -E -e '/^--/d' -e '/^\s*$/d' -e 's/\b2[0-9]{3}-[0-9]{2}-[0-9]{2}\s[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{1,6}\+00/1970-01-01 00:00:00.000000+00/g' -e '/^SET /d' >> __tests__/schema.sql
1111
dropdb graphile_worker_dump
1212
dropuser graphile_worker_role

0 commit comments

Comments
 (0)