Microsoft sql table events

MySQL Server -- Posted on Oct. 24, 2020

Microsft SQL table events create

              
                CREATE TABLE Events (
    Id int IDENTITY(1,1) not null,
    [Order] int not null default 0,
    StartDate datetime not null DEFAULT GETDATE(),
    EndDate datetime not null DEFAULT GETDATE(),
    CreatedAt datetime not null DEFAULT GETDATE(),
    UpdatedAt datetime not null DEFAULT GETDATE(),
    Published bit not null default 0,
    Deleted bit not null default 0,
    Title nvarchar(max) NOT NULL,
    Description nvarchar(max) NOT NULL,
    CONSTRAINT PK_Events_Id PRIMARY KEY CLUSTERED (Id),
);


CREATE TABLE EventsMedia (
    Id int IDENTITY(1,1) not null,
    EventsId int not null,
    [Order] int not null default 0,
    CreatedAt datetime not null DEFAULT GETDATE(),
    UpdatedAt datetime not null DEFAULT GETDATE(),
    Published bit not null default 0,
    Deleted bit not null default 0,
    MediaPath nvarchar(max) NOT NULL,
    CONSTRAINT PK_EventsMedia_Id PRIMARY KEY CLUSTERED (Id),
    CONSTRAINT FK_EventssMedia_EventsId FOREIGN KEY (EventsId) REFERENCES  Events(Id),
);
                  
   
            

Related Posts