Skip to content

Commit f73c15c

Browse files
authored
Merge pull request #61 from bcc-code/docs/directus-settings-row-required
Docs: directus_settings 1 row required
2 parents e83026e + 2a3c749 commit f73c15c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ In your `docker-compose` file we need to add the `schema-sync` so that we can co
5353
```yaml
5454
// docker-compose.yaml
5555
volumes:
56-
- ./schema-sync:/directus/schema-sync
56+
- ./schema-sync:/directus/schema-sync
5757
```
5858
5959
(re)Build and run your container.
@@ -67,24 +67,26 @@ Once it is running, run the following command (from host) to install the extensi
6767
docker compose exec -it my-directus npx directus schema-sync install --force
6868
```
6969

70-
We are using force since we do want to replace the `schema-sync` folder already added as a volumn
70+
We are using force since we do want to replace the `schema-sync` folder already added as a volume
7171

7272
---
7373

7474
## 1 via NPM (Assuming you are running Directus via NPM)
7575

7676
1. `npm install directus-extension-schema-sync`
7777
2. Then run `directus schema-sync install` to install the extension's columns in the database and add the config folder
78-
4. Edit the `config.js` in the schema directory and add your collections you want to sync
79-
5. Finally run `directus schema-sync export` to export the schema and data from the Directus API
78+
3. Edit the `config.js` in the schema directory and add your collections you want to sync
79+
4. Finally run `directus schema-sync export` to export the schema and data from the Directus API
8080

8181
## 2 Configuration
8282

83-
View and edit the schema-sync/*_config.js_ file to include the collections you want to sync.
83+
View and edit the schema-sync/*_config.js_ file to include the collections you want to sync.
8484

8585
To automatically import and export the schema and data, set the `SCHEMA_SYNC` environment variable to `IMPORT`, `EXPORT` or `BOTH`.
8686
In production it is advised to set `SCHEMA_SYNC` to `IMPORT` and in local development to `BOTH`.
8787

88+
Note: This extension will not work if there is no row in the `directus_settings` database table. To avoid this happening, make sure `PROJECT_NAME` configuration variable is set when Directus is first time installed into the database. Alternatively, if Directus is already installed, just manually create a row in `directus_settings`, if one is not already there, with whatever project name you want and keep everything else to defaults.
89+
8890
### Tips
8991

9092
**Order matters** when importing and exporting. For example if you have a collection (A) with a relation to another collection (B), then ensure in the config that collection (B) comes first. This is so when we import, we first import B, then A. Deletions happen afterward in the reverse order.

0 commit comments

Comments
 (0)