peewee-migrate2


Namepeewee-migrate2 JSON
Version 1.6.4 PyPI version JSON
download
home_pagehttps://github.com/spumer/peewee_migrate
SummaryFork of peewee-migrate with active support
upload_time2023-03-23 07:57:05
maintainer
docs_urlNone
authorspumer, Kirill Klenov
requires_python
licenseBSD
keywords django flask sqlalchemy testing mock stub mongoengine data
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage
            Peewee Migrate 2
################

.. _description:

Peewee Migrate 2 -- A simple migration engine for Peewee


.. _badges:

.. image:: https://travis-ci.org/spumer/peewee_migrate2.svg
    :target: http://travis-ci.org/spumer/peewee_migrate2
    :alt: Build Status


.. image:: https://coveralls.io/repos/github/spumer/peewee_migrate2/badge.svg
    :target: https://coveralls.io/github/spumer/peewee_migrate2
    :alt: Coverals

.. image:: http://img.shields.io/pypi/v/peewee_migrate2.svg?style=flat-square
    :target: https://pypi.python.org/pypi/peewee_migrate2
    :alt: Version

.. _contents:

.. contents::

.. _requirements:


Why Fork?
=========

It's a fork of original https://github.com/klen/peewee_migrate. Thank ``klen`` for that!

But ``klen`` don't support project for a long time.

To fix critical issues project was forked and development continued.


Requirements
=============

- python >= 3.6
- peewee >= 3.3.1

Dependency Note
---------------

For ``Peewee<3.0`` please use ``Peewee-Migrate==0.14.0``.

.. _installation:

Installation
=============

To reduce code changes Python package name don't changed. Only name on PyPI.

If you have installed previous version please remove it before using pip: ::

    pip uninstall peewee_migrate

**Peewee Migrate** should be installed using pip: ::

    pip install peewee_migrate2

.. _usage:

Usage
=====

Do you want Flask_ integration? Look at Flask-PW_.

From shell
----------

Getting help: ::

    $ pw_migrate --help

    Usage: pw_migrate [OPTIONS] COMMAND [ARGS]...

    Options:
        --help  Show this message and exit.

    Commands:
        create   Create migration.
        migrate  Run migrations.
        rollback Rollback migration.

Create migration: ::

    $ pw_migrate create --help

    Usage: pw_migrate create [OPTIONS] NAME

        Create migration.

    Options:
        --auto                  FLAG  Scan sources and create db migrations automatically. Supports autodiscovery.
        --auto-source           TEXT  Set to python module path for changes autoscan (e.g. 'package.models'). Current directory will be recursively scanned by default.
        --database              TEXT  Database connection
        --directory             TEXT  Directory where migrations are stored
        --schema                TEXT  Database schema
        -v, --verbose
        --help                        Show this message and exit.

Run migrations: ::

    $ pw_migrate migrate --help

    Usage: pw_migrate migrate [OPTIONS]

        Run migrations.

    Options:
        --name                  TEXT  Select migration
        --database              TEXT  Database connection
        --directory             TEXT  Directory where migrations are stored
        --schema                TEXT  Database schema
        -v, --verbose
        --help                        Show this message and exit.

Auto create migration: ::

    $ pw_migrate makemigrations --help

    Usage: pw_migrate makemigrations [OPTIONS]

      Create a migration automatically

      Similar to `create` command, but `auto` is True by default, and `name` not
      required

    Options:
        --name TEXT         Migration file name. By default will be
                          'auto_YYYYmmdd_HHMM'
        --auto              Scan sources and create db migrations automatically.
                          Supports autodiscovery.
        --auto-source TEXT  Set to python module path for changes autoscan (e.g.
                          'package.models'). Current directory will be recursively
                          scanned by default.
        --database TEXT     Database connection
        --directory TEXT    Directory where migrations are stored
        --schema                TEXT  Database schema
        -v, --verbose
        --help              Show this message and exit.

From python
-----------
::

    from peewee_migrate import Router
    from peewee import SqliteDatabase

    router = Router(SqliteDatabase('test.db'))

    # Create migration
    router.create('migration_name')

    # Run migration/migrations
    router.run('migration_name')

    # Run all unapplied migrations
    router.run()

Migration files
---------------

By default, migration files are looked up in ``os.getcwd()/migrations`` directory, but custom directory can be given.

Migration files are sorted and applied in ascending order per their filename.

