-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdatabasedetails.txt
139 lines (124 loc) · 4.77 KB
/
databasedetails.txt
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
Database details
List of relations
Schema | Name | Type | Owner
-------+---------------+-------+-------------
public | dopeevals | table | toodopeuser
public | encourage | table | toodopeuser
public | hlsevals | table | toodopeuser
public | outlinestable | table | toodopeuser
public | textbooks | table | toodopeuser
Table "public.outlinestable"
Column | Type | Modifiers
--------------+----------+-----------
id | integer | not null
docname | text | not null
course | text |
professorlast | text |
hearts | integer | default 0
userhearts | text[] |
grade | text |
semester | text |
year | integer |
doctype | text |
random | text |
content | text |
content_vec | tsvector |
Indexes:
"outlinestable_pkey" PRIMARY KEY, btree (id)
"content_vec_idx" gin (content_vec)
Triggers:
content_vec_update BEFORE INSERT OR UPDATE ON outlinestable FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('content_vec', 'pg_catalog.english', 'content')
Table "public.encourage"
Column | Type | Modifiers
------------+---------+--------------------------------------------------------
id | integer | not null default nextval('encourage_id_seq'::regclass)
username | text | not null
outlines | boolean | default false
evaluations | boolean | default false
Indexes:
"encourage_pkey" PRIMARY KEY, btree (id)
Table "public.dopeevals"
Column | Type | Modifiers
-------------+---------+--------------------------------------------------------
id | integer | not null default nextval('dopeevals_id_seq'::regclass)
legacyid | integer |
course | text | not null
professor | text | not null
interaction | integer |
feelings | integer |
laptops | integer |
reading | integer |
exam | integer |
attendance | integer |
success | integer |
difficulty | integer |
grades | integer |
preferencing | integer |
inclusive | integer |
adddate | date | default ('now'::text)::date
comments | text |
Indexes:
"dopeevals_pkey" PRIMARY KEY, btree (id)
Table "public.hlsevals"
Column | Type | Modifiers
----------+--------------+-------------------------------------------------------
id | integer | not null default nextval('hlsevals_id_seq'::regclass)
professor | text | not null
course | text | not null
semester | text | not null
year | integer | not null
q1 | numeric(5,3) | not null
q2 | numeric(5,3) | not null
q3 | numeric(5,3) | not null
q4 | numeric(5,3) | not null
q5 | numeric(5,3) | not null
q6 | numeric(5,3) | not null
q7 | numeric(5,3) | not null
q8 | numeric(5,3) | not null
q9 | numeric(5,3) | not null
q10 | numeric(5,3) | not null
q11 | numeric(5,3) | not null
q12 | numeric(5,3) | not null
q13 | numeric(5,3) | not null
q14 | numeric(5,3) | not null
q15 | numeric(5,3) | not null
q16 | numeric(5,3) | not null
q17 | numeric(5,3) | not null
q18 | numeric(5,3) | not null
q19 | numeric(5,3) | not null
q20 | numeric(5,3) | not null
q21 | numeric(5,3) | not null
enrolled | integer | not null
returned | integer | not null
q6_rank | integer |
q20_rank | integer |
q15_rank | integer |
Indexes:
"hlsevals_pkey" PRIMARY KEY, btree (id)
Table "public.textbooks"
Column | Type | Modifiers
----------+--------------+--------------------------------------------------------
id | integer | not null default nextval('textbooks_id_seq'::regclass)
isbn | bigint |
users | text |
price | numeric(7,2) |
condition | text |
sold | boolean | default false
adddate | date | default ('now'::text)::date
Indexes:
"textbooks_pkey" PRIMARY KEY, btree (id)
Note to self: This is how I added a readonly user to the database
outlines=> CREATE ROLE toodopereadonly WITH LOGIN PASSWORD 'password' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION VALID UNTIL 'infinity';
CREATE ROLE
outlines=> GRANT CONNECT ON DATABASE outlines TO toodopereadonly;
GRANT
outlines=> GRANT USAGE ON SCHEMA public TO toodopereadonly;
GRANT
outlines=> GRANT SELECT ON ALL TABLES IN SCHEMA public TO toodopereadonly;
GRANT
outlines=> GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO toodopereadonly;
GRANT
outlines=> ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO toodopereadonly;
ALTER DEFAULT PRIVILEGES
Note to self: Command to backup postgres db
pg_dump -h <PGHOST> -U <PGUSER> <PGDATABASE> > pg_dump_toodope_outlines