更新项目描述信息,清空数据库历史迁移文件

This commit is contained in:
ktianc 2022-10-11 08:45:37 +08:00
parent 87d02abf01
commit dc3edf152d
20 changed files with 29 additions and 737 deletions

View File

@ -95,26 +95,33 @@ pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
2. 修改数据库信息 2. 修改数据库信息
`application/settings.py` 文件中配置数据库信息 `application/settings.py` 文件中配置数据库信息,用于项目连接
- mysql数据库版本建议8.0 - mysql数据库版本建议8.0
- mysql数据库字符集utf8mb4 - mysql数据库字符集utf8mb4
```python ```python
""" """
数据库配置项 数据库配置项
连接引擎官方文档https://www.osgeo.cn/sqlalchemy/core/engines.html 连接引擎官方文档https://www.osgeo.cn/sqlalchemy/core/engines.html
数据库链接配置说明mysql+asyncmy://数据库用户名:数据库密码@数据库地址:数据库端口/数据库名称 数据库链接配置说明mysql+asyncmy://数据库用户名:数据库密码@数据库地址:数据库端口/数据库名称
""" """
if DEBUG: if DEBUG:
# 测试库 # 测试库
SQLALCHEMY_DATABASE_URL = "mysql+asyncmy://root:123456@127.0.0.1:3306/kinit" SQLALCHEMY_DATABASE_URL = "mysql+asyncmy://root:123456@127.0.0.1:3306/kinit"
SQLALCHEMY_DATABASE_TYPE = "mysql" SQLALCHEMY_DATABASE_TYPE = "mysql"
else: else:
# 正式库 # 正式库
SQLALCHEMY_DATABASE_URL = "mysql+asyncmy://root:123456@127.0.0.1:3306/kinit" SQLALCHEMY_DATABASE_URL = "mysql+asyncmy://root:123456@127.0.0.1:3306/kinit"
SQLALCHEMY_DATABASE_TYPE = "mysql" SQLALCHEMY_DATABASE_TYPE = "mysql"
``` ```
并在`alembic.ini`文件中配置数据库信息,用于数据库映射
```python
# mysql+pymysql://数据库用户名:数据库密码@数据库地址:数据库端口/数据库名称
sqlalchemy.url = mysql+pymysql://root:123456@127.0.0.1/kinit
```
3. 迁移数据库 3. 迁移数据库

View File

