From ec83dc4b6971bb4f5a516dd74dd152df545a0d62 Mon Sep 17 00:00:00 2001 From: Felipe Alvarado Date: Wed, 8 Jan 2025 14:13:53 +0100 Subject: [PATCH] Add default metadata providers sources --- .../versions/8d2eacb17707_default_sources.py | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 migrations/versions/8d2eacb17707_default_sources.py diff --git a/migrations/versions/8d2eacb17707_default_sources.py b/migrations/versions/8d2eacb17707_default_sources.py new file mode 100644 index 0000000..ccc87db --- /dev/null +++ b/migrations/versions/8d2eacb17707_default_sources.py @@ -0,0 +1,43 @@ +"""default_sources + +Revision ID: 8d2eacb17707 +Revises: e4e2e62601d2 +Create Date: 2025-01-08 12:32:30.338594 + +""" + +from typing import Sequence, Union + +from alembic import op + +# revision identifiers, used by Alembic. +revision: str = "8d2eacb17707" +down_revision: Union[str, None] = "e4e2e62601d2" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.execute( + """ + INSERT INTO abisource (name, url) + VALUES ('Etherscan', ''), + ('Sourcify', ''), + ('Blockscout', ''); + """ + ) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.execute( + """ + DELETE FROM abisource + WHERE (name = 'Etherscan' AND url = '') + OR (name = 'Sourcify' AND url = '') + OR (name = 'Blockscout' AND url = ''); + """ + ) + # ### end Alembic commands ###