stepwise-migrations 1.0.19 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -13
- package/package.json +1 -1
- package/src/index.ts +0 -1
package/README.md
CHANGED
@@ -24,25 +24,25 @@ Loosely based on flyway.
|
|
24
24
|
|
25
25
|
There are three types of migrations:
|
26
26
|
|
27
|
-
<b>Versioned migrations</b>
|
27
|
+
<b>1. Versioned migrations</b>
|
28
28
|
|
29
29
|
- The filename must end with `.sql`.
|
30
30
|
- These are always applied in ascending order based on filename.
|
31
31
|
- Once applied, the file cannot be altered or else an error will be thrown.
|
32
32
|
|
33
|
-
<b>Repeatable migrations</b>
|
33
|
+
<b>2. Repeatable migrations</b>
|
34
34
|
|
35
35
|
- Are identified by the filename ending with `.repeatable.sql`
|
36
36
|
- For things like trigger functions
|
37
37
|
- Are always applied after all versioned migrations
|
38
38
|
- When altered, the new script is applied on next migration run
|
39
39
|
|
40
|
-
<b>Undo migrations</b>
|
40
|
+
<b>3. Undo migrations</b>
|
41
41
|
|
42
|
-
-
|
43
|
-
- Can only be run on versioned migrations
|
44
|
-
- Are applied in reverse order of the versioned migrations
|
42
|
+
- Are completely optional
|
45
43
|
- Must have the same filename as the versioned migration but suffixed with `.undo.sql`
|
44
|
+
- Are applied in reverse order of the versioned migrations
|
45
|
+
- Can only be for undoing versioned migrations, not repeatable migrations. For repeatable migrations, simply delete the trigger function in the repeatable migration file and migrate again.
|
46
46
|
|
47
47
|
## Usage
|
48
48
|
|
@@ -150,13 +150,6 @@ npx stepwise-migrations undo \
|
|
150
150
|
<summary>Example output</summary>
|
151
151
|
|
152
152
|
```text
|
153
|
-
[
|
154
|
-
{
|
155
|
-
type: 'undo',
|
156
|
-
filename: 'v3_third.undo.sql',
|
157
|
-
script: 'drop table third;'
|
158
|
-
}
|
159
|
-
]
|
160
153
|
Applying undo migration v3_third.undo.sql... done!
|
161
154
|
All done! Performed 1 undo migration
|
162
155
|
All applied versioned migrations:
|
package/package.json
CHANGED