Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 52 additions & 18 deletions database/base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,6 @@ CREATE TABLE public.folder (
description text,
special text,
sort text,
locnid bigint,
view text,
viewproperty text,
thumbarchivenbr text,
Expand All @@ -882,7 +881,32 @@ CREATE TABLE public.folder (
type text,
publicdt timestamp with time zone,
createddt timestamp with time zone,
updateddt timestamp with time zone
updateddt timestamp with time zone,
location_displayname text,
location_geocodelookup text,
location_streetnumber text,
location_streetname text,
location_postalcode text,
location_locality text,
location_adminonename text,
location_adminonecode text,
location_admintwoname text,
location_admintwocode text,
location_country text,
location_countrycode text,
location_geometrytype text,
location_latitude double precision,
location_longitude double precision,
location_boundsouth double precision,
location_boundwest double precision,
location_boundnorth double precision,
location_boundeast double precision,
location_geometryasarray text,
location_geocodetype text,
location_sublocation text,
location_altitudemeters double precision,
location_locationprecision text CONSTRAINT folder_location_locationprecision_check CHECK (location_locationprecision IS NULL OR location_locationprecision IN ('approximate', 'uncertain', 'unknown')),
location_rawmetadata jsonb
);


Expand Down Expand Up @@ -1637,7 +1661,6 @@ CREATE TABLE public.record (
derivedenddt timestamp with time zone,
derivedcreateddt timestamp with time zone,
timezoneid bigint,
locnid bigint,
view text,
viewproperty text,
imageratio numeric(6,2),
Expand All @@ -1655,7 +1678,32 @@ CREATE TABLE public.record (
type text NOT NULL,
processeddt timestamp with time zone,
createddt timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
updateddt timestamp with time zone
updateddt timestamp with time zone,
location_displayname text,
location_geocodelookup text,
location_streetnumber text,
location_streetname text,
location_postalcode text,
location_locality text,
location_adminonename text,
location_adminonecode text,
location_admintwoname text,
location_admintwocode text,
location_country text,
location_countrycode text,
location_geometrytype text,
location_latitude double precision,
location_longitude double precision,
location_boundsouth double precision,
location_boundwest double precision,
location_boundnorth double precision,
location_boundeast double precision,
location_geometryasarray text,
location_geocodetype text,
location_sublocation text,
location_altitudemeters double precision,
location_locationprecision text CONSTRAINT record_location_locationprecision_check CHECK (location_locationprecision IS NULL OR location_locationprecision IN ('approximate', 'uncertain', 'unknown')),
location_rawmetadata jsonb
);


Expand Down Expand Up @@ -3459,13 +3507,6 @@ CREATE INDEX idx_19281_displayname ON public.folder USING gin (to_tsvector('simp
CREATE INDEX idx_19281_folder_archiveid ON public.folder USING btree (archiveid);


--
-- Name: idx_19281_folder_locnid; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_19281_folder_locnid ON public.folder USING btree (locnid);


--
-- Name: idx_19281_folder_timezoneid; Type: INDEX; Schema: public; Owner: postgres
--
Expand Down Expand Up @@ -3837,13 +3878,6 @@ CREATE INDEX idx_19402_processeddt ON public.record USING btree (processeddt);
CREATE INDEX idx_19402_publicdt ON public.record USING btree (publicdt);


--
-- Name: idx_19402_record_locnid; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_19402_record_locnid ON public.record USING btree (locnid);


--
-- Name: idx_19402_record_refarchivenbr; Type: INDEX; Schema: public; Owner: postgres
--
Expand Down
3 changes: 0 additions & 3 deletions packages/api/docs/src/models/location.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
location:
description: A geographic location object
type: object
required: [id]
properties:
id:
type: string
name:
type: string
sublocation:
Expand Down
5 changes: 3 additions & 2 deletions packages/api/docs/src/paths/record.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ records/{id}:
properties:
displayName:
type: string
locationId:
type: integer
location:
$ref: "../models/location.yaml#/location"
nullable: true
description:
type: string
displayTime:
Expand Down
1 change: 0 additions & 1 deletion packages/api/src/common/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export enum AccessRole {
}

export interface Location {
id: string;
name?: string;
sublocation?: string;
city?: string;
Expand Down
1 change: 0 additions & 1 deletion packages/api/src/folder/controller/get_folder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ describe("GET /folder", () => {
expect(folders[0].size).toEqual(0);
expect(folders[0].location).toBeDefined();
if (folders[0].location !== undefined) {
expect(folders[0].location.id).toEqual("1");
expect(folders[0].location.name).toEqual("Jean Valjean's House");
expect(folders[0].location.sublocation).toEqual("55 Rue Plumet");
expect(folders[0].location.city).toEqual("Paris");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ describe("GET /folder/{id}/children", () => {
expect(folder.size).toEqual(0);
expect(folder.location).toBeDefined();
if (folder.location !== undefined) {
expect(folder.location.id).toEqual("1");
expect(folder.location.name).toEqual("Jean Valjean's House");
expect(folder.location.sublocation).toEqual("55 Rue Plumet");
expect(folder.location.city).toEqual("Paris");
Expand Down
1 change: 0 additions & 1 deletion packages/api/src/folder/controller/utils_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export const loadFixtures = async (): Promise<void> => {
await db.sql("folder.fixtures.create_test_accounts");
await db.sql("folder.fixtures.create_test_archives");
await db.sql("folder.fixtures.create_test_account_archives");
await db.sql("folder.fixtures.create_test_locns");
await db.sql("folder.fixtures.create_test_folders");
await db.sql("folder.fixtures.create_test_records");
await db.sql("folder.fixtures.create_test_files");
Expand Down
Loading
Loading