Explorar el Código

Enumerates the migration commands

Adrien Panay hace 7 años
padre
commit
6a51318877
Se han modificado 1 ficheros con 30 adiciones y 0 borrados
  1. 30 0
      doc/migration.md

+ 30 - 0
doc/migration.md Ver fichero

@@ -0,0 +1,30 @@
1
+# Performing migrations #
2
+
3
+## Introduction ##
4
+
5
+Migrations on `Tracim` lays on [`gearbox migrate`](http://turbogears.readthedocs.io/en/tg2.3.7/turbogears/migrations.html), which in turn lays on [`alembic`](http://alembic.zzzcomputing.com/en/latest/index.html) which is the migration tool dedicated to `SQLAlchemy`.
6
+
7
+## Quick summup ##
8
+
9
+In order to use the `gearbox migrate [...]` commands, change your current directory to be `tracim/` from the root of the project :
10
+
11
+    (tg2env) user@host:~/tracim$ cd tracim/
12
+    (tg2env) user@host:~/tracim/tracim$
13
+
14
+### Retrieving schema current version ###
15
+
16
+    gearbox migrate db_version
17
+
18
+### Creating new schema migration ###
19
+
20
+This creates a new python migration file in `tracim/migration/versions/` ending by `migration_label.py`:
21
+
22
+    gearbox migrate create 'migration label'
23
+
24
+### Upgrading schema ###
25
+
26
+    gearbox migrate upgrade
27
+
28
+### Downgrading schema ###
29
+
30
+    gearbox migrate downgrade