Compare commits

...

2 Commits

Author SHA1 Message Date
e5b8457f42 feat(database): set timezone in migrations
All checks were successful
Gitea Build Check / Build (push) Successful in 2m32s
Gitea Build Check / Build (pull_request) Successful in 2m33s
2024-08-29 15:18:23 +02:00
abe553e165 chore(database): Remove unused function 2024-08-29 15:18:10 +02:00
2 changed files with 1 additions and 5 deletions

View File

@ -4,7 +4,6 @@ import (
"context"
"embed"
"fmt"
"time"
"git.anthrove.art/Anthrove/otter-space-sdk/v4/internal/utils"
otterError "git.anthrove.art/Anthrove/otter-space-sdk/v4/pkg/error"
@ -66,9 +65,6 @@ func Connect(ctx context.Context, config models.DatabaseConfig) error {
dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=%s TimeZone=%s", config.Endpoint, config.Username, config.Password, config.Database, config.Port, localSSL, config.Timezone)
sqlDB, err := gorm.Open(postgres.Open(dsn), &gorm.Config{
TranslateError: true,
NowFunc: func() time.Time {
return time.Now().UTC()
},
})
if err != nil {
return utils.HandleError(ctx, span, localLogger, err)

View File

@ -91,7 +91,7 @@ CREATE TABLE "UserSource"
scrape_time_interval TEXT,
account_username TEXT,
account_id TEXT,
last_scrape_time TIMESTAMP,
last_scrape_time TIMESTAMP WITH TIME ZONE,
account_validate BOOL DEFAULT FALSE,
account_validation_key CHAR(25),
UNIQUE (source_id, account_username, account_id)