feat: +register

This commit is contained in:
2026-06-03 02:17:07 +03:00
parent c5eb62534a
commit d67d53d914
13 changed files with 242 additions and 19 deletions
+4
View File
@@ -0,0 +1,4 @@
CREATE DATABASE booking;
\c booking
\ir ./tables/default.sql
-1
View File
@@ -1 +0,0 @@
CREATE DATABASE booking;
+2
View File
@@ -0,0 +1,2 @@
\ir users.sql
\ir provider_schedules.sql
@@ -0,0 +1,8 @@
CREATE TABLE provider_schedules (
user_id BIGINT NOT NULL REFERENCES users(id),
weekday SMALLINT NOT NULL,
start_time TIME NOT NULL,
end_time TIME NOT NULL,
PRIMARY KEY (user_id, weekday)
);
+12
View File
@@ -0,0 +1,12 @@
CREATE TYPE user_role AS ENUM (
'user',
'provider'
);
CREATE TABLE users (
id BIGSERIAL PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
role user_role NOT NULL DEFAULT 'user',
password_hash TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()
);