Restore CLI compat and plugin dependency handling

This commit is contained in:
Nick Sweeting
2026-03-15 06:06:18 -07:00
parent 6b482c62df
commit 1f792d7199
19 changed files with 302 additions and 92 deletions

View File

@@ -1,8 +1,18 @@
# Generated by Django 6.0 on 2026-01-05 01:09
from django.db import migrations
def remove_output_dir_if_exists(apps, schema_editor):
cursor = schema_editor.connection.cursor()
cursor.execute("PRAGMA table_info(machine_binary)")
columns = {row[1] for row in cursor.fetchall()}
if 'output_dir' not in columns:
return
Binary = apps.get_model('machine', 'Binary')
schema_editor.remove_field(Binary, Binary._meta.get_field('output_dir'))
class Migration(migrations.Migration):
dependencies = [
@@ -10,8 +20,15 @@ class Migration(migrations.Migration):
]
operations = [
migrations.RemoveField(
model_name='binary',
name='output_dir',
migrations.SeparateDatabaseAndState(
database_operations=[
migrations.RunPython(remove_output_dir_if_exists, migrations.RunPython.noop),
],
state_operations=[
migrations.RemoveField(
model_name='binary',
name='output_dir',
),
],
),
]

View File

@@ -352,7 +352,7 @@ class Binary(ModelWithHealthStats, ModelWithStateMachine):
# Case 2: From binaries.json - create queued binary (needs installation)
if 'binproviders' in record or ('overrides' in record and not abspath):
binary, created = Binary.objects.get_or_create(
binary, _ = Binary.objects.update_or_create(
machine=machine,
name=name,
defaults={