Implement refund system for sales
This commit is contained in:
14
refund_migration.sql
Normal file
14
refund_migration.sql
Normal 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;
|
||||
Reference in New Issue
Block a user