Have a requirement where promotions table needs to be created which can have multiple promotion types. i.e Coupons, Promo Codes, Gifts etc
The problem is when creating a Promotion how can we save the foreign key value of promotions types where every promotion type is a separate entity and has it's own attributes.
Resolutions in my mind:
Create separate tables for every promotion types to accommodate the relation between Promotions and relevant Type table eg: Promotion_Coupon_Relation
Drop foreign Key constraint in promotion table and create a column that will store the foreign key value every time the promotion is created based on a type. But in this case the relation will not be concrete and will be identified based on the promotion type only.
PromotionType:
PromotypeID, PromoTypeDesc (eg: Coupon,PromoCode,Gifts and can be more in future)
Promotion:
PromotionID, PromotypeID, PromotionTypeReferenceID, EffectiveDate, EndDate, Active
Coupon:
CouponID, CouponName, CouponCOde, CouponTitle, isActive
PromoCode:
PromoCodeID, PromoCodeName, PromoCodeText, PromoCodeTitle, isActive
Gift:
GiftID, GiftTitle, GiftDesc, isActive
please advise.