From 411e34f7eb5a94413960279266f6b2c67de1712c Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@nibio.no>
Date: Wed, 17 Aug 2022 14:43:33 +0200
Subject: [PATCH] Docs: Added database init example

---
 README.md | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 14ef303..8193839 100644
--- a/README.md
+++ b/README.md
@@ -108,5 +108,22 @@ no.nibio.vips.coremanager.MD5_SALT=FooBarFooBarFooBar
 ### Initialization
 The code includes database migrations by Flyway, so the database structure will be created automatically on the first successfull deployment.
 
-In order to use the service, you need to add at least one organization and at least one user. This is done by SQL directly in the database.
+In order to use the service, you need to add at least one organization and at least one user. This is done by SQL directly in the database. See example below:
 
+```sql
+-- Create the organization
+INSERT INTO public.organization(organization_name)VALUES('Foobar International');
+-- Create the batch user for VIPSLogic
+-- Assuming that the INSERT statement above created an organization with organization_id=1
+INSERT INTO public.vips_core_user(vips_core_user_id,last_name,organization_id)
+VALUES(-10,'VIPSLogic',1);
+-- Create login credentials for this user
+-- Use the system property no.nibio.vips.coremanager.MD5_SALT to create the hash
+-- These credentials must be set as system properties in the server running VIPSLogic
+-- (Please the the docs for VIPSLogic)
+INSERT INTO public.vips_core_credentials(username,password,vips_core_user_id)
+VALUES('vipslogic','XXXXXXXXXXX',-10);
+```
+
+## Create a client
+If you don't use VIPSLogic or just want to test the system (e.g. with Postman), you can send requests directly to the system. Please see the VIPSCore documentation for how to do this.
\ No newline at end of file
-- 
GitLab