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: docs/README.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,3 +101,35 @@ You can add additional functionality to your application via building your own w
101
101
## Environment variables
102
102
103
103
Have a look at the [docker-compose.yml](../deployment/docker/docker-compose.yml) file to know what all environment variables are available for you to tweak.
104
+
105
+
## Applying DB Migrations
106
+
107
+
The migrations are located in the [apps/web/.migrations](../apps/web/.migrations) directory. The migrations are named like `DD-MM-YY_HH-MM-<migration-purpose>.js` so that they can be sorted chronologically.
108
+
109
+
### To Apply a Migration
110
+
111
+
Since the migrations are complete scripts, you need to have some development chops—not much, though.
112
+
113
+
1. Initialize a blank Node project. In your terminal, create a blank Node project:
114
+
115
+
```
116
+
mkdir migration
117
+
cd migration
118
+
npm init -y
119
+
```
120
+
121
+
2. Install dependencies.
122
+
123
+
You can refer to the first few lines of the migration to see which dependencies are required. Most of the time, you'll be good to go after running the following command:
124
+
125
+
```
126
+
npm i mongoose nanoid
127
+
```
128
+
129
+
3. Copy the migration script into this new project folder.
0 commit comments