fix(dbtool): 导出视图并刷新 db_dump.sql(补 4 个公开视图)

This commit is contained in:
toom1996
2026-09-23 14:07:43 +08:00
parent d68a57009c
commit 762e528334
2 changed files with 254 additions and 12 deletions

View File

@ -1,5 +1,5 @@
-- dbtool 导出:127.0.0.1:5432/fashion
-- 生成时间:2026-09-23T13:49:34+08:00
-- 生成时间:2026-09-23T14:06:13+08:00
--
-- 导入(二选一):
-- dbtool import -in <本文件>
@ -171,6 +171,85 @@ CREATE TABLE IF NOT EXISTS public."users" (
"tier" character varying(16)
);
CREATE VIEW public."public_brand_runway_images" AS
SELECT i.id,
i.created_at,
i.updated_at,
i.is_deleted,
i.image,
i.runway_id,
i.brand_id,
i.name,
i.sort_order,
i.look_index,
i.is_detail,
i.phash,
i.is_duplicate,
i.dup_of
FROM brand_runway_images i
JOIN brand_runways r ON r.id = i.runway_id
WHERE i.is_deleted = 0 AND r.status::text = 'published'::text AND r.is_deleted = 0;
CREATE VIEW public."public_brand_runways" AS
SELECT brand_runways.id,
brand_runways.title_en,
brand_runways.title_cn,
brand_runways.description_en,
brand_runways.description_cn,
brand_runways.created_at,
brand_runways.updated_at,
brand_runways.is_deleted,
brand_runways.image_count,
brand_runways.brand_id,
brand_runways.year,
brand_runways.cover,
brand_runways.collection_type,
brand_runways.season,
brand_runways.season_code,
brand_runways.status,
brand_runways.job_id,
brand_runways.reviewer,
brand_runways.reject_reason
FROM brand_runways
WHERE brand_runways.status::text = 'published'::text AND brand_runways.is_deleted = 0;
CREATE VIEW public."public_street_snap_images" AS
SELECT i.id,
i.snap_id,
i.image,
i.name,
i.sort_order,
i.is_deleted,
i.created_at,
i.updated_at,
i.phash,
i.is_duplicate,
i.dup_of,
i.is_detail,
i.parent_image_id
FROM street_snap_images i
JOIN street_snaps s ON s.id = i.snap_id
WHERE i.is_deleted = 0 AND s.status::text = 'published'::text AND s.is_deleted = 0;
CREATE VIEW public."public_street_snaps" AS
SELECT street_snaps.id,
street_snaps.title,
street_snaps.year,
street_snaps.city,
street_snaps.cover,
street_snaps.image_count,
street_snaps.is_deleted,
street_snaps.created_at,
street_snaps.updated_at,
street_snaps.source,
street_snaps.source_url,
street_snaps.status,
street_snaps.job_id,
street_snaps.reviewer,
street_snaps.reject_reason
FROM street_snaps
WHERE street_snaps.status::text = 'published'::text AND street_snaps.is_deleted = 0;
-- ==================== 数据 ====================
INSERT INTO public."brand_runway_images" ("id", "created_at", "updated_at", "is_deleted", "image", "runway_id", "brand_id", "name", "sort_order", "look_index", "is_detail", "phash", "is_duplicate", "dup_of") VALUES
(E'989', E'1789137485', E'1789137485', E'0', E'runway/3b9b7e07916b454ba93c56b4d2edc81614101e3c.jpg', E'9', E'7', E'Look 1', E'1', E'1', E'0', NULL, E'0', E''),