USE [master]
GO

/****** 
		Object:  Database [AUTOHUB.MDF]    
		Script Date: 5/2/2016 10:12:31 PM 
******/
CREATE DATABASE [AUTOHUB.MDF]
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'autohub', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\autohub.mdf' , SIZE = 3136KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'autohub_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\autohub_log.ldf' , SIZE = 784KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO

ALTER DATABASE [AUTOHUB.MDF] SET COMPATIBILITY_LEVEL = 110
GO

IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [AUTOHUB.MDF].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO

ALTER DATABASE [AUTOHUB.MDF] SET ANSI_NULL_DEFAULT OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET ANSI_NULLS OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET ANSI_PADDING OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET ANSI_WARNINGS OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET ARITHABORT OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET AUTO_CLOSE ON 
GO

ALTER DATABASE [AUTOHUB.MDF] SET AUTO_CREATE_STATISTICS ON 
GO

ALTER DATABASE [AUTOHUB.MDF] SET AUTO_SHRINK ON 
GO

ALTER DATABASE [AUTOHUB.MDF] SET AUTO_UPDATE_STATISTICS ON 
GO

ALTER DATABASE [AUTOHUB.MDF] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET CURSOR_DEFAULT  GLOBAL 
GO

ALTER DATABASE [AUTOHUB.MDF] SET CONCAT_NULL_YIELDS_NULL OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET NUMERIC_ROUNDABORT OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET QUOTED_IDENTIFIER OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET RECURSIVE_TRIGGERS OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET  DISABLE_BROKER 
GO

ALTER DATABASE [AUTOHUB.MDF] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET TRUSTWORTHY OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET PARAMETERIZATION SIMPLE 
GO

ALTER DATABASE [AUTOHUB.MDF] SET READ_COMMITTED_SNAPSHOT OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET HONOR_BROKER_PRIORITY OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET RECOVERY SIMPLE 
GO

ALTER DATABASE [AUTOHUB.MDF] SET  MULTI_USER 
GO

ALTER DATABASE [AUTOHUB.MDF] SET PAGE_VERIFY CHECKSUM  
GO

ALTER DATABASE [AUTOHUB.MDF] SET DB_CHAINING OFF 
GO

ALTER DATABASE [AUTOHUB.MDF] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
GO

ALTER DATABASE [AUTOHUB.MDF] SET TARGET_RECOVERY_TIME = 0 SECONDS 
GO

ALTER DATABASE [AUTOHUB.MDF] SET  READ_WRITE 
GO

/****** 
	Object:  Table [AutoHubCode]    
	Script Date: 5/2/2016 10:15:53 PM 
******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [AutoHubCode](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[AutoCodeKey] [varchar](30) NOT NULL,
	[AutoCodeVal] [varchar](max) NOT NULL,
	[CreatedOn] [datetime] NULL,
	[CreatedBy] [varchar](50) NOT NULL,
	[ModifiedOn] [datetime] NULL,
	[ModifiedBy] [varchar](50) NULL,
PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 
	Object:  Table [AutoHubLog]    
	Script Date: 5/2/2016 10:15:53 PM 
******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [AutoHubLog](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[CodeKey] [int] NOT NULL,
	[RequestedByAction] [varchar](255) NOT NULL,
	[RequestedFrom] [varchar](max) NOT NULL,
	[RequestedOn] [datetime] NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [AutoHubCode] ADD  DEFAULT ('newKey') FOR [AutoCodeKey]
GO
ALTER TABLE [AutoHubCode] ADD  DEFAULT (getdate()) FOR [CreatedOn]
GO
ALTER TABLE [AutoHubCode] ADD  DEFAULT (suser_name()) FOR [CreatedBy]
GO
ALTER TABLE [AutoHubLog] ADD  DEFAULT ('UNK') FOR [RequestedFrom]
GO
ALTER TABLE [AutoHubLog] ADD  DEFAULT (getdate()) FOR [RequestedOn]
GO
