Plume/plume-models/src/blog_authors.rs
Bat 68c7aad179 Big repository reorganization
The code is divided in three crates:
- plume-common, for the ActivityPub module, and some common utils
- plume-models, for the models and database-related code
- plume, the app itself

This new organization will allow to test it more easily, but also to create other tools that only reuse a little part of
the code (for instance a Wordpress import tool, that would just use the plume-models crate)
2018-06-23 17:36:11 +01:00

25 lines
492 B
Rust

use diesel::{self, QueryDsl, RunQueryDsl, ExpressionMethods, PgConnection};
use schema::blog_authors;
#[derive(Queryable, Identifiable)]
pub struct BlogAuthor {
pub id: i32,
pub blog_id: i32,
pub author_id: i32,
pub is_owner: bool,
}
#[derive(Insertable)]
#[table_name = "blog_authors"]
pub struct NewBlogAuthor {
pub blog_id: i32,
pub author_id: i32,
pub is_owner: bool,
}
impl BlogAuthor {
insert!(blog_authors, NewBlogAuthor);
get!(blog_authors);
}