Compare commits
No commits in common. "d55d81f0a3f2facd2a8f89e31d690281e73bab17" and "81766ac5dfcdcea0410169b87b8a8b0c77a17e85" have entirely different histories.
d55d81f0a3
...
81766ac5df
2 changed files with 0 additions and 14 deletions
|
@ -1,7 +1,3 @@
|
||||||
# 0.3.2 / 2024-03-24
|
|
||||||
|
|
||||||
* Fix: Move database logging to stderr
|
|
||||||
|
|
||||||
# 0.3.1 / 2024-03-24
|
# 0.3.1 / 2024-03-24
|
||||||
|
|
||||||
* Fix: Reduce storage size also for status
|
* Fix: Reduce storage size also for status
|
||||||
|
|
|
@ -2,16 +2,12 @@ package database
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"os"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/glebarez/sqlite"
|
"github.com/glebarez/sqlite"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"gorm.io/driver/mysql"
|
"gorm.io/driver/mysql"
|
||||||
"gorm.io/driver/postgres"
|
"gorm.io/driver/postgres"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
"gorm.io/gorm/logger"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
@ -40,12 +36,6 @@ func New(driverName, connString string) (d *DB, err error) {
|
||||||
|
|
||||||
db, err := gorm.Open(innerDB, &gorm.Config{
|
db, err := gorm.Open(innerDB, &gorm.Config{
|
||||||
DisableForeignKeyConstraintWhenMigrating: true,
|
DisableForeignKeyConstraintWhenMigrating: true,
|
||||||
Logger: logger.New(log.New(os.Stderr, "\r\n", log.LstdFlags), logger.Config{
|
|
||||||
SlowThreshold: time.Second,
|
|
||||||
LogLevel: logger.Warn,
|
|
||||||
IgnoreRecordNotFoundError: true,
|
|
||||||
Colorful: false,
|
|
||||||
}),
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "connecting database")
|
return nil, errors.Wrap(err, "connecting database")
|
||||||
|
|
Loading…
Reference in a new issue