Added basic models and schemas.

Signed-off-by: Louis Hollingworth <louis@hollingworth.nl>
This commit is contained in:
Louis Hollingworth 2023-10-15 21:33:14 +01:00
parent ab60127530
commit b330bea46d
Signed by: lucxjo
GPG key ID: A11415CB3DC7809B
18 changed files with 250 additions and 1 deletions

51
src/schema.rs Normal file
View file

@ -0,0 +1,51 @@
// SPDX-FileCopyrightText: 2023 Louis Hollingworth <louis@hollingworth.nl>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
// @generated automatically by Diesel CLI.
diesel::table! {
blogs (id) {
id -> Int4,
slug -> Varchar,
name -> Varchar,
description -> Text,
url -> Text,
owner -> Int4,
created_at -> Timestamp,
updated_at -> Timestamp,
}
}
diesel::table! {
posts (id) {
id -> Int4,
slug -> Varchar,
title -> Varchar,
body -> Text,
published -> Bool,
author -> Int4,
created_at -> Timestamp,
updated_at -> Timestamp,
}
}
diesel::table! {
users (id) {
id -> Int4,
username -> Varchar,
epost -> Varchar,
pass -> Varchar,
created_at -> Timestamp,
updated_at -> Timestamp,
}
}
diesel::joinable!(blogs -> users (owner));
diesel::joinable!(posts -> users (author));
diesel::allow_tables_to_appear_in_same_query!(
blogs,
posts,
users,
);