Skip to content

Commit

Permalink
Fix history views for catmaid_sampler table
Browse files Browse the repository at this point in the history
This is mainly needed to make the tests work, because in migration 70,
the catmaid_sampler table is created from scratch anyway.
  • Loading branch information
tomka committed Oct 28, 2019
1 parent 7c0d4e5 commit 79b7f0f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
forward_history = """
SELECT disable_history_tracking_for_table('catmaid_sampler'::regclass,
get_history_table_name('catmaid_sampler'::regclass));
SELECT drop_history_view_for_table('catmaid_sampler'::regclass);
-- Update table columns, add inverval boundary column,
-- add interval_error column
Expand All @@ -32,13 +33,15 @@
interval_error = 0.0;
SELECT create_history_view_for_table('catmaid_sampler'::regclass);
SELECT enable_history_tracking_for_table('catmaid_sampler'::regclass,
get_history_table_name('catmaid_sampler'::regclass), FALSE);
"""

backward_history = """
SELECT disable_history_tracking_for_table('catmaid_sampler'::regclass,
get_history_table_name('catmaid_sampler'::regclass));
SELECT drop_history_view_for_table('catmaid_sampler'::regclass);
ALTER TABLE catmaid_sampler
DROP COLUMN create_interval_boundaries;
Expand All @@ -50,6 +53,7 @@
ALTER TABLE catmaid_sampler__history
DROP COLUMN interval_error;
SELECT create_history_view_for_table('catmaid_sampler'::regclass);
SELECT enable_history_tracking_for_table('catmaid_sampler'::regclass,
get_history_table_name('catmaid_sampler'::regclass), FALSE);
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
forward_history = """
SELECT disable_history_tracking_for_table('catmaid_sampler'::regclass,
get_history_table_name('catmaid_sampler'::regclass));
SELECT drop_history_view_for_table('catmaid_sampler'::regclass);
-- Update table columns, add leaf_segment_handling column
Expand All @@ -26,19 +27,22 @@
SET leaf_segment_handling = 'ignore';
SELECT create_history_view_for_table('catmaid_sampler'::regclass);
SELECT enable_history_tracking_for_table('catmaid_sampler'::regclass,
get_history_table_name('catmaid_sampler'::regclass), FALSE);
"""

backward_history = """
SELECT disable_history_tracking_for_table('catmaid_sampler'::regclass,
get_history_table_name('catmaid_sampler'::regclass));
SELECT drop_history_view_for_table('catmaid_sampler'::regclass);
ALTER TABLE catmaid_sampler
DROP COLUMN leaf_segment_handling;
ALTER TABLE catmaid_sampler__history
DROP COLUMN leaf_segment_handling;
SELECT create_history_view_for_table('catmaid_sampler'::regclass);
SELECT enable_history_tracking_for_table('catmaid_sampler'::regclass,
get_history_table_name('catmaid_sampler'::regclass), FALSE);
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
forward_history = """
SELECT disable_history_tracking_for_table('catmaid_sampler'::regclass,
get_history_table_name('catmaid_sampler'::regclass));
SELECT drop_history_view_for_table('catmaid_sampler'::regclass);
-- Update table columns, add leaf_segment_handling column
ALTER TABLE catmaid_sampler
Expand All @@ -25,19 +25,22 @@
SET merge_limit = 0;
SELECT create_history_view_for_table('catmaid_sampler'::regclass);
SELECT enable_history_tracking_for_table('catmaid_sampler'::regclass,
get_history_table_name('catmaid_sampler'::regclass), FALSE);
"""

backward_history = """
SELECT disable_history_tracking_for_table('catmaid_sampler'::regclass,
get_history_table_name('catmaid_sampler'::regclass));
SELECT drop_history_view_for_table('catmaid_sampler'::regclass);
ALTER TABLE catmaid_sampler
DROP COLUMN merge_limit;
ALTER TABLE catmaid_sampler__history
DROP COLUMN merge_limit;
SELECT create_history_view_for_table('catmaid_sampler'::regclass);
SELECT enable_history_tracking_for_table('catmaid_sampler'::regclass,
get_history_table_name('catmaid_sampler'::regclass), FALSE);
"""
Expand Down

0 comments on commit 79b7f0f

Please sign in to comment.