Skip to content

Instantly share code, notes, and snippets.

@serverhorror
Created October 11, 2019 11:10
Show Gist options
  • Save serverhorror/f1849d8cefb725d227e2c84d8630e364 to your computer and use it in GitHub Desktop.
Save serverhorror/f1849d8cefb725d227e2c84d8630e364 to your computer and use it in GitHub Desktop.
CREATE SEQUENCE REVISION_SEQ
START WITH 1
INCREMENT BY 1
;
CREATE TABLE REVISION
(
REVISION_NR BIGINT NOT NULL ,
CREATED_AT TIMESTAMP WITH TIME ZONE ,
CREATED_BY UUID NOT NULL ,
CREATING_ACTION VARCHAR (10)
);
ALTER TABLE REVISION
ADD CONSTRAINT REVISIONS_PK PRIMARY KEY ( REVISION_NR );
insert into revision (revision_nr, created_at, created_by, creating_action) select NEXTVAL('REVISION_SEQ'), CURRENT_TIMESTAMP, 'setup', null ;
insert into revision (revision_nr, created_at, created_by, creating_action) values (9223372036854775807, CURRENT_TIMESTAMP, 'setup', null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment