Skip to main content

No project description provided

Project description

##########################################
 __  __ _                 _       ___ _
|  \/  (_) __ _ _ __ __ _| |_ ___|_ _| |_
| |\/| | |/ _` | '__/ _` | __/ _ \| || __|
| |  | | | (_| | | | (_| | ||  __/| || |_
|_|  |_|_|\__, |_|  \__,_|\__\___|___|\__|
          |___/
##########################################

Handle database migrations with ease managing your database changes with simple SQL files. Make the migration process easier, more manageable and repeteable.

How does this work

Installation

pip install migrateit

Configuration

Configurations can be changed as environment variables.

# basic configuration
MIGRATIONS_TABLE=MIGRATEIT_CHANGELOG
MIGRATIONS_DIR=migrateit

# database configuration
DB_URL=postgresql://postgres:postgres@localhost:5432/postgres
# -------- or ----------
DB_HOST=localhost
DB_PORT=5432
DB_NAME=postgres
DB_USER=postgres
DB_PASS=postgres

Usage

# initialize MigrateIt to create:
# - database table in the configured database
# - 'migrations' directory inside the MIGRATIONS_DIR
# - 'changelog.json' file inside the MIGRATIONS_DIR
migrateit init

# create a new migration file
migrateit newmigration first_migration

# add your sql commands to the migration file
echo "CREATE TABLE test (id SERIAL PRIMARY KEY, name VARCHAR(50));" > migrateit/0001_first_migration.sql

# show pending migrations
migrateit showmigrations

# run the migrations
migrateit migrate

# run a given migration
migrateit migrate 0001

# fake a migration (will save the migration as applied without running it)
migrateit 0001 --fake

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

migrateit-0.2.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

migrateit-0.2.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file migrateit-0.2.0.tar.gz.

File metadata

  • Download URL: migrateit-0.2.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for migrateit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 af8f28e561bb0ba62b573871c2bfbdf81057fde457502f842cf0b433ecfb9196
MD5 46304e3066e4a9430bbbd2b6ef5654f9
BLAKE2b-256 121c7d36a5a1b56783303872c744f3a9e175a22246754589c931460c65883236

See more details on using hashes here.

File details

Details for the file migrateit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: migrateit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for migrateit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 19338333a8f04a388052b956b34fc739b50e4b6d7be416e9130159df735fc78c
MD5 249b492db57d5e78163aef807748cce9
BLAKE2b-256 0a7aada1fde9c062891fe8744cab99f0f60047ec372f9cd979b86a1c6fa677af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page