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:
@@ -697,13 +697,8 @@
|
||||
var attrs = await TemplateEngineRepository.GetAttributesByTemplateIdAsync(inst.TemplateId);
|
||||
_bindingDataSourceAttrs = attrs.Where(a => !string.IsNullOrEmpty(a.DataSourceReference)).ToList();
|
||||
|
||||
// Load data connections for this site
|
||||
// Load data connections for this site (each connection now belongs to exactly one site)
|
||||
_siteConnections = (await SiteRepository.GetDataConnectionsBySiteIdAsync(inst.SiteId)).ToList();
|
||||
if (_siteConnections.Count == 0)
|
||||
{
|
||||
// Also show unassigned connections (they may not be assigned to a site yet)
|
||||
_siteConnections = (await SiteRepository.GetAllDataConnectionsAsync()).ToList();
|
||||
}
|
||||
|
||||
// Load existing bindings
|
||||
var existingBindings = await TemplateEngineRepository.GetBindingsByInstanceIdAsync(inst.Id);
|
||||
|
||||
Reference in New Issue
Block a user