Skip to content

Commit

Permalink
Cherry pick and reconcile repost fix migration (#4697)
Browse files Browse the repository at this point in the history
Co-authored-by: Raymond Jacobson <ray@audius.co>
  • Loading branch information
2 people authored and jowlee committed Feb 3, 2023
1 parent 682a38b commit a5f71e4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion discovery-provider/alembic/trigger_sql/handle_repost.sql
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ begin

-- create a milestone if applicable
select new_val into milestone where new_val in (10, 25, 50, 100, 250, 500, 1000, 5000, 10000, 20000, 50000, 100000, 1000000);
if new.is_delete = false and milestone is not null then
if new.is_delete = false and milestone is not null and owner_user_id is not null then
insert into milestones
(id, name, threshold, blocknumber, slot, timestamp)
values
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""handle_repost_fix
Revision ID: 72b030bb3dcb
Revises: 6a9f01e775d5
Create Date: 2023-01-31 17:56:07.385681
"""
from alembic import op
from src.utils.alembic_helpers import build_sql

# revision identifiers, used by Alembic.
revision = '72b030bb3dcb'
down_revision = '6a9f01e775d5'
branch_labels = None
depends_on = None

up_files = [
"handle_repost.sql"
]

def upgrade():
sql = build_sql(up_files)
connection = op.get_bind()
connection.execute(sql)


def downgrade():
sql = build_sql(up_files)
connection = op.get_bind()
connection.execute(sql)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""fix track_cid that were nullified when editted
Revision ID: a62b4e92b733
Revises: efafdb22df81
Revises: 72b030bb3dcb
Create Date: 2023-01-12 18:21:58.029182
"""
Expand All @@ -10,7 +10,7 @@

# revision identifiers, used by Alembic.
revision = "a62b4e92b733"
down_revision = "6a9f01e775d5"
down_revision = "72b030bb3dcb"
branch_labels = None
depends_on = None

Expand Down

0 comments on commit a5f71e4

Please sign in to comment.