005.Shutdown process tables

master
Tudor Stanciu 2022-01-13 14:17:37 +02:00
parent 4be57b3ae3
commit 43dddcf59f
1 changed files with 32 additions and 0 deletions

View File

@ -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