Questions tagged [sqlalchemy-migrate]

Schema migration tools for SQLAlchemy, designed to support an agile approach to database design, and make it easier to keep development and production databases in sync, as schema changes are required.

Inspired by Ruby on Rails’ migrations, SQLAlchemy Migrate provides a way to deal with database schema changes in SQLAlchemy projects. Migrate was started as part of Google’s Summer of Code by Evan Rosson, mentored by Jonathan LaCour. The project was taken over by a small group of volunteers when Evan had no free time for the project. It is now hosted as a Google Code project. During the hosting change the project was renamed to SQLAlchemy Migrate.

Python 2.4-2.7 is supported.

Resources:

97 questions
0
votes
1 answer

Strange TypeError when migrating database

After migrating my database a few times, I began to see this error appear on my local server. If I clear the database and re-create it, there is no error, so I don't think there is anything wrong with the way my models are written. I get the…
0
votes
2 answers

How to create a migration script with dialect types (HSTORE) in SQLAlchemy-Migrate?

How do you create a migration script that supports dialect data types? Here's an example of a model: db = SQLAlchemy() class Event(db.Model): __tablename__ = 'event' id = db.Column(db.Integer, primary_key=True) created_at =…
DiogoNeves
  • 1,727
  • 2
  • 17
  • 36
0
votes
1 answer

sqlalchemy-migrate DatabaseNotControlledError exception

I would like to add a new column in my existing database, initially created by sqlalchemy. I tried using the sqlalchemy-migrate tool to do this and running into the following error: C:\Users\sk11\Desktop\playground\migrateDB>%PYTHON_EXE% manage.py…
sk11
  • 1,779
  • 1
  • 17
  • 29
0
votes
1 answer

alembic will allow sql files under versions?

In sqlalchemy-migrate repos, we can place .sql files instead of .py files under versions folder for upgrading/downgrading database schema. 001_mysql_downgrade.sql 001_mysql_upgrade.sql Is the same feature exist in alembic? If yes can someone plz…
Murali Mopuru
  • 6,086
  • 5
  • 33
  • 51
0
votes
1 answer

Strange error in SqlAlchemy-migrate on column.copy() with column type BigInteger .

The situation is a little bit simplified. I have two migration files for sqlalchemy-migrate: In First I create table volume_usage_cache, then autoload it, create copy of its columns and print it: from sqlalchemy import Column, DateTime from…
Boris Pavlovic
  • 1,279
  • 8
  • 17
0
votes
1 answer

Drop duplicate foreign keys with SQLAlchemy Migrate

By mistake I added two foreign keys referring to the same table and column. The SHOW CREATE TABLE table_a look like: table_a | CREATE TABLE `table_a` ( `id` char(36) NOT NULL, `fk` int(11) default NULL, `created_at` datetime default NULL, PRIMARY…
Carl
  • 740
  • 8
  • 18
-1
votes
1 answer

Flask-SqlAlchemy declaring models

This is application.py file: db = SQLAlchemy() migrate = Migrate() db.app = app db.init_app(app) migrate.init_app(app, db) I find out that, I can declare model with two different ways. from application import db class MyModel(db.Model): id =…
1 2 3 4 5 6
7