[int]
This commit is contained in:
parent
2c048f90c0
commit
781218e171
4 changed files with 130 additions and 4 deletions
98
source/structure/r2.sindri.json
Normal file
98
source/structure/r2.sindri.json
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
{
|
||||||
|
"domains": [
|
||||||
|
{
|
||||||
|
"name": "member_core",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "member_extras",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "members",
|
||||||
|
"key_field": {
|
||||||
|
"name": "id"
|
||||||
|
},
|
||||||
|
"data_fields": [
|
||||||
|
{
|
||||||
|
"name": "membership_number",
|
||||||
|
"type": "string_short",
|
||||||
|
"nullable": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "enabled",
|
||||||
|
"type": "boolean",
|
||||||
|
"nullable": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name_login",
|
||||||
|
"type": "string_short",
|
||||||
|
"nullable": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "password_image",
|
||||||
|
"type": "string_medium",
|
||||||
|
"nullable": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name_real_value",
|
||||||
|
"type": "string_medium",
|
||||||
|
"nullable": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name_real_extension",
|
||||||
|
"type": "string_short",
|
||||||
|
"nullable": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name_display",
|
||||||
|
"type": "string_medium",
|
||||||
|
"nullable": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salutation",
|
||||||
|
"type": "string_short",
|
||||||
|
"nullable": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "email_address_private_value",
|
||||||
|
"type": "string_short",
|
||||||
|
"nullable": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "email_address_numberbased_use",
|
||||||
|
"type": "boolean",
|
||||||
|
"nullable": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "email_address_namebased_use",
|
||||||
|
"type": "boolean",
|
||||||
|
"nullable": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "email_redirect_to_private",
|
||||||
|
"type": "boolean",
|
||||||
|
"nullable": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"constraints": [
|
||||||
|
{
|
||||||
|
"kind": "unique",
|
||||||
|
"parameters": {
|
||||||
|
"fields": ["membership_number"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "unique",
|
||||||
|
"parameters": {
|
||||||
|
"fields": ["name_real_value","name_real_extension"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "unique",
|
||||||
|
"parameters": {
|
||||||
|
"fields": ["name_login"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
34
tools/build
34
tools/build
|
@ -1,8 +1,36 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
## functions
|
||||||
|
|
||||||
|
function syntaxerror
|
||||||
|
{
|
||||||
|
echo "SYNTAX: build <revision> [<format>]" > /dev/stderr
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
## consts
|
||||||
|
|
||||||
dir_source="source"
|
dir_source="source"
|
||||||
dir_build="build"
|
dir_build="build"
|
||||||
|
|
||||||
mkdir -p ${dir_build}
|
|
||||||
cat ${dir_source}/espe.sindri.json | tools/sindri/sindri $@ # -f database:sqlite
|
|
||||||
|
|
||||||
|
## args
|
||||||
|
|
||||||
|
if [ $# -ge 1 ] ; then revision=$1 && shift ; else syntaxerror ; fi
|
||||||
|
if [ $# -ge 1 ] ; then format=$1 && shift ; else format="sqlite" ; fi
|
||||||
|
|
||||||
|
|
||||||
|
## exec
|
||||||
|
|
||||||
|
mkdir -p ${dir_build}
|
||||||
|
|
||||||
|
echo "-- data"
|
||||||
|
cat ${dir_source}/structure/${revision}.sindri.json | tools/sindri/sindri -f database:${format}
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
echo "-- meta"
|
||||||
|
echo "DROP TABLE IF EXISTS _meta;"
|
||||||
|
echo "CREATE TABLE _meta(revision VARCHAR(15) NOT NULL);"
|
||||||
|
echo "INSERT INTO _meta(revision) VALUES ('${revision}');"
|
||||||
|
echo ""
|
||||||
|
|
|
@ -5978,7 +5978,7 @@ var _sindri;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
_sindri.add_output(_sindri.enum_realm.database, "mysql", {
|
_sindri.add_output(_sindri.enum_realm.database, "mysql", {
|
||||||
"render": (x) => Promise.resolve(_sindri.outputs.backend.typescript.render(x)),
|
"render": (x) => Promise.resolve(_sindri.outputs.database.mysql.render(x)),
|
||||||
});
|
});
|
||||||
var _sindri;
|
var _sindri;
|
||||||
(function (_sindri) {
|
(function (_sindri) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue