项目作者: k-int

项目描述 :
FOLIO Resource Sharing (Backend Module)
高级语言: Groovy
项目地址: git://github.com/k-int/mod-resource-sharing.git
创建时间: 2017-09-29T09:31:16Z
项目社区:https://github.com/k-int/mod-resource-sharing

开源协议:Apache License 2.0

下载


mod-resource-sharing

GIT Submodule dependencies

Run

  1. git submodule update --init --recursive

After first checkout to pull dependent submodules

Database setup

N.B. This project has a database dependency on postgres functionality. The test system requires
the following setup

CREATE USER folio WITH PASSWORD ‘folio’ SUPERUSER CREATEDB INHERIT LOGIN;

DROP DATABASE foliodev;
CREATE DATABASE foliodev;
GRANT ALL PRIVILEGES ON DATABASE foliodev to folio;
DROP DATABASE foliotest;
CREATE DATABASE foliotest;
GRANT ALL PRIVILEGES ON DATABASE foliotest to folio;
DROP DATABASE folio;
CREATE DATABASE folio;
GRANT ALL PRIVILEGES ON DATABASE folio to folio;

Dockerized postgres

Get a postgres session in dockerized pgsql using

  1. docker exec -it your_pg_container_name psql -U postgres

Testing

This module uses the idiomatic grails functional test suite — run the tests after creating the pgsql database above with

  1. grails test-app

The tests will create a tenant using the okapi tenant endpoint, and then issue a number of requests. Finally the tenant DELETE verb is used to destroy the tenant (And drop the schema and all it’s tables)

Database Migrations

When changing the domain model, the migrations for the schema must be generated and added - Here is the command

grails dbm-gorm-diff description-of-change.groovy —add

For info, The full set of database migrations can be re-generated with the command

grails dbm-generate-gorm-changelog my-new-changelog.groovy

This can be useful when manually crafting deltas. Developers must be careful when creating upgrades of existing systems! gorm-dbm-diff is the way to go normally!

ToDo

Explain how config options get passed