{"id":15024424,"url":"https://github.com/klen/peewee_migrate","last_synced_at":"2025-05-15T11:07:35.739Z","repository":{"id":24049227,"uuid":"27434828","full_name":"klen/peewee_migrate","owner":"klen","description":"Simple migration engine for Peewee","archived":false,"fork":false,"pushed_at":"2024-07-17T10:12:27.000Z","size":437,"stargazers_count":362,"open_issues_count":46,"forks_count":86,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-05-15T11:07:34.119Z","etag":null,"topics":["migrations","peewee","peewee-orm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/klen.png","metadata":{"files":{"readme":"README.rst","changelog":"Changelog","contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":".github/code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/codeowners","security":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-12-02T13:59:17.000Z","updated_at":"2025-05-05T06:30:02.000Z","dependencies_parsed_at":"2024-09-24T21:40:53.050Z","dependency_job_id":null,"html_url":"https://github.com/klen/peewee_migrate","commit_stats":{"total_commits":414,"total_committers":39,"mean_commits":"10.615384615384615","dds":"0.21739130434782605","last_synced_commit":"daa96cea3e1ccba6733b8a52ca1b04fa1e20872c"},"previous_names":[],"tags_count":136,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fpeewee_migrate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fpeewee_migrate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fpeewee_migrate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fpeewee_migrate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klen","download_url":"https://codeload.github.com/klen/peewee_migrate/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328384,"owners_count":22052632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["migrations","peewee","peewee-orm"],"created_at":"2024-09-24T20:00:20.527Z","updated_at":"2025-05-15T11:07:35.699Z","avatar_url":"https://github.com/klen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Peewee Migrate\n##############\n\n.. _description:\n\nPeewee Migrate -- A simple migration engine for Peewee_ ORM\n\n.. _badges:\n\n.. image:: https://github.com/klen/peewee_migrate/workflows/tests/badge.svg\n    :target: https://github.com/klen/peewee_migrate/actions/workflows/tests.yml\n    :alt: Tests Status\n\n.. image:: https://github.com/klen/peewee_migrate/workflows/release/badge.svg\n    :target: https://github.com/klen/peewee_migrate/actions/workflows/release.yml\n    :alt: Build Status\n\n.. image:: https://img.shields.io/pypi/v/peewee-migrate\n    :target: https://pypi.org/project/peewee-migrate/\n    :alt: PYPI Version\n\n.. image:: https://img.shields.io/pypi/pyversions/peewee-migrate\n    :target: https://pypi.org/project/peewee-migrate/\n    :alt: Python Versions\n\n.. _contents:\n\n.. contents::\n\n.. _requirements:\n\nRequirements\n=============\n\n- peewee \u003e= 3.8\n\nDependency Note\n---------------\n\n- For ``Peewee\u003c3.0`` please use ``Peewee-Migrate==0.14.0``\n- For ``Python 3.0-3.6`` please use ``Peewee-Migrate==1.1.6``\n- For ``Python 3.7`` please use ``Peewee-Migrate==1.6.6``\n- For ``Python 3.8+`` please use ``Peewee-Migrate\u003e=1.12.1``\n\n.. _installation:\n\nInstallation\n=============\n\n**Peewee Migrate** should be installed using pip: ::\n\n    pip install peewee-migrate\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        -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        -v, --verbose\n        --help            Show this message and exit.\n\nRollback migrations: ::\n\n    $ pw_migrate rollback --help\n\n    Usage: pw_migrate rollback [OPTIONS]\n\n        Rollback a migration with given steps --count of last migrations as integer number\n\n    Options:\n        --count INTEGER   Number of last migrations to be rolled back.Ignored in\n                            case of non-empty name\n\n        --database TEXT   Database connection\n        --directory TEXT  Directory where migrations are stored\n        -v, --verbose\n        --help            Show this message and exit.\n\n\nFrom python\n-----------\n\n.. code-block:: python\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.. code-block:: python\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/klen/peewee_migrate/issues\n\n.. _contributing:\n\nContributing\n============\n\nDevelopment of starter happens at github: https://github.com/klen/peewee_migrate\n\n.. _links:\n\n.. _klen: https://klen.github.io/\n.. _Flask: http://flask.pocoo.org/\n.. _Flask-PW: https://github.com/klen/flask-pw\n.. _Peewee: http://docs.peewee-orm.com/en/latest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklen%2Fpeewee_migrate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklen%2Fpeewee_migrate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklen%2Fpeewee_migrate/lists"}