Update seller store experience
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
SET search_path TO atlas, public;
|
||||
|
||||
-- `workspace_id` is the tenant boundary and is never nullable. PostgreSQL's
|
||||
-- unqualified ON DELETE SET NULL on a composite FK clears every referencing
|
||||
-- column, including workspace_id. Only the optional variant pointer may be
|
||||
-- cleared when a re-collected source snapshot replaces its variants.
|
||||
ALTER TABLE collection_asset_transfers
|
||||
DROP CONSTRAINT collection_asset_transfers_workspace_id_source_variant_id_fkey;
|
||||
|
||||
ALTER TABLE collection_asset_transfers
|
||||
ADD CONSTRAINT collection_asset_transfers_workspace_id_source_variant_id_fkey
|
||||
FOREIGN KEY (workspace_id, source_variant_id)
|
||||
REFERENCES product_variants(workspace_id, id)
|
||||
ON DELETE SET NULL (source_variant_id);
|
||||
@@ -0,0 +1,5 @@
|
||||
SET search_path TO atlas, public;
|
||||
|
||||
-- Source-image candidates are recorded during collection but are not fetched
|
||||
-- until the user actually selects one for editing, processing or publishing.
|
||||
ALTER TYPE processing_status ADD VALUE IF NOT EXISTS 'pending_selection';
|
||||
@@ -0,0 +1,8 @@
|
||||
SET search_path TO atlas, public;
|
||||
|
||||
ALTER TABLE collection_asset_transfers
|
||||
ALTER COLUMN status SET DEFAULT 'pending_selection';
|
||||
|
||||
CREATE INDEX ix_collection_asset_transfers_pending_selection
|
||||
ON collection_asset_transfers (workspace_id, collection_item_id, source_snapshot_revision, created_at)
|
||||
WHERE status = 'pending_selection';
|
||||
@@ -0,0 +1,10 @@
|
||||
SET search_path TO atlas, public;
|
||||
|
||||
CREATE TYPE collection_media_type AS ENUM ('image', 'video');
|
||||
|
||||
ALTER TABLE collection_asset_transfers
|
||||
ADD COLUMN media_type collection_media_type NOT NULL DEFAULT 'image',
|
||||
ADD COLUMN poster_url TEXT;
|
||||
|
||||
CREATE INDEX collection_asset_transfers_media_status_idx
|
||||
ON collection_asset_transfers (workspace_id, media_type, status, created_at);
|
||||
Reference in New Issue
Block a user