stepwise-migrations 1.0.19 → 1.0.21

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 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
- - Run on the "undo" command
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stepwise-migrations",
3
- "version": "1.0.19",
4
- "description": "",
3
+ "version": "1.0.21",
4
+ "description": "A JavaScript CLI tool for managing Raw SQL migrations in a Postgres database. Loosely based on flyway.",
5
5
  "main": "./dist/src/index.js",
6
6
  "scripts": {
7
7
  "build": "tsc",
package/src/index.ts CHANGED
@@ -147,7 +147,6 @@ const main = async () => {
147
147
  process.exit(1);
148
148
  }
149
149
 
150
- console.log(undosToApply);
151
150
  for (const { filename, script } of undosToApply) {
152
151
  await applyUndoMigration(client, schema, filename, script);
153
152
  }