Removing unnecesary SqlStore interface (#16057)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5b1a716e2c
Коммит
d274cf8afa
@@ -42,18 +42,18 @@ func botFromModel(b *model.Bot) *bot {
|
||||
// Bots are otherwise normal users with extra metadata record in the Bots table. The primary key
|
||||
// for a bot matches the primary key value for corresponding User record.
|
||||
type SqlBotStore struct {
|
||||
SqlStore
|
||||
*SqlSupplier
|
||||
metrics einterfaces.MetricsInterface
|
||||
}
|
||||
|
||||
// newSqlBotStore creates an instance of SqlBotStore, registering the table schema in question.
|
||||
func newSqlBotStore(sqlStore SqlStore, metrics einterfaces.MetricsInterface) store.BotStore {
|
||||
func newSqlBotStore(sqlSupplier *SqlSupplier, metrics einterfaces.MetricsInterface) store.BotStore {
|
||||
us := &SqlBotStore{
|
||||
SqlStore: sqlStore,
|
||||
metrics: metrics,
|
||||
SqlSupplier: sqlSupplier,
|
||||
metrics: metrics,
|
||||
}
|
||||
|
||||
for _, db := range sqlStore.GetAllConns() {
|
||||
for _, db := range sqlSupplier.GetAllConns() {
|
||||
table := db.AddTableWithName(bot{}, "Bots").SetKeys(false, "UserId")
|
||||
table.ColMap("UserId").SetMaxSize(26)
|
||||
table.ColMap("Description").SetMaxSize(1024)
|
||||
|
||||
Ссылка в новой задаче
Block a user