Questions tagged [alembic]
Alembic is a lightweight database migration tool for usage with the SQLAlchemy Database Toolkit for Python.
584
questions
0
votes
0answers
20 views
Alembic autogenerate not detecting current state
Problem
I'm using Alembic autogenerate to migrate some model changes. I run alembic revision/upgrade once and it properly creates my table and adds an alembic_version table to my database. When I go ...
0
votes
0answers
10 views
How can multiple engineers work on same DB with alembic?
We have a few engineers all working on the same database.
When one runs alembic revision -m 'name'
We get
FAILED: Multiple heads are present; please specify the head revision on which the new revision ...
0
votes
0answers
10 views
Alembic generating alter columns same as models
I'm working on a legacy multi-tenant postgres database. And now we are mapping to clean SQLAlchemy new code. I'm using alembic to generate the new migrations operations(until now are just SQL scripts)....
1
vote
0answers
19 views
SQLalchemy cant find my tables, but alembic finds them just fine
I'm starting a project with SQLAlchemy and Alembic. I'm using SQLite for testing purposes.
When I execute alembic revision --autogenerate -m "..." it correctly generates the migrations and ...
0
votes
0answers
11 views
Model class not changed after an Alembic Migration
I am new to Alembic and SQLalchemy. I created a pretty simple table in postgres and created a relational mapping in SQLAlchemy with class User
engine = create_engine(DATABASE_URL)
Base = ...
2
votes
1answer
34 views
VARCHAR length error when using StringEncryptedType, SQLAlchemy
I have the following model:
from enum import Enum
from sqlalchemy_utils.types.encrypted.encrypted_type import StringEncryptedType
from sqlalchemy import (
Column,
Integer,
Float,
Enum ...
1
vote
1answer
20 views
Cross reference while defining FK and children relationships SQLAlchemy
Class Bed
id
Class Guest
id
bed_assignments = relationship(
primaryjoin=(
"and_(Guest.id"
"==foreign(BedAssignment.guest_id),"
...
0
votes
0answers
24 views
Alembic Python Question: How to get value from arbGeomParams?
This is probably an easy question. I'm new to alembic python and not a hardcore programmer, I'm trying to get the string value of an alembic attribute added to a sphereShape cached from from maya. I ...
5
votes
1answer
79 views
Alembic ignore specific tables
I'm using alembic to manage database migrations as per user defined sqlalchemy models. My challenge is that I'd like for alembic to ignore any creation, deletion, or changes to a specific set of ...
1
vote
1answer
20 views
SQLAlchemy not updating changes causing issues
So I've made some changes to my schema on a Flask Server, using SQLite and SQLAlchemy. The database is generally functional and I'm able to add some of the models, as well as update and query all ...
0
votes
0answers
10 views
When I create a Foreign key, can Alembic auto deletes rows violates the constraint?
I'm upgrading a database on postgresql, with a new foreign key constraint.
When I create it with alembic, I meet this error:
sqlalchemy.exc.IntegrityError: (psycopg2.errors.ForeignKeyViolation) insert ...
0
votes
0answers
14 views
flask-migrate stuck on downgrade with table containing Enum field
I have defined the following models using sqlalchemy and my database backend is mysql.
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class Vehicle(db.Model):
id = db.Column(db....
0
votes
0answers
23 views
sqlalchemy - flask table not defined
I'm using Flask + sqlalchemy with sqlite3 (not flask-sqlalchemy), with alembic for migrations. I have setup migrations and I can see the table created, I've examined the database and confirmed the ...
0
votes
1answer
45 views
alembic.util.exc.CommandError: Can't locate revision identified by 'f1942fde9843'
This happens when I do flask db migrate on my production PostgreSQL database.
Locally, migrate works fine (also PostgreSQL). I'm not sure what's wrong.
Some info: f1942fde9843 is not in my migrations/...
0
votes
0answers
10 views
How can I check that the a database is aligned with alembic head [duplicate]
I have a automated test script and before I run the tests I want to be sure that the alembic version is matching my current test database version and if not then I would like to reinitialize my test ...