This commit is contained in:
Nick Sweeting
2025-12-28 17:51:54 -08:00
parent 54f91c1339
commit f0aa19fa7d
157 changed files with 6774 additions and 5061 deletions

View File

@@ -192,7 +192,7 @@ class TestMigrationFrom08x(unittest.TestCase):
self.assertTrue(ok, msg)
def test_migration_removes_seed_id_column(self):
"""Migration should remove seed_id column from crawls_crawl."""
"""Migration should remove seed_id column from archivebox.crawls.crawl."""
result = run_archivebox(self.work_dir, ['init'], timeout=45)
self.assertEqual(result.returncode, 0, f"Init failed: {result.stderr}")
@@ -524,7 +524,7 @@ class TestFilesystemMigration08to09(unittest.TestCase):
try:
django.setup()
from core.models import Snapshot
from archivebox.core.models import Snapshot
# Load the snapshot (should trigger migration on save)
snapshot = Snapshot.objects.get(url='https://example.com')

View File

@@ -158,7 +158,7 @@ CREATE TABLE IF NOT EXISTS core_snapshot_tags (
CREATE TABLE IF NOT EXISTS core_archiveresult (
id INTEGER PRIMARY KEY AUTOINCREMENT,
snapshot_id CHAR(32) NOT NULL REFERENCES core_snapshot(id),
plugin VARCHAR(32) NOT NULL,
extractor VARCHAR(32) NOT NULL,
cmd TEXT,
pwd VARCHAR(256),
cmd_version VARCHAR(128),
@@ -379,7 +379,7 @@ CREATE TABLE IF NOT EXISTS crawls_seed (
created_by_id INTEGER NOT NULL REFERENCES auth_user(id),
modified_at DATETIME,
uri VARCHAR(2048) NOT NULL,
plugin VARCHAR(32) NOT NULL DEFAULT 'auto',
extractor VARCHAR(32) NOT NULL DEFAULT 'auto',
tags_str VARCHAR(255) NOT NULL DEFAULT '',
label VARCHAR(255) NOT NULL DEFAULT '',
config TEXT DEFAULT '{}',
@@ -465,7 +465,7 @@ CREATE TABLE IF NOT EXISTS core_archiveresult (
created_at DATETIME NOT NULL,
modified_at DATETIME,
snapshot_id CHAR(36) NOT NULL REFERENCES core_snapshot(id),
plugin VARCHAR(32) NOT NULL,
extractor VARCHAR(32) NOT NULL,
pwd VARCHAR(256),
cmd TEXT,
cmd_version VARCHAR(128),
@@ -951,10 +951,13 @@ def seed_0_8_data(db_path: Path) -> Dict[str, List[Dict]]:
('core', '0074_alter_snapshot_downloaded_at'),
('core', '0023_new_schema'),
('machine', '0001_initial'),
('machine', '0002_alter_machine_stats_installedbinary'),
('machine', '0003_alter_installedbinary_options_and_more'),
('machine', '0004_alter_installedbinary_abspath_and_more'),
('machine', '0001_squashed'),
('machine', '0002_alter_machine_stats_binary'),
('machine', '0003_alter_binary_options_and_more'),
('machine', '0004_alter_binary_abspath_and_more'),
('machine', '0002_rename_custom_cmds_to_overrides'),
('machine', '0003_alter_dependency_id_alter_installedbinary_dependency_and_more'),
('machine', '0004_drop_dependency_table'),
('core', '0024_snapshot_crawl'),
('core', '0025_allow_duplicate_urls_per_crawl'),
('api', '0001_initial'),
@@ -968,6 +971,10 @@ def seed_0_8_data(db_path: Path) -> Dict[str, List[Dict]]:
('api', '0008_alter_apitoken_created_alter_apitoken_created_by_and_more'),
('api', '0009_rename_created_apitoken_created_at_and_more'),
('crawls', '0001_initial'),
('crawls', '0002_drop_seed_model'),
('crawls', '0003_alter_crawl_output_dir'),
('crawls', '0004_alter_crawl_output_dir'),
('core', '0035_snapshot_crawl_non_nullable_remove_created_by'),
]
for app, name in migrations: