Skip to content

DBO model conversion tweaks - #1458

Open
grafnu wants to merge 15 commits into
faucetsdn:masterfrom
grafnu:dbomodel
Open

grafnu wants to merge 15 commits into
faucetsdn:masterfrom
grafnu:dbomodel

Conversation

@grafnu

@grafnu grafnu commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread bin/dbo_merge

# Externals
externals = metadata.setdefault("externals", {})
dbo = externals.setdefault("dbo", {})

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're migrating guid to system.guid and no longer writing externals.dbo.ext_id, should we also add dbo.pop("ext_id", None) here so existing site models that already have ext_id under externals.dbo get cleaned up when dbo_merge runs?


Comment added by Gemini

Comment thread bin/dbo_extract
target_guid = device_id_to_guid.get(target_id, target_id)
if isinstance(relation, dict) and relation:
# Match string enum format expected by schema
rel_type = list(relation.keys())[0]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In bin/dbo_merge, dbo.connections[target_name] is stored as a list of relationship types so a device can have multiple connection types to the same target. Here in dbo_extract, list(relation.keys())[0] only extracts the first relationship type and drops any others—should we iterate over the list of relationship types (when isinstance(relation, list)) so round-tripping through dbo_extract preserves all connections?


Comment added by Gemini

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants