-- +goose Up

ALTER TABLE rental_orders
  ADD COLUMN pure_coin_original_amount_cent BIGINT NOT NULL DEFAULT 0 COMMENT '下单时租客纯币原价快照(分)' AFTER rent_discount_amount_cent,
  ADD COLUMN extra_item_original_amount_cent BIGINT NOT NULL DEFAULT 0 COMMENT '下单时额外物品原价快照(分)' AFTER pure_coin_original_amount_cent,
  ADD COLUMN actual_coin_consumed_m DECIMAL(12,2) NOT NULL DEFAULT 0.00 COMMENT '最终确认哈夫币消耗(M)' AFTER extra_item_original_amount_cent,
  ADD COLUMN actual_pure_coin_amount_cent BIGINT NOT NULL DEFAULT 0 COMMENT '最终实际纯币原价(分)' AFTER actual_coin_consumed_m,
  ADD COLUMN actual_pure_coin_discount_cent BIGINT NOT NULL DEFAULT 0 COMMENT '最终实际纯币等级优惠(分)' AFTER actual_pure_coin_amount_cent,
  ADD COLUMN growth_points_basis_cent BIGINT NOT NULL DEFAULT 0 COMMENT '成长积分计算纯币基数(分)' AFTER renter_discount_bps,
  ADD COLUMN growth_points_per_yuan BIGINT NOT NULL DEFAULT 0 COMMENT '成长积分发放倍率' AFTER growth_points_basis_cent;

ALTER TABLE order_checkouts
  ADD COLUMN pure_coin_amount_cent BIGINT NOT NULL DEFAULT 0 COMMENT '方案实际纯币原价(分)' AFTER deposit_amount_cent,
  ADD COLUMN pure_coin_discount_cent BIGINT NOT NULL DEFAULT 0 COMMENT '方案实际纯币等级优惠(分)' AFTER pure_coin_amount_cent,
  ADD COLUMN pure_coin_payable_cent BIGINT NOT NULL DEFAULT 0 COMMENT '方案实际折后纯币金额(分)' AFTER pure_coin_discount_cent;

ALTER TABLE renter_growth_ledger
  ADD COLUMN basis_amount_cent BIGINT NOT NULL DEFAULT 0 COMMENT '积分计算纯币基数(分)' AFTER points,
  ADD COLUMN points_per_yuan BIGINT NOT NULL DEFAULT 0 COMMENT '积分发放倍率' AFTER basis_amount_cent;

-- +goose Down

ALTER TABLE order_checkouts
  DROP COLUMN pure_coin_payable_cent,
  DROP COLUMN pure_coin_discount_cent,
  DROP COLUMN pure_coin_amount_cent;

ALTER TABLE renter_growth_ledger
  DROP COLUMN points_per_yuan,
  DROP COLUMN basis_amount_cent;

ALTER TABLE rental_orders
  DROP COLUMN growth_points_per_yuan,
  DROP COLUMN growth_points_basis_cent,
  DROP COLUMN actual_pure_coin_discount_cent,
  DROP COLUMN actual_pure_coin_amount_cent,
  DROP COLUMN actual_coin_consumed_m,
  DROP COLUMN extra_item_original_amount_cent,
  DROP COLUMN pure_coin_original_amount_cent;
