Add plan catalog and subscription schema support, seed baselines, and real importers for core domestic subscriptions plus stable official pricing sources. This commit also hardens the shared fetch layers so the importers can support live collection and database writes instead of relying on manual placeholders alone.
22 lines
788 B
SQL
22 lines
788 B
SQL
DO $$
|
||
BEGIN
|
||
IF EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'chk_models_date_source_kind') THEN
|
||
ALTER TABLE models DROP CONSTRAINT chk_models_date_source_kind;
|
||
END IF;
|
||
|
||
ALTER TABLE models
|
||
ADD CONSTRAINT chk_models_date_source_kind
|
||
CHECK (
|
||
date_source_kind IN (
|
||
'official_announcement',
|
||
'official_product_page',
|
||
'official_pricing',
|
||
'secondary_authoritative_report',
|
||
'catalog_backfill',
|
||
'unknown'
|
||
)
|
||
);
|
||
END $$;
|
||
|
||
COMMENT ON COLUMN models.date_source_kind IS '发布日期证据来源类型:official_announcement / official_product_page / official_pricing / secondary_authoritative_report / catalog_backfill / unknown';
|