This commit is contained in:
parent
e2faeb9337
commit
aff9e76a4c
4 changed files with 83 additions and 2 deletions
40
alembic/versions/934c5c1d1f4a_id_from_int_to_bigint.py
Normal file
40
alembic/versions/934c5c1d1f4a_id_from_int_to_bigint.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
"""id from int to bigint
|
||||
|
||||
Revision ID: 934c5c1d1f4a
|
||||
Revises: 9f96b664be50
|
||||
Create Date: 2025-04-15 18:14:14.644341
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '934c5c1d1f4a'
|
||||
down_revision: Union[str, None] = '9f96b664be50'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('tracks', 'id',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.BigInteger(),
|
||||
existing_nullable=False,
|
||||
autoincrement=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('tracks', 'id',
|
||||
existing_type=sa.BigInteger(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False,
|
||||
autoincrement=True)
|
||||
# ### end Alembic commands ###
|
40
alembic/versions/9b7a211cc587_id_from_int_to_bigint.py
Normal file
40
alembic/versions/9b7a211cc587_id_from_int_to_bigint.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
"""id from int to bigint
|
||||
|
||||
Revision ID: 9b7a211cc587
|
||||
Revises: 934c5c1d1f4a
|
||||
Create Date: 2025-04-15 18:17:57.302668
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '9b7a211cc587'
|
||||
down_revision: Union[str, None] = '934c5c1d1f4a'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('users', 'id',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.BigInteger(),
|
||||
existing_nullable=False,
|
||||
autoincrement=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('users', 'id',
|
||||
existing_type=sa.BigInteger(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False,
|
||||
autoincrement=True)
|
||||
# ### end Alembic commands ###
|
|
@ -7,7 +7,7 @@ from sqlalchemy import BigInteger, LargeBinary, Integer, JSON
|
|||
|
||||
class Track(Base):
|
||||
__tablename__ = 'tracks'
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
|
||||
|
||||
telegram_id: Mapped[Optional[int]] = mapped_column(BigInteger)
|
||||
telegram_access_hash: Mapped[Optional[int]] = mapped_column(BigInteger)
|
||||
|
|
|
@ -3,11 +3,12 @@ from typing import Optional
|
|||
from app.models import Base
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
from sqlalchemy import JSON
|
||||
from sqlalchemy import BigInteger
|
||||
|
||||
|
||||
class User(Base):
|
||||
__tablename__ = 'users'
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
|
||||
|
||||
spotify_auth: Mapped[dict] = mapped_column(JSON, default={})
|
||||
ymusic_auth: Mapped[dict] = mapped_column(JSON, default={})
|
||||
|
|
Loading…
Add table
Reference in a new issue