

-- DGE 30/06/2017
-- création de la table de compléments sinistre-acteur. AisServerInstall ne traite pas cette table, sa structure étant dynamique. 
if not exists(	select	1
				from	sysobjects
				where	name = 'claim_actors_cpl'
				and		xtype = 'U')
begin

	CREATE TABLE [dbo].[claim_actors_cpl]
	(
	[clactcpl_claim_id] [int] NOT NULL,
	[clactcpl_actor_id] [int] NOT NULL,
	[clactcpl_rowver] [timestamp] NOT NULL
	) ON [PRIMARY]
	-- Constraints and Indexes

	ALTER TABLE [dbo].[claim_actors_cpl] ADD CONSTRAINT [PK_claim_actors_cpl] PRIMARY KEY CLUSTERED  ([clactcpl_claim_id], [clactcpl_actor_id]) ON [PRIMARY]
	-- Foreign Keys

	ALTER TABLE [dbo].[claim_actors_cpl] ADD CONSTRAINT [FK_claim_actors_cpl_claim_actors] FOREIGN KEY ([clactcpl_claim_id], [clactcpl_actor_id]) REFERENCES [dbo].[claim_actors] ([clact_claim_id], [clact_actor_id]) ON DELETE CASCADE
end
