feat(server): persist renderContent texture and cover it in asset lifecycle
Add an optional renderContent field to canvas nodes across the go-zero API type, domain node, SQLC models/queries, PostgreSQL schema, and mappers so a lightweight transparent-WebP display texture persists alongside the original content. Prefer renderContent for project thumbnails and main-canvas previews, and treat both content and renderContent as protected/deletable asset URLs during canvas asset cleanup. Extend round-trip coverage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -195,7 +195,8 @@ CREATE TABLE IF NOT EXISTS canvas_nodes (
|
||||
flip_x BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
flip_y BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
rotation DOUBLE PRECISION NOT NULL DEFAULT 0,
|
||||
semantic_context TEXT NOT NULL DEFAULT ''
|
||||
semantic_context TEXT NOT NULL DEFAULT '',
|
||||
render_content TEXT NOT NULL DEFAULT ''
|
||||
);
|
||||
|
||||
ALTER TABLE canvas_nodes ADD COLUMN IF NOT EXISTS user_id UUID;
|
||||
@@ -227,6 +228,7 @@ ALTER TABLE canvas_nodes ADD COLUMN IF NOT EXISTS flip_x BOOLEAN NOT NULL DEFAUL
|
||||
ALTER TABLE canvas_nodes ADD COLUMN IF NOT EXISTS flip_y BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
ALTER TABLE canvas_nodes ADD COLUMN IF NOT EXISTS rotation DOUBLE PRECISION NOT NULL DEFAULT 0;
|
||||
ALTER TABLE canvas_nodes ADD COLUMN IF NOT EXISTS semantic_context TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE canvas_nodes ADD COLUMN IF NOT EXISTS render_content TEXT NOT NULL DEFAULT '';
|
||||
|
||||
CREATE INDEX IF NOT EXISTS canvas_nodes_project_id_idx ON canvas_nodes(project_id);
|
||||
CREATE INDEX IF NOT EXISTS canvas_nodes_user_project_idx ON canvas_nodes(user_id, project_id);
|
||||
|
||||
Reference in New Issue
Block a user