首页 > 其他分享 >flask-migrate迁移ORM模型

flask-migrate迁移ORM模型

时间:2024-03-20 11:12:51浏览次数:30  
标签:already flask satisfied migrate ORM Flask packages

  • 安装依赖
(C:\ProgramData\Anaconda3) C:\Users\ychen>pip install flask-migrate
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting flask-migrate
  Downloading https://mirrors.aliyun.com/pypi/packages/93/01/587023575286236f95d2ab8a826c320375ed5ea2102bb103ed89704ffa6b/Flask_Migrate-4.0.7-py3-none-any.whl (21 kB)
Requirement already satisfied: Flask>=0.9 in c:\programdata\anaconda3\lib\site-packages (from flask-migrate) (2.0.1)
Requirement already satisfied: Flask-SQLAlchemy>=1.0 in c:\programdata\anaconda3\lib\site-packages (from flask-migrate) (2.5.1)
  Downloading https://mirrors.aliyun.com/pypi/packages/7e/dc/0099c61985b6cb92688c8b9c9c6943d22b80957751d43c51def582afc546/Flask_Migrate-4.0.6-py3-none-any.whl (21 kB)
  Downloading https://mirrors.aliyun.com/pypi/packages/0e/3a/3e7a97fff0396e5206af5fdcbf66fdbb499b1daa049fbe074566fd73c664/Flask_Migrate-4.0.5-py3-none-any.whl (21 kB)
  Downloading https://mirrors.aliyun.com/pypi/packages/e4/65/9e0a6ce67e1776b0d8a4ebcd40ee519b6c8339a62b05dbc9b153c0d6a17b/Flask_Migrate-4.0.4-py3-none-any.whl (20 kB)
  Downloading https://mirrors.aliyun.com/pypi/packages/7f/cd/ea936f728fd0e2d148ad25dc9859d15c2bf62580ffdbfa04ce4f7aca461a/Flask_Migrate-4.0.3-py3-none-any.whl (20 kB)
  Downloading https://mirrors.aliyun.com/pypi/packages/7e/26/9f3a57830627cf67c26893b7042cb0ec8c77205331636212b81ae3c35f20/Flask_Migrate-4.0.2-py3-none-any.whl (20 kB)
  Downloading https://mirrors.aliyun.com/pypi/packages/26/e1/824c124993ddaac5b5ab30f930d685295c401e1a28d00012f75721edf33d/Flask_Migrate-4.0.1-py3-none-any.whl (20 kB)
Collecting alembic>=0.7
  Downloading https://mirrors.aliyun.com/pypi/packages/b3/e2/8d48220731b7279911c43e95cd182961a703b939de6822b00de3ea0d3159/alembic-1.7.7-py3-none-any.whl (210 kB)
     |████████████████████████████████| 210 kB 1.1 MB/s
Requirement already satisfied: SQLAlchemy>=1.3.0 in c:\programdata\anaconda3\lib\site-packages (from alembic>=0.7->flask-migrate) (1.4.52)
Requirement already satisfied: importlib-metadata in c:\programdata\anaconda3\lib\site-packages (from alembic>=0.7->flask-migrate) (4.8.3)
Collecting Mako
  Downloading https://mirrors.aliyun.com/pypi/packages/b4/4d/e03d08f16ee10e688bde9016bc80af8b78c7f36a8b37c7194da48f72207e/Mako-1.1.6-py2.py3-none-any.whl (75 kB)
     |████████████████████████████████| 75 kB 1.7 MB/s
Requirement already satisfied: importlib-resources in c:\programdata\anaconda3\lib\site-packages (from alembic>=0.7->flask-migrate) (5.4.0)
Requirement already satisfied: click>=7.1.2 in c:\programdata\anaconda3\lib\site-packages (from Flask>=0.9->flask-migrate) (8.0.4)
Requirement already satisfied: Jinja2>=3.0 in c:\programdata\anaconda3\lib\site-packages (from Flask>=0.9->flask-migrate) (3.0.3)
Requirement already satisfied: itsdangerous>=2.0 in c:\programdata\anaconda3\lib\site-packages (from Flask>=0.9->flask-migrate) (2.0.1)
Requirement already satisfied: Werkzeug>=2.0 in c:\programdata\anaconda3\lib\site-packages (from Flask>=0.9->flask-migrate) (2.0.3)
Requirement already satisfied: colorama in c:\programdata\anaconda3\lib\site-packages (from click>=7.1.2->Flask>=0.9->flask-migrate) (0.4.5)
Requirement already satisfied: MarkupSafe>=2.0 in c:\programdata\anaconda3\lib\site-packages (from Jinja2>=3.0->Flask>=0.9->flask-migrate) (2.0.1)
Requirement already satisfied: greenlet!=0.4.17 in c:\programdata\anaconda3\lib\site-packages (from SQLAlchemy>=1.3.0->alembic>=0.7->flask-migrate) (2.0.2)
Requirement already satisfied: dataclasses in c:\programdata\anaconda3\lib\site-packages (from Werkzeug>=2.0->Flask>=0.9->flask-migrate) (0.8)
Requirement already satisfied: typing-extensions>=3.6.4 in c:\programdata\anaconda3\lib\site-packages (from importlib-metadata->alembic>=0.7->flask-migrate) (4.1.1)
Requirement already satisfied: zipp>=0.5 in c:\programdata\anaconda3\lib\site-packages (from importlib-metadata->alembic>=0.7->flask-migrate) (3.6.0)
Installing collected packages: Mako, alembic, flask-migrate
Successfully installed Mako-1.1.6 alembic-1.7.7 flask-migrate-4.0.1
  • 导入依赖
