CREATE TABLE [dbo].[ProfileAddress] (
	[Id]            INT           IDENTITY (1, 1) NOT NULL,
	[ProfileId]     INT           NOT NULL,
	[AddressTypeId] INT           NOT NULL,
	[Line1]         NVARCHAR (50) NOT NULL,
	[Line2]         NVARCHAR (50) NULL,
	[City]          NVARCHAR (50) NULL,
	[PostalCode]    NVARCHAR (50) NULL,
	[ProvinceId]    INT           NULL,
	[CountryId]     INT           NULL,
	[IsDeleted] BIT NOT NULL DEFAULT 0, 
	CONSTRAINT [PK_ProfileAddress] PRIMARY KEY CLUSTERED ([Id] ASC),
	CONSTRAINT [FK_ProfileAddress_AddressType] FOREIGN KEY ([AddressTypeId]) REFERENCES [dbo].[AddressType] ([Id]),
	CONSTRAINT [FK_ProfileAddress_Country] FOREIGN KEY ([CountryId]) REFERENCES [dbo].[Country] ([Id]),
	CONSTRAINT [FK_ProfileAddress_Profile] FOREIGN KEY ([ProfileId]) REFERENCES [dbo].[Profile] ([Id]),
	CONSTRAINT [FK_ProfileAddress_Province] FOREIGN KEY ([ProvinceId]) REFERENCES [dbo].[Province] ([Id])
);

