Lets customers pick options on a menu item detail page before adding to the basket, and makes displayed prices respect a configurable currency/locale via VITE_CURRENCY/VITE_LOCALE. Also crossfades the basket's empty/filled states with AnimatePresence in wait mode instead of animating both at once. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
16 lines
839 B
SQL
16 lines
839 B
SQL
CREATE TABLE "menu_item_options" (
|
|
"id" serial PRIMARY KEY NOT NULL,
|
|
"menu_item_id" integer NOT NULL,
|
|
"name" text NOT NULL,
|
|
"price_delta_cents" integer DEFAULT 0 NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE "order_item_options" (
|
|
"id" serial PRIMARY KEY NOT NULL,
|
|
"order_item_id" integer NOT NULL,
|
|
"name" text NOT NULL,
|
|
"price_delta_cents" integer NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
ALTER TABLE "menu_item_options" ADD CONSTRAINT "menu_item_options_menu_item_id_menu_items_id_fk" FOREIGN KEY ("menu_item_id") REFERENCES "public"."menu_items"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
ALTER TABLE "order_item_options" ADD CONSTRAINT "order_item_options_order_item_id_order_items_id_fk" FOREIGN KEY ("order_item_id") REFERENCES "public"."order_items"("id") ON DELETE no action ON UPDATE no action; |