-- vd20140220: New table for various customer related information
-- First attributes are for DanHostel Information

IF NOT EXISTS (SELECT * FROM dbo.sysobjects WITH (NOLOCK) 
               WHERE 
                 id = object_id(N'[dbo].[CustomerVarious]') AND 
                 OBJECTPROPERTY(id, N'IsUserTable') = 1)
BEGIN

  CREATE TABLE CustomerVarious(
    ID INTEGER IDENTITY(1, 1) NOT NULL PRIMARY KEY,
    CustomerNumber INTEGER NOT NULL,
    HostelID INTEGER NOT NULL,	
    HostelSite VARCHAR(100))
  
  ALTER TABLE CustomerVarious ADD CONSTRAINT FK_CustomerVarious_CustomerFK 
    FOREIGN KEY (CustomerNumber) 
    REFERENCES Customer (CustomerNumber )

END
