feat: move project to crates

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-10-21 11:14:58 +02:00
parent 381b472eca
commit 6e16fc6b2b
63 changed files with 9 additions and 15 deletions

View File

@@ -0,0 +1,8 @@
-- Add migration script here
CREATE TABLE IF NOT EXISTS users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
username varchar not null,
password_hash varchar not null
);
CREATE unique index users_username_idx on users(username)

View File

@@ -0,0 +1,10 @@
-- Add migration script here
CREATE TABLE IF NOT EXISTS projects (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name varchar not null,
description varchar default null,
user_id varchar not null,
created_at timestamp not null,
updated_at timestamp not null
);

View File

@@ -0,0 +1,17 @@
-- Add migration script here
create table if not exists items (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
title varchar not null,
description varchar default null,
state integer not null,
user_id varchar not null,
project_id UUID not null,
created_at timestamp not null,
updated_at timestamp not null,
CONSTRAINT fk_project
FOREIGN KEY(project_id)
REFERENCES projects(id)
ON DELETE CASCADE
)

View File

@@ -0,0 +1,4 @@
-- Add migration script here
ALTER TABLE items ALTER COLUMN state TYPE varchar(255);