We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5424b8 commit 53424ebCopy full SHA for 53424eb
zipline/assets/asset_db_migrations.py
@@ -526,3 +526,28 @@ def _downgrade_v7(op):
526
sa.Column('multiplier', sa.Float),
527
sa.Column('tick_size', sa.Float),
528
)
529
+
530
+ # Delete equity_symbol_mappings records that no longer refer to valid sids.
531
+ op.execute(
532
+ """
533
+ DELETE FROM
534
+ equity_symbol_mappings
535
+ WHERE
536
+ sid NOT IN (SELECT sid FROM equities);
537
538
+ )
539
540
+ # Delete asset_router records that no longer refer to valid sids.
541
542
543
544
+ asset_router
545
546
+ sid
547
+ NOT IN (
548
+ SELECT sid FROM equities
549
+ UNION
550
+ SELECT sid FROM futures_contracts
551
+ );
552
553
0 commit comments