forked from ccandreva/DbtDiary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tables.php
90 lines (81 loc) · 2.27 KB
/
tables.php
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
/**
* DBT Diary
*
* @copyright (C) 2012, Christopher X. Candreva <[email protected]>
* @link http://github.com/ccandreva/DbtDiary
* @license See license.txt
* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
*/
function DbtDiary_tables()
{
//Initialize table aray
$tables = array();
/* Diary card table
* This is the information on the main Diary Card, one table.
* One record per day per user
*/
$tables['dbtdiary_diary'] = DBUtil::getLimitedTablename('dbtdiary_diary');
$tables['dbtdiary_diary_column'] = array(
'id' => 'diary_id',
'uid' => 'diary_uid',
'date' => 'diary_date',
'hurt' => 'diary_hurt',
'good' => 'diary_good',
'tense' => 'diary_tense',
'miserable' => 'diary_miserable',
'panic' => 'diary_panic',
'overwhelmed' => 'diary_overwhelmed',
'angry' => 'diary_angry',
'sad' => 'diary_sad',
'hopeful' => 'diary_hopeful',
'alone' => 'diary_alone',
'distracted' => 'diary_distracted',
'bad' => 'diary_bad',
'guilty' => 'diary_guilty',
'unreal' => 'diary_unreal',
'injure' => 'diary_injure',
'kill' => 'diary_kill',
'meds' => 'diary_meds',
'skip' => 'diary_skip',
'binge' => 'diary_binge',
'purge' => 'diary_purge',
'alcohol' => 'diary_alcohol',
'drugs' => 'diary_drugs',
'comments' => 'diary_comments',
);
$tables['dbtdiary_diary_column_def'] = array(
'id' => 'I UNSIGNED NOTNULL AUTOINCREMENT PRIMARY',
'uid' => 'I UNSIGNED NOTNULL',
'date' => 'T NOTNULL',
'hurt' => 'I1',
'good' => 'I1',
'tense' => 'I1',
'miserable' => 'I1',
'panic' => 'I1',
'overwhelmed' => 'I1',
'angry' => 'I1',
'sad' => 'I1',
'hopeful' => 'I1',
'alone' => 'I1',
'distracted' => 'I1',
'bad' => 'I1',
'guilty' => 'I1',
'unreal' => 'I1',
'injure' => 'I1',
'kill' => 'I1',
'meds' => 'I1',
'skip' => 'I1',
'binge' => 'I1',
'purge' => 'I1',
'alcohol' => 'I1',
'drugs' => 'I1',
'comments' => 'X',
);
// add standard data fields
ObjectUtil::addStandardFieldsToTableDefinition (
$tables['dbtdiary_diary_column'], 'diary_');
ObjectUtil::addStandardFieldsToTableDataDefinition(
$tables['dbtdiary_diary_column_def']);
return $tables;
}