This commit is contained in:
zhangsan 2024-07-29 17:26:18 +08:00
parent 45ce6d7f0e
commit b0092bb0c1
59 changed files with 59 additions and 2178 deletions

View File

@ -1,5 +1,19 @@
## 如何运行?
1.pip install -r requirements.txt
2.配置数据库在config.py文件中(项目根目录下),SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:123456@localhost/covid_detector'
2.命令行输入 run.bat
3.浏览器输入http://127.0.0.1:5000/
1.pip install -r requirements.txt
2.配置数据库在config.py文件中(项目根目录下),SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:123456@localhost/covid_detector'
默认mysql的端口为3306 root:123456 分别是用户名 密码 covid_detector 是数据库
3.使用navicat创建covid_detector数据库与代码中保持一致
4.可以先删除migrations文件夹然后conda activate激活环境在命令行输入
1. set FLASK_APP=flaskapp.py
2. flask db init
3. flask db upgrade
以上步骤结束会在数据库中创建若干空表
2.命令行输入 run.bat
3.浏览器输入http://127.0.0.1:5000/即可访问主页。

View File

@ -1,45 +1,51 @@
from flask import Flask,session
from flask import Flask
from flask_mail import Mail
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_migrate import Migrate
from config import config
from flask_moment import Moment
from flask_bootstrap import Bootstrap
# 创建 Flask 应用对象 app
# 通过配置文件或环境变量加载应用配置;
# 初始化扩展对象,如数据库、邮件等;
# 注册蓝图Blueprint对象将不同模块的视图函数注册到应用中
# 返回 Flask 应用对象 。app
mail = Mail()
db = SQLAlchemy()
moment = Moment()
bootstrap=Bootstrap()
bootstrap = Bootstrap()
login_manager = LoginManager()
login_manager.login_view = 'auth.login'
def create_app(config_name):
app = Flask(__name__)
app.config.from_object(config[config_name])
config[config_name].init_app(app)
mail.init_app(app) #将 Flask 应用程序与 Flask-Mail 扩展库绑定
mail.init_app(app)
db.init_app(app)
moment.init_app(app)
login_manager.init_app(app)
bootstrap.init_app(app)
migrate = Migrate(app, db) # Initialize Flask-Migrate
# 确保在此处导入模型,以便 Flask-SQLAlchemy 能够识别
from . import models
from .main import main as main_blueprint
app.register_blueprint(main_blueprint)
from .auth import auth as auth_blueprint
app.register_blueprint(auth_blueprint)
app.register_blueprint(auth_blueprint, url_prefix='/auth')
from .user import user as user_blueprint
app.register_blueprint(user_blueprint)
app.register_blueprint(user_blueprint, url_prefix='/user')
from .appointment import appointment as appointment_blueprint
app.register_blueprint(appointment_blueprint)
app.register_blueprint(appointment_blueprint, url_prefix='/appointment')
from .faqs import faqs as faqs_blueprint
app.register_blueprint(faqs_blueprint)
app.register_blueprint(faqs_blueprint, url_prefix='/faqs')
# from .detect import detect as detect_blueprint
# app.register_blueprint(detect_blueprint)
from .detect import detect as detect_blueprint
app.register_blueprint(detect_blueprint)
return app

View File

@ -1,5 +1,3 @@
import os
import numpy as np
import tensorflow as tf
class COVIDxCTDataset:

View File

@ -3,8 +3,7 @@ import random
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin,AnonymousUserMixin
from . import db, login_manager
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import current_app
class Permission:
FOLLOW = 1

View File

@ -1,7 +1,13 @@
import os
import click
from flask_migrate import Migrate
from flask_app import create_app,db
from flask_app.models import User, Role
app = create_app(os.getenv('FLASK_CONFIG') or 'default') #默认开发模式
migrate = Migrate(app, db)
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from flask_app import create_app, db
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.run()

View File

@ -1 +0,0 @@
Single-database configuration for Flask.

View File

