-- 课包（用于卖课的产品模板）
CREATE TABLE course_package (
    id VARCHAR NOT NULL PRIMARY KEY,
    package_name VARCHAR NOT NULL,
    description TEXT,
    ws_course_id VARCHAR,
    total_lessons INT4 DEFAULT 0,
    original_price INT8 DEFAULT 0,
    selling_price INT8 DEFAULT 0,
    validity_days INT4 DEFAULT 0,
    package_status VARCHAR NOT NULL DEFAULT 'ACTIVE',
    cover_image_url VARCHAR,
    sort_order INT4 DEFAULT 0,
    created_by VARCHAR,
    created_at TIMESTAMP NOT NULL DEFAULT NOW(),
    updated_at TIMESTAMP,
    is_delete BOOL DEFAULT FALSE,
    org_id VARCHAR
);

CREATE INDEX idx_course_package_org_id ON course_package (org_id);
CREATE INDEX idx_course_package_created_by ON course_package (created_by);
CREATE INDEX idx_course_package_status ON course_package (package_status);
