CREATE TABLE [dbo].[claim_variables_provisions]
(
[clvp_claim_id] [int] NOT NULL,
[clvp_variable_id] [int] NOT NULL,
[clvp_date] [datetime] NOT NULL,
[clvp_amount] [dbo].[ais_decimal2] NOT NULL,
[clvp_user_code] [dbo].[ais_code_medium] NOT NULL,
[clvp_repr] [bit] NOT NULL CONSTRAINT [DF__claim_variables_provisions__clvp_repr] DEFAULT ((0)),
[clvp_injury] [bit] NOT NULL CONSTRAINT [DF__claim_variables_provisions__clvp_injury] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[claim_variables_provisions] ADD CONSTRAINT [PK_claim_variables_provisions] PRIMARY KEY CLUSTERED  ([clvp_claim_id], [clvp_variable_id], [clvp_date]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[claim_variables_provisions] ADD CONSTRAINT [FK_claim_variables_provisions_claim_variables] FOREIGN KEY ([clvp_claim_id], [clvp_variable_id]) REFERENCES [dbo].[claim_variables] ([clv_claim_id], [clv_variable_id])
GO
ALTER TABLE [dbo].[claim_variables_provisions] ADD CONSTRAINT [FK_claim_variables_provisions_usr_users] FOREIGN KEY ([clvp_user_code]) REFERENCES [dbo].[usr_users] ([usr_user_code])
GO
