diff --git a/Source/Data/MySQL/InitialDataSet.sql b/Source/Data/MySQL/InitialDataSet.sql index 025017f007..bca0b2b8ee 100755 --- a/Source/Data/MySQL/InitialDataSet.sql +++ b/Source/Data/MySQL/InitialDataSet.sql @@ -254,4 +254,6 @@ INSERT INTO AlarmState (State, Color) VALUES ('Bad Time', 'purple'); INSERT INTO AlarmState (State, Color) VALUES ('Out of Service', 'grey'); INSERT INTO AlarmState (State, Color) VALUES ('Acknowledged', 'rosybrown'); INSERT INTO Protocol(Acronym, Name, Type, Category, AssemblyName, TypeName, LoadOrder) VALUES('COMTRADE', 'COMTRADE Import', 'Measurement', 'Imported', 'TestingAdapters.dll', 'TestingAdapters.VirtualInputAdapter', 15); +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeCompressionSetting', 'CompressionSettings', 'Defines information about measurement compression settings', 19, 1); +INSERT INTO Protocol(Acronym, Name, Type, Category, AssemblyName, TypeName, LoadOrder) VALUES('COMTRADE', 'COMTRADE Import', 'Measurement', 'Imported', 'TestingAdapters.dll', 'TestingAdapters.VirtualInputAdapter', 15); INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeCompressionSetting', 'CompressionSettings', 'Defines information about measurement compression settings', 19, 1); \ No newline at end of file diff --git a/Source/Data/MySQL/openHistorian.sql b/Source/Data/MySQL/openHistorian.sql index e6f6c198ea..cb7d946216 100755 --- a/Source/Data/MySQL/openHistorian.sql +++ b/Source/Data/MySQL/openHistorian.sql @@ -1899,3 +1899,36 @@ CREATE TABLE EventMarker( Notes VARCHAR(max) NULL, CONSTRAINT FK_EventMarker_EventMarker FOREIGN KEY(ParentID) REFERENCES EventMarker (ID) ON DELETE CASCADE ON UPDATE CASCADE ); + +-- ******************************************************************************************* +-- IMPORTANT NOTE: When making updates to this schema, please increment the version number! +-- ******************************************************************************************* +CREATE VIEW LocalSchemaVersion AS +SELECT 1 AS VersionNumber; + +CREATE TABLE CompressionSetting( + PointID INT NOT NULL, + CompressionMinTime BIGINT NOT NULL DEFAULT 0, + CompressionMaxTime BIGINT NOT NULL DEFAULT 0, + CompressionLimit DOUBLE NOT NULL DEFAULT 0.0, + CONSTRAINT PK_CompressionSetting PRIMARY KEY (PointID ASC) +); + +CREATE VIEW NodeCompressionSetting AS +SELECT + Node.ID AS NodeID, + CompressionSetting.PointID, + CompressionSetting.CompressionMinTime, + CompressionSetting.CompressionMaxTime, + CompressionSetting.CompressionLimit +FROM CompressionSetting CROSS JOIN Node; + +CREATE TABLE EventMarker( + ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + ParentID INTEGER NULL, + Source VARCHAR(200) NULL, + StartTime DATETIME NULL, + StopTime DATETIME NULL, + Notes VARCHAR(max) NULL, + CONSTRAINT FK_EventMarker_EventMarker FOREIGN KEY(ParentID) REFERENCES EventMarker (ID) ON DELETE CASCADE ON UPDATE CASCADE +); diff --git a/Source/Data/Oracle/InitialDataSet.sql b/Source/Data/Oracle/InitialDataSet.sql index ca14af8fa1..726303bcf8 100755 --- a/Source/Data/Oracle/InitialDataSet.sql +++ b/Source/Data/Oracle/InitialDataSet.sql @@ -252,4 +252,6 @@ INSERT INTO AlarmState (State, Color) VALUES ('Bad Time', 'purple'); INSERT INTO AlarmState (State, Color) VALUES ('Out of Service', 'grey'); INSERT INTO AlarmState (State, Color) VALUES ('Acknowledged', 'rosybrown'); INSERT INTO Protocol(Acronym, Name, Type, Category, AssemblyName, TypeName, LoadOrder) VALUES('COMTRADE', 'COMTRADE Import', 'Measurement', 'Imported', 'TestingAdapters.dll', 'TestingAdapters.VirtualInputAdapter', 15); +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeCompressionSetting', 'CompressionSettings', 'Defines information about measurement compression settings', 19, 1); +INSERT INTO Protocol(Acronym, Name, Type, Category, AssemblyName, TypeName, LoadOrder) VALUES('COMTRADE', 'COMTRADE Import', 'Measurement', 'Imported', 'TestingAdapters.dll', 'TestingAdapters.VirtualInputAdapter', 15); INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeCompressionSetting', 'CompressionSettings', 'Defines information about measurement compression settings', 19, 1); \ No newline at end of file diff --git a/Source/Data/Oracle/openHistorian.sql b/Source/Data/Oracle/openHistorian.sql index c36b802257..8e03ab1283 100755 --- a/Source/Data/Oracle/openHistorian.sql +++ b/Source/Data/Oracle/openHistorian.sql @@ -2858,3 +2858,48 @@ CREATE TRIGGER AI_EventMarker BEFORE INSERT ON EventMarker FOR EACH ROW BEGIN SELECT SEQ_EventMarker.nextval INTO :NEW.ID FROM dual; END; + +-- ******************************************************************************************* +-- IMPORTANT NOTE: When making updates to this schema, please increment the version number! +-- ******************************************************************************************* +CREATE VIEW LocalSchemaVersion AS +SELECT 1 AS VersionNumber +FROM dual; + +CREATE TABLE CompressionSetting( + PointID NUMBER NOT NULL, + CompressionMinTime NUMBER(19, 0) DEFAULT 0 NOT NULL, + CompressionMaxTime NUMBER(19, 0) DEFAULT 0 NOT NULL, + CompressionLimit NUMBER(9, 6) DEFAULT 0.0 NOT NULL +); + +CREATE UNIQUE INDEX IX_CompressionSetting_PointID ON CompressionSetting (PointID ASC) TABLESPACE openHistorian_INDEX; + +CREATE VIEW NodeCompressionSetting AS +SELECT + Node.ID AS NodeID, + CompressionSetting.PointID, + CompressionSetting.CompressionMinTime, + CompressionSetting.CompressionMaxTime, + CompressionSetting.CompressionLimit +FROM CompressionSetting CROSS JOIN Node; + +CREATE TABLE EventMarker( + ID NUMBER NOT NULL, + ParentID Number NULL, + Source VARCHAR2(200) NULL, + StartTime DATE NULL, + StopTime DATE NULL, + Notes VARCHAR2(4000) NULL +); + +CREATE UNIQUE INDEX IX_EventMarker_ID ON EventMarker (ID ASC) TABLESPACE openHistorian_INDEX; + +ALTER TABLE EventMarker ADD CONSTRAINT PK_EventMarker PRIMARY KEY (ID); + +CREATE SEQUENCE SEQ_EventMarker START WITH 1 INCREMENT BY 1; + +CREATE TRIGGER AI_EventMarker BEFORE INSERT ON EventMarker + FOR EACH ROW BEGIN SELECT SEQ_EventMarker.nextval INTO :NEW.ID FROM dual; +END; + diff --git a/Source/Data/PostgreSQL/InitialDataSet.sql b/Source/Data/PostgreSQL/InitialDataSet.sql index de6456eb51..29bcce11f1 100644 --- a/Source/Data/PostgreSQL/InitialDataSet.sql +++ b/Source/Data/PostgreSQL/InitialDataSet.sql @@ -252,4 +252,6 @@ INSERT INTO AlarmState (State, Color) VALUES ('Bad Time', 'purple'); INSERT INTO AlarmState (State, Color) VALUES ('Out of Service', 'grey'); INSERT INTO AlarmState (State, Color) VALUES ('Acknowledged', 'rosybrown'); INSERT INTO Protocol(Acronym, Name, Type, Category, AssemblyName, TypeName, LoadOrder) VALUES('COMTRADE', 'COMTRADE Import', 'Measurement', 'Imported', 'TestingAdapters.dll', 'TestingAdapters.VirtualInputAdapter', 15); +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeCompressionSetting', 'CompressionSettings', 'Defines information about measurement compression settings', 19, 1); +INSERT INTO Protocol(Acronym, Name, Type, Category, AssemblyName, TypeName, LoadOrder) VALUES('COMTRADE', 'COMTRADE Import', 'Measurement', 'Imported', 'TestingAdapters.dll', 'TestingAdapters.VirtualInputAdapter', 15); INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeCompressionSetting', 'CompressionSettings', 'Defines information about measurement compression settings', 19, 1); \ No newline at end of file diff --git a/Source/Data/PostgreSQL/openHistorian.sql b/Source/Data/PostgreSQL/openHistorian.sql index 951050673f..a21e79c000 100644 --- a/Source/Data/PostgreSQL/openHistorian.sql +++ b/Source/Data/PostgreSQL/openHistorian.sql @@ -1928,3 +1928,35 @@ CREATE TABLE EventMarker( Notes VARCHAR(max) NULL, CONSTRAINT FK_EventMarker_EventMarker FOREIGN KEY(ParentID) REFERENCES EventMarker (ID) ON DELETE CASCADE ON UPDATE CASCADE ); + +-- ******************************************************************************************* +-- IMPORTANT NOTE: When making updates to this schema, please increment the version number! +-- ******************************************************************************************* +CREATE VIEW LocalSchemaVersion AS +SELECT 1 AS VersionNumber; + +CREATE TABLE CompressionSetting( + PointID INTEGER NOT NULL PRIMARY KEY, + CompressionMinTime BIGINT NOT NULL DEFAULT 0, + CompressionMaxTime BIGINT NOT NULL DEFAULT 0, + CompressionLimit DOUBLE PRECISION NOT NULL DEFAULT 0.0 +); + +CREATE VIEW NodeCompressionSetting AS +SELECT + Node.ID AS NodeID, + CompressionSetting.PointID, + CompressionSetting.CompressionMinTime, + CompressionSetting.CompressionMaxTime, + CompressionSetting.CompressionLimit +FROM CompressionSetting CROSS JOIN Node; + +CREATE TABLE EventMarker( + ID SERIAL NOT NULL PRIMARY KEY, + ParentID INTEGER NULL, + Source VARCHAR(200) NULL, + StartTime TIMESTAMP NULL, + StopTime TIMESTAMP NULL, + Notes VARCHAR(max) NULL, + CONSTRAINT FK_EventMarker_EventMarker FOREIGN KEY(ParentID) REFERENCES EventMarker (ID) ON DELETE CASCADE ON UPDATE CASCADE +); diff --git a/Source/Data/SQL Server/InitialDataSet.sql b/Source/Data/SQL Server/InitialDataSet.sql index c792cf518f..c2f0f2417d 100755 --- a/Source/Data/SQL Server/InitialDataSet.sql +++ b/Source/Data/SQL Server/InitialDataSet.sql @@ -759,5 +759,10 @@ GO INSERT INTO Protocol(Acronym, Name, Type, Category, AssemblyName, TypeName, LoadOrder) VALUES('COMTRADE', 'COMTRADE Import', 'Measurement', 'Imported', 'TestingAdapters.dll', 'TestingAdapters.VirtualInputAdapter', 15) GO +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeCompressionSetting', 'CompressionSettings', 'Defines information about measurement compression settings', 19, 1) +GO +INSERT INTO Protocol(Acronym, Name, Type, Category, AssemblyName, TypeName, LoadOrder) VALUES('COMTRADE', 'COMTRADE Import', 'Measurement', 'Imported', 'TestingAdapters.dll', 'TestingAdapters.VirtualInputAdapter', 15) +GO + INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeCompressionSetting', 'CompressionSettings', 'Defines information about measurement compression settings', 19, 1) GO \ No newline at end of file diff --git a/Source/Data/SQL Server/openHistorian.sql b/Source/Data/SQL Server/openHistorian.sql index d6a725ef4f..01d3daea27 100755 --- a/Source/Data/SQL Server/openHistorian.sql +++ b/Source/Data/SQL Server/openHistorian.sql @@ -3184,6 +3184,56 @@ FROM CompressionSetting CROSS JOIN Node GO +CREATE TABLE [dbo].[EventMarker]( + [ID] [int] IDENTITY(1,1) NOT NULL, + [ParentID] [int] NULL, + [Source] [varchar](200) NULL, + [StartTime] [datetime] NULL, + [StopTime] [datetime] NULL, + [Notes] [varchar](max) NULL, + CONSTRAINT [PK_EventMarker] PRIMARY KEY CLUSTERED + ( [ID] ASC ) WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] +) +ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +ALTER TABLE [dbo].[EventMarker] WITH CHECK ADD CONSTRAINT [FK_EventMarker_EventMarker] FOREIGN KEY([ParentID]) +REFERENCES [dbo].[EventMarker] ([ID]) +GO +-- ******************************************************************************************* +-- IMPORTANT NOTE: When making updates to this schema, please increment the version number! +-- ******************************************************************************************* +CREATE VIEW [dbo].[LocalSchemaVersion] AS +SELECT 1 AS VersionNumber +GO + +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +CREATE TABLE [dbo].[CompressionSetting]( + [PointID] [int] NOT NULL, + [CompressionMinTime] [bigint] NOT NULL DEFAULT ((0)), + [CompressionMaxTime] [bigint] NOT NULL DEFAULT ((0)), + [CompressionLimit] [float] NOT NULL DEFAULT ((0.0)), + CONSTRAINT [PK_CompressionSetting] PRIMARY KEY CLUSTERED +( + [PointID] ASC +)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] +) ON [PRIMARY] +GO + +CREATE VIEW NodeCompressionSetting AS +SELECT + Node.ID AS NodeID, + CompressionSetting.PointID, + CompressionSetting.CompressionMinTime, + CompressionSetting.CompressionMaxTime, + CompressionSetting.CompressionLimit +FROM CompressionSetting CROSS JOIN Node +GO + + CREATE TABLE [dbo].[EventMarker]( [ID] [int] IDENTITY(1,1) NOT NULL, [ParentID] [int] NULL, diff --git a/Source/Data/SQLite/InitialDataSet.sql b/Source/Data/SQLite/InitialDataSet.sql index f2a67c6f2f..f71286222a 100755 --- a/Source/Data/SQLite/InitialDataSet.sql +++ b/Source/Data/SQLite/InitialDataSet.sql @@ -255,3 +255,6 @@ INSERT INTO AlarmState (State, Color) VALUES ('Out of Service', 'grey'); INSERT INTO AlarmState (State, Color) VALUES ('Acknowledged', 'rosybrown'); INSERT INTO Protocol(Acronym, Name, Type, Category, AssemblyName, TypeName, LoadOrder) VALUES('COMTRADE', 'COMTRADE Import', 'Measurement', 'Imported', 'TestingAdapters.dll', 'TestingAdapters.VirtualInputAdapter', 15); INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeCompressionSetting', 'CompressionSettings', 'Defines information about measurement compression settings', 19, 1); + +INSERT INTO Protocol(Acronym, Name, Type, Category, AssemblyName, TypeName, LoadOrder) VALUES('COMTRADE', 'COMTRADE Import', 'Measurement', 'Imported', 'TestingAdapters.dll', 'TestingAdapters.VirtualInputAdapter', 15); +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeCompressionSetting', 'CompressionSettings', 'Defines information about measurement compression settings', 19, 1); diff --git a/Source/Data/SQLite/openHistorian-InitialDataSet.db b/Source/Data/SQLite/openHistorian-InitialDataSet.db index 5a404f84be..f851d01c77 100755 Binary files a/Source/Data/SQLite/openHistorian-InitialDataSet.db and b/Source/Data/SQLite/openHistorian-InitialDataSet.db differ diff --git a/Source/Data/SQLite/openHistorian-SampleDataSet.db b/Source/Data/SQLite/openHistorian-SampleDataSet.db index 026697ff10..8de5af8304 100755 Binary files a/Source/Data/SQLite/openHistorian-SampleDataSet.db and b/Source/Data/SQLite/openHistorian-SampleDataSet.db differ diff --git a/Source/Data/SQLite/openHistorian.db b/Source/Data/SQLite/openHistorian.db index 91491aef62..4e16b0b813 100755 Binary files a/Source/Data/SQLite/openHistorian.db and b/Source/Data/SQLite/openHistorian.db differ diff --git a/Source/Data/SQLite/openHistorian.sql b/Source/Data/SQLite/openHistorian.sql index a88af7815e..6e42004556 100755 --- a/Source/Data/SQLite/openHistorian.sql +++ b/Source/Data/SQLite/openHistorian.sql @@ -1763,6 +1763,27 @@ FROM AlarmDevice CREATE VIEW LocalSchemaVersion AS SELECT 1 AS VersionNumber; +CREATE TABLE CompressionSetting( + PointID INTEGER PRIMARY KEY NOT NULL, + CompressionMinTime INTEGER NOT NULL DEFAULT 0, + CompressionMaxTime INTEGER NOT NULL DEFAULT 0, + CompressionLimit REAL NOT NULL DEFAULT 0.0 + ); + +CREATE VIEW NodeCompressionSetting AS +SELECT + Node.ID AS NodeID, + CompressionSetting.PointID, + CompressionSetting.CompressionMinTime, + CompressionSetting.CompressionMaxTime, + CompressionSetting.CompressionLimit +FROM CompressionSetting CROSS JOIN Node; +-- ******************************************************************************************* +-- IMPORTANT NOTE: When making updates to this schema, please increment the version number! +-- ******************************************************************************************* +CREATE VIEW LocalSchemaVersion AS +SELECT 1 AS VersionNumber; + CREATE TABLE CompressionSetting( PointID INTEGER PRIMARY KEY NOT NULL, CompressionMinTime INTEGER NOT NULL DEFAULT 0, diff --git a/Source/Data/SerializedSchema.bin b/Source/Data/SerializedSchema.bin index 966cdba4ab..8155341f1f 100644 Binary files a/Source/Data/SerializedSchema.bin and b/Source/Data/SerializedSchema.bin differ