Skip to content

Commit 0a44dc9

Browse files
committed
fix(model): change UserModel timestamps to NaiveDateTime for TIMESTAMP compatibility
1 parent a450fee commit 0a44dc9

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ resolver = "2"
77
[package]
88
name = "backend"
99
description = "Backend API and services for StackClass"
10-
version = "0.32.7"
10+
version = "0.32.8"
1111
edition = "2024"
1212

1313
default-run = "stackclass-server"

openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": {
77
"name": ""
88
},
9-
"version": "0.32.7"
9+
"version": "0.32.8"
1010
},
1111
"paths": {
1212
"/v1/courses": {

src/model/user.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
use chrono::{DateTime, Utc};
15+
use chrono::{DateTime, NaiveDateTime, Utc};
1616
use sqlx::FromRow;
1717

1818
/// Database model representing a user entity
@@ -34,10 +34,10 @@ pub struct UserModel {
3434
pub image: Option<String>,
3535

3636
/// Creation timestamp
37-
pub created_at: DateTime<Utc>,
37+
pub created_at: NaiveDateTime,
3838

3939
/// Last update timestamp
40-
pub updated_at: DateTime<Utc>,
40+
pub updated_at: NaiveDateTime,
4141
}
4242

4343
impl UserModel {
@@ -49,8 +49,8 @@ impl UserModel {
4949
email,
5050
email_verified: false,
5151
image: None,
52-
created_at: Utc::now(),
53-
updated_at: Utc::now(),
52+
created_at: Utc::now().naive_utc(),
53+
updated_at: Utc::now().naive_utc(),
5454
}
5555
}
5656

0 commit comments

Comments
 (0)