File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ CREATE TABLE contact (
5555 username text , -- reference to web user
5656 default_channel_id bigint NOT NULL REFERENCES channel(id),
5757 color varchar (7 ) NOT NULL , -- hex color codes e.g #000000
58+ external_uuid uuid NOT NULL ,
5859
5960 CONSTRAINT pk_contact PRIMARY KEY (id),
6061 UNIQUE (username)
@@ -74,6 +75,7 @@ CREATE TABLE contactgroup (
7475 id bigserial ,
7576 name text NOT NULL ,
7677 color varchar (7 ) NOT NULL , -- hex color codes e.g #000000
78+ external_uuid uuid NOT NULL ,
7779
7880 CONSTRAINT pk_contactgroup PRIMARY KEY (id)
7981);
Original file line number Diff line number Diff line change 1+ CREATE EXTENSION IF NOT EXISTS " uuid-ossp" ;
2+
3+ ALTER TABLE contact ADD COLUMN external_uuid uuid;
4+ ALTER TABLE contactgroup ADD COLUMN external_uuid uuid;
5+
6+ UPDATE contact SET external_uuid = uuid_generate_v4() WHERE external_uuid IS NULL ;
7+ UPDATE contactgroup SET external_uuid = uuid_generate_v4() WHERE external_uuid IS NULL ;
8+
9+ ALTER TABLE contact ALTER COLUMN external_uuid SET NOT NULL ;
10+ ALTER TABLE contactgroup ALTER COLUMN external_uuid SET NOT NULL ;
11+
12+ DROP EXTENSION " uuid-ossp" ;
You can’t perform that action at this time.
0 commit comments