Skip to content

Commit

Permalink
Update id column of treenode_connector_edge and connector_geom table
Browse files Browse the repository at this point in the history
This migration rewrites the tables treenode_connector_edge and
connector_geom, because their references to the treenode_connector table
are wrong and need to be updated. Up to this migration the id column was
of type int, but since it references the treenode_edge id column and the
connector id column, respectively, and they should follow their type,
which is bigint. This is updated by this migration by creating a new
table. This has the benefit that cleaning up the old table is easier and
doesn't need a VACUUM FULL run to reclaim space.

Both The treenode_connector_edge table and the connector_geom table
aren't tracked by the history system, which makes this update simpler.
In principle it could also be merged into the previous 64 Bit concept ID
migration, but it is easier for some existing test systems to not be
re-migrated.

The changes to the connector tables have been merged alrady separately
into the dev branch in commit 65b4044, but the migration didn't
allow to avoid VACUUM FULL to reclaim space, therefore the existing
version is updated accordingly. The existing version rewrote the table
directly, which would only allow to reclaim space with VACCUUM FULL.
Since this isn't very practical on large tables with many connectors,
this new version is introduced. The schema outcome is the same and
therefore no action has to be taken, if the previous version has been
applied already.
  • Loading branch information
tomka committed Nov 4, 2019
1 parent 8dbb6c0 commit 7bb29fc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
-- data type for its ID. All other constraints will be added after the data
-- is copied.
CREATE TABLE connector_geom (
id bigint NOT NULL,
id bigint PRIMARY KEY NOT NULL,
project_id integer NOT NULL,
geom geometry(PointZ) NOT NULL
);
Expand Down

0 comments on commit 7bb29fc

Please sign in to comment.