Skip to content

Commit 2e0277a

Browse files
committed
update naming and docs
1 parent fddf84c commit 2e0277a

File tree

4 files changed

+26
-27
lines changed

4 files changed

+26
-27
lines changed

README.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Django auto rollback
2-
This package allow to easily manage apps migrations based on GIT repository (it use commits to store apps state).
3-
So you can easily return to any previous state that is stored in DB by one command.
2+
This package allow to easy manage apps migrations based on GIT repository (it use commits to save apps state).
3+
So you can return to any previous state that is saved in DB by one command.
44

55
## Version
6-
This is the first release of package. Current version is `0.1.1`
6+
Current version is `0.2.0`
77

88
It works with:
99
- django == 1.11
@@ -12,9 +12,9 @@ It works with:
1212

1313
## Installing
1414

15-
First yoy need to install package with pip:
15+
First you need to install package with pip:
1616
```bash
17-
pip install git+https://github.com/freenoth/django-rollback.git@0.1.1
17+
pip install git+https://github.com/freenoth/django-rollback.git@0.2.0
1818
```
1919

2020
Then install it to your `INSTALLED_APPS`
@@ -25,16 +25,16 @@ INSTALLED_APPS = [
2525
]
2626
```
2727

28-
You are also should execute `./manage.py migrate` before using additional management commands.
28+
You are also should run `./manage.py migrate` before using additional management commands.
2929

3030
## Using
31-
There is only two commands to manage migrations state:
31+
There are two commands to manage migrations state:
3232

33-
### Storing current state
33+
### Saving current state
3434
```bash
35-
./manage.py store_migrations_state
35+
./manage.py save_migrations_state
3636
```
37-
This command used to store current commit state to DB (it create new or update existing state).
37+
This command used to save apps migrations state of current commit to DB (it create new or update existing state).
3838

3939
Successful output example below:
4040
```bash
@@ -51,19 +51,18 @@ Help message below:
5151
usage: manage.py rollback_migrations [-t TAG] [-c COMMIT] [--fake]
5252

5353
Rollback migrations state of all django apps to chosen tag or commit if
54-
previously stored.
54+
previously saved.
5555

5656
optional arguments:
57-
-t TAG, --tag TAG Git tag in witch needs to rollback migrations.
57+
-t TAG, --tag TAG Git tag to which to rollback migrations.
5858
-c COMMIT, --commit COMMIT
59-
Git commit hash in witch needs to rollback migrations.
60-
--fake Used to block migrate commands execution, so it allow
61-
to only print info about processed actions without
62-
execution.
59+
Git commit hash to which to rollback migrations.
60+
--fake It allow to only print info about processed actions
61+
without execution (no changes for DB).
62+
6363
```
6464
65-
You can use git commit hash (hex) directly.
66-
You don`t need to specify full commit hash, you just can use first letters.
65+
You can use git commit hash (hex) directly. And you don`t need to specify full commit hash, you just can use first letters.
6766
The commands below are equal:
6867
```bash
6968
./manage.py rollback_migrations -c 0e02e741c5953212428adc1cac9060b2a0b8626b
@@ -103,6 +102,6 @@ As you can see above, apps can be rollbacked to `zero` state too, if in previous
103102
104103
### Successful rollback conditions
105104
So rollback will be successfully finished if two conditions are satisfied:
106-
- state for current commit are stored (if not - use `./manage.py store_migrations_state` command)
107-
- state for specified commit or commit witch relates to specified tag was stored in the past
105+
- state for current commit was saved (if not - use `./manage.py save_migrations_state` command)
106+
- state for specified commit or commit which relates to specified tag was saved in the past
108107

django_rollback/management/commands/rollback_migrations.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515

1616
class Command(BaseCommand):
17-
help = 'Rollback migrations state of all django apps to chosen tag or commit if previously stored.'
17+
help = 'Rollback migrations state of all django apps to chosen tag or commit if previously saved.'
1818

1919
def add_arguments(self, parser):
20-
parser.add_argument('-t', '--tag', type=str, help='Git tag in witch needs to rollback migrations.')
21-
parser.add_argument('-c', '--commit', type=str, help='Git commit hash in witch needs to rollback migrations.')
20+
parser.add_argument('-t', '--tag', type=str, help='Git tag to which to rollback migrations.')
21+
parser.add_argument('-c', '--commit', type=str, help='Git commit hash to which to rollback migrations.')
2222
parser.add_argument('--fake', action='store_true',
23-
help='Used to block migrate commands execution, so it allow to only print info '
24-
'about processed actions without execution.')
23+
help='It allow to only print info about processed actions without execution '
24+
'(no changes for DB).')
2525

2626
def handle(self, *args, **options):
2727
other_commit = self.get_commit_from_options(options)

django_rollback/management/commands/store_migrations_state.py renamed to django_rollback/management/commands/save_migrations_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
class Command(BaseCommand):
12-
help = 'Store migrations state for current commit.'
12+
help = 'Save migrations state for current commit.'
1313

1414
def handle(self, *args, **options):
1515
commit = self.get_current_commit()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name='django_rollback',
8-
version='0.1.1',
8+
version='0.2.0',
99
author='Aleksey Yakovlev',
1010
author_email='nothscr@gmail.com',
1111
description='Package to automate django rollback',

0 commit comments

Comments
 (0)