USE [AIS_S3]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MachineKits]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MachineKits](
	[MachineKitNo] [int] IDENTITY(1,1) NOT NULL,
	[MachineNo] [int] NOT NULL,
	[Kit] [varchar](5) NOT NULL,
	[LastModified] [datetime] NOT NULL,
 CONSTRAINT [PK_MachineKits] PRIMARY KEY CLUSTERED 
(
	[MachineKitNo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[KitBins]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[KitBins](
	[KitBinNo] [int] IDENTITY(1,1) NOT NULL,
	[MachineKitNo] [int] NOT NULL,
	[BinNo] [int] NOT NULL,
	[Position] [int] NOT NULL,
	[LastModified] [datetime] NOT NULL,
 CONSTRAINT [PK_KitBin] PRIMARY KEY CLUSTERED 
(
	[KitBinNo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO