Add creation timestamps
This commit is contained in:
+3
-1
@@ -1,3 +1,4 @@
|
||||
use chrono::NaiveDateTime;
|
||||
use diesel::{self, QueryDsl, RunQueryDsl, ExpressionMethods, PgConnection};
|
||||
|
||||
use activity_pub::activity::Activity;
|
||||
@@ -16,7 +17,8 @@ pub struct Blog {
|
||||
pub summary: String,
|
||||
pub outbox_url: String,
|
||||
pub inbox_url: String,
|
||||
pub instance_id: i32
|
||||
pub instance_id: i32,
|
||||
pub creation_date: NaiveDateTime
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use chrono::NaiveDateTime;
|
||||
use diesel::{self, QueryDsl, RunQueryDsl, ExpressionMethods, PgConnection};
|
||||
use std::iter::Iterator;
|
||||
|
||||
@@ -11,7 +12,8 @@ pub struct Instance {
|
||||
pub public_domain: String,
|
||||
pub name: String,
|
||||
pub local: bool,
|
||||
pub blocked: bool
|
||||
pub blocked: bool,
|
||||
pub creation_date: NaiveDateTime
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
|
||||
+3
-1
@@ -1,3 +1,4 @@
|
||||
use chrono::NaiveDateTime;
|
||||
use diesel::{self, PgConnection, RunQueryDsl, QueryDsl, ExpressionMethods, BelongingToDsl};
|
||||
use diesel::dsl::any;
|
||||
use serde_json;
|
||||
@@ -17,7 +18,8 @@ pub struct Post {
|
||||
pub title: String,
|
||||
pub content: String,
|
||||
pub published: bool,
|
||||
pub license: String
|
||||
pub license: String,
|
||||
pub creation_date: NaiveDateTime
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
|
||||
+3
-1
@@ -1,4 +1,5 @@
|
||||
use bcrypt;
|
||||
use chrono::NaiveDateTime;
|
||||
use diesel::{self, QueryDsl, RunQueryDsl, ExpressionMethods, BelongingToDsl, PgConnection};
|
||||
use diesel::dsl::any;
|
||||
use rocket::request::{self, FromRequest, Request};
|
||||
@@ -27,7 +28,8 @@ pub struct User {
|
||||
pub summary: String,
|
||||
pub email: Option<String>,
|
||||
pub hashed_password: Option<String>,
|
||||
pub instance_id: i32
|
||||
pub instance_id: i32,
|
||||
pub creation_date: NaiveDateTime
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
|
||||
@@ -16,6 +16,7 @@ table! {
|
||||
outbox_url -> Varchar,
|
||||
inbox_url -> Varchar,
|
||||
instance_id -> Int4,
|
||||
creation_date -> Timestamp,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +28,7 @@ table! {
|
||||
name -> Varchar,
|
||||
local -> Bool,
|
||||
blocked -> Bool,
|
||||
creation_date -> Timestamp,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +49,7 @@ table! {
|
||||
content -> Text,
|
||||
published -> Bool,
|
||||
license -> Varchar,
|
||||
creation_date -> Timestamp,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,6 +65,7 @@ table! {
|
||||
email -> Nullable<Text>,
|
||||
hashed_password -> Nullable<Text>,
|
||||
instance_id -> Int4,
|
||||
creation_date -> Timestamp,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user