CREATE TABLE [dbo].[act_actors]
(
[act_actor_id] [int] NOT NULL,
[act_rowver] [timestamp] NOT NULL,
[act_type_code] [dbo].[ais_code_short] NOT NULL,
[act_internal_reference] [dbo].[ais_code_medium] NOT NULL,
[act_external_reference] [dbo].[ais_code_long] NULL,
[act_address_id] [int] NOT NULL,
[act_sequence_code] [dbo].[ais_code_short] NULL,
[act_date_setup] [date] NULL,
[act_clob] [text] COLLATE French_CI_AS NULL,
[act_blob] [image] NULL,
[act_freeze] [bit] NOT NULL CONSTRAINT [DF__act_actors__act_freeze] DEFAULT ((0))
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
ALTER TABLE [dbo].[act_actors] ADD 
CONSTRAINT [PK_act_actors] PRIMARY KEY CLUSTERED  ([act_actor_id]) ON [PRIMARY]
CREATE UNIQUE NONCLUSTERED INDEX [IX_act_actors] ON [dbo].[act_actors] ([act_type_code], [act_internal_reference]) ON [PRIMARY]

GO

ALTER TABLE [dbo].[act_actors] ADD CONSTRAINT [FK_act_actors_adr_addresses] FOREIGN KEY ([act_address_id]) REFERENCES [dbo].[adr_addresses] ([adr_address_id])
GO
ALTER TABLE [dbo].[act_actors] ADD CONSTRAINT [FK_act_actors_sq_sequences] FOREIGN KEY ([act_sequence_code]) REFERENCES [dbo].[sq_sequences] ([seq_sequence_code])
GO
ALTER TABLE [dbo].[act_actors] ADD CONSTRAINT [FK_act_actors_act_types] FOREIGN KEY ([act_type_code]) REFERENCES [dbo].[act_types] ([at_type_code])
GO
