be-graphes-map-generator/script/pgsnapshot_schema_0.6_action.sql
2018-02-24 22:43:28 +01:00

16 lines
617 B
SQL

-- Add an action table for the purpose of capturing all actions applied to a database.
-- The table is populated during application of a changeset, then osmosisUpdate is called,
-- then the table is cleared all within a single database transaction.
-- The contents of this table can be used to update derivative tables by customising the
-- osmosisUpdate stored procedure.
-- Create a table for actions.
CREATE TABLE actions (
data_type character(1) NOT NULL,
action character(1) NOT NULL,
id bigint NOT NULL
);
-- Add primary key.
ALTER TABLE ONLY actions ADD CONSTRAINT pk_actions PRIMARY KEY (data_type, id);