This commit is contained in:
@@ -258,6 +258,27 @@ CREATE TABLE listing_benefits (
|
||||
INDEX idx_listing_benefits_listing (listing_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE listing_moderation_requests (
|
||||
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
||||
listing_id BIGINT UNSIGNED NOT NULL,
|
||||
request_type ENUM('create','update','delete') NOT NULL,
|
||||
request_status ENUM('open','approved','rejected') NOT NULL DEFAULT 'open',
|
||||
requested_by BIGINT UNSIGNED NOT NULL,
|
||||
reviewed_by BIGINT UNSIGNED NULL,
|
||||
request_reason TEXT NULL,
|
||||
review_note TEXT NULL,
|
||||
payload_json LONGTEXT NULL,
|
||||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
reviewed_at DATETIME NULL,
|
||||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
CONSTRAINT fk_listing_moderation_listing FOREIGN KEY (listing_id) REFERENCES listings(id) ON DELETE CASCADE,
|
||||
CONSTRAINT fk_listing_moderation_requested_by FOREIGN KEY (requested_by) REFERENCES users(id) ON DELETE CASCADE,
|
||||
CONSTRAINT fk_listing_moderation_reviewed_by FOREIGN KEY (reviewed_by) REFERENCES users(id) ON DELETE SET NULL,
|
||||
INDEX idx_listing_moderation_status (request_status),
|
||||
INDEX idx_listing_moderation_type (request_type),
|
||||
INDEX idx_listing_moderation_user (requested_by)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- Community / Forum
|
||||
CREATE TABLE forum_categories (
|
||||
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
||||
|
||||
Reference in New Issue
Block a user