﻿CREATE TABLE [dbo].[ActionsEdu] (
    [Id]                    INT              IDENTITY (1, 1) NOT NULL,
    [Numero]                NVARCHAR (MAX)   NOT NULL,
    [Nom]                   NVARCHAR (MAX)   NOT NULL,
    [Montant]               DECIMAL (18)     NULL,
    [Description]           NVARCHAR (MAX)   NULL,
    [CommentaireInterne]    NVARCHAR (MAX)   NULL,
    [CommentairePublic]     NVARCHAR (MAX)   NULL,
    [Neutralise]            BIT              NOT NULL,
    [Ordre]                 INT              NOT NULL,
    [ActionEduThematiqueId] INT              NOT NULL,
    [StatutId]              INT              CONSTRAINT [DF_ActionsEdu_StatutId] DEFAULT ((0)) NOT NULL,
    [AnneeId]               INT              NOT NULL,
    [TokenId]               UNIQUEIDENTIFIER NOT NULL,
    CONSTRAINT [PK_ActionsEdu] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_ActionEduAnnee] FOREIGN KEY ([AnneeId]) REFERENCES [dbo].[Annees] ([Id]),
    CONSTRAINT [FK_ActionEduThematiqueActionEdu] FOREIGN KEY ([ActionEduThematiqueId]) REFERENCES [dbo].[ActionEduThematiques] ([Id]),
    CONSTRAINT [FK_ActionsEdu_ActionEduStatuts] FOREIGN KEY ([StatutId]) REFERENCES [dbo].[ActionEduStatuts] ([Id])
);


GO
CREATE NONCLUSTERED INDEX [IX_FK_ActionEdu_ActionEduStatuts]
    ON [dbo].[ActionsEdu]([StatutId] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_FK_ActionEduAnnee]
    ON [dbo].[ActionsEdu]([AnneeId] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_FK_ActionEduThematiqueActionEdu]
    ON [dbo].[ActionsEdu]([ActionEduThematiqueId] ASC);

