feat: add scoped alpha sync and local self-correlation
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
"""Persist local self-correlation independently of platform snapshots."""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
revision = "0003"
|
||||
down_revision = "0002"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
"self_correlations",
|
||||
sa.Column("alpha_id", sa.String(100), sa.ForeignKey("alphas.id"), primary_key=True),
|
||||
sa.Column("region", sa.String(50), nullable=True),
|
||||
sa.Column("result", sa.JSON(), nullable=False),
|
||||
sa.Column("stale", sa.Boolean(), nullable=False),
|
||||
sa.Column("calculated_at", sa.DateTime(timezone=True), nullable=False),
|
||||
)
|
||||
op.create_index("ix_self_correlations_region", "self_correlations", ["region"])
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table("self_correlations")
|
||||
Reference in New Issue
Block a user