Implement refund system for sales

This commit is contained in:
2026-02-28 19:28:25 -07:00
parent e2973729b4
commit cbed5e4e0c
9 changed files with 841 additions and 4 deletions

14
refund_migration.sql Normal file
View File

@@ -0,0 +1,14 @@
-- Database Migration Script for Refund System
-- Run this on existing Petstoredb to add refund functionality
USE Petstoredb;
-- Add refund columns to sale table
ALTER TABLE sale
ADD COLUMN isRefund BOOLEAN DEFAULT FALSE NOT NULL,
ADD COLUMN originalSaleId INT NULL,
ADD CONSTRAINT fk_original_sale
FOREIGN KEY (originalSaleId) REFERENCES sale(saleId);
-- Verify the changes
DESCRIBE sale;