From 0043831b0e5f3b5e3ff7fb76cbf8fa4e3c006d70 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 26 Dec 2018 23:19:05 -0800 Subject: schemas: editor_id as UUID (not int) --- fatcat-openapi2.yml | 46 +++++++++------------------ rust/migrations/2018-05-12-001226_init/up.sql | 14 ++++---- 2 files changed, 22 insertions(+), 38 deletions(-) diff --git a/fatcat-openapi2.yml b/fatcat-openapi2.yml index eb0528d5..cfc6be99 100644 --- a/fatcat-openapi2.yml +++ b/fatcat-openapi2.yml @@ -414,9 +414,7 @@ definitions: - editgroup_id properties: edit_id: - type: integer - example: 847 - format: int64 + <<: *FATCATUUID ident: type: string example: "q3nouwy3nnbsvo3h5klxsx4a7y" @@ -792,9 +790,8 @@ paths: parameters: - name: edit_id in: path - type: integer - format: int64 required: true + <<: *FATCATUUID responses: 200: description: Found Edit @@ -808,9 +805,8 @@ paths: parameters: - name: edit_id in: path - type: integer - format: int64 required: true + <<: *FATCATUUID responses: 200: description: Deleted Edit @@ -1061,9 +1057,8 @@ paths: parameters: - name: edit_id in: path - type: integer - format: int64 required: true + <<: *FATCATUUID responses: 200: description: Found Edit @@ -1077,9 +1072,8 @@ paths: parameters: - name: edit_id in: path - type: integer - format: int64 required: true + <<: *FATCATUUID responses: 200: description: Deleted Edit @@ -1312,9 +1306,8 @@ paths: parameters: - name: edit_id in: path - type: integer - format: int64 required: true + <<: *FATCATUUID responses: 200: description: Found Edit @@ -1328,9 +1321,8 @@ paths: parameters: - name: edit_id in: path - type: integer - format: int64 required: true + <<: *FATCATUUID responses: 200: description: Deleted Edit @@ -1529,9 +1521,8 @@ paths: parameters: - name: edit_id in: path - type: integer - format: int64 required: true + <<: *FATCATUUID responses: 200: description: Found Edit @@ -1545,9 +1536,8 @@ paths: parameters: - name: edit_id in: path - type: integer - format: int64 required: true + <<: *FATCATUUID responses: 200: description: Deleted Edit @@ -1746,9 +1736,8 @@ paths: parameters: - name: edit_id in: path - type: integer - format: int64 required: true + <<: *FATCATUUID responses: 200: description: Found Edit @@ -1762,9 +1751,8 @@ paths: parameters: - name: edit_id in: path - type: integer - format: int64 required: true + <<: *FATCATUUID responses: 200: description: Deleted Edit @@ -2078,9 +2066,8 @@ paths: parameters: - name: edit_id in: path - type: integer - format: int64 required: true + <<: *FATCATUUID responses: 200: description: Found Edit @@ -2094,9 +2081,8 @@ paths: parameters: - name: edit_id in: path - type: integer - format: int64 required: true + <<: *FATCATUUID responses: 200: description: Deleted Edit @@ -2318,9 +2304,8 @@ paths: parameters: - name: edit_id in: path - type: integer - format: int64 required: true + <<: *FATCATUUID responses: 200: description: Found Edit @@ -2334,9 +2319,8 @@ paths: parameters: - name: edit_id in: path - type: integer - format: int64 required: true + <<: *FATCATUUID responses: 200: description: Deleted Edit diff --git a/rust/migrations/2018-05-12-001226_init/up.sql b/rust/migrations/2018-05-12-001226_init/up.sql index eadc2e8a..22f5cca6 100644 --- a/rust/migrations/2018-05-12-001226_init/up.sql +++ b/rust/migrations/2018-05-12-001226_init/up.sql @@ -85,7 +85,7 @@ CREATE INDEX creator_ident_rev_idx ON creator_ident(rev_id); CREATE INDEX creator_ident_redirect_idx ON creator_ident(redirect_id); CREATE TABLE creator_edit ( - id BIGSERIAL PRIMARY KEY, + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), editgroup_id UUID REFERENCES editgroup(id) NOT NULL, updated TIMESTAMP WITH TIME ZONE DEFAULT now() NOT NULL, ident_id UUID REFERENCES creator_ident(id) NOT NULL, @@ -126,7 +126,7 @@ CREATE INDEX container_ident_rev_idx ON container_ident(rev_id); CREATE INDEX container_ident_redirect_idx ON container_ident(redirect_id); CREATE TABLE container_edit ( - id BIGSERIAL PRIMARY KEY, + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), editgroup_id UUID REFERENCES editgroup(id) NOT NULL, updated TIMESTAMP WITH TIME ZONE DEFAULT now() NOT NULL, ident_id UUID REFERENCES container_ident(id) NOT NULL, @@ -174,7 +174,7 @@ CREATE INDEX file_ident_rev_idx ON file_ident(rev_id); CREATE INDEX file_ident_redirect_idx ON file_ident(redirect_id); CREATE TABLE file_edit ( - id BIGSERIAL PRIMARY KEY, + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), editgroup_id UUID REFERENCES editgroup(id) NOT NULL, updated TIMESTAMP WITH TIME ZONE DEFAULT now() NOT NULL, ident_id UUID REFERENCES file_ident(id) NOT NULL, @@ -223,7 +223,7 @@ CREATE TABLE fileset_ident ( CREATE INDEX fileset_ident_rev_idx ON fileset_ident(rev_id); CREATE TABLE fileset_edit ( - id BIGSERIAL PRIMARY KEY, + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), editgroup_id UUID REFERENCES editgroup(id) NOT NULL, updated TIMESTAMP WITH TIME ZONE DEFAULT now() NOT NULL, ident_id UUID REFERENCES fileset_ident(id) NOT NULL, @@ -277,7 +277,7 @@ CREATE TABLE webcapture_ident ( CREATE INDEX webcapture_ident_rev_idx ON webcapture_ident(rev_id); CREATE TABLE webcapture_edit ( - id BIGSERIAL PRIMARY KEY, + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), editgroup_id UUID REFERENCES editgroup(id) NOT NULL, updated TIMESTAMP WITH TIME ZONE DEFAULT now() NOT NULL, ident_id UUID REFERENCES webcapture_ident(id) NOT NULL, @@ -346,7 +346,7 @@ CREATE INDEX release_ident_rev_idx ON release_ident(rev_id); CREATE INDEX release_ident_redirect_idx ON release_ident(redirect_id); CREATE TABLE release_edit ( - id BIGSERIAL PRIMARY KEY, + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), editgroup_id UUID REFERENCES editgroup(id) NOT NULL, updated TIMESTAMP WITH TIME ZONE DEFAULT now() NOT NULL, ident_id UUID REFERENCES release_ident(id) NOT NULL, @@ -374,7 +374,7 @@ CREATE INDEX work_ident_rev_idx ON work_ident(rev_id); CREATE INDEX work_ident_redirect_idx ON work_ident(redirect_id); CREATE TABLE work_edit ( - id BIGSERIAL PRIMARY KEY, + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), editgroup_id UUID REFERENCES editgroup(id) NOT NULL, updated TIMESTAMP WITH TIME ZONE DEFAULT now() NOT NULL, ident_id UUID REFERENCES work_ident(id) NOT NULL, -- cgit v1.2.3