Migrate channel_store to sqlx (#19247)
* Migrate channel_store to sqlx https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4/chur9rxkghprg7dz1mcqssj34ic ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
a07936c279
Коммит
b37c07ec41
@@ -144,9 +144,9 @@ type ChannelSearchOpts struct {
|
||||
}
|
||||
|
||||
type ChannelMemberCountByGroup struct {
|
||||
GroupId string `db:"-" json:"group_id"`
|
||||
ChannelMemberCount int64 `db:"-" json:"channel_member_count"`
|
||||
ChannelMemberTimezonesCount int64 `db:"-" json:"channel_member_timezones_count"`
|
||||
GroupId string `json:"group_id"`
|
||||
ChannelMemberCount int64 `json:"channel_member_count"`
|
||||
ChannelMemberTimezonesCount int64 `json:"channel_member_timezones_count"`
|
||||
}
|
||||
|
||||
type ChannelOption func(channel *Channel)
|
||||
|
||||
@@ -117,6 +117,11 @@ func (m *StringMap) Scan(value interface{}) error {
|
||||
return errors.New("received value is neither a byte slice nor string")
|
||||
}
|
||||
|
||||
// Value converts StringMap to database value
|
||||
func (m StringMap) Value() (driver.Value, error) {
|
||||
return json.Marshal(m)
|
||||
}
|
||||
|
||||
func (si *StringInterface) Scan(value interface{}) error {
|
||||
if value == nil {
|
||||
return nil
|
||||
|
||||
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@@ -453,6 +453,10 @@ func testChannelStoreGet(t *testing.T, ss store.Store, s SqlStore) {
|
||||
require.NoError(t, err, err)
|
||||
require.Greater(t, len(channelsTeam), 0, "too little")
|
||||
|
||||
_, err = ss.Channel().GetTeamChannels("notfound")
|
||||
var nfErr *store.ErrNotFound
|
||||
require.True(t, errors.As(err, &nfErr))
|
||||
|
||||
// Manually truncate Channels table until testlib can handle cleanups
|
||||
s.GetMaster().Exec("TRUNCATE Channels")
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user