refactor: simplify data connections from many-to-many site assignment to direct site ownership
Replace SiteDataConnectionAssignment join table with a direct SiteId FK on DataConnection, simplifying the data model, repositories, UI, CLI, and deployment service.
This commit is contained in:
@@ -3,13 +3,15 @@ namespace ScadaLink.Commons.Entities.Sites;
|
||||
public class DataConnection
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int SiteId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Protocol { get; set; }
|
||||
public string? Configuration { get; set; }
|
||||
|
||||
public DataConnection(string name, string protocol)
|
||||
public DataConnection(string name, string protocol, int siteId)
|
||||
{
|
||||
Name = name ?? throw new ArgumentNullException(nameof(name));
|
||||
Protocol = protocol ?? throw new ArgumentNullException(nameof(protocol));
|
||||
SiteId = siteId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace ScadaLink.Commons.Entities.Sites;
|
||||
|
||||
public class SiteDataConnectionAssignment
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int SiteId { get; set; }
|
||||
public int DataConnectionId { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user