Skip to content

Commit b0b132e

Browse files
committed
update docs
1 parent 06e5139 commit b0b132e

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ dependencies {
2525
}
2626
```
2727

28-
## Migration File Format
28+
## Migrations
29+
All migrations must be named after database version. So if you start a new project your first migration will be `1.yaml`.
30+
When upgrading to new version the the migration file must have the name corresponding to the new database version i.e
31+
if you upgrading from `version 1` to `version 2` then you migration script name will be `2.yaml`
32+
33+
All migration have the below format:
34+
2935
```yaml
3036
up: # sql scripts to run during database upgrade or create
3137
- CREATE TABLE tests (name VARCHAR(45))
@@ -35,6 +41,14 @@ down: # sql scripts to run during database downgrade
3541
- DROP TABLE tests
3642
```
3743
44+
Where:
45+
46+
- `up` - List of SQL DDL to be applied to a database. Mainly for creating or altering a table.
47+
- `seeds` - List of SQL DML to be applied to a database. All DML will be applied after success `up DDL`.
48+
- `down` - List of DML and DDL to be applied to a database when downgrading. `Currently not implemented`.
49+
50+
Whole of migration occur with a single database transaction. So up and seeding may happen or fail as whole.
51+
3852
## Contribute
3953
It will be nice, if you open an issue first so that we can know what is going on, then, fork this repo and push in your ideas.
4054
Do not forget to add a bit of test(s) of what value you adding.

0 commit comments

Comments
 (0)