mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-06 07:47:53 +10:00
Restore CLI compat and plugin dependency handling
This commit is contained in:
@@ -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',
|
||||
),
|
||||
],
|
||||
),
|
||||
]
|
||||
|
||||
@@ -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={
|
||||
|
||||
Reference in New Issue
Block a user