Fix PayPal migrations: use proper revision IDs and remove table creation
- Rebased onto master to include grid_lanes_enabled and other changes - Replaced fake revision IDs (a1b2c3d4...) with proper alembic-generated IDs - Removed table creation migrations (auto-created) - Removed obsolete merge migration - Keep only shop column migration for paypal_client_id, paypal_secret, paypal_enabled
This commit is contained in:
parent
8a3b172c0a
commit
66382c9ca2
4 changed files with 5 additions and 139 deletions
|
|
@ -1,26 +0,0 @@
|
|||
"""merge paypal and default_theme migrations
|
||||
|
||||
Revision ID: 1396317d0fc4
|
||||
Revises: a1b2c3d4e5f8, b090f873502e
|
||||
Create Date: 2025-11-07 15:42:41.411619
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '1396317d0fc4'
|
||||
down_revision = ('a1b2c3d4e5f8', 'b090f873502e')
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
from make_post_sell.models.meta import UUIDType
|
||||
|
||||
|
||||
def upgrade():
|
||||
pass
|
||||
|
||||
|
||||
def downgrade():
|
||||
pass
|
||||
|
|
@ -1,18 +1,17 @@
|
|||
"""add paypal credentials to shop
|
||||
|
||||
Revision ID: a1b2c3d4e5f6
|
||||
Revises: 81d65d8605c2
|
||||
Create Date: 2025-11-07 00:00:00.000000
|
||||
Revision ID: 418933067d81
|
||||
Revises: a7c3e8f1d2b4
|
||||
Create Date: 2025-12-22 12:06:14.945882
|
||||
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "a1b2c3d4e5f6"
|
||||
down_revision = "81d65d8605c2"
|
||||
revision = '418933067d81'
|
||||
down_revision = 'a7c3e8f1d2b4'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
"""create paypal_user_shop table
|
||||
|
||||
Revision ID: a1b2c3d4e5f7
|
||||
Revises: a1b2c3d4e5f6
|
||||
Create Date: 2025-11-07 00:00:01.000000
|
||||
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "a1b2c3d4e5f7"
|
||||
down_revision = "a1b2c3d4e5f6"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
from make_post_sell.models.meta import UUIDType
|
||||
|
||||
|
||||
def upgrade():
|
||||
# Create mps_paypal_user_shop table
|
||||
op.create_table(
|
||||
"mps_paypal_user_shop",
|
||||
sa.Column("id", UUIDType(), nullable=False),
|
||||
sa.Column("user_id", UUIDType(), nullable=False),
|
||||
sa.Column("shop_id", UUIDType(), nullable=False),
|
||||
sa.Column("payer_id", sa.Unicode(64), nullable=True),
|
||||
sa.Column("billing_agreement_id", sa.Unicode(64), nullable=True),
|
||||
sa.Column("active_payment_token", sa.Unicode(128), nullable=True),
|
||||
sa.ForeignKeyConstraint(["user_id"], ["mps_user.id"]),
|
||||
sa.ForeignKeyConstraint(["shop_id"], ["mps_shop.id"]),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
)
|
||||
|
||||
# Create indexes for foreign keys
|
||||
op.create_index(
|
||||
"ix_mps_paypal_user_shop_id",
|
||||
"mps_paypal_user_shop",
|
||||
["id"],
|
||||
unique=False,
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
# Drop the PayPalUserShop table
|
||||
op.drop_index("ix_mps_paypal_user_shop_id", table_name="mps_paypal_user_shop")
|
||||
op.drop_table("mps_paypal_user_shop")
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
"""create paypal_payment table
|
||||
|
||||
Revision ID: a1b2c3d4e5f8
|
||||
Revises: a1b2c3d4e5f7
|
||||
Create Date: 2025-11-07 00:00:02.000000
|
||||
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "a1b2c3d4e5f8"
|
||||
down_revision = "a1b2c3d4e5f7"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
from make_post_sell.models.meta import UUIDType
|
||||
|
||||
|
||||
def upgrade():
|
||||
# Create mps_paypal_payment table
|
||||
op.create_table(
|
||||
"mps_paypal_payment",
|
||||
sa.Column("id", UUIDType(), nullable=False),
|
||||
sa.Column("invoice_id", UUIDType(), nullable=False),
|
||||
sa.Column("paypal_order_id", sa.Unicode(64), nullable=False),
|
||||
sa.Column("paypal_payer_id", sa.Unicode(64), nullable=True),
|
||||
sa.Column("paypal_capture_id", sa.Unicode(64), nullable=True),
|
||||
sa.Column("status", sa.Unicode(32), nullable=False),
|
||||
sa.Column("amount_in_cents", sa.BigInteger(), nullable=False),
|
||||
sa.Column("created_timestamp", sa.BigInteger(), nullable=False),
|
||||
sa.Column("updated_timestamp", sa.BigInteger(), nullable=False),
|
||||
sa.ForeignKeyConstraint(["invoice_id"], ["mps_invoice.id"]),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
)
|
||||
|
||||
# Create indexes
|
||||
op.create_index(
|
||||
"ix_mps_paypal_payment_id",
|
||||
"mps_paypal_payment",
|
||||
["id"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
"ix_mps_paypal_payment_order_id",
|
||||
"mps_paypal_payment",
|
||||
["paypal_order_id"],
|
||||
unique=True,
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
# Drop the PayPalPayment table
|
||||
op.drop_index("ix_mps_paypal_payment_order_id", table_name="mps_paypal_payment")
|
||||
op.drop_index("ix_mps_paypal_payment_id", table_name="mps_paypal_payment")
|
||||
op.drop_table("mps_paypal_payment")
|
||||
Loading…
Add table
Add a link
Reference in a new issue