Skip to content

Commit

Permalink
ripe-import: Add DB update script for route_automatic
Browse files Browse the repository at this point in the history
This adds an update script for the new route_automatic table. The name
script file does not include a version number like the other update
scripts because it's not clear yet which version this file will be
included in.

Related to #15
  • Loading branch information
bernhard-herzog committed May 20, 2021
1 parent 9d98a6b commit 8d4c4f6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sql/update-route.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- Update script for the route_automatic table.

CREATE TABLE route_automatic (
route_automatic_id SERIAL PRIMARY KEY,
address CIDR NOT NULL,
asn BIGINT NOT NULL,
import_source VARCHAR(500) NOT NULL,
import_time TIMESTAMP NOT NULL,

-- explicitly name the constraint to make sure it has the same name
-- as the constraint created by initdb.sql.
CONSTRAINT automatic_templ_import_source_check CHECK (import_source <> ''),

UNIQUE (address, asn, import_source)
);

CREATE INDEX route_automatic_cidr_gist_idx ON route_automatic
USING gist (address inet_ops);

0 comments on commit 8d4c4f6

Please sign in to comment.