From 9b2ac9f74f58552bc0e87af2df2ce06632ae446b Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 14 Aug 2025 00:14:29 +0100 Subject: [PATCH] directus minimal seed & seed instructions (#305) --- backend/README.md | 18 ++++++++++++++++++ backend/directus-config/seed/maps.json | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 backend/directus-config/seed/maps.json diff --git a/backend/README.md b/backend/README.md index 4b17e2d8..c0bbcfc9 100644 --- a/backend/README.md +++ b/backend/README.md @@ -23,6 +23,24 @@ npx directus-sync push \ --directus-password admin123 ``` +## Seed Data for local development +Seed the development data via: +``` +npx directus-sync seed push \ + --directus-url http://localhost:8055 \ + --directus-email admin@it4c.dev \ + --directus-password admin123 +``` + +## Seed Data - find differences +In order so see what changes would appear when seeding, you can execute: +``` +npx directus-sync seed diff \ + --directus-url http://localhost:8055 \ + --directus-email admin@it4c.dev \ + --directus-password admin123 +``` + ## Backup Database Either keep a copy of the `/data/database` folder or run the following command to get an sql dump diff --git a/backend/directus-config/seed/maps.json b/backend/directus-config/seed/maps.json new file mode 100644 index 00000000..59a8443b --- /dev/null +++ b/backend/directus-config/seed/maps.json @@ -0,0 +1,18 @@ +{ + "collection": "maps", + "meta": { + "insert_order": 1, + "create": true, + "update": true, + "delete": true, + "preserve_ids": false, + "ignore_on_update": [] + }, + "data": [ + { + "_sync_id": "local-development", + "name": "Local Development", + "url": "http://local.development" + } + ] +} \ No newline at end of file