refactor: rename ScadaLink → ZB.MOM.WW.ScadaBridge (code + projects + namespaces)
Solution + 23 src projects + 26 test projects renamed; folders, csproj, namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated. ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated. SQL roles/logins, LDAP domains, CLI command name, and CLI config dir (~/.scadalink → ~/.scadabridge) also renamed. Build green; 5 Host.Tests fail awaiting SQL login rename in next commit. Pre-existing StaleTagMonitor timing flakes unchanged. Rename script committed at tools/rename-to-scadabridge.sh.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
-- ScadaLink Machine Data Database seed script
|
||||
-- Populates ScadaLinkMachineData with realistic SCADA/MES tables,
|
||||
-- ScadaBridge Machine Data Database seed script
|
||||
-- Populates ScadaBridgeMachineData with realistic SCADA/MES tables,
|
||||
-- sample data, and stored procedures for development and testing.
|
||||
--
|
||||
-- Run after setup.sql:
|
||||
-- docker exec -i scadalink-mssql /opt/mssql-tools18/bin/sqlcmd \
|
||||
-- -S localhost -U sa -P 'ScadaLink_Dev1#' -C \
|
||||
-- docker exec -i scadabridge-mssql /opt/mssql-tools18/bin/sqlcmd \
|
||||
-- -S localhost -U sa -P 'ScadaBridge_Dev1#' -C \
|
||||
-- -i /docker-entrypoint-initdb.d/machinedata_seed.sql
|
||||
|
||||
USE ScadaLinkMachineData;
|
||||
USE ScadaBridgeMachineData;
|
||||
GO
|
||||
|
||||
-- =========================================================================
|
||||
@@ -324,7 +324,7 @@ INSERT INTO dbo.AlarmHistory (SiteId, AlarmName, Severity, State, ActivatedAt, A
|
||||
('SiteB', 'Mixer-001 Vibration', 2, 'Active', DATEADD(HOUR, -2, @now), NULL, NULL, NULL, 'Vibration level elevated');
|
||||
GO
|
||||
|
||||
PRINT 'ScadaLinkMachineData seed complete.';
|
||||
PRINT 'ScadaBridgeMachineData seed complete.';
|
||||
PRINT 'Tables: TagHistory, ProductionCounts, EquipmentEvents, BatchRecords, AlarmHistory';
|
||||
PRINT 'Stored Procedures: usp_GetTagHistory, usp_GetProductionSummary, usp_InsertBatchRecord, usp_CompleteBatch, usp_GetEquipmentEvents, usp_GetActiveAlarms';
|
||||
GO
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- ScadaLink design-data seed.
|
||||
-- Auto-generated by infra/tools/dump_seed.py against ScadaLinkConfig.
|
||||
-- ScadaBridge design-data seed.
|
||||
-- Auto-generated by infra/tools/dump_seed.py against ScadaBridgeConfig.
|
||||
-- Replays the design-time configuration (templates, scripts,
|
||||
-- data connections, external systems). Idempotent: deletes
|
||||
-- existing rows in the covered tables before inserting.
|
||||
@@ -177,15 +177,15 @@ SET IDENTITY_INSERT [SharedScripts] OFF;
|
||||
|
||||
-- DataConnections (3 rows)
|
||||
SET IDENTITY_INSERT [DataConnections] ON;
|
||||
INSERT INTO [DataConnections] ([Id], [Name], [Protocol], [PrimaryConfiguration], [SiteId], [BackupConfiguration], [FailoverRetryCount]) VALUES (1, N'OPC PLC Simulator', N'OpcUa', N'{"endpointUrl":"opc.tcp://scadalink-opcua:50000","securityMode":"none","autoAcceptUntrustedCerts":true,"sessionTimeoutMs":60000,"operationTimeoutMs":15000,"publishingIntervalMs":1000,"samplingIntervalMs":1000,"queueSize":10,"keepAliveCount":10,"lifetimeCount":30,"maxNotificationsPerPublish":100,"discardOldest":true,"subscriptionPriority":0,"subscriptionDisplayName":"ScadaLink","timestampsToReturn":"source","deadband":null,"userIdentity":null,"heartbeat":null}', 1, NULL, 3);
|
||||
INSERT INTO [DataConnections] ([Id], [Name], [Protocol], [PrimaryConfiguration], [SiteId], [BackupConfiguration], [FailoverRetryCount]) VALUES (3014, N'OPC PLC Simulator', N'OpcUa', N'{"endpoint":"opc.tcp://scadalink-opcua:50000","securityMode":"None","publishInterval":1000}', 2, NULL, 3);
|
||||
INSERT INTO [DataConnections] ([Id], [Name], [Protocol], [PrimaryConfiguration], [SiteId], [BackupConfiguration], [FailoverRetryCount]) VALUES (3015, N'OPC PLC Simulator', N'OpcUa', N'{"endpoint":"opc.tcp://scadalink-opcua:50000","securityMode":"None","publishInterval":1000}', 3, NULL, 3);
|
||||
INSERT INTO [DataConnections] ([Id], [Name], [Protocol], [PrimaryConfiguration], [SiteId], [BackupConfiguration], [FailoverRetryCount]) VALUES (1, N'OPC PLC Simulator', N'OpcUa', N'{"endpointUrl":"opc.tcp://scadabridge-opcua:50000","securityMode":"none","autoAcceptUntrustedCerts":true,"sessionTimeoutMs":60000,"operationTimeoutMs":15000,"publishingIntervalMs":1000,"samplingIntervalMs":1000,"queueSize":10,"keepAliveCount":10,"lifetimeCount":30,"maxNotificationsPerPublish":100,"discardOldest":true,"subscriptionPriority":0,"subscriptionDisplayName":"ScadaBridge","timestampsToReturn":"source","deadband":null,"userIdentity":null,"heartbeat":null}', 1, NULL, 3);
|
||||
INSERT INTO [DataConnections] ([Id], [Name], [Protocol], [PrimaryConfiguration], [SiteId], [BackupConfiguration], [FailoverRetryCount]) VALUES (3014, N'OPC PLC Simulator', N'OpcUa', N'{"endpoint":"opc.tcp://scadabridge-opcua:50000","securityMode":"None","publishInterval":1000}', 2, NULL, 3);
|
||||
INSERT INTO [DataConnections] ([Id], [Name], [Protocol], [PrimaryConfiguration], [SiteId], [BackupConfiguration], [FailoverRetryCount]) VALUES (3015, N'OPC PLC Simulator', N'OpcUa', N'{"endpoint":"opc.tcp://scadabridge-opcua:50000","securityMode":"None","publishInterval":1000}', 3, NULL, 3);
|
||||
SET IDENTITY_INSERT [DataConnections] OFF;
|
||||
|
||||
-- ExternalSystemDefinitions (1 rows)
|
||||
-- NOTE: [AuthConfiguration] is an encrypted secret column — dumped as NULL. Restore via the app (CLI/API) post-seed.
|
||||
SET IDENTITY_INSERT [ExternalSystemDefinitions] ON;
|
||||
INSERT INTO [ExternalSystemDefinitions] ([Id], [Name], [EndpointUrl], [AuthType], [AuthConfiguration], [MaxRetries], [RetryDelay]) VALUES (1, N'Test REST API', N'http://scadalink-restapi:5200', N'ApiKey', NULL, 0, '00:00:00.000000');
|
||||
INSERT INTO [ExternalSystemDefinitions] ([Id], [Name], [EndpointUrl], [AuthType], [AuthConfiguration], [MaxRetries], [RetryDelay]) VALUES (1, N'Test REST API', N'http://scadabridge-restapi:5200', N'ApiKey', NULL, 0, '00:00:00.000000');
|
||||
SET IDENTITY_INSERT [ExternalSystemDefinitions] OFF;
|
||||
|
||||
-- ExternalSystemMethods (1 rows)
|
||||
|
||||
+17
-17
@@ -1,31 +1,31 @@
|
||||
-- ScadaLink env2 database setup
|
||||
-- Creates env2 logical databases on an existing scadalink-mssql instance.
|
||||
-- ScadaBridge env2 database setup
|
||||
-- Creates env2 logical databases on an existing scadabridge-mssql instance.
|
||||
-- Idempotent: re-runs are no-ops. Assumes setup.sql has already run
|
||||
-- (i.e. the scadalink_app login already exists).
|
||||
-- (i.e. the scadabridge_app login already exists).
|
||||
|
||||
-- Create env2 databases
|
||||
IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = 'ScadaLinkConfig2')
|
||||
CREATE DATABASE ScadaLinkConfig2;
|
||||
IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = 'ScadaBridgeConfig2')
|
||||
CREATE DATABASE ScadaBridgeConfig2;
|
||||
GO
|
||||
|
||||
IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = 'ScadaLinkMachineData2')
|
||||
CREATE DATABASE ScadaLinkMachineData2;
|
||||
IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = 'ScadaBridgeMachineData2')
|
||||
CREATE DATABASE ScadaBridgeMachineData2;
|
||||
GO
|
||||
|
||||
-- Grant db_owner on ScadaLinkConfig2
|
||||
USE ScadaLinkConfig2;
|
||||
-- Grant db_owner on ScadaBridgeConfig2
|
||||
USE ScadaBridgeConfig2;
|
||||
GO
|
||||
IF NOT EXISTS (SELECT name FROM sys.database_principals WHERE name = 'scadalink_app')
|
||||
CREATE USER scadalink_app FOR LOGIN scadalink_app;
|
||||
IF NOT EXISTS (SELECT name FROM sys.database_principals WHERE name = 'scadabridge_app')
|
||||
CREATE USER scadabridge_app FOR LOGIN scadabridge_app;
|
||||
GO
|
||||
ALTER ROLE db_owner ADD MEMBER scadalink_app;
|
||||
ALTER ROLE db_owner ADD MEMBER scadabridge_app;
|
||||
GO
|
||||
|
||||
-- Grant db_owner on ScadaLinkMachineData2
|
||||
USE ScadaLinkMachineData2;
|
||||
-- Grant db_owner on ScadaBridgeMachineData2
|
||||
USE ScadaBridgeMachineData2;
|
||||
GO
|
||||
IF NOT EXISTS (SELECT name FROM sys.database_principals WHERE name = 'scadalink_app')
|
||||
CREATE USER scadalink_app FOR LOGIN scadalink_app;
|
||||
IF NOT EXISTS (SELECT name FROM sys.database_principals WHERE name = 'scadabridge_app')
|
||||
CREATE USER scadabridge_app FOR LOGIN scadabridge_app;
|
||||
GO
|
||||
ALTER ROLE db_owner ADD MEMBER scadalink_app;
|
||||
ALTER ROLE db_owner ADD MEMBER scadabridge_app;
|
||||
GO
|
||||
|
||||
+17
-17
@@ -1,36 +1,36 @@
|
||||
-- ScadaLink development database setup
|
||||
-- ScadaBridge development database setup
|
||||
-- Run against a fresh MS SQL 2022 instance.
|
||||
-- EF Core migrations handle schema creation; this script only creates
|
||||
-- the empty databases and the application login/user.
|
||||
|
||||
-- Create databases
|
||||
IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = 'ScadaLinkConfig')
|
||||
CREATE DATABASE ScadaLinkConfig;
|
||||
IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = 'ScadaBridgeConfig')
|
||||
CREATE DATABASE ScadaBridgeConfig;
|
||||
GO
|
||||
|
||||
IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = 'ScadaLinkMachineData')
|
||||
CREATE DATABASE ScadaLinkMachineData;
|
||||
IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = 'ScadaBridgeMachineData')
|
||||
CREATE DATABASE ScadaBridgeMachineData;
|
||||
GO
|
||||
|
||||
-- Create application login
|
||||
IF NOT EXISTS (SELECT name FROM sys.server_principals WHERE name = 'scadalink_app')
|
||||
CREATE LOGIN scadalink_app WITH PASSWORD = 'ScadaLink_Dev1#', DEFAULT_DATABASE = ScadaLinkConfig;
|
||||
IF NOT EXISTS (SELECT name FROM sys.server_principals WHERE name = 'scadabridge_app')
|
||||
CREATE LOGIN scadabridge_app WITH PASSWORD = 'ScadaBridge_Dev1#', DEFAULT_DATABASE = ScadaBridgeConfig;
|
||||
GO
|
||||
|
||||
-- Grant db_owner on ScadaLinkConfig
|
||||
USE ScadaLinkConfig;
|
||||
-- Grant db_owner on ScadaBridgeConfig
|
||||
USE ScadaBridgeConfig;
|
||||
GO
|
||||
IF NOT EXISTS (SELECT name FROM sys.database_principals WHERE name = 'scadalink_app')
|
||||
CREATE USER scadalink_app FOR LOGIN scadalink_app;
|
||||
IF NOT EXISTS (SELECT name FROM sys.database_principals WHERE name = 'scadabridge_app')
|
||||
CREATE USER scadabridge_app FOR LOGIN scadabridge_app;
|
||||
GO
|
||||
ALTER ROLE db_owner ADD MEMBER scadalink_app;
|
||||
ALTER ROLE db_owner ADD MEMBER scadabridge_app;
|
||||
GO
|
||||
|
||||
-- Grant db_owner on ScadaLinkMachineData
|
||||
USE ScadaLinkMachineData;
|
||||
-- Grant db_owner on ScadaBridgeMachineData
|
||||
USE ScadaBridgeMachineData;
|
||||
GO
|
||||
IF NOT EXISTS (SELECT name FROM sys.database_principals WHERE name = 'scadalink_app')
|
||||
CREATE USER scadalink_app FOR LOGIN scadalink_app;
|
||||
IF NOT EXISTS (SELECT name FROM sys.database_principals WHERE name = 'scadabridge_app')
|
||||
CREATE USER scadabridge_app FOR LOGIN scadabridge_app;
|
||||
GO
|
||||
ALTER ROLE db_owner ADD MEMBER scadalink_app;
|
||||
ALTER ROLE db_owner ADD MEMBER scadabridge_app;
|
||||
GO
|
||||
|
||||
Reference in New Issue
Block a user