Changes for page Data Structures

Last modified by Kerem Yollu on 2025/03/23 11:28

From version 13.1
edited by Kerem Yollu
on 2025/03/23 10:54
Change comment: There is no comment for this version
To version 11.10
edited by Kerem Yollu
on 2025/03/22 15:04
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,12 +1,10 @@
1 1  = Data Structures for KPM and database relations =
2 2  
3 3  
4 -= Core Entity Tables =
4 += Models =
5 5  
6 6  == Address ==
7 7  
8 -{{diagram/}}
9 -
10 10  {{code language="SQL"}}
11 11  -- Table: public.address
12 12  
... ... @@ -57,7 +57,7 @@
57 57   IS 'Optional: for geolocation';
58 58  {{/code}}
59 59  
60 -== Lookup Tables without references. ==
58 +== Common Stand alone tables having the same Cols. and pointing to no other table ==
61 61  
62 62  === Company ===
63 63  
... ... @@ -84,18 +84,21 @@
84 84  * user_role
85 85  * user_type
86 86  
87 -=== Employee ===
85 +=== Groupe ===
88 88  
89 -* employee_role
90 -* employee_status
91 -* employee_departement (this one i am not shure, maybe departments should be in company ?)
87 +*
92 92  
89 +
90 +
93 93  {{code language="sql"}}
94 94  DO $$
95 95  DECLARE
96 96   tname TEXT;
97 97  BEGIN
98 - FOREACH tname IN ARRAY ARRAY'TBALE_ONE','TABLE_TWO']
96 + FOREACH tname IN ARRAY ARRAY'company_legal_form','company_relation','company_status','company_type',
97 + 'task_status', 'task_type', 'task_category',
98 + 'user_role', 'user_type',
99 + 'project_type','project_areas', 'project_person_roles', 'project_company_role']
99 99   LOOP
100 100   EXECUTE format('
101 101   CREATE TABLE IF NOT EXISTS public.%I (
... ... @@ -111,24 +111,4 @@
111 111  END$$;
112 112  {{/code}}
113 113  
114 -== Lookup Tables with references. ==
115 -
116 -=== Company ===
117 -
118 -* company_departements
119 -
120 -{{code language="sql"}}
121 -CREATE TABLE IF NOT EXISTS public.TABLE
122 -(
123 - uid SERIAL PRIMARY KEY,
124 - OTHER_TABLE_uid INTEGER NOT NULL REFERENCES public.OTHER_TABLE(uid) ON DELETE CASCADE,
125 - name VARCHAR(100) NOT NULL,
126 - description VARCHAR(255),
127 - creation_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
128 - updated_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
129 -)
130 -TABLESPACE pg_default;
131 -
132 -ALTER TABLE IF EXISTS public.TABLE
133 - OWNER TO kpm_rw;
134 -{{/code}}
115 +== ==