Added freely editable description_name field to channel

This commit is contained in:
2023-01-13 12:43:20 +01:00
parent 3343285761
commit e49d9159e4
11 changed files with 217 additions and 12 deletions

View File

@@ -289,3 +289,20 @@ func (db *Database) UpdateChannelDisplayName(ctx TxContext, channelid models.Cha
return nil
}
func (db *Database) UpdateChannelDescriptionName(ctx TxContext, channelid models.ChannelID, descname *string) error {
tx, err := ctx.GetOrCreateTransaction(db)
if err != nil {
return err
}
_, err = tx.Exec(ctx, "UPDATE channels SET description_name = :nam WHERE channel_id = :cid", sq.PP{
"nam": descname,
"cid": channelid,
})
if err != nil {
return err
}
return nil
}

View File

@@ -48,6 +48,7 @@ CREATE TABLE channels
internal_name TEXT NOT NULL,
display_name TEXT NOT NULL,
description_name TEXT NULL,
subscribe_key TEXT NOT NULL,
send_key TEXT NOT NULL,