text: USE [SquiggleHistory]
  GO
  /****** Object:  Table [dbo].[Events]    Script Date: 11/3/2012 12:06:01 PM ******/
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  CREATE TABLE [dbo].[Events](
  	[Id] [uniqueidentifier] NOT NULL,
  	[SessionId] [uniqueidentifier] NOT NULL,
  	[TypeCode] [int] NOT NULL,
  	[SenderId] [uniqueidentifier] NOT NULL,
  	[SenderName] [nvarchar](max) NULL,
  	[Data] [nvarchar](max) NULL,
  	[Stamp] [datetime] NOT NULL,
   CONSTRAINT [PK_dbo.Events] 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
  /****** Object:  Table [dbo].[Participants]    Script Date: 11/3/2012 12:06:01 PM ******/
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  CREATE TABLE [dbo].[Participants](
  	[Id] [uniqueidentifier] NOT NULL,
  	[SessionId] [uniqueidentifier] NOT NULL,
  	[ContactId] [uniqueidentifier] NOT NULL,
  	[ContactName] [nvarchar](max) NULL,
   CONSTRAINT [PK_dbo.Participants] 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
  /****** Object:  Table [dbo].[Sessions]    Script Date: 11/3/2012 12:06:01 PM ******/
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  CREATE TABLE [dbo].[Sessions](
  	[Id] [uniqueidentifier] NOT NULL,
  	[ContactId] [uniqueidentifier] NOT NULL,
  	[ContactName] [nvarchar](max) NULL,
  	[Start] [datetime] NOT NULL,
  	[End] [datetime] NULL,
   CONSTRAINT [PK_dbo.Sessions] 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
  /****** Object:  Table [dbo].[StatusUpdates]    Script Date: 11/3/2012 12:06:01 PM ******/
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  CREATE TABLE [dbo].[StatusUpdates](
  	[Id] [uniqueidentifier] NOT NULL,
  	[ContactId] [uniqueidentifier] NOT NULL,
  	[ContactName] [nvarchar](max) NULL,
  	[StatusCode] [int] NOT NULL,
  	[Stamp] [datetime] NOT NULL,
   CONSTRAINT [PK_dbo.StatusUpdates] 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
  ALTER TABLE [dbo].[Events]  WITH CHECK ADD  CONSTRAINT [FK_dbo.Events_dbo.Sessions_SessionId] FOREIGN KEY([SessionId])
  REFERENCES [dbo].[Sessions] ([Id])
  ON DELETE CASCADE
  GO
  ALTER TABLE [dbo].[Events] CHECK CONSTRAINT [FK_dbo.Events_dbo.Sessions_SessionId]
  GO
  ALTER TABLE [dbo].[Participants]  WITH CHECK ADD  CONSTRAINT [FK_dbo.Participants_dbo.Sessions_SessionId] FOREIGN KEY([SessionId])
  REFERENCES [dbo].[Sessions] ([Id])
  ON DELETE CASCADE
  GO
  ALTER TABLE [dbo].[Participants] CHECK CONSTRAINT [FK_dbo.Participants_dbo.Sessions_SessionId]
  GO
  