feat: choose a product's category from the ones T5DE has seen
A product can be filed under another IMVU category than its parent's: any category path the hub has seen on a revision's parent (and each step of it), within the parent's top-level category, so it stays the same kind of product (the proxy tells clothing, furniture and rooms apart by category). It's an info field like the others: lockable, in the history, undone by the same rules. Lists filter by the chosen path, and products show it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
8793b5afd8
commit
ceceb69eaf
12 files changed
+165
-22
No files matched your search
@@ -13,6 +13,7 @@ ALTER TABLE "product" ADD COLUMN "status" text DEFAULT 'published' NOT NULL;-->
|
||||
ALTER TABLE "product" ADD COLUMN "published_at" timestamp with time zone;--> statement-breakpoint
|
||||
ALTER TABLE "product" ADD COLUMN "listed" boolean DEFAULT true NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "product" ADD COLUMN "tags" jsonb DEFAULT '[]'::jsonb NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "product" ADD COLUMN "category" jsonb;--> statement-breakpoint
|
||||
ALTER TABLE "product" ADD COLUMN "locked" jsonb DEFAULT '[]'::jsonb NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "product_info_change" ADD CONSTRAINT "product_info_change_product_id_product_id_fk" FOREIGN KEY ("product_id") REFERENCES "public"."product"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "product_info_change" ADD CONSTRAINT "product_info_change_by_id_user_id_fk" FOREIGN KEY ("by_id") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"id": "5663cafb-98ed-4a05-8163-f86b813ea0a3",
|
||||
"id": "0b410a02-49ab-42cc-82e6-45b3bd265602",
|
||||
"prevId": "2a4756bc-d197-4321-84ef-a8238ed002d3",
|
||||
"version": "7",
|
||||
"dialect": "postgresql",
|
||||
@@ -1938,6 +1938,12 @@
|
||||
"notNull": true,
|
||||
"default": "'[]'::jsonb"
|
||||
},
|
||||
"category": {
|
||||
"name": "category",
|
||||
"type": "jsonb",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"locked": {
|
||||
"name": "locked",
|
||||
"type": "jsonb",
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
{
|
||||
"idx": 11,
|
||||
"version": "7",
|
||||
"when": 1793884711638,
|
||||
"when": 1793886718951,
|
||||
"tag": "0011_product_info",
|
||||
"breakpoints": true
|
||||
}
|
||||
|
||||
@@ -365,6 +365,8 @@ export const product = pgTable(
|
||||
// Unlisted: left out of search, lists and creator pages for others; its link still works.
|
||||
listed: boolean("listed").notNull().default(true),
|
||||
tags: jsonb("tags").$type<string[]>().notNull().default([]),
|
||||
// The IMVU category path its creator (or a moderator) chose, outermost first; null: its parent's.
|
||||
category: jsonb("category").$type<{ id: number; name: string }[]>(),
|
||||
// Info fields a moderator locked: only people with product:edit-locked change them.
|
||||
locked: jsonb("locked").$type<string[]>().notNull().default([]),
|
||||
// Deleted by its creator: no longer listed or added to libraries; those who have it keep it, and rooms keep it.
|
||||
|
||||
Reference in new issue
Block a user