fix: timestamp cols default not working

This commit is contained in:
2025-11-30 17:42:35 +00:00
parent fb8e91dd47
commit 987edc0d4a
4 changed files with 7 additions and 7 deletions

View File

@@ -14,8 +14,8 @@ type Account struct {
UserID uuid.UUID `bun:"user_id,notnull,type:uuid" json:"userId"` UserID uuid.UUID `bun:"user_id,notnull,type:uuid" json:"userId"`
StorageUsageBytes int64 `bun:"storage_usage_bytes,notnull" json:"storageUsageBytes"` StorageUsageBytes int64 `bun:"storage_usage_bytes,notnull" json:"storageUsageBytes"`
StorageQuotaBytes int64 `bun:"storage_quota_bytes,notnull" json:"storageQuotaBytes"` StorageQuotaBytes int64 `bun:"storage_quota_bytes,notnull" json:"storageQuotaBytes"`
CreatedAt time.Time `bun:"created_at,notnull" json:"createdAt"` CreatedAt time.Time `bun:"created_at,notnull,nullzero" json:"createdAt"`
UpdatedAt time.Time `bun:"updated_at,notnull" json:"updatedAt"` UpdatedAt time.Time `bun:"updated_at,notnull,nullzero" json:"updatedAt"`
} }
func newAccountID() (uuid.UUID, error) { func newAccountID() (uuid.UUID, error) {

View File

@@ -33,7 +33,7 @@ type RefreshToken struct {
Token []byte `bun:"-"` Token []byte `bun:"-"`
TokenHash string `bun:"token_hash,notnull"` TokenHash string `bun:"token_hash,notnull"`
ExpiresAt time.Time `bun:"expires_at,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) { func newTokenID() (uuid.UUID, error) {

View File

@@ -15,8 +15,8 @@ type User struct {
DisplayName string `bun:"display_name" json:"displayName"` DisplayName string `bun:"display_name" json:"displayName"`
Email string `bun:"email,unique,notnull" json:"email"` Email string `bun:"email,unique,notnull" json:"email"`
Password password.Hashed `bun:"password,notnull" json:"-"` Password password.Hashed `bun:"password,notnull" json:"-"`
CreatedAt time.Time `bun:"created_at,notnull" json:"createdAt"` CreatedAt time.Time `bun:"created_at,notnull,nullzero" json:"createdAt"`
UpdatedAt time.Time `bun:"updated_at,notnull" json:"updatedAt"` UpdatedAt time.Time `bun:"updated_at,notnull,nullzero" json:"updatedAt"`
} }
func newUserID() (uuid.UUID, error) { func newUserID() (uuid.UUID, error) {

View File

@@ -37,8 +37,8 @@ type Node struct {
Size int64 `bun:"size"` Size int64 `bun:"size"`
MimeType string `bun:"mime_type"` MimeType string `bun:"mime_type"`
CreatedAt time.Time `bun:"created_at,notnull"` CreatedAt time.Time `bun:"created_at,notnull,nullzero"`
UpdatedAt time.Time `bun:"updated_at,notnull"` UpdatedAt time.Time `bun:"updated_at,notnull,nullzero"`
DeletedAt time.Time `bun:"deleted_at"` DeletedAt time.Time `bun:"deleted_at"`
} }