...
 
Commits (3)
......@@ -98,8 +98,6 @@ def merge_mbids(conn, target_mbid, source_mbids):
conn.execute(update_stmt.values(track_mbid_id=row['id']))
update_stmt = schema.track_mbid_change.update().where(schema.track_mbid_change.c.track_mbid_id.in_(old_ids))
conn.execute(update_stmt.values(track_mbid_id=row['id']))
update_stmt = schema.track_mbid_flag.update().where(schema.track_mbid_flag.c.track_mbid_id.in_(old_ids))
conn.execute(update_stmt.values(track_mbid_id=row['id']))
if to_delete:
delete_stmt = schema.track_mbid.delete().where(
schema.track_mbid.c.id.in_(to_delete))
......@@ -138,8 +136,6 @@ def _merge_tracks_gids(conn, name_with_id, target_id, source_ids):
if name == 'mbid':
tab_chg = schema.metadata.tables['track_%s_change' % name]
col_chg = tab_chg.columns['track_%s_id' % name]
tab_flag = schema.metadata.tables['track_%s_flag' % name]
col_flag = tab_flag.columns['track_%s_id' % name]
columns = [
sql.func.min(tab.c.id).label('id'),
sql.func.array_agg(tab.c.id).label('all_ids'),
......@@ -162,8 +158,6 @@ def _merge_tracks_gids(conn, name_with_id, target_id, source_ids):
if name == 'mbid':
update_stmt = tab_chg.update().where(col_chg.in_(old_ids))
conn.execute(update_stmt.values({col_chg: row['id']}))
update_stmt = tab_flag.update().where(col_flag.in_(old_ids))
conn.execute(update_stmt.values({col_flag: row['id']}))
if to_delete:
delete_stmt = tab.delete().where(tab.c.id.in_(to_delete))
conn.execute(delete_stmt)
......
......@@ -233,14 +233,6 @@ track_mbid_change = Table('track_mbid_change', metadata,
Column('note', Text),
)
track_mbid_flag = Table('track_mbid_flag', metadata,
Column('id', Integer, primary_key=True),
Column('track_mbid_id', Integer, ForeignKey('track_mbid.id'), nullable=False),
Column('account_id', Integer, ForeignKey('account.id'), nullable=False),
Column('handled', Boolean, default=False, server_default=sql.false(), nullable=False),
Column('created', DateTime(timezone=True), server_default=sql.func.current_timestamp(), nullable=False),
)
track_puid = Table('track_puid', metadata,
Column('track_id', Integer, ForeignKey('track.id'), nullable=False),
Column('puid', UUID, nullable=False, index=True),
......
......@@ -42,4 +42,4 @@ subprocess32==3.5.3 ; python_version < "3.2"
typing==3.6.6
urllib3==1.24.2 # via requests, sentry-sdk
uwsgi==2.0.18
werkzeug==0.15.2
werkzeug==0.15.3
......@@ -52,7 +52,6 @@ SEQUENCES = [
('track_mbid', 'id'),
('track_mbid_source', 'id'),
('track_mbid_change', 'id'),
('track_mbid_flag', 'id'),
('track_puid', 'id'),
('track_puid_source', 'id'),
('track_meta', 'id'),
......@@ -76,7 +75,6 @@ TABLES = [
'track_mbid',
'track_mbid_source',
'track_mbid_change',
'track_mbid_flag',
'track_puid',
'track_puid_source',
'track_meta',
......