CREATE TABLE [dbo].[CallPurpose]
(
	[Id] UNIQUEIDENTIFIER CONSTRAINT [DF_CallPurpose_Id] DEFAULT (newid()) ROWGUIDCOL NOT NULL, 
    [NOA_NODId] UNIQUEIDENTIFIER NULL, 
    [CallPurposeCode] int NULL, 
    [CallPurposeDescription] NVARCHAR (100) NULL, 
	CONSTRAINT [PK_CallPurpose] PRIMARY KEY CLUSTERED ([Id] ASC),
	CONSTRAINT [FK_CallPurpose_NOA_NOD] FOREIGN KEY ([NOA_NODId]) REFERENCES [dbo].[NOA_NOD] ([Id])
)

GO

ALTER TABLE [dbo].[NOA_NOD] DROP COLUMN [CallPurposeCode], COLUMN [CallPurposeDescription];
GO

ALTER TABLE [dbo].[BKRA] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[BKRD] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[LADG] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[CREW] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[PAS] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[SERV] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[TOWA] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[TOWD] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[CallPurpose] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[LastTenPortFacilitiesCalled] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[PortOfCallLast30Days] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[PortOfCallLast30DaysCrewJoinedShip] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[PortOfItinerary] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[ShipToShipActivitiesDuringLastTenPortFacilitiesCalled] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[SubsidiaryRisks] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[Waste] ADD [Identifier] NVARCHAR (50) NULL;
GO
ALTER TABLE [dbo].[WasteDisposalServiceProvider] ADD [Identifier] NVARCHAR (50) NULL;
GO


ALTER TABLE [dbo].[Waste] DROP CONSTRAINT [FK_Waste_WasteDisposalServiceProvider];
GO

ALTER TABLE [dbo].[MessageCore] ADD [ETAKielCanal] DATETIME NULL;
GO

EXECUTE sp_rename @objname = N'[dbo].[TOWD].[TowageOnDepartureOperatorStreetAndNumber]', @newname = N'TowageOnDepartureOperatorStreetNameAndNumber', @objtype = N'COLUMN';
GO
