fix: missing index and geodata import process uses normal table (#17343)
* chore: add geodata indexes to table definitions * chore: rename incorrectly name geodata index * fix: import into geodata places with correct index names
This commit is contained in:
19
server/src/migrations/1743611339000-GeodataCleanup.ts
Normal file
19
server/src/migrations/1743611339000-GeodataCleanup.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class GeodataCleanup1743611339000 implements MigrationInterface {
|
||||
name = 'GeodataCleanup1743611339000';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER INDEX IF EXISTS "idx_geodata_places_admin2_alternate_names" RENAME TO "idx_geodata_places_alternate_names"`,
|
||||
);
|
||||
await queryRunner.query(`DROP TABLE IF EXISTS "geodata_places_tmp"`);
|
||||
await queryRunner.query(`DROP TABLE IF EXISTS "naturalearth_countries_tmp"`)
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER INDEX IF EXISTS "idx_geodata_places_alternate_names" RENAME TO "idx_geodata_places_admin2_alternate_names"`,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user