Added basic models and schemas.
Signed-off-by: Louis Hollingworth <louis@hollingworth.nl>
This commit is contained in:
parent
ab60127530
commit
b330bea46d
18 changed files with 250 additions and 1 deletions
51
src/schema.rs
Normal file
51
src/schema.rs
Normal 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,
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue