-------------------------------------------------------------------------------------------------
-- AGNT

PRINT N'new table AGNT';
GO

CREATE TABLE [dbo].[AGNT] (
	[Id]	UNIQUEIDENTIFIER CONSTRAINT [DF_AGNT_Id] DEFAULT (newid()) ROWGUIDCOL NOT NULL,
	[MessageHeaderId] UNIQUEIDENTIFIER NULL,
	[AgentCompanyName] NVARCHAR (100) NULL,
	[AgentStreetAndNumber] NVARCHAR (100) NULL,
	[AgentPostalCode] NVARCHAR (25) NULL,
	[AgentCity] NVARCHAR (100) NULL,
	[AgentCountry] NVARCHAR (100) NULL,
	[AgentLastName] NVARCHAR (100) NULL,
	[AgentFirstName] NVARCHAR (100) NULL,
	[AgentPhone] NVARCHAR (100) NULL,
	[AgentFax] NVARCHAR (100) NULL,
	[AgentEMail] NVARCHAR (100) NULL,
	
	CONSTRAINT [PK_AGNT] PRIMARY KEY CLUSTERED ([Id] ASC),
	CONSTRAINT [FK_AGNT_MessageHeader] FOREIGN KEY ([MessageHeaderId]) REFERENCES [dbo].[MessageHeader] ([Id])
);

-------------------------------------------------------------------------------------------------
-- INFO

PRINT N'Altering [dbo].[INFO]...';

GO
ALTER TABLE [dbo].[INFO]
    ADD [PortArea]           NVARCHAR (50) NULL,
        [BowThrusterPower]   NVARCHAR (50) NULL,
        [SternThrusterPower] NVARCHAR (50) NULL;
GO

-------------------------------------------------------------------------------------------------
-- INFO

PRINT N'Altering [dbo].[STAT]...';

ALTER TABLE [dbo].[STAT]
    ADD [TransportMode] NCHAR (1) NULL;
GO


-------------------------------------------------------------------------------------------------
-- IMDGPosition

PRINT N'Altering [dbo].[IMDGPosition]...';


GO
ALTER TABLE [dbo].[IMDGPosition]
    ADD [Bay]  NVARCHAR (5) NULL,
        [Row]  NVARCHAR (5) NULL,
        [Tier] NVARCHAR (5) NULL;

GO

-------------------------------------------------------------------------------------------------
-- SanitaryMeasuresDetail

PRINT N'New table [dbo].[SanitaryMeasuresDetail]...';


CREATE TABLE [dbo].[SanitaryMeasuresDetail] (
    [Id]                                    UNIQUEIDENTIFIER CONSTRAINT [DF_SanitaryMeasuresDetail_Id] DEFAULT (newid()) ROWGUIDCOL NOT NULL,
    [MDH_Id]                                UNIQUEIDENTIFIER NULL,
    [SanitaryMeasuresType]		            NVARCHAR (255)   NULL,
    [SanitaryMeasuresLocation]			    NVARCHAR (255)   NULL,
    [SanitaryMeasuresDate]					DATE             NULL,
    [Identifier]                            NVARCHAR (50)    NULL,
    CONSTRAINT [PK_SanitaryMeasuresDetail] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_SanitaryMeasuresDetail_MDH] FOREIGN KEY ([MDH_Id]) REFERENCES [dbo].[MDH] ([Id])
);

GO

-------------------------------------------------------------------------------------------------
-- StowawaysJoiningLocation

PRINT N'New table [dbo].[StowawaysJoiningLocation]...';


CREATE TABLE [dbo].[StowawaysJoiningLocation] (
    [Id]                                    UNIQUEIDENTIFIER CONSTRAINT [DF_StowawaysJoiningLocation_Id] DEFAULT (newid()) ROWGUIDCOL NOT NULL,
    [MDH_Id]                                UNIQUEIDENTIFIER NULL,
    [StowawaysJoiningLocation]	            NVARCHAR (255)   NULL,    
    [Identifier]                            NVARCHAR (50)    NULL,
    CONSTRAINT [PK_StowawaysJoiningLocation] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_StowawaysJoiningLocation_MDH] FOREIGN KEY ([MDH_Id]) REFERENCES [dbo].[MDH] ([Id])
);

GO

-------------------------------------------------------------------------------------------------
-- InfectedArea

PRINT N'New table [dbo].[InfectedArea]...';


CREATE TABLE [dbo].[InfectedArea] (
    [Id]                                    UNIQUEIDENTIFIER CONSTRAINT [DF_InfectedArea_Id] DEFAULT (newid()) ROWGUIDCOL NOT NULL,
    [MDH_Id]                                UNIQUEIDENTIFIER NULL,
    [InfectedAreaPort]			            NVARCHAR (255)   NULL,    
    [InfectedAreaDate]						DATE             NULL,
    [Identifier]                            NVARCHAR (50)    NULL,
    CONSTRAINT [PK_InfectedArea] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_SInfectedArea_MDH] FOREIGN KEY ([MDH_Id]) REFERENCES [dbo].[MDH] ([Id])
);

GO




