Add Inter-Hub migration bundle importer
This commit is contained in:
parent
a1fc57b278
commit
e4f7cfed60
12 changed files with 861 additions and 5 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import DateTime, ForeignKey, Integer, String, Text, func
|
||||
from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, String, Text, func
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from .db import Base
|
||||
|
|
@ -102,3 +102,17 @@ class InteractionEvent(Base):
|
|||
metadata_json: Mapped[str] = mapped_column(Text(), default="{}")
|
||||
body_json: Mapped[str] = mapped_column(Text(), default="{}")
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
|
||||
class MigrationRun(Base):
|
||||
__tablename__ = "migration_runs"
|
||||
|
||||
id: Mapped[str] = mapped_column(String(36), primary_key=True, default=uuid_str)
|
||||
source: Mapped[str] = mapped_column(String(120), index=True)
|
||||
schema_version: Mapped[str] = mapped_column(String(80))
|
||||
bundle_sha256: Mapped[str] = mapped_column(String(64), index=True)
|
||||
dry_run: Mapped[bool] = mapped_column(Boolean(), default=False)
|
||||
status: Mapped[str] = mapped_column(String(40), default="imported")
|
||||
counts_json: Mapped[str] = mapped_column(Text(), default="{}")
|
||||
diagnostics_json: Mapped[str] = mapped_column(Text(), default="{}")
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue