在准备环境前提交次全部更改。
This commit is contained in:
@@ -26,9 +26,9 @@
|
||||
-- 3档 优秀档 180≤ H <210 10 30% 6
|
||||
-- 4档 销冠竞争 H ≥210 8 25% 休假自由
|
||||
-- =============================================================================
|
||||
TRUNCATE TABLE billiards_dws.cfg_performance_tier RESTART IDENTITY CASCADE;
|
||||
TRUNCATE TABLE dws.cfg_performance_tier RESTART IDENTITY CASCADE;
|
||||
|
||||
INSERT INTO billiards_dws.cfg_performance_tier (
|
||||
INSERT INTO dws.cfg_performance_tier (
|
||||
tier_code, tier_name, tier_level,
|
||||
min_hours, max_hours,
|
||||
base_deduction, bonus_deduction_ratio, vacation_days, vacation_unlimited,
|
||||
@@ -123,9 +123,9 @@ INSERT INTO billiards_dws.cfg_performance_tier (
|
||||
-- - 包厢课基础课统一138元/小时(不随等级变化)
|
||||
-- - 数据来源:DWS 数据库处理需求.md
|
||||
-- =============================================================================
|
||||
TRUNCATE TABLE billiards_dws.cfg_assistant_level_price RESTART IDENTITY CASCADE;
|
||||
TRUNCATE TABLE dws.cfg_assistant_level_price RESTART IDENTITY CASCADE;
|
||||
|
||||
INSERT INTO billiards_dws.cfg_assistant_level_price (
|
||||
INSERT INTO dws.cfg_assistant_level_price (
|
||||
level_code, level_name,
|
||||
base_course_price, bonus_course_price,
|
||||
effective_from, effective_to, description
|
||||
@@ -167,9 +167,9 @@ INSERT INTO billiards_dws.cfg_assistant_level_price (
|
||||
-- - SPRINT: 冲刺奖金(历史口径,至2026-02-28)
|
||||
-- - TOP_RANK: Top3排名奖金(2026-03-01起)
|
||||
-- =============================================================================
|
||||
TRUNCATE TABLE billiards_dws.cfg_bonus_rules RESTART IDENTITY CASCADE;
|
||||
TRUNCATE TABLE dws.cfg_bonus_rules RESTART IDENTITY CASCADE;
|
||||
|
||||
INSERT INTO billiards_dws.cfg_bonus_rules (
|
||||
INSERT INTO dws.cfg_bonus_rules (
|
||||
rule_type, rule_code, rule_name,
|
||||
threshold_hours, rank_position, bonus_amount,
|
||||
is_cumulative, priority,
|
||||
@@ -226,9 +226,9 @@ INSERT INTO billiards_dws.cfg_bonus_rules (
|
||||
-- - SPECIAL: 特殊(补时长等)
|
||||
-- - OTHER: 其他
|
||||
-- =============================================================================
|
||||
TRUNCATE TABLE billiards_dws.cfg_area_category RESTART IDENTITY CASCADE;
|
||||
TRUNCATE TABLE dws.cfg_area_category RESTART IDENTITY CASCADE;
|
||||
|
||||
INSERT INTO billiards_dws.cfg_area_category (
|
||||
INSERT INTO dws.cfg_area_category (
|
||||
source_area_name, category_code, category_name,
|
||||
match_type, match_priority, is_active, description
|
||||
) VALUES
|
||||
@@ -299,9 +299,9 @@ INSERT INTO billiards_dws.cfg_area_category (
|
||||
-- - 附加课/超休: skill_id = 2807440316432197
|
||||
-- - 避免依赖 skill_name 文本匹配
|
||||
-- =============================================================================
|
||||
TRUNCATE TABLE billiards_dws.cfg_skill_type RESTART IDENTITY CASCADE;
|
||||
TRUNCATE TABLE dws.cfg_skill_type RESTART IDENTITY CASCADE;
|
||||
|
||||
INSERT INTO billiards_dws.cfg_skill_type (
|
||||
INSERT INTO dws.cfg_skill_type (
|
||||
skill_id, skill_name,
|
||||
course_type_code, course_type_name,
|
||||
is_active, description
|
||||
@@ -372,11 +372,11 @@ DECLARE
|
||||
v_area_count INTEGER;
|
||||
v_skill_count INTEGER;
|
||||
BEGIN
|
||||
SELECT COUNT(*) INTO v_tier_count FROM billiards_dws.cfg_performance_tier;
|
||||
SELECT COUNT(*) INTO v_price_count FROM billiards_dws.cfg_assistant_level_price;
|
||||
SELECT COUNT(*) INTO v_bonus_count FROM billiards_dws.cfg_bonus_rules;
|
||||
SELECT COUNT(*) INTO v_area_count FROM billiards_dws.cfg_area_category;
|
||||
SELECT COUNT(*) INTO v_skill_count FROM billiards_dws.cfg_skill_type;
|
||||
SELECT COUNT(*) INTO v_tier_count FROM dws.cfg_performance_tier;
|
||||
SELECT COUNT(*) INTO v_price_count FROM dws.cfg_assistant_level_price;
|
||||
SELECT COUNT(*) INTO v_bonus_count FROM dws.cfg_bonus_rules;
|
||||
SELECT COUNT(*) INTO v_area_count FROM dws.cfg_area_category;
|
||||
SELECT COUNT(*) INTO v_skill_count FROM dws.cfg_skill_type;
|
||||
|
||||
RAISE NOTICE '配置数据初始化完成:';
|
||||
RAISE NOTICE ' - cfg_performance_tier: % 条', v_tier_count;
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
-- =============================================================================
|
||||
|
||||
-- 清理旧版指数参数
|
||||
DELETE FROM billiards_dws.cfg_index_parameters WHERE index_type IN ('RECALL', 'INTIMACY');
|
||||
DELETE FROM dws.cfg_index_parameters WHERE index_type IN ('RECALL', 'INTIMACY');
|
||||
-- 清理 ML 已废弃参数
|
||||
DELETE FROM billiards_dws.cfg_index_parameters WHERE index_type = 'ML' AND param_name IN ('source_mode', 'recharge_attribute_hours');
|
||||
DELETE FROM dws.cfg_index_parameters WHERE index_type = 'ML' AND param_name IN ('source_mode', 'recharge_attribute_hours');
|
||||
|
||||
INSERT INTO billiards_dws.cfg_index_parameters
|
||||
INSERT INTO dws.cfg_index_parameters
|
||||
(index_type, param_name, param_value, description, effective_from)
|
||||
VALUES
|
||||
('NCI', 'active_new_penalty', 0.200000, 'active-new suppression multiplier', DATE '2026-02-06'),
|
||||
@@ -82,7 +82,7 @@ ON CONFLICT (index_type, param_name, effective_from) DO UPDATE SET
|
||||
-- 生效时间:北京时间 2026-01-01(按数据库日期管理)
|
||||
-- =============================================================================
|
||||
|
||||
INSERT INTO billiards_dws.cfg_index_parameters
|
||||
INSERT INTO dws.cfg_index_parameters
|
||||
(index_type, param_name, param_value, description, effective_from)
|
||||
VALUES
|
||||
-- RS(关系强度)
|
||||
@@ -149,27 +149,27 @@ DECLARE
|
||||
wbi_count INTEGER;
|
||||
BEGIN
|
||||
SELECT COUNT(*) INTO rs_count
|
||||
FROM billiards_dws.cfg_index_parameters
|
||||
FROM dws.cfg_index_parameters
|
||||
WHERE index_type = 'RS';
|
||||
|
||||
SELECT COUNT(*) INTO os_count
|
||||
FROM billiards_dws.cfg_index_parameters
|
||||
FROM dws.cfg_index_parameters
|
||||
WHERE index_type = 'OS';
|
||||
|
||||
SELECT COUNT(*) INTO ms_count
|
||||
FROM billiards_dws.cfg_index_parameters
|
||||
FROM dws.cfg_index_parameters
|
||||
WHERE index_type = 'MS';
|
||||
|
||||
SELECT COUNT(*) INTO ml_count
|
||||
FROM billiards_dws.cfg_index_parameters
|
||||
FROM dws.cfg_index_parameters
|
||||
WHERE index_type = 'ML';
|
||||
|
||||
SELECT COUNT(*) INTO nci_count
|
||||
FROM billiards_dws.cfg_index_parameters
|
||||
FROM dws.cfg_index_parameters
|
||||
WHERE index_type = 'NCI';
|
||||
|
||||
SELECT COUNT(*) INTO wbi_count
|
||||
FROM billiards_dws.cfg_index_parameters
|
||||
FROM dws.cfg_index_parameters
|
||||
WHERE index_type = 'WBI';
|
||||
|
||||
RAISE NOTICE 'RS 参数数量: %', rs_count;
|
||||
@@ -186,5 +186,5 @@ SELECT
|
||||
param_value,
|
||||
description,
|
||||
effective_from
|
||||
FROM billiards_dws.cfg_index_parameters
|
||||
FROM dws.cfg_index_parameters
|
||||
ORDER BY index_type, param_name, effective_from;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
-- 将新的 ODS 任务注册到 etl_admin.etl_task(按需替换 store_id)。
|
||||
-- 使用方式(示例):
|
||||
-- psql "$PG_DSN" -f etl_billiards/database/seed_ods_tasks.sql
|
||||
-- 或在 psql 中直接执行本文件内容。
|
||||
-- CHANGE 2026-02-15 | 修复 schema 引用:etl_admin → meta(对齐新库 etl_feiqiu 六层架构)
|
||||
-- 将新的 ODS 任务注册到 meta.etl_task(按需替换 store_id)。
|
||||
|
||||
WITH target_store AS (
|
||||
SELECT 2790685415443269::bigint AS store_id -- TODO: 替换为实际 store_id
|
||||
@@ -34,7 +32,7 @@ task_codes AS (
|
||||
'ODS_SETTLEMENT_TICKET'
|
||||
]) AS task_code
|
||||
)
|
||||
INSERT INTO etl_admin.etl_task (task_code, store_id, enabled)
|
||||
INSERT INTO meta.etl_task (task_code, store_id, enabled)
|
||||
SELECT t.task_code, s.store_id, TRUE
|
||||
FROM task_codes t CROSS JOIN target_store s
|
||||
ON CONFLICT (task_code, store_id) DO UPDATE
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- Seed scheduler-compatible tasks into etl_admin.etl_task.
|
||||
-- AI_CHANGELOG [2026-02-13] 移除 DWS_RECALL_INDEX/DWS_INTIMACY_INDEX 任务种子
|
||||
-- CHANGE 2026-02-15 | 修复 schema 引用:etl_admin → meta(对齐新库 etl_feiqiu 六层架构)
|
||||
-- Seed scheduler-compatible tasks into meta.etl_task.
|
||||
--
|
||||
-- Notes:
|
||||
-- - These task_code values must match orchestration/task_registry.py.
|
||||
@@ -46,7 +46,7 @@ task_codes AS (
|
||||
'DWS_ML_MANUAL_IMPORT'
|
||||
]) AS task_code
|
||||
)
|
||||
INSERT INTO etl_admin.etl_task (task_code, store_id, enabled)
|
||||
INSERT INTO meta.etl_task (task_code, store_id, enabled)
|
||||
SELECT t.task_code, s.store_id, TRUE
|
||||
FROM task_codes t CROSS JOIN target_store s
|
||||
ON CONFLICT (task_code, store_id) DO UPDATE
|
||||
|
||||
Reference in New Issue
Block a user