增加 InitData.sql 文件负责初始化数据库,删除不用的数据库脚本

This commit is contained in:
Argo-Lenovo 2016-10-31 17:30:52 -07:00
parent 5931065434
commit 9f299d6d01
5 changed files with 9 additions and 54 deletions

View File

@ -7,6 +7,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bootstrap.DataAccess", "Boo
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sql", "sql", "{87319AF5-7C40-4362-B67C-35F9DD737DB4}"
ProjectSection(SolutionItems) = preProject
DatabaseScripts\InitData.sql = DatabaseScripts\InitData.sql
DatabaseScripts\Install.sql = DatabaseScripts\Install.sql
DatabaseScripts\Readme.txt = DatabaseScripts\Readme.txt
EndProjectSection

Binary file not shown.

View File

@ -1,14 +1,18 @@
USE [BootstrapAdmin]
GO
/* added by argo the default password is 123789 */
insert into Users (UserName, Password, PassSalt, DisplayName) values ('Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator')
GO
DELETE From Users where ID = 1
SET IDENTITY_INSERT [dbo].[Users] ON
insert into Users (ID, UserName, Password, PassSalt, DisplayName) values (1, 'Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator')
SET IDENTITY_INSERT [dbo].[Users] OFF
DELETE From Dicts where ID in (1, 2)
SET IDENTITY_INSERT [dbo].[Dicts] ON
INSERT [dbo].[Dicts] ([ID], [Category], [Name], [Code]) VALUES (1, N'菜单', N'系统菜单', '0')
INSERT [dbo].[Dicts] ([ID], [Category], [Name], [Code]) VALUES (2, N'菜单', N'外部菜单', '1')
SET IDENTITY_INSERT [dbo].[Dicts] OFF
DELETE FROM Navigations where ID in (1, 2, 3, 4, 5, 6, 7)
SET IDENTITY_INSERT [dbo].[Navigations] ON
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (1, 0, N'菜单管理', 10, N'fa fa-dashboard', N'~/Admin/Menus', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (2, 0, N'用户管理', 20, N'fa fa-user', N'~/Admin/Users', N'0')
@ -17,4 +21,4 @@ INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [C
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (5, 0, N'字典表维护', 50, N'fa fa-book', N'~/Admin/Dicts', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (6, 0, N'个性化维护', 60, N'fa fa-pencil', N'~/Admin/Profiles', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (7, 0, N'系统日志', 70, N'fa fa-gears', N'~/Admin/Logs', N'0')
SET IDENTITY_INSERT [dbo].[Navigations] OFF
SET IDENTITY_INSERT [dbo].[Navigations] OFF

View File

@ -1,26 +0,0 @@
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Argo Zhang
-- Create date: 2016-09-06
-- Description:
-- =============================================
CREATE PROCEDURE Proc_StartTerminal
-- Add the parameters for the stored procedure here
@tId int,
@rId int
WITH ENCRYPTION
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SET XACT_ABORT ON;
-- Insert statements for procedure here
delete from TerminalRuleConfig where TerminalID = @tId;
insert into TerminalRuleConfig (TerminalID, RuleID) values (@tId, @rId);
update Terminals set Status = 1 where Id = @tId;
END
GO

View File

@ -1,24 +0,0 @@
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Argo Zhang
-- Create date: 2016-09-06
-- Description:
-- =============================================
CREATE PROCEDURE Proc_StopTerminal
-- Add the parameters for the stored procedure here
@tId int
WITH ENCRYPTION
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SET XACT_ABORT ON;
-- Insert statements for procedure here
delete from TerminalRuleConfig where TerminalID = @tId;
update Terminals set Status = 0 where Id = @tId;
END
GO