2016-10-20 17:55:29 +08:00
|
|
|
|
USE [master]
|
|
|
|
|
GO
|
|
|
|
|
|
2016-10-22 20:55:07 +08:00
|
|
|
|
Create database [BootstrapAdmin]
|
2016-10-20 17:55:29 +08:00
|
|
|
|
GO
|
|
|
|
|
|
2016-10-22 20:55:07 +08:00
|
|
|
|
ALTER DATABASE [BootstrapAdmin] SET RECOVERY SIMPLE
|
2016-10-20 17:55:29 +08:00
|
|
|
|
GO
|
|
|
|
|
|
2016-10-22 20:55:07 +08:00
|
|
|
|
ALTER DATABASE [BootstrapAdmin] SET AUTO_SHRINK ON
|
2016-10-20 17:55:29 +08:00
|
|
|
|
GO
|
|
|
|
|
|
2016-10-22 20:55:07 +08:00
|
|
|
|
USE [BootstrapAdmin]
|
2016-10-20 17:55:29 +08:00
|
|
|
|
GO
|
|
|
|
|
|
2016-10-22 20:55:07 +08:00
|
|
|
|
/****** Object: Table [dbo].[Users] Script Date: 10/22/2016 09:44:03 ******/
|
2016-10-20 17:55:29 +08:00
|
|
|
|
SET ANSI_NULLS ON
|
|
|
|
|
GO
|
|
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
CREATE TABLE [dbo].[Users](
|
2016-10-20 17:55:29 +08:00
|
|
|
|
[ID] [int] IDENTITY(1,1) NOT NULL,
|
2016-10-22 20:55:07 +08:00
|
|
|
|
[UserName] [nvarchar](50) NULL,
|
|
|
|
|
[Password] [nvarchar](50) NULL,
|
|
|
|
|
[PassSalt] [nvarchar](50) NULL,
|
|
|
|
|
CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
|
2016-10-20 17:55:29 +08:00
|
|
|
|
(
|
|
|
|
|
[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]
|
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Users', @level2type=N'COLUMN',@level2name=N'ID'
|
2016-10-20 17:55:29 +08:00
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Users', @level2type=N'COLUMN',@level2name=N'UserName'
|
|
|
|
|
GO
|
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Users', @level2type=N'COLUMN',@level2name=N'Password'
|
|
|
|
|
GO
|
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD>֤' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Users', @level2type=N'COLUMN',@level2name=N'PassSalt'
|
|
|
|
|
GO
|
|
|
|
|
/****** Object: Table [dbo].[UserRole] Script Date: 10/22/2016 09:44:03 ******/
|
2016-10-20 17:55:29 +08:00
|
|
|
|
SET ANSI_NULLS ON
|
|
|
|
|
GO
|
|
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
CREATE TABLE [dbo].[UserRole](
|
|
|
|
|
[ID] [int] IDENTITY(1,1) NOT NULL,
|
|
|
|
|
[UserID] [int] NOT NULL,
|
|
|
|
|
[RoleID] [int] NOT NULL,
|
|
|
|
|
CONSTRAINT [PK_UserRole] 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]
|
2016-10-20 17:55:29 +08:00
|
|
|
|
) ON [PRIMARY]
|
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserRole', @level2type=N'COLUMN',@level2name=N'ID'
|
|
|
|
|
GO
|
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD>û<EFBFBD>ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserRole', @level2type=N'COLUMN',@level2name=N'UserID'
|
|
|
|
|
GO
|
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD>ɫID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserRole', @level2type=N'COLUMN',@level2name=N'RoleID'
|
|
|
|
|
GO
|
|
|
|
|
/****** Object: Table [dbo].[UserGroup] Script Date: 10/22/2016 09:44:03 ******/
|
2016-10-20 17:55:29 +08:00
|
|
|
|
SET ANSI_NULLS ON
|
|
|
|
|
GO
|
|
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
CREATE TABLE [dbo].[UserGroup](
|
2016-10-20 17:55:29 +08:00
|
|
|
|
[ID] [int] IDENTITY(1,1) NOT NULL,
|
2016-10-22 20:55:07 +08:00
|
|
|
|
[UserID] [int] NOT NULL,
|
|
|
|
|
[GroupID] [int] NOT NULL,
|
|
|
|
|
CONSTRAINT [PK_UserGroup] PRIMARY KEY CLUSTERED
|
2016-10-20 17:55:29 +08:00
|
|
|
|
(
|
|
|
|
|
[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]
|
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserGroup', @level2type=N'COLUMN',@level2name=N'ID'
|
|
|
|
|
GO
|
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD>û<EFBFBD>ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserGroup', @level2type=N'COLUMN',@level2name=N'UserID'
|
2016-10-20 17:55:29 +08:00
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserGroup', @level2type=N'COLUMN',@level2name=N'GroupID'
|
|
|
|
|
GO
|
|
|
|
|
/****** Object: Table [dbo].[Roles] Script Date: 10/22/2016 09:44:03 ******/
|
2016-10-20 17:55:29 +08:00
|
|
|
|
SET ANSI_NULLS ON
|
|
|
|
|
GO
|
|
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
CREATE TABLE [dbo].[Roles](
|
2016-10-20 17:55:29 +08:00
|
|
|
|
[ID] [int] IDENTITY(1,1) NOT NULL,
|
2016-10-22 20:55:07 +08:00
|
|
|
|
[RoleName] [nvarchar](50) NULL,
|
|
|
|
|
[Description] [nvarchar](500) NULL,
|
|
|
|
|
CONSTRAINT [PK_Roles] PRIMARY KEY CLUSTERED
|
2016-10-20 17:55:29 +08:00
|
|
|
|
(
|
|
|
|
|
[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]
|
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Roles', @level2type=N'COLUMN',@level2name=N'ID'
|
2016-10-20 17:55:29 +08:00
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD>ɫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Roles', @level2type=N'COLUMN',@level2name=N'RoleName'
|
2016-10-20 17:55:29 +08:00
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Roles', @level2type=N'COLUMN',@level2name=N'Description'
|
|
|
|
|
GO
|
|
|
|
|
/****** Object: Table [dbo].[RoleGroup] Script Date: 10/22/2016 09:44:03 ******/
|
2016-10-20 17:55:29 +08:00
|
|
|
|
SET ANSI_NULLS ON
|
|
|
|
|
GO
|
|
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
CREATE TABLE [dbo].[RoleGroup](
|
|
|
|
|
[ID] [int] IDENTITY(1,1) NOT NULL,
|
|
|
|
|
[RoleID] [int] NOT NULL,
|
|
|
|
|
[GroupID] [int] NOT NULL,
|
|
|
|
|
CONSTRAINT [PK_RoleGroup] 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]
|
|
|
|
|
GO
|
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'RoleGroup', @level2type=N'COLUMN',@level2name=N'ID'
|
2016-10-20 17:55:29 +08:00
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD>ɫID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'RoleGroup', @level2type=N'COLUMN',@level2name=N'RoleID'
|
|
|
|
|
GO
|
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'RoleGroup', @level2type=N'COLUMN',@level2name=N'GroupID'
|
|
|
|
|
GO
|
|
|
|
|
/****** Object: Table [dbo].[Groups] Script Date: 10/22/2016 09:44:03 ******/
|
2016-10-20 17:55:29 +08:00
|
|
|
|
SET ANSI_NULLS ON
|
|
|
|
|
GO
|
|
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
|
|
GO
|
2016-10-22 20:55:07 +08:00
|
|
|
|
CREATE TABLE [dbo].[Groups](
|
|
|
|
|
[ID] [int] IDENTITY(1,1) NOT NULL,
|
|
|
|
|
[GroupName] [nvarchar](50) NULL,
|
|
|
|
|
[Description] [nvarchar](500) NULL,
|
|
|
|
|
CONSTRAINT [PK_Groups] 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]
|
|
|
|
|
GO
|
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Groups', @level2type=N'COLUMN',@level2name=N'ID'
|
|
|
|
|
GO
|
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Groups', @level2type=N'COLUMN',@level2name=N'GroupName'
|
|
|
|
|
GO
|
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Groups', @level2type=N'COLUMN',@level2name=N'Description'
|
2016-10-20 17:55:29 +08:00
|
|
|
|
GO
|