Add creation timestamps

This commit is contained in:
Bat
2018-04-30 18:46:27 +01:00
parent 0fd63eb886
commit e93bb3a21f
9 changed files with 28 additions and 5 deletions
+3 -1
View File
@@ -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)]
+3 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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)]