from flask_migrate import Migrate
  • 注释如下
# 创建表
# with app.app_context():
#     db.create_all()

标签:already,flask,satisfied,migrate,ORM,Flask,packages
From: https://www.cnblogs.com/dogleftover/p/18084805

相关文章

  • 在winform中如何嵌入第三方软件窗体
    合集-C#(24) 1.使用C#将几个Excel文件合并去重分类2023-11-152.C#使用SqlSugar操作MySQL数据库实现简单的增删改查2023-11-163.C#中的类和继承2023-11-174.C#中的virtual和override关键字2023-11-175.C#中的属性2023-11-206.C#winform中使用SQLite数据库2023-11-237.C#简......
  • 【python】flask服务端响应与重定向处理
    ✨✨欢迎大家来到景天科技苑✨✨......
  • Python 数据持久层ORM框架 TorToise模块(异步)
    文章目录TortoiseORM简介TortoiseORM特性TortoiseORM安装TortoiseORM数据库支持TortoiseORM创建模型aerich迁移工具简介aerich迁移工具安装aerich迁移工具使用TrotoiseORM查询数据TrotoiseORM修改数据TrotoiseORM删除数据TrotoiseORM新增数据......
  • 如何解决 WinForm窗体标题字符数限制 导致的显示不全问题?
    现在需要对窗体标题进行居中显示,通过在标题内容前增加空格的方式达到该目的。实测是发现窗口标题的字符数量受到操作系统限制网上查询的最大标题字符数是260个字符实测最大字符数为587个下面的代码可以勉强解决“由于最大字符数受到操作系统的限制导致最大化时显示不全”的问......
  • 配置Flask-CLI以便与Flask应用程序一起使用
    第1步:创建Flask应用首先,你需要创建一个新的Flask应用(入口文件)。这可以通过创建一个包含Flask应用实例的Python文件来完成。创建一个名为 main.py 的文件,并在其中定义Flask应用。#main.pyfromflaskimportFlaskapp=Flask(__name__)@app.route('/')defindex():......
  • WebStorm 怎么编译 Vue 工程
    最近一些工程项目,需要用到Vue,只能从头学一下。目前使用的WebStorm,但是不知道怎么编译,还要下载Node.js,对这个不熟悉。最终找到了编译方法:记录一下1.打包方法1.1在工程里面,package.json,点击右键,选择显示npm脚本。然后点击build1.2菜单-->视图-->工具窗口-->npm,然......
  • Pytorch环境下基于Transformer模型的滚动轴承故障诊断
    注意力机制是深度学习中的重要技术之一,正日益受到重视关注。注意力机制作为一种信息贡献筛选的方法被提出,它可以帮助神经网络更多地关注与任务相关的特征,从而减少对任务贡献较小信息的影响。因此,利用注意机制可以提高神经网络的学习能力和可解释性。Transformer是一种基于纯注......
  • 【Lazy ORM】 小工具 acw 本地客户端 你负责点击页面,他负责输出代码
    介绍wu-smart-acw-client简称acw-client,是一个基于LazyORM定制的客户端代码生成小工具LazyORM小工具acw本地客户端你负责点击页面,他负责输出代码安装<dependency><groupId>top.wu2020</groupId><artifactId>wu-smart-acw-cli......
  • 界面组件DevExpress WinForms v23.2 - 数据可视化功能升级
    DevExpressWinForms拥有180+组件和UI库,能为WindowsForms平台创建具有影响力的业务解决方案。DevExpressWinForms能完美构建流畅、美观且易于使用的应用程序,无论是Office风格的界面,还是分析处理大批量的业务数据,它都能轻松胜任!DevExpressWinForms控件日前正式发布了v23.2,此版......
  • WinForm】使用Costura.Fody打包编译成可独立运行的桌面程序
    新建项目在建项目的时候要注意,选择Windows窗体应用(.NETFramework)或者wpf项目,然后打开安装包在解决方案资源管理器中,选择刚才的项目名,鼠标右键找到并打开管理NuGet包,然后在浏览选项卡里,输入一个Costura.Fody并查找,有就点安装,安装前需要注意选择支持的对应版本和依赖项静......