PageRenderTime 16ms CodeModel.GetById 1ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 1ms

/BlogEngine/BlogEngine.NET/setup/SQLServer/MSSQLUpgradeTo1.4.5.0From1.4.0.0.sql

#
SQL | 86 lines | 75 code | 5 blank | 6 comment | 0 complexity | db2797b919a23c653cb232f28971c9a7 MD5 | raw file
 1/****** BlogEngine.NET 1.4. SQL Upgrade Script ******/
 2
 3/* be_Categories update */
 4ALTER TABLE [dbo].[be_Categories]
 5	ADD
 6		[ParentID] [uniqueidentifier] NULL
 7
 8/* be_DataStoreSettings update */
 9ALTER TABLE [dbo].[be_DataStoreSettings]
10	ALTER COLUMN Settings varchar(max)
11
12GO
13/****** Object:  Table [dbo].[be_Users]    Script Date: 07/30/2008 21:55:28 ******/
14SET ANSI_NULLS ON
15GO
16SET QUOTED_IDENTIFIER ON
17GO
18CREATE TABLE [dbo].[be_Users](
19	[UserID] [int] IDENTITY(1,1) NOT NULL,
20	[UserName] [nvarchar](100) NOT NULL,
21	[Password] [nvarchar](255) NOT NULL,
22	[LastLoginTime] [datetime] NULL,
23	[EmailAddress] [nvarchar](100) NULL,
24 CONSTRAINT [PK_be_Users] PRIMARY KEY CLUSTERED 
25(
26	[UserID] ASC
27)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
28) ON [PRIMARY]
29GO
30/****** Object:  Table [dbo].[be_Roles]    Script Date: 07/30/2008 21:56:59 ******/
31SET ANSI_NULLS ON
32GO
33SET QUOTED_IDENTIFIER ON
34GO
35CREATE TABLE [dbo].[be_Roles](
36	[RoleID] [int] IDENTITY(1,1) NOT NULL,
37	[Role] [nvarchar](100) NOT NULL,
38 CONSTRAINT [PK_be_Roles] PRIMARY KEY CLUSTERED 
39(
40	[RoleID] ASC
41)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
42) ON [PRIMARY]
43GO
44/****** Object:  Table [dbo].[be_UserRoles]    Script Date: 07/31/2008 12:26:45 ******/
45SET ANSI_NULLS ON
46GO
47SET QUOTED_IDENTIFIER ON
48GO
49CREATE TABLE [dbo].[be_UserRoles](
50	[UserRoleID] [int] IDENTITY(1,1) NOT NULL,
51	[UserID] [int] NOT NULL,
52	[RoleID] [int] NOT NULL,
53 CONSTRAINT [PK_be_UserRoles] PRIMARY KEY CLUSTERED 
54(
55	[UserRoleID] ASC
56)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
57) ON [PRIMARY]
58
59GO
60ALTER TABLE [dbo].[be_UserRoles]  WITH CHECK ADD  CONSTRAINT [FK_be_UserRoles_be_Roles] FOREIGN KEY([RoleID])
61REFERENCES [dbo].[be_Roles] ([RoleID])
62GO
63ALTER TABLE [dbo].[be_UserRoles] CHECK CONSTRAINT [FK_be_UserRoles_be_Roles]
64GO
65ALTER TABLE [dbo].[be_UserRoles]  WITH CHECK ADD  CONSTRAINT [FK_be_UserRoles_be_Users] FOREIGN KEY([UserID])
66REFERENCES [dbo].[be_Users] ([UserID])
67GO
68ALTER TABLE [dbo].[be_UserRoles] CHECK CONSTRAINT [FK_be_UserRoles_be_Users]
69GO
70INSERT INTO be_Users (UserName, Password, LastLoginTime, EmailAddress)
71	VALUES ('Admin', '', GETDATE(), 'email@example.com');
72INSERT INTO be_Roles (Role) 
73	VALUES ('Administrators');
74INSERT INTO be_Roles (Role) 
75	VALUES ('Editors');
76INSERT INTO be_UserRoles (UserID, RoleID)
77VALUES ( 1, 1);
78
79UPDATE be_DataStoreSettings 
80SET Settings =
81'<?xml version="1.0" encoding="utf-16"?>
82<WidgetData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
83  <Settings>&lt;widgets&gt;&lt;widget id="d9ada63d-3462-4c72-908e-9d35f0acce40" title="TextBox" showTitle="True"&gt;TextBox&lt;/widget&gt;&lt;widget id="19baa5f6-49d4-4828-8f7f-018535c35f94" title="Administration" showTitle="True"&gt;Administration&lt;/widget&gt;&lt;widget id="d81c5ae3-e57e-4374-a539-5cdee45e639f" title="Search" showTitle="True"&gt;Search&lt;/widget&gt;&lt;widget id="77142800-6dff-4016-99ca-69b5c5ebac93" title="Tag cloud" showTitle="True"&gt;Tag cloud&lt;/widget&gt;&lt;widget id="4ce68ae7-c0c8-4bf8-b50f-a67b582b0d2e" title="RecentPosts" showTitle="True"&gt;RecentPosts&lt;/widget&gt;&lt;/widgets&gt;</Settings>
84</WidgetData>'
85WHERE ExtensionId = 'be_WIDGET_ZONE'
86GO