Add Options field to RemoteClusters (#25771)

* add Option flag to RemoteClusters

* add Options column to RemoteClusters table
Этот коммит содержится в:
Doug Lauder
2023-12-19 13:01:35 -05:00
коммит произвёл GitHub
родитель f118b4f0ed
Коммит d56dc9d0ce
8 изменённых файлов: 102 добавлений и 15 удалений

Просмотреть файл

@@ -40,6 +40,7 @@ func remoteClusterFields(prefix string) []string {
prefix + "Topics",
prefix + "CreatorId",
prefix + "PluginID",
prefix + "Options",
}
}
@@ -51,10 +52,10 @@ func (s sqlRemoteClusterStore) Save(remoteCluster *model.RemoteCluster) (*model.
query := `INSERT INTO RemoteClusters
(RemoteId, RemoteTeamId, Name, DisplayName, SiteURL, CreateAt,
LastPingAt, Token, RemoteToken, Topics, CreatorId, PluginID)
LastPingAt, Token, RemoteToken, Topics, CreatorId, PluginID, Options)
VALUES
(:RemoteId, :RemoteTeamId, :Name, :DisplayName, :SiteURL, :CreateAt,
:LastPingAt, :Token, :RemoteToken, :Topics, :CreatorId, :PluginID)`
:LastPingAt, :Token, :RemoteToken, :Topics, :CreatorId, :PluginID, :Options)`
if _, err := s.GetMasterX().NamedExec(query, remoteCluster); err != nil {
return nil, errors.Wrap(err, "failed to save RemoteCluster")
@@ -78,7 +79,8 @@ func (s sqlRemoteClusterStore) Update(remoteCluster *model.RemoteCluster) (*mode
DisplayName = :DisplayName,
SiteURL = :SiteURL,
Topics = :Topics,
PluginID = :PluginID
PluginID = :PluginID,
Options = :Options
WHERE RemoteId = :RemoteId AND Name = :Name`
if _, err := s.GetMasterX().NamedExec(query, remoteCluster); err != nil {