-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepify_db.sql
More file actions
351 lines (305 loc) · 9.98 KB
/
Copy pathrepify_db.sql
File metadata and controls
351 lines (305 loc) · 9.98 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
create table achievements
(
id bigserial
primary key,
name text,
description text,
unlock text
);
create table auth_group
(
id integer generated by default as identity
primary key,
name varchar(150) not null
unique
);
create index auth_group_name_a6ea08ec_like
on auth_group (name varchar_pattern_ops);
create table auth_user
(
id integer generated by default as identity
primary key,
password varchar(128) not null,
last_login timestamp with time zone,
is_superuser boolean not null,
username varchar(150) not null
unique,
first_name varchar(150) not null,
last_name varchar(150) not null,
email varchar(254) not null,
is_staff boolean not null,
is_active boolean not null,
date_joined timestamp with time zone not null
);
create index auth_user_username_6821ab7c_like
on auth_user (username varchar_pattern_ops);
create table auth_user_groups
(
id bigint generated by default as identity
primary key,
user_id integer not null
constraint auth_user_groups_user_id_6a12ed8b_fk_auth_user_id
references auth_user
deferrable initially deferred,
group_id integer not null
constraint auth_user_groups_group_id_97559544_fk_auth_group_id
references auth_group
deferrable initially deferred,
constraint auth_user_groups_user_id_group_id_94350c0c_uniq
unique (user_id, group_id)
);
create index auth_user_groups_group_id_97559544
on auth_user_groups (group_id);
create index auth_user_groups_user_id_6a12ed8b
on auth_user_groups (user_id);
create table authtoken_token
(
key varchar(40) not null
primary key,
created timestamp with time zone not null,
user_id integer not null
unique
constraint authtoken_token_user_id_35299eff_fk_auth_user_id
references auth_user
deferrable initially deferred
);
create index authtoken_token_key_10f0b77e_like
on authtoken_token (key varchar_pattern_ops);
create table django_content_type
(
id integer generated by default as identity
primary key,
app_label varchar(100) not null,
model varchar(100) not null,
constraint django_content_type_app_label_model_76bd3d3b_uniq
unique (app_label, model)
);
create table auth_permission
(
id integer generated by default as identity
primary key,
name varchar(255) not null,
content_type_id integer not null
constraint auth_permission_content_type_id_2f476e4b_fk_django_co
references django_content_type
deferrable initially deferred,
codename varchar(100) not null,
constraint auth_permission_content_type_id_codename_01ab375a_uniq
unique (content_type_id, codename)
);
create table auth_group_permissions
(
id bigint generated by default as identity
primary key,
group_id integer not null
constraint auth_group_permissions_group_id_b120cbf9_fk_auth_group_id
references auth_group
deferrable initially deferred,
permission_id integer not null
constraint auth_group_permissio_permission_id_84c5c92e_fk_auth_perm
references auth_permission
deferrable initially deferred,
constraint auth_group_permissions_group_id_permission_id_0cd325b0_uniq
unique (group_id, permission_id)
);
create index auth_group_permissions_group_id_b120cbf9
on auth_group_permissions (group_id);
create index auth_group_permissions_permission_id_84c5c92e
on auth_group_permissions (permission_id);
create index auth_permission_content_type_id_2f476e4b
on auth_permission (content_type_id);
create table auth_user_user_permissions
(
id bigint generated by default as identity
primary key,
user_id integer not null
constraint auth_user_user_permissions_user_id_a95ead1b_fk_auth_user_id
references auth_user
deferrable initially deferred,
permission_id integer not null
constraint auth_user_user_permi_permission_id_1fbb5f2c_fk_auth_perm
references auth_permission
deferrable initially deferred,
constraint auth_user_user_permissions_user_id_permission_id_14a6b632_uniq
unique (user_id, permission_id)
);
create index auth_user_user_permissions_permission_id_1fbb5f2c
on auth_user_user_permissions (permission_id);
create index auth_user_user_permissions_user_id_a95ead1b
on auth_user_user_permissions (user_id);
create table django_admin_log
(
id integer generated by default as identity
primary key,
action_time timestamp with time zone not null,
object_id text,
object_repr varchar(200) not null,
action_flag smallint not null
constraint django_admin_log_action_flag_check
check (action_flag >= 0),
change_message text not null,
content_type_id integer
constraint django_admin_log_content_type_id_c4bce8eb_fk_django_co
references django_content_type
deferrable initially deferred,
user_id integer not null
constraint django_admin_log_user_id_c564eba6_fk_auth_user_id
references auth_user
deferrable initially deferred
);
create index django_admin_log_content_type_id_c4bce8eb
on django_admin_log (content_type_id);
create index django_admin_log_user_id_c564eba6
on django_admin_log (user_id);
create table django_migrations
(
id bigint generated by default as identity
primary key,
app varchar(255) not null,
name varchar(255) not null,
applied timestamp with time zone not null
);
create table django_session
(
session_key varchar(40) not null
primary key,
session_data text not null,
expire_date timestamp with time zone not null
);
create index django_session_expire_date_a5c62663
on django_session (expire_date);
create index django_session_session_key_c0390e0f_like
on django_session (session_key varchar_pattern_ops);
create table tags
(
id bigserial
primary key,
name text not null,
search_date timestamp default CURRENT_TIMESTAMP,
counter integer default 0
);
create table users
(
id bigserial
primary key,
university text,
career text,
cycle text,
biography text,
photo text,
achievements text,
created_at timestamp default CURRENT_TIMESTAMP,
authuser_id integer
constraint fk_auth_user
references auth_user
on delete cascade,
reset_code integer,
reset_code_created_at timestamp,
interests character varying[]
);
create table forms
(
id bigserial
primary key,
title text,
url text,
created_at timestamp default CURRENT_TIMESTAMP,
created_end timestamp default CURRENT_TIMESTAMP,
user_id integer
constraint fk_users_forms
references users
);
create table notifications
(
id bigserial
primary key,
sender_id bigint
constraint fk_user_notification
references users
on delete cascade,
message text,
is_read integer,
created_at timestamp default CURRENT_TIMESTAMP,
user_id integer
);
create table projects
(
id bigserial
primary key,
name text,
description text,
start_date date default CURRENT_TIMESTAMP,
end_date date default CURRENT_TIMESTAMP,
status text,
priority text,
responsible bigint
constraint fk_responsible
references users
on update cascade on delete set null,
detailed_description text,
progress integer,
accepting_applications boolean default true,
type_aplyuni text,
name_uniuser text,
objectives text[],
necessary_requirements text[],
project_type character varying[]
);
create table collaborations
(
id bigserial
primary key,
user_id bigint
constraint fk_user_collaboration
references users
on delete cascade,
project bigint
constraint fk_project_collaboration
references projects
on delete cascade,
role text,
status text default 'Pendiente'::text not null
);
create table solicitudes
(
id_solicitud serial
primary key,
id_user bigint
references users
on delete cascade,
id_project bigint
references projects
on delete cascade,
status text default 'Pendiente'::text not null,
created_at timestamp,
name_user text,
name_lider text,
name_project text,
message text,
photo text
);
create table tag_associations
(
id bigserial
primary key,
tag_id bigint
constraint fk_tag
references tags
on update cascade on delete cascade,
project_id bigint
constraint fk_project
references projects
on update cascade on delete cascade
);
create table user_achievements
(
id bigserial
primary key,
user_id bigint
constraint fk_user
references users,
achievement_id bigint
constraint fk_achievement
references achievements,
unlocked boolean not null
);