Metadata-Version: 2.1
Name: simple_migrator
Version: 0.1.7
Summary: A simple migrator with no bs.
Home-page: https://github.com/h-tiwari-dev/Simple-Migrator
License: MIT
Author: Harsh Tiwari
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: build (==1.0.3)
Requires-Dist: click (==8.1.7)
Requires-Dist: colored (>=2.2.4,<3.0.0)
Requires-Dist: mysqlclient (==2.2.1)
Requires-Dist: packaging (==23.2)
Requires-Dist: pathlib (>=1.0.1,<2.0.0)
Requires-Dist: pip-tools (==7.3.0)
Requires-Dist: prettytable (>=3.9.0,<4.0.0)
Requires-Dist: pyproject-hooks (==1.0.0)
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
Requires-Dist: sqlalchemy (==2.0.23)
Requires-Dist: typing-extensions (==4.9.0)
Requires-Dist: wheel (==0.42.0)
Description-Content-Type: text/markdown

# Simple Migrator

A simple tool written in python to run simple migrations.
# Basic Usage

### 1. Setup
```bash
simple_migrator setup {DATABASE_URL}
```
### 2. Create 
```bash
simple_migrator create {MIGRATION_NAME} 
```
### 3. Apply 
i. There are two ways to apply the migration. One way is to apply all the latest pending migrations.
```bash
simple_migrator up  
```
ii. Another way to do this is to give the files name to the up command. 
> Note that this method will rerun the given migrations file.
```bash
simple_migrator up --files 1703509439.048595_temp
```

### 3. Rollback 
i. Similar to "up" migration there are two ways to do this 
```bash
simple_migrator down 
```
ii. Another way to do this is to give the files name to the up command. 
> Note that this method will rollback every migration no matter if they were applied or not.
```bash
simple_migrator down --files 1703509439.048595_temp
```
### 4. List
i. List All
This will list all the migrations present.
```bash
simple_migrator list all
```
ii. List All Applied
This will list all the migrations present.
```bash
simple_migrator list applied 
```
iii. List All Applied
This will list the last applied migrations. 
```bash
simple_migrator list last-applied 
```
iv. List Pending 
This will list the all the pending migrations. 
```bash
simple_migrator list pending 
```
---

## Setup your project

# TDOD:
* [ ] Make it so that the project does not reset when the setup is called twice.(There must be a better way).
* [ ] Add tests to ensure that it works.
* [ ] Add a decorator so that we can check if setup is correctly done and exists gracefully.
* [ ] Make sql errors more visible.

