Metadata-Version: 1.1
Name: raw-sql-migrate
Version: 0.1.1
Summary: Simple tool for managing raw sql migrations scripts.
Home-page: https://github.com/ts-taiye/raw-sql-migrate
Author: ts.taiye aka Vadim Tsander
Author-email: ts.taiye@live.com
License: UNKNOWN
Description: .. image:: https://travis-ci.org/ts-taiye/raw-sql-migrate.svg?branch=master
            :target: https://travis-ci.org/ts-taiye/raw-sql-migrate
        
        .. image:: https://coveralls.io/repos/ts-taiye/raw-sql-migrate/badge.svg?branch=master
          :target: https://coveralls.io/r/ts-taiye/raw-sql-migrate?branch=master
        
        
        
        Goal
        ====
        Raw-sql-migrate is tool for managing your raw SQL migrations.
        
        
        Docs
        ====
        See <http://rsm.readthedocs.org/en/latest/> page for full docs.
        
        
        TODO
        ====
        - Write tests.
        - Make database backend support for Oracle Database.
        - Make base consistency check.
        
        
        Short guide
        ===========
        1. Create raw_sql_migrate.yaml in your project dir with next structure:
        
        .. code-block:: yaml
        
            database:
                engine: engine backend module
                host: database host
                port: database port
                name: database name
                user: user name
                password: user password
            history_table_name: migration history table name
            
        
        2. Import and make instance of Api:
        
        .. code-block:: python
        
            from raw_sql_migrate.api import Api
            api = Api()
        
        3. Create first migration
        
        .. code-block:: python
        
            api.create('package_a.package_b', name='initial')
        
        4. Edit migration file found package_a/package_b/migrations/0001_initial.py. Example:
        
        .. code-block:: python
        
            def forward(database_api):
                database_api.execute(
                    sql='''
                    CREATE TABLE test (
                       id INT PRIMARY KEY NOT NULL,
                       test_value BIGINT NOT NULL,
                    );
                    CREATE INDEX test_value_index ON test(test_value);
                    ''',
                    params={},
                    return_result=None,
                )
                database_api.commit()
            def backward(database_api):
                database_api.execute(
                    sql='''
                    DROP TABLE test;
                    ''',
                    params={},
                    return_result=None,
                )
                database_api.commit()
        
        5. Run migrations:
        
        .. code-block:: python
        
            api.forward('package_a.package_b')
        
        6. Migrating backwards:
        
        .. code-block:: python
        
            api.backward('package_a.package_b')
        
        
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Software Development :: Libraries :: Python Modules
