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
then please change the ownership of the folder `node_modules` (**from the shell of the API container**):
102
+
103
+
```bash
104
+
chown node:node node_modules/ -R
105
+
```
106
+
107
+
Afterwards, re-run
108
+
109
+
```bash
110
+
npx prisma migrate dev
111
+
```
112
+
113
+
:::
114
+
115
+
### Database Schema Migration
102
116
103
117
If you are a developer who wants to change the database schema for adding a feature, you can update the schema file `CODEPOD_ROOT/api/prisma/schema.prisma` and then run
104
118
@@ -109,6 +123,15 @@ npx prisma migrate dev --name add_a_new_field
109
123
to generate a migration, like [this](https://github.com/codepod-io/codepod/blob/main/api/prisma/migrations/20230223102734_add_updated_at/migration.sql).
110
124
The schema change along with this migration need to be checked in (add, commit, and push) to git.
111
125
126
+
Once the DB schema is changed, other developers need to pull the changes, and
127
+
apply the migration by running the following command in the `api` container:
128
+
129
+
```
130
+
npx prisma migrate dev
131
+
```
132
+
133
+
and then restart the `api` container to take effect of the new DB schema.
134
+
112
135
## Auto-completion & Linting
113
136
114
137
Although we developed this project using docker, we still want features like auto-completion and linting while coding. For that to work, you need to install the all the relevant node packages, i.e.
0 commit comments