- Add upsertGlobalItemSchema and bulkUpsertGlobalItemsSchema to schemas.ts - Add UpsertGlobalItemInput and BulkUpsertGlobalItemsInput types to types.ts - Implement upsertGlobalItem with onConflictDoUpdate and tag sync - Implement bulkUpsertGlobalItems processing array in single transaction - Fix migration 0003 to only add new columns + unique constraint - All 21 tests pass including 8 new upsert operation tests
5 lines
352 B
SQL
5 lines
352 B
SQL
ALTER TABLE "global_items" ADD COLUMN "source_url" text;--> statement-breakpoint
|
|
ALTER TABLE "global_items" ADD COLUMN "image_credit" text;--> statement-breakpoint
|
|
ALTER TABLE "global_items" ADD COLUMN "image_source_url" text;--> statement-breakpoint
|
|
ALTER TABLE "global_items" ADD CONSTRAINT "global_items_brand_model_unique" UNIQUE("brand","model");
|