@ -1,50 +0,0 @@
# A generic, single database configuration.
[alembic]
# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s
# set to 'true' to run the environment during
# the 'revision' command, regardless of autogenerate
# revision_environment = false
# Logging configuration
[loggers]
keys = root,sqlalchemy,alembic,flask_migrate
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = WARN
handlers = console
qualname =
[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine
[logger_alembic]
level = INFO
handlers =
qualname = alembic
[logger_flask_migrate]
level = INFO
handlers =
qualname = flask_migrate
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S

View File

@ -1,105 +0,0 @@
from __future__ import with_statement
import logging
from logging.config import fileConfig
from flask import current_app
from alembic import context
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python logging.
# This line sets up loggers basically.
fileConfig(config.config_file_name)
logger = logging.getLogger('alembic.env')
def get_engine():
try:
# this works with Flask-SQLAlchemy<3 and Alchemical
return current_app.extensions['migrate'].db.get_engine()
except TypeError:
# this works with Flask-SQLAlchemy>=3
return current_app.extensions['migrate'].db.engine
# add your model's MetaData object here
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
config.set_main_option(
'sqlalchemy.url', str(get_engine().url).replace('%', '%%'))
target_db = current_app.extensions['migrate'].db
# other values from the config, defined by the needs of env.py,
# can be acquired:
# my_important_option = config.get_main_option("my_important_option")
# ... etc.
def get_metadata():
if hasattr(target_db, 'metadatas'):
return target_db.metadatas[None]
return target_db.metadata
def run_migrations_offline():
"""Run migrations in 'offline' mode.
This configures the context with just a URL
and not an Engine, though an Engine is acceptable
here as well. By skipping the Engine creation
we don't even need a DBAPI to be available.
Calls to context.execute() here emit the given string to the
script output.
"""
url = config.get_main_option("sqlalchemy.url")
context.configure(
url=url, target_metadata=get_metadata(), literal_binds=True
)
with context.begin_transaction():
context.run_migrations()
def run_migrations_online():
"""Run migrations in 'online' mode.
In this scenario we need to create an Engine
and associate a connection with the context.
"""
# this callback is used to prevent an auto-migration from being generated
# when there are no changes to the schema
# reference: http://alembic.zzzcomputing.com/en/latest/cookbook.html
def process_revision_directives(context, revision, directives):
if getattr(config.cmd_opts, 'autogenerate', False):
script = directives[0]
if script.upgrade_ops.is_empty():
directives[:] = []
logger.info('No changes in schema detected.')
connectable = get_engine()
with connectable.connect() as connection:
context.configure(
connection=connection,
target_metadata=get_metadata(),
process_revision_directives=process_revision_directives,
**current_app.extensions['migrate'].configure_args
)
with context.begin_transaction():
context.run_migrations()
if context.is_offline_mode():
run_migrations_offline()
else:
run_migrations_online()

View File

@ -1,24 +0,0 @@
"""${message}
Revision ID: ${up_revision}
Revises: ${down_revision | comma,n}
Create Date: ${create_date}
"""
from alembic import op
import sqlalchemy as sa
${imports if imports else ""}
# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
depends_on = ${repr(depends_on)}
def upgrade():
${upgrades if upgrades else "pass"}
def downgrade():
${downgrades if downgrades else "pass"}

View File

@ -1,35 +0,0 @@
"""empty message
Revision ID: 0232292c96ab
Revises: e0b52571de61
Create Date: 2023-04-20 19:52:09.265045
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0232292c96ab'
down_revision = 'e0b52571de61'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('call_numbers',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('appointment_id', sa.Integer(), nullable=True),
sa.Column('notified', sa.Boolean(), nullable=True),
sa.Column('call_time', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['appointment_id'], ['appointment.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('call_numbers')
# ### end Alembic commands ###

View File

@ -1,36 +0,0 @@
"""empty message
Revision ID: 02b3b778cb77
Revises: 990cd6f0472e
Create Date: 2023-04-20 19:32:12.155188
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '02b3b778cb77'
down_revision = '990cd6f0472e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.add_column(sa.Column('status', sa.String(length=20), nullable=True))
batch_op.add_column(sa.Column('notified', sa.Boolean(), nullable=True))
batch_op.drop_column('has_called')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.add_column(sa.Column('has_called', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True))
batch_op.drop_column('notified')
batch_op.drop_column('status')
# ### end Alembic commands ###

View File

@ -1,51 +0,0 @@
"""empty message
Revision ID: 0dde8306cfab
Revises:
Create Date: 2023-04-02 15:09:09.251414
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0dde8306cfab'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('roles',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=64), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
op.create_table('users',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('email', sa.String(length=64), nullable=True),
sa.Column('username', sa.String(length=64), nullable=True),
sa.Column('role_id', sa.Integer(), nullable=True),
sa.Column('password_hash', sa.String(length=128), nullable=True),
sa.ForeignKeyConstraint(['role_id'], ['roles.id'], ),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_users_email'), ['email'], unique=True)
batch_op.create_index(batch_op.f('ix_users_username'), ['username'], unique=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_users_username'))
batch_op.drop_index(batch_op.f('ix_users_email'))
op.drop_table('users')
op.drop_table('roles')
# ### end Alembic commands ###

View File

@ -1,50 +0,0 @@
"""empty message
Revision ID: 0df253550689
Revises: 1a574337293a
Create Date: 2023-04-22 10:33:01.833957
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '0df253550689'
down_revision = '1a574337293a'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('private_messages',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('sender_id', sa.Integer(), nullable=True),
sa.Column('recipient_id', sa.Integer(), nullable=True),
sa.Column('body', sa.Text(), nullable=True),
sa.Column('time', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['recipient_id'], ['users.id'], ),
sa.ForeignKeyConstraint(['sender_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.drop_table('messages')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('messages',
sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False),
sa.Column('sender_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('recipient_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('body', mysql.TEXT(), nullable=True),
sa.Column('time', mysql.DATETIME(), nullable=True),
sa.ForeignKeyConstraint(['recipient_id'], ['users.id'], name='messages_ibfk_1'),
sa.ForeignKeyConstraint(['sender_id'], ['users.id'], name='messages_ibfk_2'),
sa.PrimaryKeyConstraint('id'),
mysql_default_charset='utf8',
mysql_engine='InnoDB'
)
op.drop_table('private_messages')
# ### end Alembic commands ###

View File

@ -1,48 +0,0 @@
"""empty message
Revision ID: 169f586b8369
Revises: a6858c0553e9
Create Date: 2023-04-14 14:31:04.633225
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '169f586b8369'
down_revision = 'a6858c0553e9'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.add_column(sa.Column('email', sa.String(length=64), nullable=True))
batch_op.add_column(sa.Column('name', sa.String(length=64), nullable=True))
batch_op.add_column(sa.Column('location', sa.String(length=64), nullable=True))
batch_op.add_column(sa.Column('gender', sa.String(length=5), nullable=True))
batch_op.add_column(sa.Column('address', sa.String(length=256), nullable=True))
batch_op.add_column(sa.Column('phone', sa.String(length=15), nullable=True))
batch_op.add_column(sa.Column('age', sa.Integer(), nullable=True))
batch_op.add_column(sa.Column('id_number', sa.String(length=64), nullable=True))
batch_op.create_index(batch_op.f('ix_appointment_email'), ['email'], unique=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_appointment_email'))
batch_op.drop_column('id_number')
batch_op.drop_column('age')
batch_op.drop_column('phone')
batch_op.drop_column('address')
batch_op.drop_column('gender')
batch_op.drop_column('location')
batch_op.drop_column('name')
batch_op.drop_column('email')
# ### end Alembic commands ###

View File

@ -1,37 +0,0 @@
"""empty message
Revision ID: 1a574337293a
Revises: 0232292c96ab
Create Date: 2023-04-22 10:28:36.617214
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1a574337293a'
down_revision = '0232292c96ab'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('messages',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('sender_id', sa.Integer(), nullable=True),
sa.Column('recipient_id', sa.Integer(), nullable=True),
sa.Column('body', sa.Text(), nullable=True),
sa.Column('time', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['recipient_id'], ['users.id'], ),
sa.ForeignKeyConstraint(['sender_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('messages')
# ### end Alembic commands ###

View File

@ -1,35 +0,0 @@
"""empty message
Revision ID: 1c5ef9475969
Revises: 6419f62abd69
Create Date: 2023-04-11 12:38:22.601185
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1c5ef9475969'
down_revision = '6419f62abd69'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('likes',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=True),
sa.Column('post_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['post_id'], ['posts.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('likes')
# ### end Alembic commands ###

View File

@ -1,32 +0,0 @@
"""empty message
Revision ID: 279578d46236
Revises: 2a6772c55c55
Create Date: 2023-04-15 15:00:54.859894
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '279578d46236'
down_revision = '2a6772c55c55'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.add_column(sa.Column('num', sa.Integer(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.drop_column('num')
# ### end Alembic commands ###

View File

@ -1,32 +0,0 @@
"""empty message
Revision ID: 2961517be887
Revises: 8a31f809b808
Create Date: 2023-04-15 18:23:26.756873
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2961517be887'
down_revision = '8a31f809b808'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('id_number', sa.String(length=64), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_column('id_number')
# ### end Alembic commands ###

View File

@ -1,32 +0,0 @@
"""empty message
Revision ID: 2a6772c55c55
Revises: 60bd7995263a
Create Date: 2023-04-15 14:38:43.754851
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2a6772c55c55'
down_revision = '60bd7995263a'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.add_column(sa.Column('cost', sa.Integer(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.drop_column('cost')
# ### end Alembic commands ###

View File

@ -1,32 +0,0 @@
"""empty message
Revision ID: 31222bff99e8
Revises: 0dde8306cfab
Create Date: 2023-04-03 09:55:34.224070
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '31222bff99e8'
down_revision = '0dde8306cfab'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('confirmed', sa.Boolean(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_column('confirmed')
# ### end Alembic commands ###

View File

@ -1,34 +0,0 @@
"""empty message
Revision ID: 31f169c37c61
Revises: dfa6be070d7e
Create Date: 2023-04-07 14:08:34.257702
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '31f169c37c61'
down_revision = 'dfa6be070d7e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('has_avatar', sa.Boolean(), nullable=True))
batch_op.drop_column('avatar_path')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('avatar_path', mysql.VARCHAR(length=256), nullable=True))
batch_op.drop_column('has_avatar')
# ### end Alembic commands ###

View File

@ -1,79 +0,0 @@
"""empty message
Revision ID: 36b005d8e480
Revises: ef4643db2b6e
Create Date: 2023-04-23 21:24:19.183397
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '36b005d8e480'
down_revision = 'ef4643db2b6e'
branch_labels = None
depends_on = None
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('reports', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='foreignkey')
batch_op.create_foreign_key('reports_ibfk_1', 'appointment_info', ['appointment_id'], ['id'])
with op.batch_alter_table('call_numbers', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='foreignkey')
batch_op.create_foreign_key('call_numbers_ibfk_1', 'appointment_info', ['appointment_id'], ['id'])
op.create_table('comment_fordoc',
sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False),
sa.Column('body', mysql.TEXT(), nullable=True),
sa.Column('timestamp', mysql.DATETIME(), nullable=True),
sa.Column('author_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('doc_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('star_num', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['author_id'], ['users.id'], name='comment_fordoc_ibfk_1'),
sa.ForeignKeyConstraint(['doc_id'], ['users.id'], name='comment_fordoc_ibfk_2'),
sa.PrimaryKeyConstraint('id'),
mysql_default_charset='utf8',
mysql_engine='InnoDB'
)
with op.batch_alter_table('comment_fordoc', schema=None) as batch_op:
batch_op.create_index('ix_doccomments_timestamp', ['timestamp'], unique=False)
op.create_table('appointment_info',
sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False),
sa.Column('patient_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('doc_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('date', sa.DATE(), nullable=True),
sa.Column('email', mysql.VARCHAR(length=256), nullable=True),
sa.Column('name', mysql.VARCHAR(length=256), nullable=True),
sa.Column('gender', mysql.VARCHAR(length=256), nullable=True),
sa.Column('phone', mysql.VARCHAR(length=256), nullable=True),
sa.Column('age', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('id_number', mysql.VARCHAR(length=256), nullable=True),
sa.Column('time', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('location', mysql.VARCHAR(length=256), nullable=True),
sa.Column('cost', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('num', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['doc_id'], ['users.id'], name='appointment_info_ibfk_1'),
sa.ForeignKeyConstraint(['patient_id'], ['users.id'], name='appointment_info_ibfk_2'),
sa.PrimaryKeyConstraint('id'),
mysql_default_charset='utf8',
mysql_engine='InnoDB'
)
with op.batch_alter_table('appointment_info', schema=None) as batch_op:
batch_op.create_index('ix_appointment_email', ['email'], unique=False)
batch_op.create_index('ix_appointment_date', ['date'], unique=False)
with op.batch_alter_table('doccomments', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_doccomments_timestamp'))
op.drop_table('doccomments')
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_appointment_email'))
batch_op.drop_index(batch_op.f('ix_appointment_date'))
op.drop_table('appointment')
# ### end Alembic commands ###

View File

@ -1,32 +0,0 @@
"""empty message
Revision ID: 39e44c8af34c
Revises: 7738309ad0d0
Create Date: 2023-04-06 16:45:14.509974
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '39e44c8af34c'
down_revision = '7738309ad0d0'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('age', sa.Integer(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_column('age')
# ### end Alembic commands ###

View File

@ -1,57 +0,0 @@
"""empty message
Revision ID: 411a1d0b9294
Revises: bad91e69ca34
Create Date: 2023-04-13 20:14:04.733864
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '411a1d0b9294'
down_revision = 'bad91e69ca34'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('appointment',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('patient_id', sa.Integer(), nullable=True),
sa.Column('doc_id', sa.Integer(), nullable=True),
sa.Column('date', sa.Date(), nullable=True),
sa.ForeignKeyConstraint(['doc_id'], ['users.id'], ),
sa.ForeignKeyConstraint(['patient_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_appointment_date'), ['date'], unique=False)
op.create_table('workday',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('doc_id', sa.Integer(), nullable=True),
sa.Column('date', sa.Date(), nullable=True),
sa.Column('num', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['doc_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('workday', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_workday_date'), ['date'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('workday', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_workday_date'))
op.drop_table('workday')
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_appointment_date'))
op.drop_table('appointment')
# ### end Alembic commands ###

View File

@ -1,36 +0,0 @@
"""empty message
Revision ID: 49aeda2e2b80
Revises: d46f10b87507
Create Date: 2023-04-14 14:38:38.730728
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '49aeda2e2b80'
down_revision = 'd46f10b87507'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.add_column(sa.Column('time', sa.Integer(), nullable=True))
batch_op.drop_column('is_morning')
batch_op.drop_column('is_afternoon')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.add_column(sa.Column('is_afternoon', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
batch_op.add_column(sa.Column('is_morning', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
batch_op.drop_column('time')
# ### end Alembic commands ###

View File

@ -1,35 +0,0 @@
"""empty message
Revision ID: 4a9d1ba8736e
Revises: 1c5ef9475969
Create Date: 2023-04-11 13:55:44.332479
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4a9d1ba8736e'
down_revision = '1c5ef9475969'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('collects',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=True),
sa.Column('post_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['post_id'], ['posts.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('collects')
# ### end Alembic commands ###

View File

@ -1,54 +0,0 @@
"""empty message
Revision ID: 5bcae7b12e80
Revises: c47fdd1a45f9
Create Date: 2023-04-15 12:36:16.564662
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '5bcae7b12e80'
down_revision = 'c47fdd1a45f9'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.alter_column('name',
existing_type=mysql.VARCHAR(length=64),
type_=sa.String(length=256),
existing_nullable=True)
batch_op.alter_column('gender',
existing_type=mysql.VARCHAR(length=5),
type_=sa.String(length=256),
existing_nullable=True)
batch_op.alter_column('phone',
existing_type=mysql.VARCHAR(length=15),
type_=sa.String(length=256),
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.alter_column('phone',
existing_type=sa.String(length=256),
type_=mysql.VARCHAR(length=15),
existing_nullable=True)
batch_op.alter_column('gender',
existing_type=sa.String(length=256),
type_=mysql.VARCHAR(length=5),
existing_nullable=True)
batch_op.alter_column('name',
existing_type=sa.String(length=256),
type_=mysql.VARCHAR(length=64),
existing_nullable=True)
# ### end Alembic commands ###

View File

@ -1,32 +0,0 @@
"""empty message
Revision ID: 5f6e19ecdbaf
Revises: e345198c92d5
Create Date: 2023-04-13 09:49:14.466038
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5f6e19ecdbaf'
down_revision = 'e345198c92d5'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('department', sa.String(length=128), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_column('department')
# ### end Alembic commands ###

View File

@ -1,34 +0,0 @@
"""empty message
Revision ID: 60bd7995263a
Revises: 5bcae7b12e80
Create Date: 2023-04-15 13:12:17.315378
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '60bd7995263a'
down_revision = '5bcae7b12e80'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.add_column(sa.Column('location', sa.String(length=256), nullable=True))
batch_op.drop_column('address')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.add_column(sa.Column('address', mysql.VARCHAR(length=256), nullable=True))
batch_op.drop_column('location')
# ### end Alembic commands ###

View File

@ -1,43 +0,0 @@
"""empty message
Revision ID: 6419f62abd69
Revises: 688e06991331
Create Date: 2023-04-09 19:03:09.833527
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6419f62abd69'
down_revision = '688e06991331'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('comments',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('body', sa.Text(), nullable=True),
sa.Column('timestamp', sa.DateTime(), nullable=True),
sa.Column('author_id', sa.Integer(), nullable=True),
sa.Column('post_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['author_id'], ['users.id'], ),
sa.ForeignKeyConstraint(['post_id'], ['posts.id'], ),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('comments', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_comments_timestamp'), ['timestamp'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('comments', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_comments_timestamp'))
op.drop_table('comments')
# ### end Alembic commands ###

View File

@ -1,52 +0,0 @@
"""empty message
Revision ID: 6630335c7b63
Revises: 39e44c8af34c
Create Date: 2023-04-06 20:56:08.891686
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6630335c7b63'
down_revision = '39e44c8af34c'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('posts',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('title', sa.Text(), nullable=True),
sa.Column('content', sa.Text(), nullable=True),
sa.Column('img_path', sa.String(length=64), nullable=True),
sa.Column('collect_num', sa.Integer(), nullable=True),
sa.Column('comment_num', sa.Integer(), nullable=True),
sa.Column('like_num', sa.Integer(), nullable=True),
sa.Column('timestamp', sa.DateTime(), nullable=True),
sa.Column('author_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['author_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('posts', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_posts_timestamp'), ['timestamp'], unique=False)
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('avatar_path', sa.String(length=128), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_column('avatar_path')
with op.batch_alter_table('posts', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_posts_timestamp'))
op.drop_table('posts')
# ### end Alembic commands ###

View File

@ -1,37 +0,0 @@
"""empty message
Revision ID: 688e06991331
Revises: fa9fad0a40c3
Create Date: 2023-04-07 21:02:53.426656
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '688e06991331'
down_revision = 'fa9fad0a40c3'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('img_attrs')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('img_attrs',
sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False),
sa.Column('name', mysql.VARCHAR(length=128), nullable=True),
sa.Column('path', mysql.VARCHAR(length=128), nullable=True),
sa.Column('post_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['post_id'], ['posts.id'], name='img_attrs_ibfk_1'),
sa.PrimaryKeyConstraint('id'),
mysql_default_charset='utf8',
mysql_engine='InnoDB'
)
# ### end Alembic commands ###

View File

@ -1,40 +0,0 @@
"""empty message
Revision ID: 698ff838fb8e
Revises: 49aeda2e2b80
Create Date: 2023-04-15 09:11:10.273475
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '698ff838fb8e'
down_revision = '49aeda2e2b80'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.alter_column('location',
existing_type=mysql.VARCHAR(length=64),
type_=sa.String(length=256),
existing_nullable=True)
batch_op.drop_column('address')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('address', mysql.VARCHAR(length=256), nullable=True))
batch_op.alter_column('location',
existing_type=sa.String(length=256),
type_=mysql.VARCHAR(length=64),
existing_nullable=True)
# ### end Alembic commands ###

View File

@ -1,36 +0,0 @@
"""empty message
Revision ID: 72bce1509968
Revises: 411a1d0b9294
Create Date: 2023-04-14 10:35:25.887068
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '72bce1509968'
down_revision = '411a1d0b9294'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('workday', schema=None) as batch_op:
batch_op.add_column(sa.Column('morning_num', sa.Integer(), nullable=True))
batch_op.add_column(sa.Column('afternoon_num', sa.Integer(), nullable=True))
batch_op.drop_column('num')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('workday', schema=None) as batch_op:
batch_op.add_column(sa.Column('num', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
batch_op.drop_column('afternoon_num')
batch_op.drop_column('morning_num')
# ### end Alembic commands ###

View File

@ -1,34 +0,0 @@
"""empty message
Revision ID: 7738309ad0d0
Revises: d5b377434283
Create Date: 2023-04-06 15:19:58.457148
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7738309ad0d0'
down_revision = 'd5b377434283'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('address', sa.String(length=128), nullable=True))
batch_op.add_column(sa.Column('phone', sa.String(length=15), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_column('phone')
batch_op.drop_column('address')
# ### end Alembic commands ###

View File

@ -1,34 +0,0 @@
"""empty message
Revision ID: 8a31f809b808
Revises: 279578d46236
Create Date: 2023-04-15 16:35:19.380617
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8a31f809b808'
down_revision = '279578d46236'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.drop_index('ix_appointment_email')
batch_op.create_index(batch_op.f('ix_appointment_email'), ['email'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_appointment_email'))
batch_op.create_index('ix_appointment_email', ['email'], unique=False)
# ### end Alembic commands ###

View File

@ -1,32 +0,0 @@
"""empty message
Revision ID: 98fe9675245a
Revises: d4aafb947dc3
Create Date: 2023-04-17 16:15:22.010836
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '98fe9675245a'
down_revision = 'd4aafb947dc3'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('reports', schema=None) as batch_op:
batch_op.add_column(sa.Column('diagnosis_sign', sa.String(length=64), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('reports', schema=None) as batch_op:
batch_op.drop_column('diagnosis_sign')
# ### end Alembic commands ###

View File

@ -1,32 +0,0 @@
"""empty message
Revision ID: 990cd6f0472e
Revises: 98fe9675245a
Create Date: 2023-04-20 17:22:11.061461
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '990cd6f0472e'
down_revision = '98fe9675245a'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.add_column(sa.Column('has_called', sa.Boolean(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.drop_column('has_called')
# ### end Alembic commands ###

View File

@ -1,34 +0,0 @@
"""empty message
Revision ID: a6858c0553e9
Revises: a89a0dc536df
Create Date: 2023-04-14 13:57:47.242732
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a6858c0553e9'
down_revision = 'a89a0dc536df'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.add_column(sa.Column('is_morning', sa.Integer(), nullable=True))
batch_op.add_column(sa.Column('is_afternoon', sa.Integer(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.drop_column('is_afternoon')
batch_op.drop_column('is_morning')
# ### end Alembic commands ###

View File

@ -1,34 +0,0 @@
"""empty message
Revision ID: a89a0dc536df
Revises: ffde36a65d1a
Create Date: 2023-04-14 13:27:27.199624
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a89a0dc536df'
down_revision = 'ffde36a65d1a'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('workday', schema=None) as batch_op:
batch_op.add_column(sa.Column('temp_morning', sa.Integer(), nullable=True))
batch_op.add_column(sa.Column('temp_afternoon', sa.Integer(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('workday', schema=None) as batch_op:
batch_op.drop_column('temp_afternoon')
batch_op.drop_column('temp_morning')
# ### end Alembic commands ###

View File

@ -1,32 +0,0 @@
"""empty message
Revision ID: bad91e69ca34
Revises: d270947beff6
Create Date: 2023-04-13 16:38:37.237482
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bad91e69ca34'
down_revision = 'd270947beff6'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('doccomments', schema=None) as batch_op:
batch_op.add_column(sa.Column('star_num', sa.Integer(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('doccomments', schema=None) as batch_op:
batch_op.drop_column('star_num')
# ### end Alembic commands ###

View File

@ -1,38 +0,0 @@
"""empty message
Revision ID: bb3518c7dc22
Revises: 0df253550689
Create Date: 2023-04-23 19:42:48.812186
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'bb3518c7dc22'
down_revision = '0df253550689'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('feedbacks', schema=None) as batch_op:
batch_op.add_column(sa.Column('user_id', sa.Integer(), nullable=True))
batch_op.drop_index('name')
batch_op.create_foreign_key(None, 'users', ['user_id'], ['id'])
batch_op.drop_column('name')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('feedbacks', schema=None) as batch_op:
batch_op.add_column(sa.Column('name', mysql.VARCHAR(length=64), nullable=True))
batch_op.drop_constraint(None, type_='foreignkey')
batch_op.create_index('name', ['name'], unique=False)
batch_op.drop_column('user_id')
# ### end Alembic commands ###

View File

@ -1,38 +0,0 @@
"""empty message
Revision ID: bd0f2e72956b
Revises: 698ff838fb8e
Create Date: 2023-04-15 12:27:24.563859
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'bd0f2e72956b'
down_revision = '698ff838fb8e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.alter_column('email',
existing_type=mysql.VARCHAR(length=64),
type_=sa.String(length=256),
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.alter_column('email',
existing_type=sa.String(length=256),
type_=mysql.VARCHAR(length=64),
existing_nullable=True)
# ### end Alembic commands ###

View File

@ -1,38 +0,0 @@
"""empty message
Revision ID: c47fdd1a45f9
Revises: bd0f2e72956b
Create Date: 2023-04-15 12:35:09.615442
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'c47fdd1a45f9'
down_revision = 'bd0f2e72956b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.alter_column('id_number',
existing_type=mysql.VARCHAR(length=64),
type_=sa.String(length=256),
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.alter_column('id_number',
existing_type=sa.String(length=256),
type_=mysql.VARCHAR(length=64),
existing_nullable=True)
# ### end Alembic commands ###

View File

@ -1,36 +0,0 @@
"""empty message
Revision ID: c9210e82abc5
Revises: 31222bff99e8
Create Date: 2023-04-03 13:43:14.596028
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c9210e82abc5'
down_revision = '31222bff99e8'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('roles', schema=None) as batch_op:
batch_op.add_column(sa.Column('default', sa.Boolean(), nullable=True))
batch_op.add_column(sa.Column('permissions', sa.Integer(), nullable=True))
batch_op.create_index(batch_op.f('ix_roles_default'), ['default'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('roles', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_roles_default'))
batch_op.drop_column('permissions')
batch_op.drop_column('default')
# ### end Alembic commands ###

View File

@ -1,43 +0,0 @@
"""empty message
Revision ID: d270947beff6
Revises: 5f6e19ecdbaf
Create Date: 2023-04-13 15:28:37.094758
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd270947beff6'
down_revision = '5f6e19ecdbaf'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('doccomments',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('body', sa.Text(), nullable=True),
sa.Column('timestamp', sa.DateTime(), nullable=True),
sa.Column('author_id', sa.Integer(), nullable=True),
sa.Column('doc_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['author_id'], ['users.id'], ),
sa.ForeignKeyConstraint(['doc_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('doccomments', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_doccomments_timestamp'), ['timestamp'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('doccomments', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_doccomments_timestamp'))
op.drop_table('doccomments')
# ### end Alembic commands ###

View File

@ -1,32 +0,0 @@
"""empty message
Revision ID: d46f10b87507
Revises: 169f586b8369
Create Date: 2023-04-14 14:35:38.469465
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'd46f10b87507'
down_revision = '169f586b8369'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.drop_column('location')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.add_column(sa.Column('location', mysql.VARCHAR(length=64), nullable=True))
# ### end Alembic commands ###

View File

@ -1,36 +0,0 @@
"""empty message
Revision ID: d4aafb947dc3
Revises: 2961517be887
Create Date: 2023-04-17 16:12:19.482973
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd4aafb947dc3'
down_revision = '2961517be887'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('reports',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('appointment_id', sa.Integer(), nullable=True),
sa.Column('diagnosis_result', sa.String(length=256), nullable=True),
sa.Column('diagnosis_advice', sa.Text(), nullable=False),
sa.Column('diagnosis_date', sa.String(length=64), nullable=True),
sa.ForeignKeyConstraint(['appointment_id'], ['appointment.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('reports')
# ### end Alembic commands ###

View File

@ -1,34 +0,0 @@
"""empty message
Revision ID: d5b377434283
Revises: f5bf87849ce2
Create Date: 2023-04-04 20:14:14.910103
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'd5b377434283'
down_revision = 'f5bf87849ce2'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('sex', sa.String(length=5), nullable=True))
batch_op.drop_column('member_since')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('member_since', mysql.DATETIME(), nullable=True))
batch_op.drop_column('sex')
# ### end Alembic commands ###

View File

@ -1,46 +0,0 @@
"""empty message
Revision ID: dfa6be070d7e
Revises: 6630335c7b63
Create Date: 2023-04-07 12:23:19.867038
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'dfa6be070d7e'
down_revision = '6630335c7b63'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.alter_column('avatar_path',
existing_type=mysql.VARCHAR(length=128),
type_=sa.String(length=256),
existing_nullable=True)
batch_op.alter_column('address',
existing_type=mysql.VARCHAR(length=128),
type_=sa.String(length=256),
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.alter_column('address',
existing_type=sa.String(length=256),
type_=mysql.VARCHAR(length=128),
existing_nullable=True)
batch_op.alter_column('avatar_path',
existing_type=sa.String(length=256),
type_=mysql.VARCHAR(length=128),
existing_nullable=True)
# ### end Alembic commands ###

View File

@ -1,43 +0,0 @@
"""empty message
Revision ID: e0b52571de61
Revises: 02b3b778cb77
Create Date: 2023-04-20 19:49:52.091246
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'e0b52571de61'
down_revision = '02b3b778cb77'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('call_number',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('appointment_id', sa.Integer(), nullable=True),
sa.Column('notified', sa.Boolean(), nullable=True),
sa.Column('call_time', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['appointment_id'], ['appointment.id'], ),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.drop_column('notified')
batch_op.drop_column('status')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.add_column(sa.Column('status', mysql.VARCHAR(length=20), nullable=True))
batch_op.add_column(sa.Column('notified', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True))
op.drop_table('call_number')
# ### end Alembic commands ###

View File

@ -1,34 +0,0 @@
"""empty message
Revision ID: e345198c92d5
Revises: 4a9d1ba8736e
Create Date: 2023-04-12 15:57:57.258269
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e345198c92d5'
down_revision = '4a9d1ba8736e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('feedbacks',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=64), nullable=True),
sa.Column('feedback', sa.Text(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('feedbacks')
# ### end Alembic commands ###

View File

@ -1,34 +0,0 @@
"""empty message
Revision ID: e559de4fd2c3
Revises: 36b005d8e480
Create Date: 2023-05-04 17:25:33.005500
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e559de4fd2c3'
down_revision = '36b005d8e480'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_appointment_date'), ['date'], unique=False)
batch_op.create_index(batch_op.f('ix_appointment_email'), ['email'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_appointment_email'))
batch_op.drop_index(batch_op.f('ix_appointment_date'))
# ### end Alembic commands ###

View File

@ -1,96 +0,0 @@
"""empty message
Revision ID: ef4643db2b6e
Revises: bb3518c7dc22
Create Date: 2023-04-23 21:19:56.976825
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'ef4643db2b6e'
down_revision = 'bb3518c7dc22'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('appointment_info', schema=None) as batch_op:
batch_op.drop_index('ix_appointment_info_date')
batch_op.drop_index('ix_appointment_info_email')
op.drop_table('appointment_info')
with op.batch_alter_table('comment_fordoc', schema=None) as batch_op:
batch_op.drop_index('ix_comment_fordoc_timestamp')
op.drop_table('comment_fordoc')
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_appointment_date'), ['date'], unique=False)
batch_op.create_index(batch_op.f('ix_appointment_email'), ['email'], unique=False)
with op.batch_alter_table('call_numbers', schema=None) as batch_op:
batch_op.create_unique_constraint(None, ['appointment_id'])
with op.batch_alter_table('reports', schema=None) as batch_op:
batch_op.create_unique_constraint(None, ['appointment_id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('reports', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='unique')
with op.batch_alter_table('call_numbers', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='unique')
with op.batch_alter_table('appointment', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_appointment_email'))
batch_op.drop_index(batch_op.f('ix_appointment_date'))
op.create_table('comment_fordoc',
sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False),
sa.Column('body', mysql.TEXT(), nullable=True),
sa.Column('timestamp', mysql.DATETIME(), nullable=True),
sa.Column('author_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('doc_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('star_num', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['author_id'], ['users.id'], name='comment_fordoc_ibfk_1'),
sa.ForeignKeyConstraint(['doc_id'], ['users.id'], name='comment_fordoc_ibfk_2'),
sa.PrimaryKeyConstraint('id'),
mysql_default_charset='utf8',
mysql_engine='InnoDB'
)
with op.batch_alter_table('comment_fordoc', schema=None) as batch_op:
batch_op.create_index('ix_comment_fordoc_timestamp', ['timestamp'], unique=False)
op.create_table('appointment_info',
sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False),
sa.Column('patient_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('doc_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('date', sa.DATE(), nullable=True),
sa.Column('time', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('email', mysql.VARCHAR(length=256), nullable=True),
sa.Column('id_number', mysql.VARCHAR(length=256), nullable=True),
sa.Column('name', mysql.VARCHAR(length=256), nullable=True),
sa.Column('gender', mysql.VARCHAR(length=256), nullable=True),
sa.Column('location', mysql.VARCHAR(length=256), nullable=True),
sa.Column('phone', mysql.VARCHAR(length=256), nullable=True),
sa.Column('age', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('cost', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('num', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['doc_id'], ['users.id'], name='appointment_info_ibfk_1'),
sa.ForeignKeyConstraint(['patient_id'], ['users.id'], name='appointment_info_ibfk_2'),
sa.PrimaryKeyConstraint('id'),
mysql_default_charset='utf8',
mysql_engine='InnoDB'
)
with op.batch_alter_table('appointment_info', schema=None) as batch_op:
batch_op.create_index('ix_appointment_info_email', ['email'], unique=False)
batch_op.create_index('ix_appointment_info_date', ['date'], unique=False)
# ### end Alembic commands ###

View File

@ -1,32 +0,0 @@
"""empty message
Revision ID: f5bf87849ce2
Revises: f7a9296b6817
Create Date: 2023-04-04 09:59:40.714568
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f5bf87849ce2'
down_revision = 'f7a9296b6817'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('avatar_color', sa.String(length=10), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_column('avatar_color')
# ### end Alembic commands ###

View File

@ -1,40 +0,0 @@
"""empty message
Revision ID: f7a9296b6817
Revises: c9210e82abc5
Create Date: 2023-04-03 18:58:41.344794
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f7a9296b6817'
down_revision = 'c9210e82abc5'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('name', sa.String(length=64), nullable=True))
batch_op.add_column(sa.Column('location', sa.String(length=64), nullable=True))
batch_op.add_column(sa.Column('about_me', sa.Text(), nullable=True))
batch_op.add_column(sa.Column('member_since', sa.DateTime(), nullable=True))
batch_op.add_column(sa.Column('last_seen', sa.DateTime(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_column('last_seen')
batch_op.drop_column('member_since')
batch_op.drop_column('about_me')
batch_op.drop_column('location')
batch_op.drop_column('name')
# ### end Alembic commands ###

View File

@ -1,61 +0,0 @@
"""empty message
Revision ID: fa9fad0a40c3
Revises: 31f169c37c61
Create Date: 2023-04-07 18:05:59.713134
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'fa9fad0a40c3'
down_revision = '31f169c37c61'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('img_attrs',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=128), nullable=True),
sa.Column('path', sa.String(length=128), nullable=True),
sa.Column('post_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['post_id'], ['posts.id'], ),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('posts', schema=None) as batch_op:
batch_op.add_column(sa.Column('img_count', sa.Integer(), nullable=True))
batch_op.alter_column('title',
existing_type=mysql.TEXT(),
nullable=False)
batch_op.alter_column('content',
existing_type=mysql.TEXT(),
nullable=False)
batch_op.alter_column('author_id',
existing_type=mysql.INTEGER(display_width=11),
nullable=False)
batch_op.drop_column('img_path')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('posts', schema=None) as batch_op:
batch_op.add_column(sa.Column('img_path', mysql.VARCHAR(length=64), nullable=True))
batch_op.alter_column('author_id',
existing_type=mysql.INTEGER(display_width=11),
nullable=True)
batch_op.alter_column('content',
existing_type=mysql.TEXT(),
nullable=True)
batch_op.alter_column('title',
existing_type=mysql.TEXT(),
nullable=True)
batch_op.drop_column('img_count')
op.drop_table('img_attrs')
# ### end Alembic commands ###

View File

@ -1,32 +0,0 @@
"""empty message
Revision ID: ffde36a65d1a
Revises: 72bce1509968
Create Date: 2023-04-14 10:41:44.158147
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ffde36a65d1a'
down_revision = '72bce1509968'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('workday', schema=None) as batch_op:
batch_op.add_column(sa.Column('cost', sa.Integer(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('workday', schema=None) as batch_op:
batch_op.drop_column('cost')
# ### end Alembic commands ###

View File

@ -3,8 +3,10 @@ alembic==1.12.1
astor==0.8.1
blinker==1.6.3
certifi @ file:///C:/b/abs_85o_6fm0se/croot/certifi_1671487778835/work/certifi
cffi==1.15.1
click==8.0.1
colorama==0.4.6
cryptography==43.0.0
dnspython==2.3.0
dominate==2.9.1
email-validator==1.3.1
@ -12,9 +14,10 @@ Flask==1.1.2
Flask-Bootstrap==3.3.7.1
Flask-Login==0.5.0
Flask-Mail==0.9.1
Flask-Migrate==4.0.7
Flask-Migrate==2.5.3
Flask-Moment==1.0.5
Flask-PageDown==0.2.0
Flask-Script==2.0.6
Flask-SQLAlchemy==2.4.4
Flask-WTF==1.0.1
gast==0.2.2
@ -26,7 +29,7 @@ idna==3.6
importlib-metadata==6.7.0
importlib-resources==5.12.0
itsdangerous==2.0.1
Jinja2==2.11.3
Jinja2==3.0.2
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
Mako==1.2.4
@ -36,10 +39,11 @@ numpy==1.19.5
opencv-python==4.5.1.48
opt-einsum==3.3.0
packaging==24.0
protobuf==4.24.4
protobuf==3.20.3
pycparser==2.21
PyMySQL==1.0.2
six==1.16.0
SQLAlchemy==1.4.47
SQLAlchemy==1.3.23
tensorboard==1.15.0
tensorflow==1.15.0
tensorflow-estimator==1.15.1