feat: fully replace database operations with diesel
This commit is contained in:
parent
d0ecb9357a
commit
c7dc68926b
16 changed files with 227 additions and 224 deletions
|
|
@ -1,5 +1,5 @@
|
|||
create table plants (
|
||||
id bigint primary key not null,
|
||||
id integer primary key not null,
|
||||
name text not null,
|
||||
species text not null,
|
||||
description text not null
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
drop table comments;
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
create table comments (
|
||||
id bigint primary key not null,
|
||||
plant_id bigint not null
|
||||
references plants (id)
|
||||
on delete cascade,
|
||||
comment text not null
|
||||
);
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
create table events (
|
||||
id bigint primary key not null,
|
||||
plant_id bigint not null
|
||||
id integer primary key not null,
|
||||
plant_id integer not null
|
||||
references plants (id)
|
||||
on delete cascade,
|
||||
event_type text not null,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
create table users (
|
||||
id bigint primary key not null,
|
||||
id integer primary key not null,
|
||||
username text unique not null,
|
||||
password_hash text not null,
|
||||
admin boolean not null
|
||||
|
|
@ -7,7 +7,7 @@ create table users (
|
|||
|
||||
create table sessions (
|
||||
id bigint primary key not null,
|
||||
user_id bigint not null
|
||||
user_id integer not null
|
||||
references users (id)
|
||||
on delete cascade,
|
||||
unique (id, user_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue