Spaces:
Sleeping
Sleeping
Shri commited on
Commit ·
1ac4304
1
Parent(s): 973406c
feat: added alembic, asyncpg
Browse files- alembic/versions/1de57edd5ce6_added_emotion_date_in_emotion_log.py +0 -33
- alembic/versions/{fe1c25d91325_updated_emotion_s_ge_value.py → 584a5111e60f_initial_migration.py} +6 -6
- alembic/versions/6d44744180a1_initial_migration.py +0 -44
- alembic/versions/8c5fd0627d03_alter_users_verifications_columns.py +0 -39
- alembic/versions/c3992c66f8e6_updated_emotion_log_date.py +0 -33
- alembic/versions/c5d0592f9dbd_alter_users_verification_cols.py +0 -39
alembic/versions/1de57edd5ce6_added_emotion_date_in_emotion_log.py
DELETED
|
@@ -1,33 +0,0 @@
|
|
| 1 |
-
"""added emotion date in emotion_log
|
| 2 |
-
|
| 3 |
-
Revision ID: 1de57edd5ce6
|
| 4 |
-
Revises: fe1c25d91325
|
| 5 |
-
Create Date: 2025-11-10 14:18:28.647865
|
| 6 |
-
|
| 7 |
-
"""
|
| 8 |
-
from typing import Sequence, Union
|
| 9 |
-
|
| 10 |
-
from alembic import op
|
| 11 |
-
import sqlalchemy as sa
|
| 12 |
-
import sqlmodel.sql.sqltypes
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
# revision identifiers, used by Alembic.
|
| 16 |
-
revision: str = '1de57edd5ce6'
|
| 17 |
-
down_revision: Union[str, Sequence[str], None] = 'fe1c25d91325'
|
| 18 |
-
branch_labels: Union[str, Sequence[str], None] = None
|
| 19 |
-
depends_on: Union[str, Sequence[str], None] = None
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
def upgrade() -> None:
|
| 23 |
-
"""Upgrade schema."""
|
| 24 |
-
# ### commands auto generated by Alembic - please adjust! ###
|
| 25 |
-
op.add_column('emotion_logs', sa.Column('emotion_date', sa.Date(), nullable=False))
|
| 26 |
-
# ### end Alembic commands ###
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
def downgrade() -> None:
|
| 30 |
-
"""Downgrade schema."""
|
| 31 |
-
# ### commands auto generated by Alembic - please adjust! ###
|
| 32 |
-
op.drop_column('emotion_logs', 'emotion_date')
|
| 33 |
-
# ### end Alembic commands ###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
alembic/versions/{fe1c25d91325_updated_emotion_s_ge_value.py → 584a5111e60f_initial_migration.py}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
-
"""
|
| 2 |
|
| 3 |
-
Revision ID:
|
| 4 |
-
Revises:
|
| 5 |
-
Create Date: 2025-11-10
|
| 6 |
|
| 7 |
"""
|
| 8 |
from typing import Sequence, Union
|
|
@@ -13,8 +13,8 @@ import sqlmodel.sql.sqltypes
|
|
| 13 |
|
| 14 |
|
| 15 |
# revision identifiers, used by Alembic.
|
| 16 |
-
revision: str = '
|
| 17 |
-
down_revision: Union[str, Sequence[str], None] =
|
| 18 |
branch_labels: Union[str, Sequence[str], None] = None
|
| 19 |
depends_on: Union[str, Sequence[str], None] = None
|
| 20 |
|
|
|
|
| 1 |
+
"""initial migration
|
| 2 |
|
| 3 |
+
Revision ID: 584a5111e60f
|
| 4 |
+
Revises:
|
| 5 |
+
Create Date: 2025-11-10 23:50:23.367946
|
| 6 |
|
| 7 |
"""
|
| 8 |
from typing import Sequence, Union
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
# revision identifiers, used by Alembic.
|
| 16 |
+
revision: str = '584a5111e60f'
|
| 17 |
+
down_revision: Union[str, Sequence[str], None] = None
|
| 18 |
branch_labels: Union[str, Sequence[str], None] = None
|
| 19 |
depends_on: Union[str, Sequence[str], None] = None
|
| 20 |
|
alembic/versions/6d44744180a1_initial_migration.py
DELETED
|
@@ -1,44 +0,0 @@
|
|
| 1 |
-
"""Initial Migration
|
| 2 |
-
|
| 3 |
-
Revision ID: 6d44744180a1
|
| 4 |
-
Revises:
|
| 5 |
-
Create Date: 2025-11-10 13:59:02.212280
|
| 6 |
-
|
| 7 |
-
"""
|
| 8 |
-
from typing import Sequence, Union
|
| 9 |
-
|
| 10 |
-
from alembic import op
|
| 11 |
-
import sqlalchemy as sa
|
| 12 |
-
import sqlmodel.sql.sqltypes
|
| 13 |
-
from sqlalchemy.dialects import postgresql
|
| 14 |
-
|
| 15 |
-
# revision identifiers, used by Alembic.
|
| 16 |
-
revision: str = '6d44744180a1'
|
| 17 |
-
down_revision: Union[str, Sequence[str], None] = None
|
| 18 |
-
branch_labels: Union[str, Sequence[str], None] = None
|
| 19 |
-
depends_on: Union[str, Sequence[str], None] = None
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
def upgrade() -> None:
|
| 23 |
-
"""Upgrade schema."""
|
| 24 |
-
# ### commands auto generated by Alembic - please adjust! ###
|
| 25 |
-
op.drop_table('otp_verification')
|
| 26 |
-
# ### end Alembic commands ###
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
def downgrade() -> None:
|
| 30 |
-
"""Downgrade schema."""
|
| 31 |
-
# ### commands auto generated by Alembic - please adjust! ###
|
| 32 |
-
op.create_table('otp_verification',
|
| 33 |
-
sa.Column('id', sa.UUID(), autoincrement=False, nullable=False),
|
| 34 |
-
sa.Column('email', sa.VARCHAR(), autoincrement=False, nullable=False),
|
| 35 |
-
sa.Column('otp', sa.VARCHAR(), autoincrement=False, nullable=False),
|
| 36 |
-
sa.Column('created_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
|
| 37 |
-
sa.Column('expires_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
|
| 38 |
-
sa.Column('is_verified', sa.BOOLEAN(), autoincrement=False, nullable=False),
|
| 39 |
-
sa.Column('temp_name', sa.VARCHAR(), autoincrement=False, nullable=True),
|
| 40 |
-
sa.Column('temp_password', sa.VARCHAR(), autoincrement=False, nullable=True),
|
| 41 |
-
sa.PrimaryKeyConstraint('id', name=op.f('otp_verification_pkey')),
|
| 42 |
-
sa.UniqueConstraint('email', name=op.f('otp_verification_email_key'), postgresql_include=[], postgresql_nulls_not_distinct=False)
|
| 43 |
-
)
|
| 44 |
-
# ### end Alembic commands ###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
alembic/versions/8c5fd0627d03_alter_users_verifications_columns.py
DELETED
|
@@ -1,39 +0,0 @@
|
|
| 1 |
-
"""alter:users/verifications columns..
|
| 2 |
-
|
| 3 |
-
Revision ID: 8c5fd0627d03
|
| 4 |
-
Revises: c5d0592f9dbd
|
| 5 |
-
Create Date: 2025-11-10 14:55:48.357288
|
| 6 |
-
|
| 7 |
-
"""
|
| 8 |
-
from typing import Sequence, Union
|
| 9 |
-
|
| 10 |
-
from alembic import op
|
| 11 |
-
import sqlalchemy as sa
|
| 12 |
-
import sqlmodel.sql.sqltypes
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
# revision identifiers, used by Alembic.
|
| 16 |
-
revision: str = '8c5fd0627d03'
|
| 17 |
-
down_revision: Union[str, Sequence[str], None] = 'c5d0592f9dbd'
|
| 18 |
-
branch_labels: Union[str, Sequence[str], None] = None
|
| 19 |
-
depends_on: Union[str, Sequence[str], None] = None
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
def upgrade() -> None:
|
| 23 |
-
"""Upgrade schema."""
|
| 24 |
-
# ### commands auto generated by Alembic - please adjust! ###
|
| 25 |
-
op.drop_column('emotion_logs', 'emotion_date')
|
| 26 |
-
op.add_column('users', sa.Column('is_verified', sa.Boolean(), server_default='false', nullable=False))
|
| 27 |
-
op.add_column('users', sa.Column('verification_token', sqlmodel.sql.sqltypes.AutoString(), nullable=True))
|
| 28 |
-
op.add_column('users', sa.Column('verification_expires_at', sa.DateTime(), nullable=True))
|
| 29 |
-
# ### end Alembic commands ###
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
def downgrade() -> None:
|
| 33 |
-
"""Downgrade schema."""
|
| 34 |
-
# ### commands auto generated by Alembic - please adjust! ###
|
| 35 |
-
op.drop_column('users', 'verification_expires_at')
|
| 36 |
-
op.drop_column('users', 'verification_token')
|
| 37 |
-
op.drop_column('users', 'is_verified')
|
| 38 |
-
op.add_column('emotion_logs', sa.Column('emotion_date', sa.DATE(), autoincrement=False, nullable=True))
|
| 39 |
-
# ### end Alembic commands ###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
alembic/versions/c3992c66f8e6_updated_emotion_log_date.py
DELETED
|
@@ -1,33 +0,0 @@
|
|
| 1 |
-
"""updated emotion log date
|
| 2 |
-
|
| 3 |
-
Revision ID: c3992c66f8e6
|
| 4 |
-
Revises: 1de57edd5ce6
|
| 5 |
-
Create Date: 2025-11-10 14:38:01.581906
|
| 6 |
-
|
| 7 |
-
"""
|
| 8 |
-
from typing import Sequence, Union
|
| 9 |
-
|
| 10 |
-
from alembic import op
|
| 11 |
-
import sqlalchemy as sa
|
| 12 |
-
import sqlmodel.sql.sqltypes
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
# revision identifiers, used by Alembic.
|
| 16 |
-
revision: str = 'c3992c66f8e6'
|
| 17 |
-
down_revision: Union[str, Sequence[str], None] = '1de57edd5ce6'
|
| 18 |
-
branch_labels: Union[str, Sequence[str], None] = None
|
| 19 |
-
depends_on: Union[str, Sequence[str], None] = None
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
def upgrade() -> None:
|
| 23 |
-
"""Upgrade schema."""
|
| 24 |
-
# ### commands auto generated by Alembic - please adjust! ###
|
| 25 |
-
op.add_column('emotion_logs', sa.Column('emotion_date', sa.Date(), nullable=True))
|
| 26 |
-
# ### end Alembic commands ###
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
def downgrade() -> None:
|
| 30 |
-
"""Downgrade schema."""
|
| 31 |
-
# ### commands auto generated by Alembic - please adjust! ###
|
| 32 |
-
op.drop_column('emotion_logs', 'emotion_date')
|
| 33 |
-
# ### end Alembic commands ###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
alembic/versions/c5d0592f9dbd_alter_users_verification_cols.py
DELETED
|
@@ -1,39 +0,0 @@
|
|
| 1 |
-
"""alter:users/verification cols..
|
| 2 |
-
|
| 3 |
-
Revision ID: c5d0592f9dbd
|
| 4 |
-
Revises: c3992c66f8e6
|
| 5 |
-
Create Date: 2025-11-10 14:46:54.649132
|
| 6 |
-
|
| 7 |
-
"""
|
| 8 |
-
from typing import Sequence, Union
|
| 9 |
-
|
| 10 |
-
from alembic import op
|
| 11 |
-
import sqlalchemy as sa
|
| 12 |
-
import sqlmodel.sql.sqltypes
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
# revision identifiers, used by Alembic.
|
| 16 |
-
revision: str = 'c5d0592f9dbd'
|
| 17 |
-
down_revision: Union[str, Sequence[str], None] = 'c3992c66f8e6'
|
| 18 |
-
branch_labels: Union[str, Sequence[str], None] = None
|
| 19 |
-
depends_on: Union[str, Sequence[str], None] = None
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
def upgrade() -> None:
|
| 23 |
-
"""Upgrade schema."""
|
| 24 |
-
# ### commands auto generated by Alembic - please adjust! ###
|
| 25 |
-
op.drop_column('emotion_logs', 'emotion_date')
|
| 26 |
-
op.add_column('users', sa.Column('is_verified', sa.Boolean(), nullable=False))
|
| 27 |
-
op.add_column('users', sa.Column('verification_token', sqlmodel.sql.sqltypes.AutoString(), nullable=True))
|
| 28 |
-
op.add_column('users', sa.Column('verification_expires_at', sa.DateTime(), nullable=True))
|
| 29 |
-
# ### end Alembic commands ###
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
def downgrade() -> None:
|
| 33 |
-
"""Downgrade schema."""
|
| 34 |
-
# ### commands auto generated by Alembic - please adjust! ###
|
| 35 |
-
op.drop_column('users', 'verification_expires_at')
|
| 36 |
-
op.drop_column('users', 'verification_token')
|
| 37 |
-
op.drop_column('users', 'is_verified')
|
| 38 |
-
op.add_column('emotion_logs', sa.Column('emotion_date', sa.DATE(), autoincrement=False, nullable=True))
|
| 39 |
-
# ### end Alembic commands ###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|