From 987edc0d4a908b02f43e60e438067e3a44afed54 Mon Sep 17 00:00:00 2001 From: Kenneth Date: Sun, 30 Nov 2025 17:42:35 +0000 Subject: [PATCH] fix: timestamp cols default not working --- apps/backend/internal/account/account.go | 4 ++-- apps/backend/internal/auth/tokens.go | 2 +- apps/backend/internal/user/user.go | 4 ++-- apps/backend/internal/virtualfs/node.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/backend/internal/account/account.go b/apps/backend/internal/account/account.go index 487aa22..d925ea0 100644 --- a/apps/backend/internal/account/account.go +++ b/apps/backend/internal/account/account.go @@ -14,8 +14,8 @@ type Account struct { UserID uuid.UUID `bun:"user_id,notnull,type:uuid" json:"userId"` StorageUsageBytes int64 `bun:"storage_usage_bytes,notnull" json:"storageUsageBytes"` StorageQuotaBytes int64 `bun:"storage_quota_bytes,notnull" json:"storageQuotaBytes"` - CreatedAt time.Time `bun:"created_at,notnull" json:"createdAt"` - UpdatedAt time.Time `bun:"updated_at,notnull" json:"updatedAt"` + CreatedAt time.Time `bun:"created_at,notnull,nullzero" json:"createdAt"` + UpdatedAt time.Time `bun:"updated_at,notnull,nullzero" json:"updatedAt"` } func newAccountID() (uuid.UUID, error) { diff --git a/apps/backend/internal/auth/tokens.go b/apps/backend/internal/auth/tokens.go index 1abdd53..42340e9 100644 --- a/apps/backend/internal/auth/tokens.go +++ b/apps/backend/internal/auth/tokens.go @@ -33,7 +33,7 @@ type RefreshToken struct { Token []byte `bun:"-"` TokenHash string `bun:"token_hash,notnull"` ExpiresAt time.Time `bun:"expires_at,notnull"` - CreatedAt time.Time `bun:"created_at,notnull"` + CreatedAt time.Time `bun:"created_at,notnull,nullzero"` } func newTokenID() (uuid.UUID, error) { diff --git a/apps/backend/internal/user/user.go b/apps/backend/internal/user/user.go index f1bb44f..63c88cb 100644 --- a/apps/backend/internal/user/user.go +++ b/apps/backend/internal/user/user.go @@ -15,8 +15,8 @@ type User struct { DisplayName string `bun:"display_name" json:"displayName"` Email string `bun:"email,unique,notnull" json:"email"` Password password.Hashed `bun:"password,notnull" json:"-"` - CreatedAt time.Time `bun:"created_at,notnull" json:"createdAt"` - UpdatedAt time.Time `bun:"updated_at,notnull" json:"updatedAt"` + CreatedAt time.Time `bun:"created_at,notnull,nullzero" json:"createdAt"` + UpdatedAt time.Time `bun:"updated_at,notnull,nullzero" json:"updatedAt"` } func newUserID() (uuid.UUID, error) { diff --git a/apps/backend/internal/virtualfs/node.go b/apps/backend/internal/virtualfs/node.go index 9d5a044..b17c417 100644 --- a/apps/backend/internal/virtualfs/node.go +++ b/apps/backend/internal/virtualfs/node.go @@ -37,8 +37,8 @@ type Node struct { Size int64 `bun:"size"` MimeType string `bun:"mime_type"` - CreatedAt time.Time `bun:"created_at,notnull"` - UpdatedAt time.Time `bun:"updated_at,notnull"` + CreatedAt time.Time `bun:"created_at,notnull,nullzero"` + UpdatedAt time.Time `bun:"updated_at,notnull,nullzero"` DeletedAt time.Time `bun:"deleted_at"` }