"""add vocabulary model

Revision ID: add_vocabulary_model
Revises: f0f58ab55290
Create Date: 2025-09-20

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'add_vocabulary_model'
down_revision = 'f0f58ab55290'
branch_labels = None
depends_on = None


def upgrade():
    # Create vocabulary table
    op.create_table('vocabulary',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('student_id', sa.Integer(), nullable=False),
        sa.Column('word', sa.String(length=100), nullable=False),
        sa.Column('pronunciation', sa.String(length=100), nullable=True),
        sa.Column('definition', sa.Text(), nullable=False),
        sa.Column('synonyms', sa.Text(), nullable=True),
        sa.Column('antonyms', sa.Text(), nullable=True),
        sa.Column('example', sa.Text(), nullable=True),
        sa.Column('date_added', sa.DateTime(), nullable=True),
        sa.ForeignKeyConstraint(['student_id'], ['user.id'], ),
        sa.PrimaryKeyConstraint('id')
    )


def downgrade():
    # Drop vocabulary table
    op.drop_table('vocabulary')