[V0.5] Working application with all 4 screens as of yet.
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
"""Add all_day column to calendar_events
|
||||
|
||||
Revision ID: a34d847510da
|
||||
Revises: 9a82960db482
|
||||
Create Date: 2025-04-26 11:09:35.400748
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'a34d847510da'
|
||||
down_revision: Union[str, None] = '9a82960db482'
|
||||
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.drop_table('calendar_events')
|
||||
op.drop_table('users')
|
||||
op.drop_index('ix_todos_id', table_name='todos')
|
||||
op.drop_index('ix_todos_task', table_name='todos')
|
||||
op.drop_table('todos')
|
||||
op.drop_table('token_blacklist')
|
||||
op.drop_index('ix_chat_messages_id', table_name='chat_messages')
|
||||
op.drop_index('ix_chat_messages_user_id', table_name='chat_messages')
|
||||
op.drop_table('chat_messages')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('chat_messages',
|
||||
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=False),
|
||||
sa.Column('sender', postgresql.ENUM('USER', 'AI', name='messagesender'), autoincrement=False, nullable=False),
|
||||
sa.Column('text', sa.TEXT(), autoincrement=False, nullable=False),
|
||||
sa.Column('timestamp', postgresql.TIMESTAMP(timezone=True), server_default=sa.text('now()'), autoincrement=False, nullable=True),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], name='chat_messages_user_id_fkey'),
|
||||
sa.PrimaryKeyConstraint('id', name='chat_messages_pkey')
|
||||
)
|
||||
op.create_index('ix_chat_messages_user_id', 'chat_messages', ['user_id'], unique=False)
|
||||
op.create_index('ix_chat_messages_id', 'chat_messages', ['id'], unique=False)
|
||||
op.create_table('token_blacklist',
|
||||
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column('token', sa.VARCHAR(), autoincrement=False, nullable=True),
|
||||
sa.Column('expires_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
|
||||
sa.PrimaryKeyConstraint('id', name='token_blacklist_pkey'),
|
||||
sa.UniqueConstraint('token', name='token_blacklist_token_key')
|
||||
)
|
||||
op.create_table('todos',
|
||||
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column('task', sa.VARCHAR(), autoincrement=False, nullable=False),
|
||||
sa.Column('date', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
|
||||
sa.Column('remind', sa.BOOLEAN(), autoincrement=False, nullable=True),
|
||||
sa.Column('complete', sa.BOOLEAN(), autoincrement=False, nullable=True),
|
||||
sa.Column('owner_id', sa.INTEGER(), autoincrement=False, nullable=True),
|
||||
sa.ForeignKeyConstraint(['owner_id'], ['users.id'], name='todos_owner_id_fkey'),
|
||||
sa.PrimaryKeyConstraint('id', name='todos_pkey')
|
||||
)
|
||||
op.create_index('ix_todos_task', 'todos', ['task'], unique=False)
|
||||
op.create_index('ix_todos_id', 'todos', ['id'], unique=False)
|
||||
op.create_table('users',
|
||||
sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('users_id_seq'::regclass)"), autoincrement=True, nullable=False),
|
||||
sa.Column('uuid', sa.VARCHAR(), autoincrement=False, nullable=True),
|
||||
sa.Column('username', sa.VARCHAR(), autoincrement=False, nullable=True),
|
||||
sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=True),
|
||||
sa.Column('role', postgresql.ENUM('ADMIN', 'USER', name='userrole'), autoincrement=False, nullable=False),
|
||||
sa.Column('hashed_password', sa.VARCHAR(), autoincrement=False, nullable=True),
|
||||
sa.PrimaryKeyConstraint('id', name='users_pkey'),
|
||||
sa.UniqueConstraint('username', name='users_username_key'),
|
||||
sa.UniqueConstraint('uuid', name='users_uuid_key'),
|
||||
postgresql_ignore_search_path=False
|
||||
)
|
||||
op.create_table('calendar_events',
|
||||
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column('title', sa.VARCHAR(), autoincrement=False, nullable=False),
|
||||
sa.Column('description', sa.VARCHAR(), autoincrement=False, nullable=True),
|
||||
sa.Column('start', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
|
||||
sa.Column('end', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
|
||||
sa.Column('location', sa.VARCHAR(), autoincrement=False, nullable=True),
|
||||
sa.Column('tags', postgresql.JSON(astext_type=sa.Text()), autoincrement=False, nullable=True),
|
||||
sa.Column('color', sa.VARCHAR(), autoincrement=False, nullable=True),
|
||||
sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=False),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], name='calendar_events_user_id_fkey'),
|
||||
sa.PrimaryKeyConstraint('id', name='calendar_events_pkey')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user