Compare commits
No commits in common. "e5b8457f4284eba25a06bce00bed9e99a7e10c6a" and "2391bad68ed2cd614d8287753be950d5de6efcd4" have entirely different histories.
e5b8457f42
...
2391bad68e
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"embed"
|
"embed"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
"git.anthrove.art/Anthrove/otter-space-sdk/v4/internal/utils"
|
"git.anthrove.art/Anthrove/otter-space-sdk/v4/internal/utils"
|
||||||
otterError "git.anthrove.art/Anthrove/otter-space-sdk/v4/pkg/error"
|
otterError "git.anthrove.art/Anthrove/otter-space-sdk/v4/pkg/error"
|
||||||
@ -65,6 +66,9 @@ 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)
|
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{
|
sqlDB, err := gorm.Open(postgres.Open(dsn), &gorm.Config{
|
||||||
TranslateError: true,
|
TranslateError: true,
|
||||||
|
NowFunc: func() time.Time {
|
||||||
|
return time.Now().UTC()
|
||||||
|
},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return utils.HandleError(ctx, span, localLogger, err)
|
return utils.HandleError(ctx, span, localLogger, err)
|
||||||
|
@ -91,7 +91,7 @@ CREATE TABLE "UserSource"
|
|||||||
scrape_time_interval TEXT,
|
scrape_time_interval TEXT,
|
||||||
account_username TEXT,
|
account_username TEXT,
|
||||||
account_id TEXT,
|
account_id TEXT,
|
||||||
last_scrape_time TIMESTAMP WITH TIME ZONE,
|
last_scrape_time TIMESTAMP,
|
||||||
account_validate BOOL DEFAULT FALSE,
|
account_validate BOOL DEFAULT FALSE,
|
||||||
account_validation_key CHAR(25),
|
account_validation_key CHAR(25),
|
||||||
UNIQUE (source_id, account_username, account_id)
|
UNIQUE (source_id, account_username, account_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user