-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
52 additions
and
90 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
api/apps/api/src/migrations/api/1657544835000-RemoveFeatureTags.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class RemoveFeatureTags1657544835000 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
ALTER TABLE features | ||
DROP COLUMN tag; | ||
`); | ||
|
||
await queryRunner.query(` | ||
DROP TYPE features_tags; | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
CREATE TYPE "features_tags" AS ENUM ( | ||
'bioregional', | ||
'species' | ||
); | ||
`); | ||
|
||
/** | ||
* As we cannot know whether existing features are of bioregional or | ||
* species kind, we set them all as "bioregional" arbitrarily. This should | ||
* not really apply in practice, of course. | ||
*/ | ||
await queryRunner.query(` | ||
ALTER TABLE features | ||
ADD COLUMN tag features_tags; | ||
UPDATE features | ||
SET tag = 'bioregional'; | ||
ALTER TABLE features | ||
ALTER COLUMN tag SET NOT NULL; | ||
`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
api/apps/api/src/modules/geo-features/geo-features-request-info.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
import { AppInfoDTO } from '@marxan-api/dto/info.dto'; | ||
import { BBox } from 'geojson'; | ||
import { FeatureTags } from './geo-feature-set.api.entity'; | ||
|
||
export interface GeoFeaturesRequestInfo extends AppInfoDTO { | ||
params?: { | ||
featureClassAndAliasFilter?: string; | ||
projectId?: string; | ||
bbox?: BBox; | ||
ids?: string[]; | ||
featureTag?: FeatureTags | FeatureTags[]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
|
||
INSERT INTO features | ||
(feature_class_name, alias, description, property_name, intersection, tag, creation_status, created_by) | ||
(feature_class_name, alias, description, property_name, intersection, creation_status, created_by) | ||
VALUES | ||
('demo_acinonyx_jubatus', 'Acinonyx_jubatus', null, ' name', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_bucorvus_leadbeateri', 'Bucorvus_leadbeateri', null, ' id', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_ceratotherium_simum', 'Ceratotherium_simum', null, ' name', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_civettictis_civetta', 'Civettictis_civetta', null, ' id', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_diceros_bicornis', 'Diceros_bicornis', null, ' name', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_equus_quagga', 'Equus_quagga', null, ' name', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_giraffa_camelopardalis', 'Giraffa_camelopardalis', null, ' name', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_kobus_leche', 'Kobus_leche', null, ' name', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_panthera_pardus', 'Panthera_pardus', null, ' name', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')); | ||
('demo_acinonyx_jubatus', 'Acinonyx_jubatus', null, ' name', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), | ||
('demo_bucorvus_leadbeateri', 'Bucorvus_leadbeateri', null, ' id', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), | ||
('demo_ceratotherium_simum', 'Ceratotherium_simum', null, ' name', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), | ||
('demo_civettictis_civetta', 'Civettictis_civetta', null, ' id', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), | ||
('demo_diceros_bicornis', 'Diceros_bicornis', null, ' name', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), | ||
('demo_equus_quagga', 'Equus_quagga', null, ' name', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), | ||
('demo_giraffa_camelopardalis', 'Giraffa_camelopardalis', null, ' name', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), | ||
('demo_kobus_leche', 'Kobus_leche', null, ' name', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), | ||
('demo_panthera_pardus', 'Panthera_pardus', null, ' name', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.