You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,15 @@
7
7
8
8
A PostgreSQL migration library inspired by the Stack Overflow system described in [Nick Craver's blog](http://nickcraver.com/blog/2016/05/03/stack-overflow-how-we-do-deployment-2016-edition/#database-migrations).
9
9
10
+
Migrations are defined in sequential SQL files, for example:
11
+
12
+
```text
13
+
migrations
14
+
├ 1_create-table.sql
15
+
├ 2_alter-table.sql
16
+
└ 3_add-index.sql
17
+
```
18
+
10
19
Requires Node 10.17.0+
11
20
12
21
Supports PostgreSQL 9.4+
@@ -114,9 +123,9 @@ Previously run migration scripts shouldn't be modified, since we want the proces
114
123
115
124
This is enforced by hashing the file contents of a migration script and storing this in `migrations` table. Before running a migration, the previously run scripts are hashed and checked against the database to ensure they haven't changed.
116
125
117
-
### Each migration run in a transaction
126
+
### Each migration runs in a transaction
118
127
119
-
Ensures each migration is atomic. Either it completes successfully, or it is rolled back and the process is aborted.
128
+
Running in a transaction ensures each migration is atomic. Either it completes successfully, or it is rolled back and the process is aborted.
120
129
121
130
An exception is made when `-- postgres-migrations disable-transaction` is included at the top of the migration file. This allows migrations such as `CREATE INDEX CONCURRENTLY` which cannot be run inside a transaction.
0 commit comments