Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 894ca8b864
Fetching contributors…

Cannot retrieve contributors at this time

241 lines (240 sloc) 17.39 kb
USE [master]
GO
/****** Object: Database [PeerLearn] Script Date: 12/27/2010 18:11:17 ******/
CREATE DATABASE [PeerLearn] ON PRIMARY
( NAME = N'PeerLearn', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\PeerLearn.mdf' , SIZE = 2048KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'PeerLearn_log', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\PeerLearn_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [PeerLearn] SET COMPATIBILITY_LEVEL = 100
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [PeerLearn].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [PeerLearn] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [PeerLearn] SET ANSI_NULLS OFF
GO
ALTER DATABASE [PeerLearn] SET ANSI_PADDING OFF
GO
ALTER DATABASE [PeerLearn] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [PeerLearn] SET ARITHABORT OFF
GO
ALTER DATABASE [PeerLearn] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [PeerLearn] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [PeerLearn] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [PeerLearn] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [PeerLearn] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [PeerLearn] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [PeerLearn] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [PeerLearn] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [PeerLearn] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [PeerLearn] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [PeerLearn] SET DISABLE_BROKER
GO
ALTER DATABASE [PeerLearn] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [PeerLearn] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [PeerLearn] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [PeerLearn] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [PeerLearn] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [PeerLearn] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [PeerLearn] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [PeerLearn] SET READ_WRITE
GO
ALTER DATABASE [PeerLearn] SET RECOVERY SIMPLE
GO
ALTER DATABASE [PeerLearn] SET MULTI_USER
GO
ALTER DATABASE [PeerLearn] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [PeerLearn] SET DB_CHAINING OFF
GO
USE [PeerLearn]
GO
/****** Object: Table [dbo].[Event] Script Date: 12/27/2010 18:11:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Event](
[EventId] [int] IDENTITY(1,1) NOT NULL,
[EventName] [nvarchar](256) NOT NULL,
[EventDescription] [nvarchar](255) NOT NULL,
[EventBeginDate] [datetime] NOT NULL,
[EventEndDate] [datetime] NOT NULL,
[RegistrationOpenDate] [datetime] NOT NULL,
[StreetAddress] [nvarchar](255) NOT NULL,
[StreetAddress2] [nvarchar](255) NULL,
[City] [nvarchar](255) NOT NULL,
[State] [nvarchar](255) NOT NULL,
[PostalCode] [nvarchar](255) NOT NULL,
PRIMARY KEY CLUSTERED
(
[EventId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
UNIQUE NONCLUSTERED
(
[EventName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[User] Script Date: 12/27/2010 18:11:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[User](
[UserId] [int] IDENTITY(1,1) NOT NULL,
[Email] [nvarchar](256) NOT NULL,
[UserName] [nvarchar](25) NOT NULL,
[Password] [nvarchar](80) NOT NULL,
[Bio] [nvarchar](255) NULL,
[DateJoined] [datetime] NOT NULL,
[TwitterHandle] [nvarchar](15) NULL,
[FirstName] [nvarchar](40) NULL,
[LastName] [nvarchar](40) NULL,
[Blog] [nvarchar](255) NULL,
[Website] [nvarchar](255) NULL,
[IsPublic] [bit] NOT NULL,
[IsEnabled] [bit] NOT NULL,
PRIMARY KEY CLUSTERED
(
[UserId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
UNIQUE NONCLUSTERED
(
[Email] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
UNIQUE NONCLUSTERED
(
[UserName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[Role] Script Date: 12/27/2010 18:11:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Role](
[RoleId] [int] IDENTITY(1,1) NOT NULL,
[RoleName] [nvarchar](40) NOT NULL,
PRIMARY KEY CLUSTERED
(
[RoleId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
UNIQUE NONCLUSTERED
(
[RoleName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[UsersInRole] Script Date: 12/27/2010 18:11:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UsersInRole](
[Role_id] [int] NOT NULL,
[User_id] [int] NOT NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[Organizers] Script Date: 12/27/2010 18:11:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Organizers](
[Event_id] [int] NOT NULL,
[User_id] [int] NOT NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[Speakers] Script Date: 12/27/2010 18:11:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Speakers](
[Event_id] [int] NOT NULL,
[User_id] [int] NOT NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[Attendees] Script Date: 12/27/2010 18:11:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Attendees](
[Event_id] [int] NOT NULL,
[User_id] [int] NOT NULL
) ON [PRIMARY]
GO
/****** Object: ForeignKey [FKC6BE2B0BB6EF124A] Script Date: 12/27/2010 18:11:19 ******/
ALTER TABLE [dbo].[UsersInRole] WITH CHECK ADD CONSTRAINT [FKC6BE2B0BB6EF124A] FOREIGN KEY([User_id])
REFERENCES [dbo].[User] ([UserId])
GO
ALTER TABLE [dbo].[UsersInRole] CHECK CONSTRAINT [FKC6BE2B0BB6EF124A]
GO
/****** Object: ForeignKey [FKC6BE2B0BC1708D18] Script Date: 12/27/2010 18:11:19 ******/
ALTER TABLE [dbo].[UsersInRole] WITH CHECK ADD CONSTRAINT [FKC6BE2B0BC1708D18] FOREIGN KEY([Role_id])
REFERENCES [dbo].[Role] ([RoleId])
GO
ALTER TABLE [dbo].[UsersInRole] CHECK CONSTRAINT [FKC6BE2B0BC1708D18]
GO
/****** Object: ForeignKey [FK13A1DE48B6EF124A] Script Date: 12/27/2010 18:11:19 ******/
ALTER TABLE [dbo].[Organizers] WITH CHECK ADD CONSTRAINT [FK13A1DE48B6EF124A] FOREIGN KEY([User_id])
REFERENCES [dbo].[User] ([UserId])
GO
ALTER TABLE [dbo].[Organizers] CHECK CONSTRAINT [FK13A1DE48B6EF124A]
GO
/****** Object: ForeignKey [FK13A1DE48D54779F6] Script Date: 12/27/2010 18:11:19 ******/
ALTER TABLE [dbo].[Organizers] WITH CHECK ADD CONSTRAINT [FK13A1DE48D54779F6] FOREIGN KEY([Event_id])
REFERENCES [dbo].[Event] ([EventId])
GO
ALTER TABLE [dbo].[Organizers] CHECK CONSTRAINT [FK13A1DE48D54779F6]
GO
/****** Object: ForeignKey [FK73A69973B6EF124A] Script Date: 12/27/2010 18:11:19 ******/
ALTER TABLE [dbo].[Speakers] WITH CHECK ADD CONSTRAINT [FK73A69973B6EF124A] FOREIGN KEY([User_id])
REFERENCES [dbo].[User] ([UserId])
GO
ALTER TABLE [dbo].[Speakers] CHECK CONSTRAINT [FK73A69973B6EF124A]
GO
/****** Object: ForeignKey [FK73A69973D54779F6] Script Date: 12/27/2010 18:11:19 ******/
ALTER TABLE [dbo].[Speakers] WITH CHECK ADD CONSTRAINT [FK73A69973D54779F6] FOREIGN KEY([Event_id])
REFERENCES [dbo].[Event] ([EventId])
GO
ALTER TABLE [dbo].[Speakers] CHECK CONSTRAINT [FK73A69973D54779F6]
GO
/****** Object: ForeignKey [FKD42E632FB6EF124A] Script Date: 12/27/2010 18:11:19 ******/
ALTER TABLE [dbo].[Attendees] WITH CHECK ADD CONSTRAINT [FKD42E632FB6EF124A] FOREIGN KEY([User_id])
REFERENCES [dbo].[User] ([UserId])
GO
ALTER TABLE [dbo].[Attendees] CHECK CONSTRAINT [FKD42E632FB6EF124A]
GO
/****** Object: ForeignKey [FKD42E632FD54779F6] Script Date: 12/27/2010 18:11:19 ******/
ALTER TABLE [dbo].[Attendees] WITH CHECK ADD CONSTRAINT [FKD42E632FD54779F6] FOREIGN KEY([Event_id])
REFERENCES [dbo].[Event] ([EventId])
GO
ALTER TABLE [dbo].[Attendees] CHECK CONSTRAINT [FKD42E632FD54779F6]
GO
INSERT INTO Role (RoleName) Values('User'),('Admin')
Jump to Line
Something went wrong with that request. Please try again.