CREATE TABLE [dbo].[policies_replaced_lots]
(
[prl_lot_id] [int] NOT NULL,
[prl_source_product_code] [dbo].[ais_code_short] NOT NULL,
[prl_new_product_code] [dbo].[ais_code_short] NOT NULL,
[prl_start_date] [datetime] NOT NULL,
[prl_end_date] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[policies_replaced_lots] ADD CONSTRAINT [PK_policies_replaced_lots] PRIMARY KEY CLUSTERED  ([prl_lot_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[policies_replaced_lots] ADD CONSTRAINT [FK_policies_replaced_lots_pr_products] FOREIGN KEY ([prl_source_product_code]) REFERENCES [dbo].[pr_products] ([prd_product_code])
GO
ALTER TABLE [dbo].[policies_replaced_lots] ADD CONSTRAINT [FK_policies_replaced_lots_pr_products1] FOREIGN KEY ([prl_new_product_code]) REFERENCES [dbo].[pr_products] ([prd_product_code])
GO