Each migration file must specify ``migrate()`` function and may specify ``rollback()`` function::

    def migrate(migrator, database, fake=False, **kwargs):
        pass

    def rollback(migrator, database, fake=False, **kwargs):
        pass

.. _bugtracker:

Bug tracker
===========

If you have any suggestions, bug reports or
annoyances please report them to the issue tracker
at https://github.com/spumer/peewee_migrate2/issues

.. _contributing:

Contributing
============

Development of starter happens at github: https://github.com/spumer/peewee_migrate2


Contributors
=============

See `AUTHORS.rst`


.. _license:

License
=======

Licensed under a `BSD license`_.

.. _links:

.. _BSD license: http://www.linfo.org/bsdlicense.html
.. _klen: https://klen.github.io/
.. _Flask: http://flask.pocoo.org/
.. _Flask-PW: https://github.com/klen/flask-pw
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/spumer/peewee_migrate",
    "name": "peewee-migrate2",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "django,flask,sqlalchemy,testing,mock,stub,mongoengine,data",
    "author": "spumer, Kirill Klenov",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/d8/f2/fb24bcca2148a0f5d1f1c9e61395d1674d503fcb1689007b183528c5ba5d/peewee_migrate2-1.6.4.tar.gz",
    "platform": "Any",
    "description": "Peewee Migrate 2\n################\n\n.. _description:\n\nPeewee Migrate 2 -- A simple migration engine for Peewee\n\n\n.. _badges:\n\n.. image:: https://travis-ci.org/spumer/peewee_migrate2.svg\n    :target: http://travis-ci.org/spumer/peewee_migrate2\n    :alt: Build Status\n\n\n.. image:: https://coveralls.io/repos/github/spumer/peewee_migrate2/badge.svg\n    :target: https://coveralls.io/github/spumer/peewee_migrate2\n    :alt: Coverals\n\n.. image:: http://img.shields.io/pypi/v/peewee_migrate2.svg?style=flat-square\n    :target: https://pypi.python.org/pypi/peewee_migrate2\n    :alt: Version\n\n.. _contents:\n\n.. contents::\n\n.. _requirements:\n\n\nWhy Fork?\n=========\n\nIt's a fork of original https://github.com/klen/peewee_migrate. Thank ``klen`` for that!\n\nBut ``klen`` don't support project for a long time.\n\nTo fix critical issues project was forked and development continued.\n\n\nRequirements\n=============\n\n- python >= 3.6\n- peewee >= 3.3.1\n\nDependency Note\n---------------\n\nFor ``Peewee<3.0`` please use ``Peewee-Migrate==0.14.0``.\n\n.. _installation:\n\nInstallation\n=============\n\nTo reduce code changes Python package name don't changed. Only name on PyPI.\n\nIf you have installed previous version please remove it before using pip: ::\n\n    pip uninstall peewee_migrate\n\n**Peewee Migrate** should be installed using pip: ::\n\n    pip install peewee_migrate2\n\n.. _usage:\n\nUsage\n=====\n\nDo you want Flask_ integration? Look at Flask-PW_.\n\nFrom shell\n----------\n\nGetting help: ::\n\n    $ pw_migrate --help\n\n    Usage: pw_migrate [OPTIONS] COMMAND [ARGS]...\n\n    Options:\n        --help  Show this message and exit.\n\n    Commands:\n        create   Create migration.\n        migrate  Run migrations.\n        rollback Rollback migration.\n\nCreate migration: ::\n\n    $ pw_migrate create --help\n\n    Usage: pw_migrate create [OPTIONS] NAME\n\n        Create migration.\n\n    Options:\n        --auto                  FLAG  Scan sources and create db migrations automatically. Supports autodiscovery.\n        --auto-source           TEXT  Set to python module path for changes autoscan (e.g. 'package.models'). Current directory will be recursively scanned by default.\n        --database              TEXT  Database connection\n        --directory             TEXT  Directory where migrations are stored\n        --schema                TEXT  Database schema\n        -v, --verbose\n        --help                        Show this message and exit.\n\nRun migrations: ::\n\n    $ pw_migrate migrate --help\n\n    Usage: pw_migrate migrate [OPTIONS]\n\n        Run migrations.\n\n    Options:\n        --name                  TEXT  Select migration\n        --database              TEXT  Database connection\n        --directory             TEXT  Directory where migrations are stored\n        --schema                TEXT  Database schema\n        -v, --verbose\n        --help                        Show this message and exit.\n\nAuto create migration: ::\n\n    $ pw_migrate makemigrations --help\n\n    Usage: pw_migrate makemigrations [OPTIONS]\n\n      Create a migration automatically\n\n      Similar to `create` command, but `auto` is True by default, and `name` not\n      required\n\n    Options:\n        --name TEXT         Migration file name. By default will be\n                          'auto_YYYYmmdd_HHMM'\n        --auto              Scan sources and create db migrations automatically.\n                          Supports autodiscovery.\n        --auto-source TEXT  Set to python module path for changes autoscan (e.g.\n                          'package.models'). Current directory will be recursively\n                          scanned by default.\n        --database TEXT     Database connection\n        --directory TEXT    Directory where migrations are stored\n        --schema                TEXT  Database schema\n        -v, --verbose\n        --help              Show this message and exit.\n\nFrom python\n-----------\n::\n\n    from peewee_migrate import Router\n    from peewee import SqliteDatabase\n\n    router = Router(SqliteDatabase('test.db'))\n\n    # Create migration\n    router.create('migration_name')\n\n    # Run migration/migrations\n    router.run('migration_name')\n\n    # Run all unapplied migrations\n    router.run()\n\nMigration files\n---------------\n\nBy default, migration files are looked up in ``os.getcwd()/migrations`` directory, but custom directory can be given.\n\nMigration files are sorted and applied in ascending order per their filename.\n\nEach migration file must specify ``migrate()`` function and may specify ``rollback()`` function::\n\n    def migrate(migrator, database, fake=False, **kwargs):\n        pass\n\n    def rollback(migrator, database, fake=False, **kwargs):\n        pass\n\n.. _bugtracker:\n\nBug tracker\n===========\n\nIf you have any suggestions, bug reports or\nannoyances please report them to the issue tracker\nat https://github.com/spumer/peewee_migrate2/issues\n\n.. _contributing:\n\nContributing\n============\n\nDevelopment of starter happens at github: https://github.com/spumer/peewee_migrate2\n\n\nContributors\n=============\n\nSee `AUTHORS.rst`\n\n\n.. _license:\n\nLicense\n=======\n\nLicensed under a `BSD license`_.\n\n.. _links:\n\n.. _BSD license: http://www.linfo.org/bsdlicense.html\n.. _klen: https://klen.github.io/\n.. _Flask: http://flask.pocoo.org/\n.. _Flask-PW: https://github.com/klen/flask-pw",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Fork of peewee-migrate with active support",
    "version": "1.6.4",
    "split_keywords": [
        "django",
        "flask",
        "sqlalchemy",
        "testing",
        "mock",
        "stub",
        "mongoengine",
        "data"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f58fb3da21babc66331c8cfce1b93d144954686a0195d095ef30c5104c993e10",
                "md5": "e4c0d1802bee46ab3e3200854b029b03",
                "sha256": "fa23ea46b04115ccc278afc5ca6199693821692a9f564c4e2a76845280579831"
            },
            "downloads": -1,
            "filename": "peewee_migrate2-1.6.4-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e4c0d1802bee46ab3e3200854b029b03",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 18922,
            "upload_time": "2023-03-23T07:58:15",
            "upload_time_iso_8601": "2023-03-23T07:58:15.807461Z",
            "url": "https://files.pythonhosted.org/packages/f5/8f/b3da21babc66331c8cfce1b93d144954686a0195d095ef30c5104c993e10/peewee_migrate2-1.6.4-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d8f2fb24bcca2148a0f5d1f1c9e61395d1674d503fcb1689007b183528c5ba5d",
                "md5": "02587efcc176a5e9438dc953508f9d26",
                "sha256": "648359686bbee0e3a5cfa9d79047b978830506540b7ef5519df31f2ffb651257"
            },
            "downloads": -1,
            "filename": "peewee_migrate2-1.6.4.tar.gz",
            "has_sig": false,
            "md5_digest": "02587efcc176a5e9438dc953508f9d26",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 18167,
            "upload_time": "2023-03-23T07:57:05",
            "upload_time_iso_8601": "2023-03-23T07:57:05.311972Z",
            "url": "https://files.pythonhosted.org/packages/d8/f2/fb24bcca2148a0f5d1f1c9e61395d1674d503fcb1689007b183528c5ba5d/peewee_migrate2-1.6.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-23 07:57:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "spumer",
    "github_project": "peewee_migrate",
    "travis_ci": true,
    "coveralls": true,
    "github_actions": false,
    "requirements": [],
    "tox": true,
    "lcname": "peewee-migrate2"
}
        
Elapsed time: 0.04563s