Skip to content

Commit

Permalink
Shield SeaORM: Fix timestamp with time zone
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielleHuisman committed Dec 29, 2024
1 parent d85914b commit 41db3ba
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/storage/shield-sea-orm/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ impl BaseTable {
)
.col(
ColumnDef::new(Base::CreatedAt)
.timestamp()
.timestamp_with_time_zone()
.not_null()
.default(Expr::current_timestamp()),
)
.col(
ColumnDef::new(Base::UpdatedAt)
.timestamp()
.timestamp_with_time_zone()
.not_null()
.default(Expr::current_timestamp()),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ impl MigrationTrait for Migration {
.default(false),
)
.col(ColumnDef::new(EmailAddress::VerificationToken).string_len(32))
.col(ColumnDef::new(EmailAddress::VerificationTokenExpiredAt).timestamp())
.col(ColumnDef::new(EmailAddress::VerifiedAt).timestamp())
.col(
ColumnDef::new(EmailAddress::VerificationTokenExpiredAt)
.timestamp_with_time_zone(),
)
.col(ColumnDef::new(EmailAddress::VerifiedAt).timestamp_with_time_zone())
.col(ColumnDef::new(EmailAddress::EntityId).uuid().not_null())
.foreign_key(
ForeignKey::create()
Expand Down Expand Up @@ -105,8 +108,11 @@ impl MigrationTrait for Migration {
.default(false),
)
.col(ColumnDef::new(EmailAddress::VerificationToken).string_len(32))
.col(ColumnDef::new(EmailAddress::VerificationTokenExpiredAt).timestamp())
.col(ColumnDef::new(EmailAddress::VerifiedAt).timestamp())
.col(
ColumnDef::new(EmailAddress::VerificationTokenExpiredAt)
.timestamp_with_time_zone(),
)
.col(ColumnDef::new(EmailAddress::VerifiedAt).timestamp_with_time_zone())
.col(ColumnDef::new(EmailAddress::UserId).uuid().not_null())
.foreign_key(
ForeignKey::create()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl MigrationTrait for Migration {
)
.col(
ColumnDef::new(EmailAuthToken::ExpiredAt)
.timestamp()
.timestamp_with_time_zone()
.not_null(),
)
.index(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ impl MigrationTrait for Migration {
.not_null(),
)
.col(ColumnDef::new(OauthProviderConnection::RefreshToken).text())
.col(ColumnDef::new(OauthProviderConnection::ExpiredAt).timestamp())
.col(
ColumnDef::new(OauthProviderConnection::ExpiredAt)
.timestamp_with_time_zone(),
)
.col(ColumnDef::new(OauthProviderConnection::Scopes).text())
.col(
ColumnDef::new(OauthProviderConnection::ProviderId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ impl MigrationTrait for Migration {
)
.col(ColumnDef::new(OidcProviderConnection::RefreshToken).text())
.col(ColumnDef::new(OidcProviderConnection::IdToken).text())
.col(ColumnDef::new(OidcProviderConnection::ExpiredAt).timestamp())
.col(
ColumnDef::new(OidcProviderConnection::ExpiredAt)
.timestamp_with_time_zone(),
)
.col(ColumnDef::new(OidcProviderConnection::Scopes).text())
.col(
ColumnDef::new(OidcProviderConnection::ProviderId)
Expand Down

0 comments on commit 41db3ba

Please sign in to comment.