Spaces:
Sleeping
Sleeping
Upload migrations/versions/f350dae5ae0b_addstoresettings.py
Browse files
migrations/versions/f350dae5ae0b_addstoresettings.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""AddStoreSettings
|
| 2 |
+
|
| 3 |
+
Revision ID: f350dae5ae0b
|
| 4 |
+
Revises: c5fe90300920
|
| 5 |
+
Create Date: 2026-03-10 01:09:31.876342
|
| 6 |
+
|
| 7 |
+
"""
|
| 8 |
+
from typing import Sequence, Union
|
| 9 |
+
|
| 10 |
+
from alembic import op
|
| 11 |
+
import sqlalchemy as sa
|
| 12 |
+
from sqlalchemy.dialects import sqlite
|
| 13 |
+
|
| 14 |
+
# revision identifiers, used by Alembic.
|
| 15 |
+
revision: str = 'f350dae5ae0b'
|
| 16 |
+
down_revision: Union[str, None] = 'c5fe90300920'
|
| 17 |
+
branch_labels: Union[str, Sequence[str], None] = None
|
| 18 |
+
depends_on: Union[str, Sequence[str], None] = None
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def upgrade() -> None:
|
| 22 |
+
# ### commands auto generated by Alembic - please adjust! ###
|
| 23 |
+
op.drop_table('notifications')
|
| 24 |
+
op.alter_column('cart_items', 'id',
|
| 25 |
+
existing_type=sa.INTEGER(),
|
| 26 |
+
nullable=False,
|
| 27 |
+
autoincrement=True)
|
| 28 |
+
op.alter_column('carts', 'id',
|
| 29 |
+
existing_type=sa.INTEGER(),
|
| 30 |
+
nullable=False,
|
| 31 |
+
autoincrement=True)
|
| 32 |
+
# ### end Alembic commands ###
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def downgrade() -> None:
|
| 36 |
+
# ### commands auto generated by Alembic - please adjust! ###
|
| 37 |
+
op.alter_column('carts', 'id',
|
| 38 |
+
existing_type=sa.INTEGER(),
|
| 39 |
+
nullable=True,
|
| 40 |
+
autoincrement=True)
|
| 41 |
+
op.alter_column('cart_items', 'id',
|
| 42 |
+
existing_type=sa.INTEGER(),
|
| 43 |
+
nullable=True,
|
| 44 |
+
autoincrement=True)
|
| 45 |
+
op.create_table('notifications',
|
| 46 |
+
sa.Column('id', sa.INTEGER(), nullable=False),
|
| 47 |
+
sa.Column('type', sa.VARCHAR(length=50), nullable=False),
|
| 48 |
+
sa.Column('title', sa.VARCHAR(length=255), nullable=False),
|
| 49 |
+
sa.Column('message', sa.TEXT(), nullable=True),
|
| 50 |
+
sa.Column('data', sqlite.JSON(), nullable=True),
|
| 51 |
+
sa.Column('is_read', sa.BOOLEAN(), nullable=False),
|
| 52 |
+
sa.Column('created_at', sa.DATETIME(), nullable=False),
|
| 53 |
+
sa.PrimaryKeyConstraint('id')
|
| 54 |
+
)
|
| 55 |
+
# ### end Alembic commands ###
|