Store archive metadata in a morango table

Đang mở
#376 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
78/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
django, python
Lĩnh vực
database

Hướng nghiên cứu

Read morango/models/core.py and the latest migration, morango/migrations/0005_self_ref_order.py, then inspect the existing model tests. Add coverage for creating and reading an ArchiveManifestEntry and verify the key primary-key behavior; run makemigrations --check and the full test suite to confirm the migration only adds the new table.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

DEV: backend DEV: distributions P0 - critical TAG: new feature

Overview

A new ArchiveManifestEntry model stores the metadata of an archive as key and value rows. This work is part of milestone M5 (archive feature).

Background & Motivation

An archive must describe itself: the morango version that wrote it, its instance identity, its capabilities, its profile, and its filter. A later import needs these facts to use the same capabilities as the writer. The archive is a Django-managed database, so the metadata table is a morango model with a migration.

In host databases, this table stays empty.

Design: spec. Plan: implementation plan, Task 15.

Description & Expected Outcomes

The model has two fields. key is the primary key, with a maximum length of 64. value is text that holds a JSON value. Migration 0006_archivemanifestentry adds the table and depends on 0005_self_ref_order.

Deliverables & Contracts

The change delivers these capabilities:

  • The ArchiveManifestEntry model in morango/models/core.py.
  • The migration morango/migrations/0006_archivemanifestentry.py.
Acceptance Criteria
  • A test creates and reads an entry, and key is the primary key.
  • tests/testapp/manage.py makemigrations --check passes.
  • The migration only adds a table.
  • The full test suite passes.

Technical Pointers & Architecture

  • Target Components / Context: morango/models/core.py, morango/migrations/.
  • Related Patterns: The latest migration is morango/migrations/0005_self_ref_order.py.
  • Data Model & Schema Considerations: This is a new table with no foreign keys. It is safe to add to existing databases.
  • Resilience & Failure Modes: None.

Notes & Tradeoffs

  • Dependencies: Blocked by: #375 (end of the refactor milestones). Blocks: #377.
  • Testing Requirements: A model test and the migration check.
  • Tradeoffs & Alternatives Considered: A table that only archives create stays outside the migration history. The spec rejects it because the archive version check depends on that history.
  • Compatibility & Migrations: Host databases get an empty table.

Metadata

  • Complexity: Low
  • Target Branch: release-v0.9.x

AI Usage

Drafted with Claude (Claude Code) from the approved design spec and implementation plan. The author reviewed the requirements, and the code references were checked against the release-v0.9.x codebase.

Ngôn ngữ chính
Python
Star
15
Fork
27
Merge trung bình
6 ngày 44 phút
Pull request đã merge (30 ngày)
13

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của learningequality/morango

Tất cả issue của learningequality/morango

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.