Files
Neo-ZQYY/db/etl_feiqiu/migrations/2026-03-20_add_gift_breakdown_fields.sql

13 lines
931 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 赠送卡按卡类型拆分:新增 6 个细分字段
-- 需求BOARD-3 赠送卡矩阵需要按酒水卡/台费卡/抵用券展示余额和新增
-- 恒等式gift_card_balance = gift_liquor_balance + gift_table_fee_balance + gift_voucher_balance
-- recharge_gift = gift_liquor_recharge + gift_table_fee_recharge + gift_voucher_recharge
ALTER TABLE dws.dws_finance_recharge_summary
ADD COLUMN IF NOT EXISTS gift_liquor_balance NUMERIC(14,2) NOT NULL DEFAULT 0,
ADD COLUMN IF NOT EXISTS gift_table_fee_balance NUMERIC(14,2) NOT NULL DEFAULT 0,
ADD COLUMN IF NOT EXISTS gift_voucher_balance NUMERIC(14,2) NOT NULL DEFAULT 0,
ADD COLUMN IF NOT EXISTS gift_liquor_recharge NUMERIC(14,2) NOT NULL DEFAULT 0,
ADD COLUMN IF NOT EXISTS gift_table_fee_recharge NUMERIC(14,2) NOT NULL DEFAULT 0,
ADD COLUMN IF NOT EXISTS gift_voucher_recharge NUMERIC(14,2) NOT NULL DEFAULT 0;