Skip to content

Commit 39c95f1

Browse files
authored
refactor: rename geodata pk constraint to match runtime constraint name (#19856)
1 parent 4ddd376 commit 39c95f1

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Kysely, sql } from 'kysely';
2+
3+
export async function up(db: Kysely<any>): Promise<void> {
4+
await sql`ALTER TABLE "geodata_places" DROP CONSTRAINT IF EXISTS "PK_c29918988912ef4036f3d7fbff4";`.execute(db);
5+
await sql`ALTER TABLE "geodata_places" DROP CONSTRAINT IF EXISTS "geodata_places_pkey"`.execute(db);
6+
await sql`ALTER TABLE "geodata_places" ADD CONSTRAINT "geodata_places_pkey" PRIMARY KEY ("id");`.execute(db);
7+
}
8+
9+
export async function down(): Promise<void> {}

server/src/schema/tables/geodata-places.table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Column, Index, PrimaryColumn, Table, Timestamp } from 'src/sql-tools';
22

3-
@Table({ name: 'geodata_places' })
3+
@Table({ name: 'geodata_places', primaryConstraintName: 'geodata_places_pkey' })
44
@Index({
55
name: 'idx_geodata_places_alternate_names',
66
using: 'gin',

0 commit comments

Comments
 (0)