From 43dddcf59fa7ed29fb35d95bef749b1c62b16266 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Thu, 13 Jan 2022 14:17:37 +0200 Subject: [PATCH] 005.Shutdown process tables --- .../Scripts/005.Shutdown process tables.sql | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/api/NetworkResurrector.Api.Domain.Data/Scripts/005.Shutdown process tables.sql diff --git a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/005.Shutdown process tables.sql b/src/api/NetworkResurrector.Api.Domain.Data/Scripts/005.Shutdown process tables.sql new file mode 100644 index 0000000..adfc47b --- /dev/null +++ b/src/api/NetworkResurrector.Api.Domain.Data/Scripts/005.Shutdown process tables.sql @@ -0,0 +1,32 @@ +if not exists (select top 1 1 from sys.objects where name = 'ShutdownType' and type = 'U') +begin + create table ShutdownType + ( + ShutdownTypeId int identity(1, 1) constraint PK_ShutdownType primary key, + ShutdownTypeCode varchar(50), + ShutdownTypeName varchar(130) + ) +end +go + +if not exists (select top 1 1 from ShutdownType) +begin + insert into ShutdownType (ShutdownTypeCode, ShutdownTypeName) + select 'NETWORK_RESURRECTOR_SERVER', 'Network resurrector server' union + select 'NETWORK_RESURRECTOR_AGENT', 'Network resurrector agent' +end + +if not exists (select top 1 1 from sys.objects where name = 'ShutdownConfiguration' and type = 'U') +begin + create table ShutdownConfiguration + ( + ConfigurationId int identity(1, 1) constraint PK_ShutdownConfiguration primary key, + MachineId int constraint FK_ShutdownConfiguration_Machine foreign key references Machine(MachineId), + ShutdownTypeId int constraint FK_ShutdownConfiguration_ShutdownType foreign key references ShutdownType(ShutdownTypeId), + AgentPort int, + [Default] bit, + [Disabled] bit constraint DF_ShutdownConfiguration_Disabled default 0, + [Description] varchar(2000) + ) +end +go \ No newline at end of file