PageRenderTime 35ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/setup/SQLServer/MSSQLUpgradeFrom2.5to2.6.sql

#
SQL | 167 lines | 110 code | 33 blank | 24 comment | 0 complexity | 951c8586447bbdd86aec2d3276f9756b MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  1. --
  2. -- dbo.be_Packages
  3. --
  4. CREATE TABLE [dbo].[be_Packages](
  5. [PackageId] [nvarchar](128) NOT NULL,
  6. [Version] [nvarchar](128) NOT NULL,
  7. CONSTRAINT [PK_be_Packages] PRIMARY KEY CLUSTERED
  8. (
  9. [PackageId] ASC
  10. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  11. ) ON [PRIMARY]
  12. GO
  13. --
  14. -- be_PackageFiles
  15. --
  16. CREATE TABLE [dbo].[be_PackageFiles](
  17. [PackageId] [nvarchar](128) NOT NULL,
  18. [FileOrder] [int] NOT NULL,
  19. [FilePath] [nvarchar](255) NOT NULL,
  20. [IsDirectory] [bit] NOT NULL,
  21. CONSTRAINT [PK_be_PackageFiles] PRIMARY KEY CLUSTERED
  22. (
  23. [PackageId] ASC,
  24. [FileOrder] ASC
  25. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  26. ) ON [PRIMARY]
  27. GO
  28. --
  29. -- be_QuickNotes
  30. --
  31. CREATE TABLE [dbo].[be_QuickNotes](
  32. [QuickNoteID] [int] IDENTITY(1,1) NOT NULL,
  33. [NoteID] [uniqueidentifier] NOT NULL,
  34. [BlogID] [uniqueidentifier] NOT NULL,
  35. [UserName] [nvarchar](100) NOT NULL,
  36. [Note] [nvarchar](max) NOT NULL,
  37. [Updated] [datetime] NULL,
  38. CONSTRAINT [PK_be_QuickNotes] PRIMARY KEY CLUSTERED
  39. (
  40. [QuickNoteID] 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] TEXTIMAGE_ON [PRIMARY]
  43. GO
  44. CREATE NONCLUSTERED INDEX [idx_be_NoteId_BlogId_UserName] ON [dbo].[be_QuickNotes]
  45. (
  46. [NoteID] ASC,
  47. [BlogID] ASC,
  48. [UserName] ASC
  49. )
  50. GO
  51. --
  52. -- be_QuickSettings
  53. --
  54. CREATE TABLE [dbo].[be_QuickSettings](
  55. [QuickSettingID] [int] IDENTITY(1,1) NOT NULL,
  56. [BlogID] [uniqueidentifier] NOT NULL,
  57. [UserName] [nvarchar](100) NOT NULL,
  58. [SettingName] [nvarchar](255) NOT NULL,
  59. [SettingValue] [nvarchar](255) NOT NULL,
  60. CONSTRAINT [PK_be_QuickSettings] PRIMARY KEY CLUSTERED
  61. (
  62. [QuickSettingID] ASC
  63. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  64. ) ON [PRIMARY]
  65. GO
  66. --
  67. -- be_FileStoreDirectory
  68. --
  69. CREATE TABLE [dbo].[be_FileStoreDirectory](
  70. [Id] [uniqueidentifier] NOT NULL,
  71. [ParentID] [uniqueidentifier] NULL,
  72. [BlogID] [uniqueidentifier] NOT NULL,
  73. [Name] [varchar](255) NOT NULL,
  74. [FullPath] [varchar](1000) NOT NULL,
  75. [CreateDate] [datetime] NOT NULL,
  76. [LastAccess] [datetime] NOT NULL,
  77. [LastModify] [datetime] NOT NULL,
  78. CONSTRAINT [PK_be_FileStoreDirectory] PRIMARY KEY CLUSTERED
  79. (
  80. [Id] ASC
  81. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  82. ) ON [PRIMARY]
  83. GO
  84. --
  85. -- be_FileStoreFiles
  86. --
  87. CREATE TABLE [dbo].[be_FileStoreFiles](
  88. [FileID] [uniqueidentifier] NOT NULL,
  89. [ParentDirectoryID] [uniqueidentifier] NOT NULL,
  90. [Name] [varchar](255) NOT NULL,
  91. [FullPath] [varchar](255) NOT NULL,
  92. [Contents] [varbinary](max) NOT NULL,
  93. [Size] [int] NOT NULL,
  94. [CreateDate] [datetime] NOT NULL,
  95. [LastAccess] [datetime] NOT NULL,
  96. [LastModify] [datetime] NOT NULL,
  97. CONSTRAINT [PK_be_FileStoreFiles] PRIMARY KEY CLUSTERED
  98. (
  99. [FileID] ASC
  100. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  101. ) ON [PRIMARY]
  102. GO
  103. ALTER TABLE [dbo].[be_FileStoreFiles] WITH CHECK ADD CONSTRAINT [FK_be_FileStoreFiles_be_FileStoreDirectory] FOREIGN KEY([ParentDirectoryID])
  104. REFERENCES [dbo].[be_FileStoreDirectory] ([Id])
  105. ON DELETE CASCADE
  106. GO
  107. ALTER TABLE [dbo].[be_FileStoreFiles] CHECK CONSTRAINT [FK_be_FileStoreFiles_be_FileStoreDirectory]
  108. GO
  109. --
  110. -- be_FileStoreFileThumbs
  111. --
  112. CREATE TABLE [dbo].[be_FileStoreFileThumbs](
  113. [thumbnailId] [uniqueidentifier] NOT NULL,
  114. [FileId] [uniqueidentifier] NOT NULL,
  115. [size] [int] NOT NULL,
  116. [contents] [varbinary](max) NOT NULL,
  117. CONSTRAINT [PK_be_FileStoreFileThumbs] PRIMARY KEY CLUSTERED
  118. (
  119. [thumbnailId] ASC
  120. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  121. ) ON [PRIMARY]
  122. GO
  123. ALTER TABLE [dbo].[be_FileStoreFileThumbs] WITH CHECK ADD CONSTRAINT [FK_be_FileStoreFileThumbs_be_FileStoreFiles] FOREIGN KEY([FileId])
  124. REFERENCES [dbo].[be_FileStoreFiles] ([FileID])
  125. ON DELETE CASCADE
  126. GO
  127. ALTER TABLE [dbo].[be_FileStoreFileThumbs] CHECK CONSTRAINT [FK_be_FileStoreFileThumbs_be_FileStoreFiles]
  128. GO
  129. --
  130. -- be_Blogs
  131. --
  132. ALTER TABLE dbo.be_Blogs ADD
  133. IsSiteAggregation bit NOT NULL CONSTRAINT DF_be_Blogs_IsSiteAggregation DEFAULT 0
  134. GO