Skip to content

identity / media ​

Trang sinh tự động

Sinh từ ad83b0aea — chạy 820 migration lên PostgreSQL 17 rồi đọc pg_catalog. Mô tả bảng và cột lấy từ COMMENT ON. Không sửa tay: lần chạy docgen sau sẽ ghi đè.

2 bảng. Quay lại identity.

media ​

P1-11. Uploaded object metadata. Purpose fixes visibility, bucket and the opaque object key; 20 MB cap; PENDING until finalize verifies the stored object; soft delete only. Private objects are read only via short-lived signed URLs issued by the API after a permission check.

public.media · 23 cột · 13 check · 2 unique · 5 index · 22 policy · 9 trigger · RLS bật

CộtKiểuKhoáMô tả
iduuidNOT NULLPK
owner_account_iduuidNOT NULLFK → accounts
upload_appapp_codeNOT NULL
purposetextNOT NULL
visibilitytextNOT NULL
buckettextNOT NULL
mime_typetextNOT NULL
kindtextNOT NULL
file_exttextNOT NULL
original_nametextNOT NULL
file_nametextNOT NULL
storage_pathtextNOT NULLGenerated: <purpose-segment>/<id>.<ext>. Never built from client input (no traversal, PD-08 s22).
declared_size_bytesbigintNOT NULL
size_bytesbigint
statustextNOT NULL
ready_attimestamptz
request_iduuidNOT NULL
request_fingerprinttextNOT NULLSHA-256 hex of the canonical ticket payload; same request_id with another payload is a conflict.
created_attimestamptzNOT NULL
updated_attimestamptzNOT NULL
versionintegerNOT NULL
deleted_attimestamptz
deleted_byuuidFK → accounts

Khoá chính: id

Trỏ ra (2):

  • deleted_by → accounts · ON DELETE RESTRICT
  • owner_account_id → accounts · ON DELETE RESTRICT

Được trỏ tới (15): brands, categories, cod_collections, cod_remittances, content_versions, content_versions, content_versions, fulfillment_events, fulfillment_exceptions, media_uses, product_import_runs, product_import_staged_images, product_media, sale_account_profiles, shipments

media_uses ​

P1-11. One row per attachment of a media item to a business record. New uses need READY, undeleted media; removal is a set-once marker. Written only by the owning domain service (policies added by that domain).

public.media_uses · 8 cột · 2 check · 1 unique · 3 index · 15 policy · 5 trigger · RLS bật

CộtKiểuKhoáMô tả
iduuidNOT NULLPK
media_iduuidNOT NULLFK → media
use_typetextNOT NULL
use_iduuidNOT NULL
created_byuuidNOT NULLFK → accounts
created_attimestamptzNOT NULL
removed_attimestamptz
removed_byuuidFK → accounts

Khoá chính: id

Trỏ ra (3):

  • created_by → accounts · ON DELETE RESTRICT
  • media_id → media · ON DELETE RESTRICT
  • removed_by → accounts · ON DELETE RESTRICT

Được trỏ tới (1): product_media

Sinh từ ad83b0aea · 820 migration · PostgreSQL 17