[V1.0] Working application, added notifications.

Ready to upload to store.
This commit is contained in:
c-d-p
2025-04-27 00:39:52 +02:00
parent 04d9136b96
commit 62d6b8bdfd
86 changed files with 2250 additions and 240 deletions

View File

@@ -2,7 +2,6 @@ import os
import sys
from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from sqlalchemy import create_engine # Add create_engine import

View File

@@ -1,30 +0,0 @@
"""Initial migration with existing tables
Revision ID: 69069d6184b3
Revises:
Create Date: 2025-04-21 01:14:33.233195
"""
from typing import Sequence, Union
# revision identifiers, used by Alembic.
revision: str = "69069d6184b3"
down_revision: Union[str, None] = None
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! ###
pass
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@@ -1,30 +0,0 @@
"""Add todo table
Revision ID: 9a82960db482
Revises: 69069d6184b3
Create Date: 2025-04-21 20:33:27.028529
"""
from typing import Sequence, Union
# revision identifiers, used by Alembic.
revision: str = "9a82960db482"
down_revision: Union[str, None] = "69069d6184b3"
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! ###
pass
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@@ -1,94 +0,0 @@
"""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 ###