|
1 | 1 |
|
2 |
| - create table attribution ( |
| 2 | + create table apf.attribution ( |
3 | 3 | attrib_id serial not null,
|
4 | 4 | attrib_name varchar(255),
|
5 | 5 | primary key (attrib_id)
|
6 | 6 | );
|
7 | 7 |
|
8 |
| - create table data_function ( |
| 8 | + create table apf.data_function ( |
9 | 9 | data_id bigserial not null,
|
10 | 10 | det int8,
|
11 | 11 | description varchar(255),
|
|
17 | 17 | primary key (data_id)
|
18 | 18 | );
|
19 | 19 |
|
20 |
| - create table member ( |
| 20 | + create table apf.member ( |
21 | 21 | member_id bigserial not null,
|
22 | 22 | created_on date not null,
|
23 | 23 | attrib_id int4 not null,
|
|
26 | 26 | primary key (member_id)
|
27 | 27 | );
|
28 | 28 |
|
29 |
| - create table project ( |
| 29 | + create table apf.project ( |
30 | 30 | project_id bigserial not null,
|
31 | 31 | active int4,
|
32 | 32 | created_on date not null,
|
|
36 | 36 | primary key (project_id)
|
37 | 37 | );
|
38 | 38 |
|
39 |
| - create table role ( |
| 39 | + create table apf.role ( |
40 | 40 | role_id serial not null,
|
41 | 41 | role_name varchar(255),
|
42 | 42 | primary key (role_id)
|
43 | 43 | );
|
44 | 44 |
|
45 |
| - create table transaction_function ( |
| 45 | + create table apf.transaction_function ( |
46 | 46 | trans_id bigserial not null,
|
47 | 47 | det int4,
|
48 | 48 | description varchar(255),
|
|
54 | 54 | primary key (trans_id)
|
55 | 55 | );
|
56 | 56 |
|
57 |
| - create table user_role ( |
| 57 | + create table apf.user_role ( |
58 | 58 | user_id int8 not null,
|
59 | 59 | role_id int4 not null,
|
60 | 60 | primary key (user_id, role_id)
|
61 | 61 | );
|
62 | 62 |
|
63 |
| - create table user_story ( |
| 63 | + create table apf.user_story ( |
64 | 64 | user_story_id bigserial not null,
|
65 | 65 | description varchar(255),
|
66 | 66 | name varchar(255),
|
67 | 67 | project_id int8 not null,
|
68 | 68 | primary key (user_story_id)
|
69 | 69 | );
|
70 | 70 |
|
71 |
| - create table users ( |
| 71 | + create table apf.users ( |
72 | 72 | user_id bigserial not null,
|
73 | 73 | active int4,
|
74 | 74 | email varchar(255),
|
75 | 75 | last_name varchar(255),
|
76 |
| - name varchar(255), |
| 76 | + first_name varchar(255), |
77 | 77 | password varchar(255),
|
78 | 78 | primary key (user_id)
|
79 | 79 | );
|
80 | 80 |
|
81 |
| - alter table attribution |
82 |
| - add constraint UK_ifqougpv1g0br8g67hstq5kxo unique (attrib_name); |
83 |
| - |
84 |
| - alter table project |
85 |
| - add constraint UK_3k75vvu7mevyvvb5may5lj8k7 unique (name); |
86 |
| - |
87 |
| - alter table role |
88 |
| - add constraint UK_iubw515ff0ugtm28p8g3myt0h unique (role_name); |
89 |
| - |
90 |
| - alter table data_function |
91 |
| - add constraint FKre6qmiqtq8jycft6y8vabky55 |
92 |
| - foreign key (project_id) |
93 |
| - references project; |
94 |
| - |
95 |
| - alter table data_function |
96 |
| - add constraint FKdlvokmcc2or8dq955n5yisrpo |
97 |
| - foreign key (user_story_id) |
98 |
| - references user_story; |
99 |
| - |
100 |
| - alter table member |
101 |
| - add constraint FKiiq8mj6y0sssha2n9dekhhha |
102 |
| - foreign key (attrib_id) |
103 |
| - references attribution; |
104 |
| - |
105 |
| - alter table member |
106 |
| - add constraint FKn4gkqnpww70e7vcyfh0lt2imn |
107 |
| - foreign key (project_id) |
108 |
| - references project; |
109 |
| - |
110 |
| - alter table member |
111 |
| - add constraint FKe6yo8tn29so0kdd1mw4qk8tgh |
112 |
| - foreign key (user_id) |
113 |
| - references users; |
114 |
| - |
115 |
| - alter table transaction_function |
116 |
| - add constraint FKiwg15idv7boxrkyjn8c961mll |
117 |
| - foreign key (project_id) |
118 |
| - references project; |
119 |
| - |
120 |
| - alter table transaction_function |
121 |
| - add constraint FK2cxqcksbnyda0ata54ubjne98 |
122 |
| - foreign key (user_story_id) |
123 |
| - references user_story; |
124 |
| - |
125 |
| - alter table user_role |
126 |
| - add constraint FKa68196081fvovjhkek5m97n3y |
127 |
| - foreign key (role_id) |
128 |
| - references role; |
129 |
| - |
130 |
| - alter table user_role |
131 |
| - add constraint FKj345gk1bovqvfame88rcx7yyx |
132 |
| - foreign key (user_id) |
133 |
| - references users; |
134 |
| - |
135 |
| - alter table user_story |
136 |
| - add constraint FKwswc3uhx3p0yuscuxsqh2ywt |
137 |
| - foreign key (project_id) |
138 |
| - references project; |
139 |
| - |
140 |
| - create table attribution ( |
141 |
| - attrib_id serial not null, |
142 |
| - attrib_name varchar(255), |
143 |
| - primary key (attrib_id) |
144 |
| - ); |
145 |
| - |
146 |
| - create table data_function ( |
147 |
| - data_id bigserial not null, |
148 |
| - det int8, |
149 |
| - description varchar(255), |
150 |
| - name varchar(255) not null, |
151 |
| - ret int8, |
152 |
| - type varchar(255) not null, |
153 |
| - project_id int8, |
154 |
| - user_story_id int8, |
155 |
| - primary key (data_id) |
156 |
| - ); |
157 |
| - |
158 |
| - create table member ( |
159 |
| - member_id bigserial not null, |
160 |
| - created_on date not null, |
161 |
| - attrib_id int4 not null, |
162 |
| - project_id int8 not null, |
163 |
| - user_id int8 not null, |
164 |
| - primary key (member_id) |
165 |
| - ); |
| 81 | + alter table apf.attribution |
| 82 | + drop constraint UK_ifqougpv1g0br8g67hstq5kxo; |
166 | 83 |
|
167 |
| - create table project ( |
168 |
| - project_id bigserial not null, |
169 |
| - active int4, |
170 |
| - created_on date not null, |
171 |
| - description varchar(255) not null, |
172 |
| - is_private boolean not null, |
173 |
| - name varchar(255), |
174 |
| - primary key (project_id) |
175 |
| - ); |
| 84 | + alter table apf.attribution |
| 85 | + add constraint UK_ifqougpv1g0br8g67hstq5kxo unique (attrib_name); |
176 | 86 |
|
177 |
| - create table role ( |
178 |
| - role_id serial not null, |
179 |
| - role_name varchar(255), |
180 |
| - primary key (role_id) |
181 |
| - ); |
| 87 | + alter table apf.project |
| 88 | + drop constraint UK_3k75vvu7mevyvvb5may5lj8k7; |
182 | 89 |
|
183 |
| - create table transaction_function ( |
184 |
| - trans_id bigserial not null, |
185 |
| - det int4, |
186 |
| - description varchar(255), |
187 |
| - ftr int4, |
188 |
| - name varchar(255) not null, |
189 |
| - type varchar(255) not null, |
190 |
| - project_id int8, |
191 |
| - user_story_id int8, |
192 |
| - primary key (trans_id) |
193 |
| - ); |
| 90 | + alter table apf.project |
| 91 | + add constraint UK_3k75vvu7mevyvvb5may5lj8k7 unique (name); |
194 | 92 |
|
195 |
| - create table user_role ( |
196 |
| - user_id int8 not null, |
197 |
| - role_id int4 not null, |
198 |
| - primary key (user_id, role_id) |
199 |
| - ); |
| 93 | + alter table apf.role |
| 94 | + drop constraint UK_iubw515ff0ugtm28p8g3myt0h; |
200 | 95 |
|
201 |
| - create table user_story ( |
202 |
| - user_story_id bigserial not null, |
203 |
| - description varchar(255), |
204 |
| - name varchar(255), |
205 |
| - project_id int8 not null, |
206 |
| - primary key (user_story_id) |
207 |
| - ); |
| 96 | + alter table apf.role |
| 97 | + add constraint UK_iubw515ff0ugtm28p8g3myt0h unique (role_name); |
208 | 98 |
|
209 |
| - create table users ( |
| 99 | + alter table apf.data_function |
| 100 | + add constraint FKre6qmiqtq8jycft6y8vabky55 |
| 101 | + foreign key (project_id) |
| 102 | + references apf.project; |
| 103 | + |
| 104 | + alter table apf.data_function |
| 105 | + add constraint FKdlvokmcc2or8dq955n5yisrpo |
| 106 | + foreign key (user_story_id) |
| 107 | + references apf.user_story; |
| 108 | + |
| 109 | + alter table apf.member |
| 110 | + add constraint FKiiq8mj6y0sssha2n9dekhhha |
| 111 | + foreign key (attrib_id) |
| 112 | + references apf.attribution; |
| 113 | + |
| 114 | + alter table apf.member |
| 115 | + add constraint FKn4gkqnpww70e7vcyfh0lt2imn |
| 116 | + foreign key (project_id) |
| 117 | + references apf.project; |
| 118 | + |
| 119 | + alter table apf.member |
| 120 | + add constraint FKe6yo8tn29so0kdd1mw4qk8tgh |
| 121 | + foreign key (user_id) |
| 122 | + references apf.users; |
| 123 | + |
| 124 | + alter table apf.transaction_function |
| 125 | + add constraint FKiwg15idv7boxrkyjn8c961mll |
| 126 | + foreign key (project_id) |
| 127 | + references apf.project; |
| 128 | + |
| 129 | + alter table apf.transaction_function |
| 130 | + add constraint FK2cxqcksbnyda0ata54ubjne98 |
| 131 | + foreign key (user_story_id) |
| 132 | + references apf.user_story; |
| 133 | + |
| 134 | + alter table apf.user_role |
| 135 | + add constraint FKa68196081fvovjhkek5m97n3y |
| 136 | + foreign key (role_id) |
| 137 | + references apf.role; |
| 138 | + |
| 139 | + alter table apf.user_role |
| 140 | + add constraint FKj345gk1bovqvfame88rcx7yyx |
| 141 | + foreign key (user_id) |
| 142 | + references apf.users; |
| 143 | + |
| 144 | + alter table apf.user_story |
| 145 | + add constraint FKwswc3uhx3p0yuscuxsqh2ywt |
| 146 | + foreign key (project_id) |
| 147 | + references apf.project; |
| 148 | + |
| 149 | + create table apf.apf_users ( |
210 | 150 | user_id bigserial not null,
|
211 | 151 | active int4,
|
212 | 152 | email varchar(255),
|
|
216 | 156 | primary key (user_id)
|
217 | 157 | );
|
218 | 158 |
|
219 |
| - alter table attribution |
220 |
| - add constraint UK_ifqougpv1g0br8g67hstq5kxo unique (attrib_name); |
221 |
| - |
222 |
| - alter table project |
223 |
| - add constraint UK_3k75vvu7mevyvvb5may5lj8k7 unique (name); |
224 |
| - |
225 |
| - alter table role |
226 |
| - add constraint UK_iubw515ff0ugtm28p8g3myt0h unique (role_name); |
227 |
| - |
228 |
| - alter table data_function |
229 |
| - add constraint FKre6qmiqtq8jycft6y8vabky55 |
230 |
| - foreign key (project_id) |
231 |
| - references project; |
232 |
| - |
233 |
| - alter table data_function |
234 |
| - add constraint FKdlvokmcc2or8dq955n5yisrpo |
235 |
| - foreign key (user_story_id) |
236 |
| - references user_story; |
237 |
| - |
238 |
| - alter table member |
239 |
| - add constraint FKiiq8mj6y0sssha2n9dekhhha |
240 |
| - foreign key (attrib_id) |
241 |
| - references attribution; |
242 |
| - |
243 |
| - alter table member |
244 |
| - add constraint FKn4gkqnpww70e7vcyfh0lt2imn |
245 |
| - foreign key (project_id) |
246 |
| - references project; |
247 |
| - |
248 |
| - alter table member |
249 |
| - add constraint FKe6yo8tn29so0kdd1mw4qk8tgh |
250 |
| - foreign key (user_id) |
251 |
| - references users; |
252 |
| - |
253 |
| - alter table transaction_function |
254 |
| - add constraint FKiwg15idv7boxrkyjn8c961mll |
255 |
| - foreign key (project_id) |
256 |
| - references project; |
257 |
| - |
258 |
| - alter table transaction_function |
259 |
| - add constraint FK2cxqcksbnyda0ata54ubjne98 |
260 |
| - foreign key (user_story_id) |
261 |
| - references user_story; |
| 159 | + alter table apf.member |
| 160 | + add constraint FK9cgbjp4qijgbb1v615civeso2 |
| 161 | + foreign key (user_id) |
| 162 | + references apf.apf_users; |
262 | 163 |
|
263 |
| - alter table user_role |
264 |
| - add constraint FKa68196081fvovjhkek5m97n3y |
265 |
| - foreign key (role_id) |
266 |
| - references role; |
| 164 | + alter table apf.user_role |
| 165 | + add constraint FKa835ft3kmwwybwlus4ld9lqev |
| 166 | + foreign key (user_id) |
| 167 | + references apf.apf_users; |
267 | 168 |
|
268 |
| - alter table user_role |
269 |
| - add constraint FKj345gk1bovqvfame88rcx7yyx |
270 |
| - foreign key (user_id) |
271 |
| - references users; |
| 169 | + alter table apf.users |
| 170 | + add column first_name varchar(255); |
272 | 171 |
|
273 |
| - alter table user_story |
274 |
| - add constraint FKwswc3uhx3p0yuscuxsqh2ywt |
275 |
| - foreign key (project_id) |
276 |
| - references project; |
0 commit comments