Skip to content

Commit 7d7ca37

Browse files
committed
refactor: update user model and remove full_name field
1 parent 9a503d3 commit 7d7ca37

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

backend/src/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
try:
44
from .users.models import User # noqa
5-
from .flashcards.models import Collection # noqa
5+
from .flashcards.models import Collection, Card, PracticeSession, PracticeCard # noqa
66
except Exception:
77
traceback.print_exc()
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""empty message
2+
3+
Revision ID: cb16ae472c1e
4+
Revises: 4efa50e00bd4
5+
Create Date: 2025-04-24 17:23:08.101418
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
import sqlmodel.sql.sqltypes
11+
12+
13+
# revision identifiers, used by Alembic.
14+
revision = 'cb16ae472c1e'
15+
down_revision = '4efa50e00bd4'
16+
branch_labels = None
17+
depends_on = None
18+
19+
20+
def upgrade():
21+
# ### commands auto generated by Alembic - please adjust! ###
22+
op.drop_column('user', 'full_name')
23+
# ### end Alembic commands ###
24+
25+
26+
def downgrade():
27+
# ### commands auto generated by Alembic - please adjust! ###
28+
op.add_column('user', sa.Column('full_name', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
29+
# ### end Alembic commands ###

backend/src/users/schemas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class UserBase(SQLModel):
88
email: EmailStr = Field(unique=True, index=True, max_length=255)
99
is_active: bool = True
1010
is_superuser: bool = False
11-
full_name: str | None = Field(default=None, max_length=255)
1211

1312

1413
class UserUpdate(UserBase):
@@ -24,5 +23,6 @@ class UserRegister(SQLModel):
2423
email: EmailStr = Field(max_length=255)
2524
password: str = Field(min_length=8, max_length=40)
2625

26+
2727
class UserPublic(UserBase):
2828
id: uuid.UUID

0 commit comments

Comments
 (0)