feat: sqlx

This commit is contained in:
Ahmet Kaan GÜMÜŞ 2024-12-03 21:33:42 +03:00
parent 40149b372d
commit 20af44c357
16 changed files with 135 additions and 194 deletions

View file

@ -0,0 +1,12 @@
-- Add up migration script here
DROP TYPE IF EXISTS role;
CREATE TYPE role AS ENUM('Zero', 'Hero');
CREATE TABLE IF NOT EXISTS "user"(
id BIGSERIAL PRIMARY KEY NOT NULL,
name VARCHAR(255) NOT NULL,
surname VARCHAR(255) NOT NULL,
gender boolean NOT NULL,
birth_date DATE NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
role ROLE NOT NULL DEFAULT 'Zero'
);