-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutilizatori.sql
More file actions
28 lines (24 loc) · 883 Bytes
/
utilizatori.sql
File metadata and controls
28 lines (24 loc) · 883 Bytes
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
CREATE TYPE roluri AS ENUM('admin', 'moderator', 'comun');
CREATE TABLE IF NOT EXISTS utilizatori (
id serial PRIMARY KEY,
username VARCHAR(50) UNIQUE NOT NULL,
nume VARCHAR(100) NOT NULL,
prenume VARCHAR(100) NOT NULL,
parola VARCHAR(500) NOT NULL,
rol roluri NOT NULL DEFAULT 'comun',
email VARCHAR(100) NOT NULL,
culoare_chat VARCHAR(50) NOT NULL,
data_adaugare TIMESTAMP DEFAULT current_timestamp,
cod character varying(200),
confirmat_mail boolean DEFAULT false,
poza VARCHAR(200)
);
CREATE TABLE IF NOT EXISTS accesari (
id serial PRIMARY KEY,
ip VARCHAR(100) NOT NULL,
user_id INT NULL REFERENCES utilizatori(id),
pagina VARCHAR(500) NOT NULL,
data_accesare TIMESTAMP DEFAULT current_timestamp
);
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO iulia;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO iulia;