feat(M08-B): 补保洁结算发放记录
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
DELETE FROM qipai_schema_migrations
|
||||
WHERE version = '2026062728';
|
||||
|
||||
ALTER TABLE qipai_cleaning_settlements
|
||||
DROP FOREIGN KEY fk_qipai_cleaning_settlements_paid_by,
|
||||
DROP INDEX idx_qipai_cleaning_settlement_payout,
|
||||
DROP COLUMN payout_error,
|
||||
DROP COLUMN payout_reference,
|
||||
DROP COLUMN payout_channel,
|
||||
DROP COLUMN paid_by;
|
||||
@@ -0,0 +1,10 @@
|
||||
ALTER TABLE qipai_cleaning_settlements
|
||||
ADD COLUMN paid_by BIGINT UNSIGNED NULL AFTER confirmed_at,
|
||||
ADD COLUMN payout_channel VARCHAR(32) NOT NULL DEFAULT '' AFTER paid_at,
|
||||
ADD COLUMN payout_reference VARCHAR(128) NOT NULL DEFAULT '' AFTER payout_channel,
|
||||
ADD COLUMN payout_error VARCHAR(512) NOT NULL DEFAULT '' AFTER payout_reference,
|
||||
ADD CONSTRAINT fk_qipai_cleaning_settlements_paid_by FOREIGN KEY (paid_by) REFERENCES qipai_users(id),
|
||||
ADD KEY idx_qipai_cleaning_settlement_payout (tenant_id, status, paid_at);
|
||||
|
||||
INSERT IGNORE INTO qipai_schema_migrations (version, name)
|
||||
VALUES ('2026062728', 'm08b_cleaning_payouts');
|
||||
@@ -0,0 +1,22 @@
|
||||
SELECT column_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = DATABASE()
|
||||
AND table_name = 'qipai_cleaning_settlements'
|
||||
AND column_name IN ('paid_by', 'payout_channel', 'payout_reference', 'payout_error');
|
||||
|
||||
SELECT constraint_name
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_schema = DATABASE()
|
||||
AND table_name = 'qipai_cleaning_settlements'
|
||||
AND constraint_name = 'fk_qipai_cleaning_settlements_paid_by';
|
||||
|
||||
SELECT index_name
|
||||
FROM information_schema.statistics
|
||||
WHERE table_schema = DATABASE()
|
||||
AND table_name = 'qipai_cleaning_settlements'
|
||||
AND index_name = 'idx_qipai_cleaning_settlement_payout'
|
||||
GROUP BY index_name;
|
||||
|
||||
SELECT version
|
||||
FROM qipai_schema_migrations
|
||||
WHERE version = '2026062728';
|
||||
Reference in New Issue
Block a user