Skip to content

Commit 41db3ba

Browse files
Shield SeaORM: Fix timestamp with time zone
1 parent d85914b commit 41db3ba

File tree

5 files changed

+21
-9
lines changed

5 files changed

+21
-9
lines changed

packages/storage/shield-sea-orm/src/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ impl BaseTable {
2626
)
2727
.col(
2828
ColumnDef::new(Base::CreatedAt)
29-
.timestamp()
29+
.timestamp_with_time_zone()
3030
.not_null()
3131
.default(Expr::current_timestamp()),
3232
)
3333
.col(
3434
ColumnDef::new(Base::UpdatedAt)
35-
.timestamp()
35+
.timestamp_with_time_zone()
3636
.not_null()
3737
.default(Expr::current_timestamp()),
3838
)

packages/storage/shield-sea-orm/src/migrations/core/m20241210_203135_create_user.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ impl MigrationTrait for Migration {
5757
.default(false),
5858
)
5959
.col(ColumnDef::new(EmailAddress::VerificationToken).string_len(32))
60-
.col(ColumnDef::new(EmailAddress::VerificationTokenExpiredAt).timestamp())
61-
.col(ColumnDef::new(EmailAddress::VerifiedAt).timestamp())
60+
.col(
61+
ColumnDef::new(EmailAddress::VerificationTokenExpiredAt)
62+
.timestamp_with_time_zone(),
63+
)
64+
.col(ColumnDef::new(EmailAddress::VerifiedAt).timestamp_with_time_zone())
6265
.col(ColumnDef::new(EmailAddress::EntityId).uuid().not_null())
6366
.foreign_key(
6467
ForeignKey::create()
@@ -105,8 +108,11 @@ impl MigrationTrait for Migration {
105108
.default(false),
106109
)
107110
.col(ColumnDef::new(EmailAddress::VerificationToken).string_len(32))
108-
.col(ColumnDef::new(EmailAddress::VerificationTokenExpiredAt).timestamp())
109-
.col(ColumnDef::new(EmailAddress::VerifiedAt).timestamp())
111+
.col(
112+
ColumnDef::new(EmailAddress::VerificationTokenExpiredAt)
113+
.timestamp_with_time_zone(),
114+
)
115+
.col(ColumnDef::new(EmailAddress::VerifiedAt).timestamp_with_time_zone())
110116
.col(ColumnDef::new(EmailAddress::UserId).uuid().not_null())
111117
.foreign_key(
112118
ForeignKey::create()

packages/storage/shield-sea-orm/src/migrations/providers/email/m20241211_092737_create_provider_email.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl MigrationTrait for Migration {
2424
)
2525
.col(
2626
ColumnDef::new(EmailAuthToken::ExpiredAt)
27-
.timestamp()
27+
.timestamp_with_time_zone()
2828
.not_null(),
2929
)
3030
.index(

packages/storage/shield-sea-orm/src/migrations/providers/oauth/m20241211_095111_create_provider_oauth.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ impl MigrationTrait for Migration {
137137
.not_null(),
138138
)
139139
.col(ColumnDef::new(OauthProviderConnection::RefreshToken).text())
140-
.col(ColumnDef::new(OauthProviderConnection::ExpiredAt).timestamp())
140+
.col(
141+
ColumnDef::new(OauthProviderConnection::ExpiredAt)
142+
.timestamp_with_time_zone(),
143+
)
141144
.col(ColumnDef::new(OauthProviderConnection::Scopes).text())
142145
.col(
143146
ColumnDef::new(OauthProviderConnection::ProviderId)

packages/storage/shield-sea-orm/src/migrations/providers/oidc/m20241211_184751_create_provider_oidc.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ impl MigrationTrait for Migration {
140140
)
141141
.col(ColumnDef::new(OidcProviderConnection::RefreshToken).text())
142142
.col(ColumnDef::new(OidcProviderConnection::IdToken).text())
143-
.col(ColumnDef::new(OidcProviderConnection::ExpiredAt).timestamp())
143+
.col(
144+
ColumnDef::new(OidcProviderConnection::ExpiredAt)
145+
.timestamp_with_time_zone(),
146+
)
144147
.col(ColumnDef::new(OidcProviderConnection::Scopes).text())
145148
.col(
146149
ColumnDef::new(OidcProviderConnection::ProviderId)

0 commit comments

Comments
 (0)