feat: rewrite user model using diesel

This commit is contained in:
Jef Roosens 2025-01-13 13:43:09 +01:00
parent 18a321853a
commit 77995ebec9
No known key found for this signature in database
GPG key ID: 21FD3D77D56BAF49
10 changed files with 97 additions and 17 deletions

View file

@ -1,5 +1,5 @@
create table plants (
id integer primary key not null,
id bigint primary key not null,
name text not null,
species text not null,
description text not null

View file

@ -1,5 +1,7 @@
create table comments (
id integer primary key not null,
plant_id integer references plants (id),
id bigint primary key not null,
plant_id bigint not null
references plants (id)
on delete cascade,
comment text not null
);

View file

@ -1,6 +1,6 @@
create table events (
id integer primary key not null,
plant_id integer not null
id bigint primary key not null,
plant_id bigint not null
references plants (id)
on delete cascade,
event_type text not null,

View file

@ -1,13 +1,13 @@
create table users (
id integer primary key not null,
id bigint primary key not null,
username text unique not null,
password_hash text not null,
admin boolean not null
);
create table sessions (
id integer primary key not null,
user_id integer not null
id bigint primary key not null,
user_id bigint not null
references users (id)
on delete cascade,
unique (id, user_id)