Questions tagged [flask-migrate]

Use this tag for questions related to the Flask extension flask-migrate, this extension implements SQLAlchemy database migrations. It should be used with the tag Flask too.

Flask-Migrate is an extension that handles SQLAlchemy database migrations for Flask applications using Alembic. The database operations are provided as command line arguments for Flask-Script.

Documentation is here

320 questions
0
votes
1 answer

Flask-migrate doesn't create database in Heroku

The problem: I'm having trouble getting my SQLite database to work on Heroku. When I try to go to the app's URL in my browser, I get an internal server error. heroku logs shows this: OperationalError: (sqlite3.OperationalError) no such table:…
joshreesjones
  • 1,934
  • 5
  • 24
  • 42
0
votes
1 answer

flask-migrate won't recognize upgrade is complete

I ran a db migrate then a db upgrade but the upgrade failed because one of the commands failed. (I hadn't read the migration before running it.) I ended up in the state where db history recognized the upgrade had run, but db current still listed the…
Alison S
  • 1,759
  • 1
  • 14
  • 28
0
votes
1 answer

Recover database schema from Alembic migrations

I recently reinstalled my OS and lost some old data from a local postgre db. But I backed up all the migration files using Alembic. And now I just want to restore the database schema from the migration files, not data. Is that possible?
benjaminz
  • 3,118
  • 3
  • 35
  • 47
0
votes
1 answer

Flask-Migrate Error: 'ConfigParser.NoSectionError: No section: 'alembic''

For the last few weeks I've been building a website mostly based on Miguel Grinberg's book 'Flask Web Development'. This is my 'manage.py' file for reference: import os from app import create_app, db from app.models import User, Role, Permission,…
Josh Kraushaar
  • 369
  • 5
  • 17
0
votes
0 answers

ImportError: No module named flask.ext.migrate

I try to upload a flask application on heroku But I couldnt Try the command "heroku run init" and "heroku run python manage.py db create" But get the error Traceback (most recent call last): File "manage.py", line 3, in from…
LiLi
  • 301
  • 2
  • 7
  • 21
0
votes
2 answers

how can test u=g.user in Flask

Lets say I have flask Application Now I want to test u=g.user.be_friend(user) which make a user friend with eachother if they werene't friend befor But I don't know how I can test g.user and most importantly g.user.be_friend would you please help…
LiLi
  • 301
  • 2
  • 7
  • 21
0
votes
1 answer

what is that I get from my URL

In my flask application which I use flask-migrate and Alembic I got this URL" /user/1?sort=ascmonkey=< flask_sqlalchemy.Pagination+object+at+0x7f6a8077ea10 >",while this part is extra < flask_sqlalchemy.Pagination+object+at+0x7f6a8077ea10 > where…
LiLi
  • 301
  • 2
  • 7
  • 21
0
votes
2 answers

flask-migrate doesn't work When I add models with ForeignKey

class User(db.Model): __tablename__ = 'user' id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(64), unique=True) # 是不是应该加密下,不能明文存储?应该设置多长的空间? 14.7.18 4:22 by lee password = db.Column(db.String(100)) …
hugleecool
  • 205
  • 2
  • 9
0
votes
1 answer

flask-migrate wants to drop my indeces

I've got a Flask app with the following models: class User(db.Model, UserMixin): __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(64), unique=True, index=True) password_hash =…
treznick
  • 25
  • 3
0
votes
1 answer

Flask-migrate multiple models.py

I've a question related to Flask-migrate. I'm creating a set of web services with Flask. I've split each web service in his own package in a python application. The application structure look like this: MyApp WS1 models.py WS2 …
Enrico Bottani
  • 124
  • 1
  • 8
0
votes
1 answer

Alembic/Flask-migrate doesn't recognise database structure

I have a Flask-based application and I'm trying to enable migrations to be able to manage database structural changes. My database is not empty and contains tables and records before I started with alembic and flask-migrate. First, I tried to use…
lawicko
  • 7,246
  • 3
  • 37
  • 49
0
votes
1 answer

Alembic / Flask-migrate migration on Heroku runs but does not create tables

I am attempting to deploy a Flask app to Heroku. I have pushed to Heroku and can access my login page but any call to the db gives an OperationalError: 2014-01-29T12:12:31.801772+00:00 app[web.1]: OperationalError: (OperationalError) no such table:…
kendlete
  • 214
  • 4
  • 13
-1
votes
1 answer

Looking for help migrating AWS Beanstalk Service to another account

Seeking help migrating AWS Beanstalk to another account. I am a part of an AWS org where I deployed an AWS Beanstalk Service in early June under my account. My internship with them has expired, and I need to get this service off my account now, and…
-1
votes
1 answer

Flask-migrate upgrade fails because the application needs to run code that modifies the db on startup

I have a Flask application that needs to run code on startup. In my case, it detects available cloud resources and writes those to a table in a database. The problem is that when I run flask db upgrade, then flask-migrate executes the application…
user3207874
  • 2,815
  • 2
  • 13
  • 18
-1
votes
1 answer

How to migrate SQLAlchemy database without generating migration script

I am using Flask and SQLAlchemy in a serverless function, which I don't have access to the command line. And there are times that I want to change the tables. Basically I want to automatically create new tables (already done by create_all) and…
Allan Chain
  • 2,345
  • 1
  • 14
  • 29
1 2 3
21
22