-
Notifications
You must be signed in to change notification settings - Fork 1
/
HOWTO
51 lines (27 loc) · 1.3 KB
/
HOWTO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
DECOR APPLICATION MACHINERY
(c) Vladi Belperchinov-Shabanski "Cade"
COMMANDS HOWTO
This file contains HOWTO examples for creating new databases and using Decor
tools.
* create PostgreSQL database 'test-db'
createdb test-db
* create PostgreSQL user 'test-user'
createuser -D -R -S -P test-user
* rebuild Decor app named 'test_sys'
export DECOR_CORE_ROOT=/usr/local/decor/
$DECOR_CORE_ROOT/core/bin/decor-rebuild-db.pl test_sys -d -r
or
cd /usr/local/decor/core/bin
./decor-rebuild-db.pl test_sys -d -rr
NOTE: Decor app names can contain only A-Z, 9-0 and _ (underscore)
* change Decor app database settings
edit $DECOR_CORE_ROOT/apps/<app_name>/etc/dsn.def
for PostgreSQL it should look something like this:
=MAIN
DSN dbi:Pg:dbname=palm_fe4;host=127.0.0.1
USER palm-fe4
PASS palm-pass-777
for Oracle or other databases, check DBI docs for proper DSN/USER/PASS
* convert Decor type (for example UTIME) to DB native type data:
perl -I/usr/local/decor/shared/lib -MDecor::Shared::Types -e "print type_revert( '2017-01-01 00:00:00', { NAME => 'UTIME' } )"
# it should return: 1483221600 (unix time for 01.01.2017 00:00 GMT)