We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c4eca25 + 60dfa7b commit 3235059Copy full SHA for 3235059
src/main.py
@@ -152,8 +152,9 @@ def build_database(args):
152
for trigger in triggers:
153
session.execute(trigger)
154
existing_platforms = session.scalars(select(Platform)).all()
155
- if not any(existing_platforms):
156
- session.add_all([Platform(name=name) for name in PlatformName])
+ missing_platforms = set(PlatformName) - {p.name for p in existing_platforms}
+ if any(missing_platforms):
157
+ session.add_all([Platform(name=name) for name in missing_platforms])
158
session.commit()
159
160
0 commit comments