test(18-02): add failing tests for global item service and seed
- 10 test cases covering search, owner count, link/unlink, seed idempotency - Added globalItems/itemGlobalLinks tables to SQLite schema - Added Zod schemas and types for global items - Created 18-item bikepacking gear seed data JSON
This commit is contained in:
21
drizzle/0010_demonic_rawhide_kid.sql
Normal file
21
drizzle/0010_demonic_rawhide_kid.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
CREATE TABLE `global_items` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`brand` text NOT NULL,
|
||||
`model` text NOT NULL,
|
||||
`category` text,
|
||||
`weight_grams` real,
|
||||
`price_cents` integer,
|
||||
`image_url` text,
|
||||
`description` text,
|
||||
`created_at` integer NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `item_global_links` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`item_id` integer NOT NULL,
|
||||
`global_item_id` integer NOT NULL,
|
||||
FOREIGN KEY (`item_id`) REFERENCES `items`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`global_item_id`) REFERENCES `global_items`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `item_global_links_item_id_unique` ON `item_global_links` (`item_id`);
|
||||
1005
drizzle/meta/0010_snapshot.json
Normal file
1005
drizzle/meta/0010_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -71,6 +71,13 @@
|
||||
"when": 1775287060443,
|
||||
"tag": "0009_happy_mockingbird",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 10,
|
||||
"version": "6",
|
||||
"when": 1775387093955,
|
||||
"tag": "0010_demonic_rawhide_kid",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user