This commit is contained in:
Tanner Sommers 2024-11-25 20:21:11 -06:00
parent 548d4fd21c
commit e9d54a83f5
4 changed files with 9 additions and 6 deletions

View File

@ -53,7 +53,7 @@
"name": "added_at",
"type_info": {
"type": "Timestamp",
"flags": "UNSIGNED | BINARY | TIMESTAMP",
"flags": "NOT_NULL | UNSIGNED | BINARY | TIMESTAMP",
"max_size": 19
}
}
@ -67,7 +67,7 @@
false,
false,
false,
true
false
]
},
"hash": "b4e2733da7f08dcfe9cdb932a746b6c9c4fe3a6205b857f0932d2c7ed2a9b172"

View File

@ -53,7 +53,7 @@
"name": "added_at",
"type_info": {
"type": "Timestamp",
"flags": "UNSIGNED | BINARY | TIMESTAMP",
"flags": "NOT_NULL | UNSIGNED | BINARY | TIMESTAMP",
"max_size": 19
}
}
@ -67,7 +67,7 @@
false,
false,
false,
true
false
]
},
"hash": "d73179806cd00f9fcd07a40acfebed83dabca46bd3bf41478bc62243cfa03066"

View File

@ -0,0 +1,3 @@
-- Add migration script here
ALTER TABLE quotes
MODIFY added_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;

View File

@ -122,7 +122,7 @@ impl DatabaseController {
username: q.username,
quote: q.quote,
added_by: q.added_by,
added_at: q.added_at.unwrap(),
added_at: q.added_at,
})),
Err(sqlx::Error::RowNotFound) => Ok(None),
Err(e) => Err(e),
@ -142,7 +142,7 @@ impl DatabaseController {
username: q.username,
quote: q.quote,
added_by: q.added_by,
added_at: q.added_at.unwrap(),
added_at: q.added_at,
});
}