@@ -832,4 +832,43 @@ CREATE TABLE [snprc_ehr].[FeeScheduleSpeciesLookup] (
832832 CONSTRAINT [FK_FeeScheduleSpeciesLookup_container] FOREIGN KEY (Container) REFERENCES core .Containers (EntityId) );
833833GO
834834
835- ALTER TABLE snprc_ehr .package ADD pkgType NVARCHAR (1 ) not null default ' U' ;
835+ ALTER TABLE snprc_ehr .package ADD pkgType NVARCHAR (1 ) not null default ' U' ;
836+
837+ EXEC core .fn_dropifexists ' valid_birth_code' ,' snprc_ehr' , ' TABLE' ;
838+ EXEC core .fn_dropifexists ' valid_death_code' ,' snprc_ehr' , ' TABLE' ;
839+
840+ EXEC core .fn_dropifexists ' LocationTemperature' ,' snprc_ehr' , ' TABLE' ;
841+
842+ GO
843+ /* ************************************
844+ ObjectId should be populated before insert.
845+
846+
847+ srr 02.25.2019
848+ *************************************/
849+
850+ CREATE TABLE [snprc_ehr].[LocationTemperature](
851+ [Room] [varchar](100 ) NOT NULL ,
852+ [Date] [DATETIME] NOT NULL ,
853+ [LowTemperature] [NUMERIC](6 , 2 ) NULL ,
854+ [HighTemperature] [NUMERIC](6 , 2 ) NULL ,
855+ [Notify] [VARCHAR](18 ) NULL ,
856+ [ObjectId] UNIQUEIDENTIFIER NOT NULL DEFAULT NEWID (),
857+ [user_name] [VARCHAR](128 ) NOT NULL ,
858+ [entry_date_tm] [DATETIME] NOT NULL ,
859+ [Container] [entityID] NOT NULL ,
860+ [Created] DATETIME ,
861+ [CreatedBy] USERID,
862+ [Modified] DATETIME ,
863+ [ModifiedBy] USERID
864+
865+ CONSTRAINT [PK_LocationTemperature] PRIMARY KEY CLUSTERED ([Room] ASC ,[Date] ASC )
866+ CONSTRAINT FK_snprc_LocationTemperature_container FOREIGN KEY (Container) REFERENCES core .Containers (EntityId)
867+
868+ )
869+ GO
870+
871+
872+ CREATE UNIQUE INDEX idx_snprc_LocationTemperature_objectid ON snprc_ehr .LocationTemperature (ObjectId);
873+ CREATE UNIQUE INDEX idx_snprc_LocationTemperature_Room ON snprc_ehr .LocationTemperature (Room);
874+ GO
0 commit comments