@ -86,46 +86,3 @@ pnpm run build:pro
## 更新日志 ## 更新日志
[更新日志](./CHANGELOG.md) [更新日志](./CHANGELOG.md)
## 如何贡献
你可以[提一个 issue](https://github.com/kailong321200875/vue-element-plus-admin/issues/new) 或者提交一个 Pull Request。
**Pull Request:**
1. Fork 代码
2. 创建自己的分支: `git checkout -b feat/xxxx`
3. 提交你的修改: `git commit -am 'feat(function): add xxxxx'`
4. 推送您的分支: `git push origin feat/xxxx`
5. 提交 `pull request`
## Git 贡献提交规范
- `feat` 新功能
- `fix` 修补 bug
- `docs` 文档
- `style` 格式、样式(不影响代码运行的变动)
- `refactor` 重构(即不是新增功能,也不是修改 BUG 的代码)
- `perf` 优化相关,比如提升性能、体验
- `test` 添加测试
- `build` 编译相关的修改,对项目构建或者依赖的改动
- `ci` 持续集成修改
- `chore` 构建过程或辅助工具的变动
- `revert` 回滚到上一个版本
- `workflow` 工作流改进
- `mod` 不确定分类的修改
- `wip` 开发中
- `types` 类型
## 浏览器支持
本地开发推荐使用 `Chrome 80+` 浏览器
支持现代浏览器, 不支持 IE
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
| :-: | :-: | :-: | :-: | :-: |
| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
## 依赖组件

View File

@ -1,4 +1,4 @@
# 初始 FastAPI 项目 # FastAPI 项目
fastapi 源代码https://github.com/tiangolo/fastapi fastapi 源代码https://github.com/tiangolo/fastapi
@ -44,11 +44,6 @@ SQLAlchemy-Utilshttps://sqlalchemy-utils.readthedocs.io/en/latest/
## 使用 ## 使用
``` ```
# 拉取代码
git clone https://gitee.com/ktianc/create_fastapi.git
cd create_fastapi/
# 安装依赖库 # 安装依赖库
pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

View File

@ -50,7 +50,8 @@ version_path_separator = os # default: use os.pathsep
# are written from script.py.mako # are written from script.py.mako
# output_encoding = utf-8 # output_encoding = utf-8
sqlalchemy.url = mysql+pymysql://root:Ktianc123@rm-bp181adf0phw2o0r05o.mysql.rds.aliyuncs.com/kinit # mysql+pymysql://数据库用户名:数据库密码@数据库地址:数据库端口/数据库名称
sqlalchemy.url = mysql+pymysql://root:123456@127.0.0.1/kinit
[post_write_hooks] [post_write_hooks]

View File

@ -1,30 +0,0 @@
"""update
Revision ID: 03e55ed3e858
Revises: 5e629ba5c3c8
Create Date: 2022-08-13 10:41:38.008004
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '03e55ed3e858'
down_revision = '5e629ba5c3c8'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_auth_menu', sa.Column('disabled', sa.Boolean(), nullable=True, comment='是否禁用'))
op.drop_column('vadmin_auth_menu', 'status')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_auth_menu', sa.Column('status', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True, comment='是否可用'))
op.drop_column('vadmin_auth_menu', 'disabled')
# ### end Alembic commands ###

View File

@ -1,66 +0,0 @@
"""update
Revision ID: 0cd7a858c5a5
Revises: bc1417d96581
Create Date: 2022-08-08 12:39:32.344065
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0cd7a858c5a5'
down_revision = 'bc1417d96581'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('vadmin_system_dict_type',
sa.Column('id', sa.Integer(), nullable=False, comment='主键ID'),
sa.Column('create_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='创建时间'),
sa.Column('update_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='更新时间'),
sa.Column('dict_name', sa.String(length=50), nullable=False, comment='字典名称'),
sa.Column('dict_type', sa.String(length=50), nullable=False, comment='字典类型'),
sa.Column('status', sa.Boolean(), nullable=True, comment='字典状态,是否可用'),
sa.Column('remark', sa.String(length=255), nullable=True, comment='备注'),
sa.PrimaryKeyConstraint('id'),
comment='字典类型表'
)
op.create_index(op.f('ix_vadmin_system_dict_type_dict_name'), 'vadmin_system_dict_type', ['dict_name'], unique=False)
op.create_index(op.f('ix_vadmin_system_dict_type_dict_type'), 'vadmin_system_dict_type', ['dict_type'], unique=False)
op.create_index(op.f('ix_vadmin_system_dict_type_id'), 'vadmin_system_dict_type', ['id'], unique=True)
op.create_table('vadmin_system_dict_details',
sa.Column('id', sa.Integer(), nullable=False, comment='主键ID'),
sa.Column('create_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='创建时间'),
sa.Column('update_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='更新时间'),
sa.Column('dict_label', sa.String(length=50), nullable=False, comment='字典标签'),
sa.Column('dict_value', sa.String(length=50), nullable=False, comment='字典键值'),
sa.Column('status', sa.Boolean(), nullable=True, comment='字典状态,是否可用'),
sa.Column('is_default', sa.Boolean(), nullable=True, comment='是否默认'),
sa.Column('sort', sa.Integer(), nullable=True, comment='字典排序'),
sa.Column('dict_type_id', sa.Integer(), nullable=True, comment='关联字典类型'),
sa.Column('remark', sa.String(length=255), nullable=True, comment='备注'),
sa.ForeignKeyConstraint(['dict_type_id'], ['vadmin_system_dict_type.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id'),
comment='字典详情表'
)
op.create_index(op.f('ix_vadmin_system_dict_details_dict_label'), 'vadmin_system_dict_details', ['dict_label'], unique=False)
op.create_index(op.f('ix_vadmin_system_dict_details_dict_value'), 'vadmin_system_dict_details', ['dict_value'], unique=False)
op.create_index(op.f('ix_vadmin_system_dict_details_id'), 'vadmin_system_dict_details', ['id'], unique=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_vadmin_system_dict_details_id'), table_name='vadmin_system_dict_details')
op.drop_index(op.f('ix_vadmin_system_dict_details_dict_value'), table_name='vadmin_system_dict_details')
op.drop_index(op.f('ix_vadmin_system_dict_details_dict_label'), table_name='vadmin_system_dict_details')
op.drop_table('vadmin_system_dict_details')
op.drop_index(op.f('ix_vadmin_system_dict_type_id'), table_name='vadmin_system_dict_type')
op.drop_index(op.f('ix_vadmin_system_dict_type_dict_type'), table_name='vadmin_system_dict_type')
op.drop_index(op.f('ix_vadmin_system_dict_type_dict_name'), table_name='vadmin_system_dict_type')
op.drop_table('vadmin_system_dict_type')
# ### end Alembic commands ###

View File

@ -1,38 +0,0 @@
"""update
Revision ID: 1d13c64e1444
Revises: ab5fb033599e
Create Date: 2022-10-05 21:17:42.029110
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '1d13c64e1444'
down_revision = 'ab5fb033599e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_system_dict_details', sa.Column('disabled', sa.Boolean(), nullable=True, comment='字典状态,是否禁用'))
op.add_column('vadmin_system_dict_details', sa.Column('order', sa.Integer(), nullable=True, comment='字典排序'))
op.drop_column('vadmin_system_dict_details', 'status')
op.drop_column('vadmin_system_dict_details', 'sort')
op.add_column('vadmin_system_dict_type', sa.Column('disabled', sa.Boolean(), nullable=True, comment='字典状态,是否禁用'))
op.drop_column('vadmin_system_dict_type', 'status')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_system_dict_type', sa.Column('status', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True, comment='字典状态,是否可用'))
op.drop_column('vadmin_system_dict_type', 'disabled')
op.add_column('vadmin_system_dict_details', sa.Column('sort', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True, comment='字典排序'))
op.add_column('vadmin_system_dict_details', sa.Column('status', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True, comment='字典状态,是否可用'))
op.drop_column('vadmin_system_dict_details', 'order')
op.drop_column('vadmin_system_dict_details', 'disabled')
# ### end Alembic commands ###

View File

@ -1,42 +0,0 @@
"""update
Revision ID: 203b11efd025
Revises: 1d13c64e1444
Create Date: 2022-10-05 21:43:34.894121
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '203b11efd025'
down_revision = '1d13c64e1444'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_system_dict_details', sa.Column('label', sa.String(length=50), nullable=False, comment='字典标签'))
op.add_column('vadmin_system_dict_details', sa.Column('value', sa.String(length=50), nullable=False, comment='字典键值'))
op.drop_index('ix_vadmin_system_dict_details_dict_label', table_name='vadmin_system_dict_details')
op.drop_index('ix_vadmin_system_dict_details_dict_value', table_name='vadmin_system_dict_details')
op.create_index(op.f('ix_vadmin_system_dict_details_label'), 'vadmin_system_dict_details', ['label'], unique=False)
op.create_index(op.f('ix_vadmin_system_dict_details_value'), 'vadmin_system_dict_details', ['value'], unique=False)
op.drop_column('vadmin_system_dict_details', 'dict_label')
op.drop_column('vadmin_system_dict_details', 'dict_value')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_system_dict_details', sa.Column('dict_value', mysql.VARCHAR(length=50), nullable=False, comment='字典键值'))
op.add_column('vadmin_system_dict_details', sa.Column('dict_label', mysql.VARCHAR(length=50), nullable=False, comment='字典标签'))
op.drop_index(op.f('ix_vadmin_system_dict_details_value'), table_name='vadmin_system_dict_details')
op.drop_index(op.f('ix_vadmin_system_dict_details_label'), table_name='vadmin_system_dict_details')
op.create_index('ix_vadmin_system_dict_details_dict_value', 'vadmin_system_dict_details', ['dict_value'], unique=False)
op.create_index('ix_vadmin_system_dict_details_dict_label', 'vadmin_system_dict_details', ['dict_label'], unique=False)
op.drop_column('vadmin_system_dict_details', 'value')
op.drop_column('vadmin_system_dict_details', 'label')
# ### end Alembic commands ###

View File

@ -1,46 +0,0 @@
"""update
Revision ID: 2d8939b3a228
Revises: ecb50546debd
Create Date: 2022-09-22 16:34:00.663906
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '2d8939b3a228'
down_revision = 'ecb50546debd'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_auth_menu', sa.Column('name', sa.String(length=50), nullable=False, comment='名称'))
op.add_column('vadmin_auth_menu', sa.Column('noCache', sa.Boolean(), nullable=True, comment='如果设置为true则不会被 <keep-alive> 缓存(默认 false)'))
op.add_column('vadmin_auth_menu', sa.Column('breadcrumb', sa.Boolean(), nullable=True, comment='如果设置为false则不会在breadcrumb面包屑中显示(默认 true)'))
op.add_column('vadmin_auth_menu', sa.Column('affix', sa.Boolean(), nullable=True, comment='如果设置为true则会一直固定在tag项中(默认 false)'))
op.add_column('vadmin_auth_menu', sa.Column('noTagsView', sa.Boolean(), nullable=True, comment='如果设置为true则不会出现在tag中(默认 false)'))
op.add_column('vadmin_auth_menu', sa.Column('canTo', sa.Boolean(), nullable=True, comment='设置为true即使hidden为true也依然可以进行路由跳转(默认 false)'))
op.drop_index('ix_vadmin_auth_menu_title', table_name='vadmin_auth_menu')
op.create_index(op.f('ix_vadmin_auth_menu_name'), 'vadmin_auth_menu', ['name'], unique=False)
op.drop_column('vadmin_auth_menu', 'title_zh')
op.drop_column('vadmin_auth_menu', 'title')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_auth_menu', sa.Column('title', mysql.VARCHAR(length=50), nullable=False, comment='名称'))
op.add_column('vadmin_auth_menu', sa.Column('title_zh', mysql.VARCHAR(length=50), nullable=True, comment='中文名称'))
op.drop_index(op.f('ix_vadmin_auth_menu_name'), table_name='vadmin_auth_menu')
op.create_index('ix_vadmin_auth_menu_title', 'vadmin_auth_menu', ['title'], unique=False)
op.drop_column('vadmin_auth_menu', 'canTo')
op.drop_column('vadmin_auth_menu', 'noTagsView')
op.drop_column('vadmin_auth_menu', 'affix')
op.drop_column('vadmin_auth_menu', 'breadcrumb')
op.drop_column('vadmin_auth_menu', 'noCache')
op.drop_column('vadmin_auth_menu', 'name')
# ### end Alembic commands ###

View File

@ -1,30 +0,0 @@
"""update
Revision ID: 5947e4ed42db
Revises: d37b76a689c1
Create Date: 2022-10-01 16:52:06.752039
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '5947e4ed42db'
down_revision = 'd37b76a689c1'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_auth_role', sa.Column('order', sa.Integer(), nullable=True, comment='排序'))
op.drop_column('vadmin_auth_role', 'index')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_auth_role', sa.Column('index', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True, comment='排序'))
op.drop_column('vadmin_auth_role', 'order')
# ### end Alembic commands ###

View File

@ -1,88 +0,0 @@
"""update
Revision ID: 5e629ba5c3c8
Revises: 65797098992b
Create Date: 2022-08-08 17:25:54.291997
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '5e629ba5c3c8'
down_revision = '65797098992b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('vadmin_record_login',
sa.Column('id', sa.Integer(), nullable=False, comment='主键ID'),
sa.Column('create_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='创建时间'),
sa.Column('update_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='更新时间'),
sa.Column('telephone', sa.String(length=50), nullable=False, comment='手机号'),
sa.Column('status', sa.Boolean(), nullable=True, comment='是否登录成功'),
sa.Column('ip', sa.String(length=50), nullable=True, comment='登陆地址'),
sa.Column('address', sa.String(length=50), nullable=True, comment='登陆地点'),
sa.Column('browser', sa.String(length=50), nullable=True, comment='浏览器'),
sa.Column('system', sa.String(length=50), nullable=True, comment='操作系统'),
sa.Column('response', sa.TEXT(), nullable=True, comment='响应信息'),
sa.Column('request', sa.TEXT(), nullable=True, comment='请求信息'),
sa.PrimaryKeyConstraint('id'),
comment='登录记录表'
)
op.create_index(op.f('ix_vadmin_record_login_id'), 'vadmin_record_login', ['id'], unique=True)
op.create_index(op.f('ix_vadmin_record_login_telephone'), 'vadmin_record_login', ['telephone'], unique=False)
op.create_table('vadmin_record_operation',
sa.Column('id', sa.Integer(), nullable=False, comment='主键ID'),
sa.Column('create_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='创建时间'),
sa.Column('update_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='更新时间'),
sa.Column('user', sa.Integer(), nullable=True, comment='操作人'),
sa.Column('status', sa.Boolean(), nullable=True, comment='操作结果状态'),
sa.Column('ip', sa.String(length=50), nullable=True, comment='登陆地址'),
sa.Column('address', sa.String(length=50), nullable=True, comment='登陆地点'),
sa.Column('browser', sa.String(length=50), nullable=True, comment='浏览器'),
sa.Column('system', sa.String(length=50), nullable=True, comment='操作系统'),
sa.Column('response', sa.TEXT(), nullable=True, comment='响应信息'),
sa.Column('request', sa.TEXT(), nullable=True, comment='请求信息'),
sa.Column('request_api', sa.String(length=255), nullable=True, comment='请求接口'),
sa.Column('request_method', sa.String(length=255), nullable=True, comment='请求方式'),
sa.ForeignKeyConstraint(['user'], ['vadmin_auth_user.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id'),
comment='操作记录表'
)
op.create_index(op.f('ix_vadmin_record_operation_id'), 'vadmin_record_operation', ['id'], unique=True)
op.create_table('vadmin_record_sms_send',
sa.Column('id', sa.Integer(), nullable=False, comment='主键ID'),
sa.Column('create_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='创建时间'),
sa.Column('update_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='更新时间'),
sa.Column('user_id', sa.Integer(), nullable=True, comment='操作人'),
sa.Column('status', sa.Boolean(), nullable=True, comment='发送状态'),
sa.Column('content', sa.String(length=255), nullable=True, comment='发送内容'),
sa.Column('telephone', sa.String(length=11), nullable=True, comment='目标手机号'),
sa.Column('desc', sa.String(length=255), nullable=True, comment='失败描述'),
sa.Column('scene', sa.String(length=50), nullable=True, comment='发送场景'),
sa.ForeignKeyConstraint(['user_id'], ['vadmin_auth_user.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id'),
comment='短信发送记录表'
)
op.create_index(op.f('ix_vadmin_record_sms_send_id'), 'vadmin_record_sms_send', ['id'], unique=True)
op.add_column('vadmin_auth_menu', sa.Column('order', sa.Integer(), nullable=True, comment='排序'))
op.drop_column('vadmin_auth_menu', 'order_num')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_auth_menu', sa.Column('order_num', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True, comment='排序'))
op.drop_column('vadmin_auth_menu', 'order')
op.drop_index(op.f('ix_vadmin_record_sms_send_id'), table_name='vadmin_record_sms_send')
op.drop_table('vadmin_record_sms_send')
op.drop_index(op.f('ix_vadmin_record_operation_id'), table_name='vadmin_record_operation')
op.drop_table('vadmin_record_operation')
op.drop_index(op.f('ix_vadmin_record_login_telephone'), table_name='vadmin_record_login')
op.drop_index(op.f('ix_vadmin_record_login_id'), table_name='vadmin_record_login')
op.drop_table('vadmin_record_login')
# ### end Alembic commands ###

View File

@ -1,111 +0,0 @@
"""update
Revision ID: 65797098992b
Revises: f2390b45da1d
Create Date: 2022-08-08 15:13:27.266162
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '65797098992b'
down_revision = 'f2390b45da1d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('vadmin_auth_menu',
sa.Column('id', sa.Integer(), nullable=False, comment='主键ID'),
sa.Column('create_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='创建时间'),
sa.Column('update_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='更新时间'),
sa.Column('title', sa.String(length=50), nullable=False, comment='名称'),
sa.Column('icon', sa.String(length=50), nullable=True, comment='菜单图标'),
sa.Column('component', sa.String(length=50), nullable=True, comment='前端组件地址'),
sa.Column('path', sa.String(length=50), nullable=True, comment='前端路由地址'),
sa.Column('status', sa.Boolean(), nullable=True, comment='是否可用'),
sa.Column('hidden', sa.Boolean(), nullable=True, comment='是否显示'),
sa.Column('order_num', sa.Integer(), nullable=True, comment='排序'),
sa.Column('menu_type', sa.String(length=8), nullable=True, comment='菜单类型'),
sa.Column('parent_id', sa.Integer(), nullable=True, comment='父菜单'),
sa.Column('perms', sa.String(length=50), nullable=True, comment='权限标识'),
sa.ForeignKeyConstraint(['parent_id'], ['vadmin_auth_menu.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id'),
comment='菜单表'
)
op.create_index(op.f('ix_vadmin_auth_menu_id'), 'vadmin_auth_menu', ['id'], unique=True)
op.create_index(op.f('ix_vadmin_auth_menu_perms'), 'vadmin_auth_menu', ['perms'], unique=False)
op.create_index(op.f('ix_vadmin_auth_menu_title'), 'vadmin_auth_menu', ['title'], unique=False)
op.create_table('vadmin_auth_role',
sa.Column('id', sa.Integer(), nullable=False, comment='主键ID'),
sa.Column('create_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='创建时间'),
sa.Column('update_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='更新时间'),
sa.Column('name', sa.String(length=50), nullable=False, comment='名称'),
sa.Column('role_key', sa.String(length=50), nullable=False, comment='权限字符'),
sa.Column('is_active', sa.Boolean(), nullable=True, comment='是否可用'),
sa.Column('index', sa.Integer(), nullable=True, comment='排序'),
sa.Column('desc', sa.String(length=255), nullable=True, comment='描述'),
sa.Column('is_admin', sa.Boolean(), nullable=True, comment='是否为超级角色'),
sa.PrimaryKeyConstraint('id'),
comment='角色表'
)
op.create_index(op.f('ix_vadmin_auth_role_id'), 'vadmin_auth_role', ['id'], unique=True)
op.create_index(op.f('ix_vadmin_auth_role_name'), 'vadmin_auth_role', ['name'], unique=False)
op.create_index(op.f('ix_vadmin_auth_role_role_key'), 'vadmin_auth_role', ['role_key'], unique=False)
op.create_table('vadmin_auth_role_menus',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False, comment='主键ID'),
sa.Column('role_id', sa.Integer(), nullable=False),
sa.Column('menu_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['menu_id'], ['vadmin_auth_menu.id'], ondelete='CASCADE'),
sa.ForeignKeyConstraint(['role_id'], ['vadmin_auth_role.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id', 'role_id', 'menu_id')
)
op.create_index(op.f('ix_vadmin_auth_role_menus_id'), 'vadmin_auth_role_menus', ['id'], unique=True)
op.create_table('vadmin_auth_user_roles',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False, comment='主键ID'),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('role_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['role_id'], ['vadmin_auth_role.id'], ondelete='CASCADE'),
sa.ForeignKeyConstraint(['user_id'], ['vadmin_auth_user.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id', 'user_id', 'role_id')
)
op.create_index(op.f('ix_vadmin_auth_user_roles_id'), 'vadmin_auth_user_roles', ['id'], unique=True)
op.add_column('vadmin_auth_user', sa.Column('avatar', sa.String(length=500), nullable=True, comment='头像'))
op.add_column('vadmin_auth_user', sa.Column('gender', sa.String(length=8), nullable=True, comment='性别'))
op.add_column('vadmin_auth_user', sa.Column('is_active', sa.Boolean(), nullable=True, comment='是否可用'))
op.add_column('vadmin_auth_user', sa.Column('is_cancel', sa.Boolean(), nullable=True, comment='是否注销'))
op.add_column('vadmin_auth_user', sa.Column('is_reset_password', sa.Boolean(), nullable=True, comment='是否已经重置密码,没有重置的,登陆系统后必须重置密码'))
op.add_column('vadmin_auth_user', sa.Column('last_ip', sa.String(length=50), nullable=True, comment='最后一次登录IP'))
op.add_column('vadmin_auth_user', sa.Column('last_login', sa.DateTime(), nullable=True, comment='最近一次登录时间'))
op.drop_column('vadmin_auth_user', 'wechat')
op.drop_column('vadmin_auth_user', 'qq')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_auth_user', sa.Column('qq', mysql.VARCHAR(length=50), nullable=True, comment='QQ'))
op.add_column('vadmin_auth_user', sa.Column('wechat', mysql.VARCHAR(length=50), nullable=True, comment='微信'))
op.drop_column('vadmin_auth_user', 'last_login')
op.drop_column('vadmin_auth_user', 'last_ip')
op.drop_column('vadmin_auth_user', 'is_reset_password')
op.drop_column('vadmin_auth_user', 'is_cancel')
op.drop_column('vadmin_auth_user', 'is_active')
op.drop_column('vadmin_auth_user', 'gender')
op.drop_column('vadmin_auth_user', 'avatar')
op.drop_index(op.f('ix_vadmin_auth_user_roles_id'), table_name='vadmin_auth_user_roles')
op.drop_table('vadmin_auth_user_roles')
op.drop_index(op.f('ix_vadmin_auth_role_menus_id'), table_name='vadmin_auth_role_menus')
op.drop_table('vadmin_auth_role_menus')
op.drop_index(op.f('ix_vadmin_auth_role_role_key'), table_name='vadmin_auth_role')
op.drop_index(op.f('ix_vadmin_auth_role_name'), table_name='vadmin_auth_role')
op.drop_index(op.f('ix_vadmin_auth_role_id'), table_name='vadmin_auth_role')
op.drop_table('vadmin_auth_role')
op.drop_index(op.f('ix_vadmin_auth_menu_title'), table_name='vadmin_auth_menu')
op.drop_index(op.f('ix_vadmin_auth_menu_perms'), table_name='vadmin_auth_menu')
op.drop_index(op.f('ix_vadmin_auth_menu_id'), table_name='vadmin_auth_menu')
op.drop_table('vadmin_auth_menu')
# ### end Alembic commands ###

View File

@ -1,24 +0,0 @@
"""生成迁移文件
Revision ID: a95a845d335f
Revises:
Create Date: 2022-07-06 21:56:31.321170
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a95a845d335f'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
pass
def downgrade():
pass

View File

@ -1,30 +0,0 @@
"""update
Revision ID: ab5fb033599e
Revises: 5947e4ed42db
Create Date: 2022-10-02 22:40:45.967326
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'ab5fb033599e'
down_revision = '5947e4ed42db'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_auth_role', sa.Column('disabled', sa.Boolean(), nullable=True, comment='是否禁用'))
op.drop_column('vadmin_auth_role', 'is_active')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_auth_role', sa.Column('is_active', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True, comment='是否可用'))
op.drop_column('vadmin_auth_role', 'disabled')
# ### end Alembic commands ###

View File

@ -1,46 +0,0 @@
"""更新迁移文件
Revision ID: bc1417d96581
Revises: a95a845d335f
Create Date: 2022-07-06 21:56:41.154567
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bc1417d96581'
down_revision = 'a95a845d335f'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('vadmin_auth_user',
sa.Column('id', sa.Integer(), nullable=False, comment='主键ID'),
sa.Column('create_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='创建时间'),
sa.Column('update_datetime', sa.DateTime(), server_default=sa.text('now()'), nullable=True, comment='更新时间'),
sa.Column('telephone', sa.String(length=11), nullable=False, comment='手机号'),
sa.Column('name', sa.String(length=20), nullable=False, comment='姓名'),
sa.Column('nickname', sa.String(length=20), nullable=True, comment='昵称'),
sa.Column('wechat', sa.String(length=50), nullable=True, comment='微信'),
sa.Column('qq', sa.String(length=50), nullable=True, comment='QQ'),
sa.Column('password', sa.String(length=255), nullable=True, comment='密码'),
sa.PrimaryKeyConstraint('id'),
comment='用户表'
)
op.create_index(op.f('ix_vadmin_auth_user_id'), 'vadmin_auth_user', ['id'], unique=True)
op.create_index(op.f('ix_vadmin_auth_user_name'), 'vadmin_auth_user', ['name'], unique=False)
op.create_index(op.f('ix_vadmin_auth_user_telephone'), 'vadmin_auth_user', ['telephone'], unique=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_vadmin_auth_user_telephone'), table_name='vadmin_auth_user')
op.drop_index(op.f('ix_vadmin_auth_user_name'), table_name='vadmin_auth_user')
op.drop_index(op.f('ix_vadmin_auth_user_id'), table_name='vadmin_auth_user')
op.drop_table('vadmin_auth_user')
# ### end Alembic commands ###

View File

@ -1,34 +0,0 @@
"""update
Revision ID: d37b76a689c1
Revises: 2d8939b3a228
Create Date: 2022-09-22 16:35:48.607099
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'd37b76a689c1'
down_revision = '2d8939b3a228'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_auth_menu', sa.Column('title', sa.String(length=50), nullable=False, comment='名称'))
op.drop_index('ix_vadmin_auth_menu_name', table_name='vadmin_auth_menu')
op.create_index(op.f('ix_vadmin_auth_menu_title'), 'vadmin_auth_menu', ['title'], unique=False)
op.drop_column('vadmin_auth_menu', 'name')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_auth_menu', sa.Column('name', mysql.VARCHAR(length=50), nullable=False, comment='名称'))
op.drop_index(op.f('ix_vadmin_auth_menu_title'), table_name='vadmin_auth_menu')
op.create_index('ix_vadmin_auth_menu_name', 'vadmin_auth_menu', ['name'], unique=False)
op.drop_column('vadmin_auth_menu', 'title')
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""update
Revision ID: d4898760c577
Revises: 03e55ed3e858
Create Date: 2022-08-13 11:40:09.131602
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd4898760c577'
down_revision = '03e55ed3e858'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_auth_menu', sa.Column('redirect', sa.String(length=100), nullable=True, comment='重定向地址'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('vadmin_auth_menu', 'redirect')
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""update
Revision ID: ecb50546debd
Revises: d4898760c577
Create Date: 2022-09-15 20:59:40.938777
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ecb50546debd'
down_revision = 'd4898760c577'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vadmin_auth_menu', sa.Column('title_zh', sa.String(length=50), nullable=True, comment='中文名称'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('vadmin_auth_menu', 'title_zh')
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""update
Revision ID: f2390b45da1d
Revises: 0cd7a858c5a5
Create Date: 2022-08-08 13:36:03.625827
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f2390b45da1d'
down_revision = '0cd7a858c5a5'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -2,6 +2,7 @@ alembic==1.7.5
anyio==3.5.0 anyio==3.5.0
asgiref==3.5.0 asgiref==3.5.0
asyncmy==0.2.5 asyncmy==0.2.5
bcrypt==3.2.2
certifi==2022.6.15 certifi==2022.6.15
cffi==1.15.1 cffi==1.15.1
charset-normalizer==2.0.12 charset-normalizer==2.0.12