iElectric 7eafe744c2 - refactor migrate.changeset;
- visitors are refactored to be more unified
- constraint module is refactored, CheckConstraint is added
- documentation is partialy updated, dialect support table is added (unfinished)
- test_constraint was updated
NOTE: oracle and mysql were not tested, *may be broken*
2009-06-16 15:17:33 +00:00

119 lines
6.5 KiB
ReStructuredText

:mod:`migrate` - SQLAlchemy Migrate (schema change management)
==============================================================
.. module:: migrate
.. moduleauthor:: Evan Rosson
:Author: Evan Rosson
:Maintainer: Domen Kozar <domenNO@SPAMdev.si>
:Source code: http://code.google.com/p/sqlalchemy-migrate/issues/list
:Issues: http://code.google.com/p/sqlalchemy-migrate/
:Version: |release|
.. topic:: Overview
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.
Currently, sqlalchemy-migrate supports Python versions from 2.4 to 2.6.
SQLAlchemy >=0.5 is supported only.
.. warning::
Version **0.5.5** breaks backward compatability, please read :ref:`changelog <backwards-055>` for more info.
Download and Development
------------------------
.. toctree::
download
Dialect support
----------------------------------
+--------------------------+--------------------------+------------------------------+------------------------+---------------------------+----------+-------+
| Operation / Dialect | :ref:`sqlite <sqlite-d>` | :ref:`postgres <postgres-d>` | :ref:`mysql <mysql-d>` | :ref:`oracle <oracle-d>` | firebird | mssql |
| | | | | | | |
+==========================+==========================+==============================+========================+===========================+==========+=======+
| ALTER TABLE | yes | yes | | | | |
| RENAME TABLE | | | | | | |
+--------------------------+--------------------------+------------------------------+------------------------+---------------------------+----------+-------+
| ALTER TABLE | yes | yes | | | | |
| RENAME COLUMN | (workaround) [#1]_ | | | | | |
+--------------------------+--------------------------+------------------------------+------------------------+---------------------------+----------+-------+
| ALTER TABLE | yes | yes | | | | |
| DROP COLUMN | (workaround) [#1]_ | | | | | |
+--------------------------+--------------------------+------------------------------+------------------------+---------------------------+----------+-------+
| ALTER TABLE | yes | yes | | | | |
| ADD COLUMN | (with limitations) [#2]_ | | | | | |
+--------------------------+--------------------------+------------------------------+------------------------+---------------------------+----------+-------+
| ALTER TABLE | no | yes | | | | |
| ADD CONSTRAINT | | | | | | |
+--------------------------+--------------------------+------------------------------+------------------------+---------------------------+----------+-------+
| ALTER TABLE | no | yes | | | | |
| DROP CONSTRAINT | | | | | | |
+--------------------------+--------------------------+------------------------------+------------------------+---------------------------+----------+-------+
| ALTER TABLE | no | yes | | | | |
| ALTER COLUMN | | | | | | |
+--------------------------+--------------------------+------------------------------+------------------------+---------------------------+----------+-------+
| RENAME INDEX | no | yes | | | | |
| | | | | | | |
+--------------------------+--------------------------+------------------------------+------------------------+---------------------------+----------+-------+
.. [#1] Table is renamed to temporary table, new table is created followed by INSERT statements.
.. [#2] Visit http://www.sqlite.org/lang_altertable.html for more information.
Documentation
-------------
SQLAlchemy is split into two parts, database schema versioning and
database changeset management. This is represented by two python
packages :mod:`migrate.versioning` and :mod:`migrate.changeset`. The
versioning API is available as the :ref:`migrate <command-line-usage>` command.
.. toctree::
versioning
changeset
tools
.. _`google's summer of code`: http://code.google.com/soc
.. _`Google Code project`: http://code.google.com/p/sqlalchemy-migrate
.. _sqlalchemy: http://www.sqlalchemy.org
API Documentation
------------------
.. toctree::
api
Changelog
---------
.. toctree::
changelog
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`