mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-17 11:52:27 +08:00
fix(backup): restore db and tests
This commit is contained in:
8
pkg/cache/store/rdbms.go
vendored
8
pkg/cache/store/rdbms.go
vendored
@@ -3,6 +3,7 @@ package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/eiblog/eiblog/pkg/model"
|
||||
@@ -129,7 +130,7 @@ func (db *rdbms) InsertArticle(ctx context.Context, article *model.Article, star
|
||||
if id < startID {
|
||||
id = startID
|
||||
} else {
|
||||
id += 1
|
||||
id++
|
||||
}
|
||||
article.ID = id
|
||||
}
|
||||
@@ -190,6 +191,11 @@ func (db *rdbms) LoadArticleList(ctx context.Context, search SearchArticles) (mo
|
||||
return articles, int(count), err
|
||||
}
|
||||
|
||||
// DropDatabase drop eiblog database
|
||||
func (db *rdbms) DropDatabase(ctx context.Context) error {
|
||||
return errors.New("can not drop eiblog database in rdbms")
|
||||
}
|
||||
|
||||
// register store
|
||||
func init() {
|
||||
Register("mysql", &rdbms{})
|
||||
|
||||
Reference in New Issue
Block a user