feat: ✨ sqlx
This commit is contained in:
parent
40149b372d
commit
20af44c357
16 changed files with 135 additions and 194 deletions
3
migrations/20241203135558_create_user_table.down.sql
Normal file
3
migrations/20241203135558_create_user_table.down.sql
Normal file
|
@ -0,0 +1,3 @@
|
|||
-- Add down migration script here
|
||||
DROP TABLE IF EXISTS "user";
|
||||
DROP TYPE IF EXISTS role;
|
12
migrations/20241203135558_create_user_table.up.sql
Normal file
12
migrations/20241203135558_create_user_table.up.sql
Normal 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'
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue