Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: data source schema refactoring (#4053)

Danny Xu33c405f76357
diff --git a/api/data_source.go b/api/data_source.go
index afbb5c8928..104eb27e55 100644
--- a/api/data_source.go
+++ b/api/data_source.go
@@ -96,10 +96,10 @@ type DataSource struct {
SslCa string
SslCert string
SslKey string
- // HostOverride and PortOverride are only used for read-only data sources for user's read-replica instances.
- HostOverride string `jsonapi:"attr,hostOverride"`
- PortOverride string `jsonapi:"attr,portOverride"`
- Options DataSourceOptions `jsonapi:"attr,options"`
+ Host string `jsonapi:"attr,hostOverride"`
+ Port string `jsonapi:"attr,portOverride"`
+ Options DataSourceOptions `jsonapi:"attr,options"`
+ Database string `jsonapi:"attr,database"`
}
// DataSourceCreate is the API message for creating a data source.
@@ -113,16 +113,17 @@ type DataSourceCreate struct {
DatabaseID int `jsonapi:"attr,databaseId"`
// Domain specific fields
- Name string `jsonapi:"attr,name"`
- Type DataSourceType `jsonapi:"attr,type"`
- Username string `jsonapi:"attr,username"`
- Password string `jsonapi:"attr,password"`
- SslCa string `jsonapi:"attr,sslCa"`
- SslCert string `jsonapi:"attr,sslCert"`
- SslKey string `jsonapi:"attr,sslKey"`
- HostOverride string `jsonapi:"attr,hostOverride"`
- PortOverride string `jsonapi:"attr,portOverride"`
- Options DataSourceOptions `jsonapi:"attr,options"`
+ Name string `jsonapi:"attr,name"`
+ Type DataSourceType `jsonapi:"attr,type"`
+ Username string `jsonapi:"attr,username"`
+ Password string `jsonapi:"attr,password"`
+ SslCa string `jsonapi:"attr,sslCa"`
+ SslCert string `jsonapi:"attr,sslCert"`
+ SslKey string `jsonapi:"attr,sslKey"`
+ Host string `jsonapi:"attr,hostOverride"`
+ Port string `jsonapi:"attr,portOverride"`
+ Options DataSourceOptions `jsonapi:"attr,options"`
+ Database string `jsonapi:"attr,database"`
}
// DataSourceFind is the API message for finding data sources.
@@ -160,9 +161,10 @@ type DataSourcePatch struct {
SslCa *string `jsonapi:"attr,sslCa"`
SslCert *string `jsonapi:"attr,sslCert"`
SslKey *string `jsonapi:"attr,sslKey"`
- HostOverride *string `jsonapi:"attr,hostOverride"`
- PortOverride *string `jsonapi:"attr,portOverride"`
+ Host *string `jsonapi:"attr,hostOverride"`
+ Port *string `jsonapi:"attr,portOverride"`
Options *DataSourceOptions `jsonapi:"attr,options"`
+ Database *string `jsonapi:"attr,database"`
}
// DataSourceDelete is the API message for deleting data sources.
diff --git a/api/v1/data_source.go b/api/v1/data_source.go
index b8e80e1727..bc621a05a1 100644
--- a/api/v1/data_source.go
+++ b/api/v1/data_source.go
@@ -14,21 +14,22 @@ type DataSource struct {
Type api.DataSourceType `json:"type"`
Username string `json:"username"`
- // HostOverride and PortOverride are only used for read-only data sources for user's read-replica instances.
- HostOverride string `json:"hostOverride"`
- PortOverride string `json:"portOverride"`
+ Host string `json:"hostOverride"`
+ Port string `json:"portOverride"`
+ Database string `json:"database"`
}
// DataSourceCreate is the API message for creating a data source.
type DataSourceCreate struct {
// Domain specific fields
- Name string `json:"name"`
- Type api.DataSourceType `json:"type"`
- Username string `json:"username"`
- Password string `json:"password"`
- SslCa string `json:"sslCa"`
- SslCert string `json:"sslCert"`
- SslKey string `json:"sslKey"`
- HostOverride string `json:"hostOverride"`
- PortOverride string `json:"portOverride"`
+ Name string `json:"name"`
+ Type api.DataSourceType `json:"type"`
+ Username string `json:"username"`
+ Password string `json:"password"`
+ SslCa string `json:"sslCa"`
+ SslCert string `json:"sslCert"`
+ SslKey string `json:"sslKey"`
+ Host string `json:"hostOverride"`
+ Port string `json:"portOverride"`
+ Database string `json:"database"`
}
diff --git a/server/component/dbfactory/dbfactory.go b/server/component/dbfactory/dbfactory.go
index 25d6da5790..413514058e 100644
--- a/server/component/dbfactory/dbfactory.go
+++ b/server/component/dbfactory/dbfactory.go
@@ -95,8 +95,8 @@ func (d *DBFactory) GetReadOnlyDatabaseDriver(ctx context.Context, instance *api
}
host, port := instance.Host, instance.Port
- if dataSource.HostOverride != "" || dataSource.PortOverride != "" {
- host, port = dataSource.HostOverride, dataSource.PortOverride
+ if dataSource.Host != "" || dataSource.Port != "" {
+ host, port = dataSource.Host, dataSource.Port
}
dbBinDir := ""
diff --git a/server/database.go b/server/database.go
index d3c1ddae7e..6b890d613f 100644
--- a/server/database.go
+++ b/server/database.go
@@ -502,16 +502,12 @@ func (s *Server) registerDatabaseRoutes(g *echo.Group) {
if err := jsonapi.UnmarshalPayload(c.Request().Body, dataSourceCreate); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, "Malformed create data source request").SetInternal(err)
}
- if !s.licenseService.IsFeatureEnabled(api.FeatureReadReplicaConnection) {
- if dataSourceCreate.HostOverride != "" || dataSourceCreate.PortOverride != "" {
+ if !s.licenseService.IsFeatureEnabled(api.FeatureReadReplicaConnection) && dataSourceCreate.Type == api.RO {
+ if dataSourceCreate.Host != "" || dataSourceCreate.Port != "" {
return echo.NewHTTPError(http.StatusForbidden, api.FeatureReadReplicaConnection.AccessErrorMessage())
}
}
- if dataSourceCreate.Type == api.Admin && (dataSourceCreate.HostOverride != "" || dataSourceCreate.PortOverride != "") {
- return echo.NewHTTPError(http.StatusBadRequest, "Host and port override cannot be set for admin type of data sources.")
- }
-
dataSourceCreate.CreatorID = c.Get(getPrincipalIDContextKey()).(int)
dataSourceCreate.DatabaseID = databaseID
@@ -578,9 +574,8 @@ func (s *Server) registerDatabaseRoutes(g *echo.Group) {
if err := jsonapi.UnmarshalPayload(c.Request().Body, dataSourcePatch); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, "Malformed patch data source request").SetInternal(err)
}
- if !s.licenseService.IsFeatureEnabled(api.FeatureReadReplicaConnection) {
- // In the non-enterprise version, we should allow users to set HostOverride or PortOverride to the empty string.
- if (dataSourcePatch.HostOverride != nil && *dataSourcePatch.HostOverride != "") || (dataSourcePatch.PortOverride != nil && *dataSourcePatch.PortOverride != "") {
+ if dataSourceOld.Type == api.RO && !s.licenseService.IsFeatureEnabled(api.FeatureReadReplicaConnection) {
+ if (dataSourcePatch.Host != nil && *dataSourcePatch.Host != "") || (dataSourcePatch.Port != nil && *dataSourcePatch.Port != "") {
return echo.NewHTTPError(http.StatusForbidden, api.FeatureReadReplicaConnection.AccessErrorMessage())
}
}
@@ -592,10 +587,6 @@ func (s *Server) registerDatabaseRoutes(g *echo.Group) {
password := ""
dataSourcePatch.Password = &password
}
- if dataSourceOld.Type == api.Admin && (dataSourcePatch.HostOverride != nil || dataSourcePatch.PortOverride != nil) {
- return echo.NewHTTPError(http.StatusBadRequest, "Host and port override cannot be set for admin type of data sources.")
- }
-
dataSourceNew, err := s.store.PatchDataSource(ctx, dataSourcePatch)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to update data source with ID %d", dataSourceID)).SetInternal(err)
diff --git a/server/instance.go b/server/instance.go
index 36fd848f85..f24c23311d 100644
--- a/server/instance.go
+++ b/server/instance.go
@@ -50,10 +50,13 @@ func (s *Server) registerInstanceRoutes(g *echo.Group) {
SslCa: instanceCreate.SslCa,
SslCert: instanceCreate.SslCert,
SslKey: instanceCreate.SslKey,
+ Host: instanceCreate.Host,
+ Port: instanceCreate.Port,
Options: api.DataSourceOptions{
SRV: instanceCreate.SRV,
AuthSource: instanceCreate.AuthSource,
},
+ Database: instanceCreate.Database,
},
},
Name: instanceCreate.Name,
diff --git a/server/openapi_instance.go b/server/openapi_instance.go
index 3a8da8a993..f110d6784a 100644
--- a/server/openapi_instance.go
+++ b/server/openapi_instance.go
@@ -445,13 +445,13 @@ func convertToOpenAPIInstance(instance *api.Instance) *openAPIV1.Instance {
dataSourceList := []*openAPIV1.DataSource{}
for _, dataSource := range instance.DataSourceList {
dataSourceList = append(dataSourceList, &openAPIV1.DataSource{
- ID: dataSource.ID,
- DatabaseID: dataSource.DatabaseID,
- Name: dataSource.Name,
- Type: dataSource.Type,
- Username: dataSource.Username,
- HostOverride: dataSource.HostOverride,
- PortOverride: dataSource.PortOverride,
+ ID: dataSource.ID,
+ DatabaseID: dataSource.DatabaseID,
+ Name: dataSource.Name,
+ Type: dataSource.Type,
+ Username: dataSource.Username,
+ Host: dataSource.Host,
+ Port: dataSource.Port,
})
}
@@ -497,15 +497,15 @@ func convertToAPIDataSouceList(dataSourceList []*openAPIV1.DataSourceCreate) ([]
})
case api.RO:
res = append(res, &api.DataSourceCreate{
- Name: dataSource.Name,
- Type: api.RO,
- Username: dataSource.Username,
- Password: dataSource.Password,
- SslCa: dataSource.SslCa,
- SslCert: dataSource.SslCert,
- SslKey: dataSource.SslKey,
- HostOverride: dataSource.HostOverride,
- PortOverride: dataSource.PortOverride,
+ Name: dataSource.Name,
+ Type: api.RO,
+ Username: dataSource.Username,
+ Password: dataSource.Password,
+ SslCa: dataSource.SslCa,
+ SslCert: dataSource.SslCert,
+ SslKey: dataSource.SslKey,
+ Host: dataSource.Host,
+ Port: dataSource.Port,
})
default:
return nil, echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("The data source type %s is not supported", dataSource.Type))
diff --git a/store/data_source.go b/store/data_source.go
index 84a68ba63d..bd2946d0c8 100644
--- a/store/data_source.go
+++ b/store/data_source.go
@@ -28,16 +28,17 @@ type dataSourceRaw struct {
DatabaseID int
// Domain specific fields
- Name string
- Type api.DataSourceType
- Username string
- Password string
- SslCa string
- SslCert string
- SslKey string
- HostOverride string
- PortOverride string
- Options api.DataSourceOptions
+ Name string
+ Type api.DataSourceType
+ Username string
+ Password string
+ SslCa string
+ SslCert string
+ SslKey string
+ Host string
+ Port string
+ Options api.DataSourceOptions
+ Database string
}
// toDataSource creates an instance of DataSource based on the dataSourceRaw.
@@ -57,16 +58,17 @@ func (raw *dataSourceRaw) toDataSource() *api.DataSource {
DatabaseID: raw.DatabaseID,
// Domain specific fields
- Name: raw.Name,
- Type: raw.Type,
- Username: raw.Username,
- Password: raw.Password,
- SslCa: raw.SslCa,
- SslCert: raw.SslCert,
- SslKey: raw.SslKey,
- HostOverride: raw.HostOverride,
- PortOverride: raw.PortOverride,
- Options: raw.Options,
+ Name: raw.Name,
+ Type: raw.Type,
+ Username: raw.Username,
+ Password: raw.Password,
+ SslCa: raw.SslCa,
+ SslCert: raw.SslCert,
+ SslKey: raw.SslKey,
+ Host: raw.Host,
+ Port: raw.Port,
+ Options: raw.Options,
+ Database: raw.Database,
}
}
@@ -299,12 +301,13 @@ func (*Store) createDataSourceImpl(ctx context.Context, tx *Tx, create *api.Data
ssl_key,
ssl_cert,
ssl_ca,
- host_override,
- port_override,
- options
+ host,
+ port,
+ options,
+ database
)
- VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14)
- RETURNING id, creator_id, created_ts, updater_id, updated_ts, instance_id, database_id, name, type, username, password, ssl_key, ssl_cert, ssl_ca, host_override, port_override, options
+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15)
+ RETURNING id, creator_id, created_ts, updater_id, updated_ts, instance_id, database_id, name, type, username, password, ssl_key, ssl_cert, ssl_ca, host, port, options, database
`
var dataSourceRaw dataSourceRaw
if err := tx.QueryRowContext(ctx, query,
@@ -319,9 +322,10 @@ func (*Store) createDataSourceImpl(ctx context.Context, tx *Tx, create *api.Data
create.SslKey,
create.SslCert,
create.SslCa,
- create.HostOverride,
- create.PortOverride,
+ create.Host,
+ create.Port,
create.Options,
+ create.Database,
).Scan(
&dataSourceRaw.ID,
&dataSourceRaw.CreatorID,
@@ -337,9 +341,10 @@ func (*Store) createDataSourceImpl(ctx context.Context, tx *Tx, create *api.Data
&dataSourceRaw.SslKey,
&dataSourceRaw.SslCert,
&dataSourceRaw.SslCa,
- &dataSourceRaw.HostOverride,
- &dataSourceRaw.PortOverride,
+ &dataSourceRaw.Host,
+ &dataSourceRaw.Port,
&dataSourceRaw.Options,
+ &dataSourceRaw.Database,
); err != nil {
if err == sql.ErrNoRows {
return nil, common.FormatDBErrorEmptyRowWithQuery(query)
@@ -381,9 +386,10 @@ func (*Store) findDataSourceImpl(ctx context.Context, tx *Tx, find *api.DataSour
ssl_key,
ssl_cert,
ssl_ca,
- host_override,
- port_override,
- options
+ host,
+ port,
+ options,
+ database
FROM data_source
WHERE `+strings.Join(where, " AND "),
args...,
@@ -412,9 +418,10 @@ func (*Store) findDataSourceImpl(ctx context.Context, tx *Tx, find *api.DataSour
&dataSourceRaw.SslKey,
&dataSourceRaw.SslCert,
&dataSourceRaw.SslCa,
- &dataSourceRaw.HostOverride,
- &dataSourceRaw.PortOverride,
+ &dataSourceRaw.Host,
+ &dataSourceRaw.Port,
&dataSourceRaw.Options,
+ &dataSourceRaw.Database,
); err != nil {
return nil, FormatError(err)
}
@@ -447,15 +454,18 @@ func (*Store) patchDataSourceImpl(ctx context.Context, tx *Tx, patch *api.DataSo
if v := patch.SslCert; v != nil {
set, args = append(set, fmt.Sprintf("ssl_cert= $%d", len(args)+1)), append(args, *v)
}
- if v := patch.HostOverride; v != nil {
- set, args = append(set, fmt.Sprintf("host_override= $%d", len(args)+1)), append(args, *v)
+ if v := patch.Host; v != nil {
+ set, args = append(set, fmt.Sprintf("host = $%d", len(args)+1)), append(args, *v)
}
- if v := patch.PortOverride; v != nil {
- set, args = append(set, fmt.Sprintf("port_override= $%d", len(args)+1)), append(args, *v)
+ if v := patch.Port; v != nil {
+ set, args = append(set, fmt.Sprintf("port = $%d", len(args)+1)), append(args, *v)
}
if v := patch.Options; v != nil {
set, args = append(set, fmt.Sprintf("options= $%d", len(args)+1)), append(args, *v)
}
+ if v := patch.Database; v != nil {
+ set, args = append(set, fmt.Sprintf("database = $%d", len(args)+1)), append(args, *v)
+ }
args = append(args, patch.ID)
var dataSourceRaw dataSourceRaw
@@ -464,7 +474,7 @@ func (*Store) patchDataSourceImpl(ctx context.Context, tx *Tx, patch *api.DataSo
UPDATE data_source
SET `+strings.Join(set, ", ")+`
WHERE id = $%d
- RETURNING id, creator_id, created_ts, updater_id, updated_ts, instance_id, database_id, name, type, username, password, ssl_key, ssl_cert, ssl_ca, host_override, port_override, options
+ RETURNING id, creator_id, created_ts, updater_id, updated_ts, instance_id, database_id, name, type, username, password, ssl_key, ssl_cert, ssl_ca, host, port, options, database
`, len(args)),
args...,
).Scan(
@@ -482,9 +492,10 @@ func (*Store) patchDataSourceImpl(ctx context.Context, tx *Tx, patch *api.DataSo
&dataSourceRaw.SslKey,
&dataSourceRaw.SslCert,
&dataSourceRaw.SslCa,
- &dataSourceRaw.HostOverride,
- &dataSourceRaw.PortOverride,
+ &dataSourceRaw.Host,
+ &dataSourceRaw.Port,
&dataSourceRaw.Options,
+ &dataSourceRaw.Database,
); err != nil {
if err == sql.ErrNoRows {
return nil, &common.Error{Code: common.NotFound, Err: errors.Errorf("DataSource not found with ID %d", patch.ID)}
@@ -536,8 +547,8 @@ func (s *Store) listDataSourceV2(ctx context.Context, tx *Tx, instanceID int) ([
ssl_key,
ssl_cert,
ssl_ca,
- host_override,
- port_override
+ host,
+ port
FROM data_source
WHERE instance_id = $1`,
instanceID,
@@ -559,7 +570,7 @@ func (s *Store) listDataSourceV2(ctx context.Context, tx *Tx, instanceID int) ([
&dataSourceMessage.SslCert,
&dataSourceMessage.SslCa,
&dataSourceMessage.Host,
- &dataSourceMessage.Password,
+ &dataSourceMessage.Port,
); err != nil {
return nil, FormatError(err)
}
diff --git a/store/instance.go b/store/instance.go
index 578794ccdd..35d9dfa4a2 100644
--- a/store/instance.go
+++ b/store/instance.go
@@ -404,19 +404,20 @@ func (s *Store) createInstanceRaw(ctx context.Context, create *InstanceCreate) (
for _, dataSource := range create.DataSourceList {
dataSourceCreate := &api.DataSourceCreate{
- CreatorID: create.CreatorID,
- InstanceID: instance.ID,
- DatabaseID: allDatabase.ID,
- Name: dataSource.Name,
- Type: dataSource.Type,
- Username: dataSource.Username,
- Password: dataSource.Password,
- SslKey: dataSource.SslKey,
- SslCert: dataSource.SslCert,
- SslCa: dataSource.SslCa,
- HostOverride: dataSource.HostOverride,
- PortOverride: dataSource.PortOverride,
- Options: dataSource.Options,
+ CreatorID: create.CreatorID,
+ InstanceID: instance.ID,
+ DatabaseID: allDatabase.ID,
+ Name: dataSource.Name,
+ Type: dataSource.Type,
+ Username: dataSource.Username,
+ Password: dataSource.Password,
+ SslKey: dataSource.SslKey,
+ SslCert: dataSource.SslCert,
+ SslCa: dataSource.SslCa,
+ Host: dataSource.Host,
+ Port: dataSource.Port,
+ Options: dataSource.Options,
+ Database: dataSource.Database,
}
if err := s.createDataSourceRawTx(ctx, tx, dataSourceCreate); err != nil {
return nil, err
@@ -528,18 +529,20 @@ func (s *Store) patchInstanceRaw(ctx context.Context, patch *InstancePatch) (*in
for _, dataSource := range patch.DataSourceList {
dataSourceCreate := &api.DataSourceCreate{
- CreatorID: patch.UpdaterID,
- InstanceID: instance.ID,
- DatabaseID: database.ID,
- Name: dataSource.Name,
- Type: dataSource.Type,
- Username: dataSource.Username,
- Password: dataSource.Password,
- SslKey: dataSource.SslKey,
- SslCert: dataSource.SslCert,
- SslCa: dataSource.SslCa,
- HostOverride: dataSource.HostOverride,
- PortOverride: dataSource.PortOverride,
+ CreatorID: patch.UpdaterID,
+ InstanceID: instance.ID,
+ DatabaseID: database.ID,
+ Name: dataSource.Name,
+ Type: dataSource.Type,
+ Username: dataSource.Username,
+ Password: dataSource.Password,
+ SslKey: dataSource.SslKey,
+ SslCert: dataSource.SslCert,
+ SslCa: dataSource.SslCa,
+ Host: dataSource.Host,
+ Port: dataSource.Port,
+ Options: dataSource.Options,
+ Database: dataSource.Database,
}
if err := s.createDataSourceRawTx(ctx, tx, dataSourceCreate); err != nil {
return nil, err
diff --git a/store/migration/dev/LATEST.sql b/store/migration/dev/LATEST.sql
index 90eb532d2e..1a10ef9cb8 100644
--- a/store/migration/dev/LATEST.sql
+++ b/store/migration/dev/LATEST.sql
@@ -555,10 +555,10 @@ CREATE TABLE data_source (
ssl_key TEXT NOT NULL DEFAULT '',
ssl_cert TEXT NOT NULL DEFAULT '',
ssl_ca TEXT NOT NULL DEFAULT '',
- -- host_override and port_override are used for read-replicas that have different connection addresses.
- host_override TEXT NOT NULL DEFAULT '',
- port_override TEXT NOT NULL DEFAULT '',
- options JSONB NOT NULL DEFAULT '{}'
+ host TEXT NOT NULL DEFAULT '',
+ port TEXT NOT NULL DEFAULT '',
+ options JSONB NOT NULL DEFAULT '{}',
+ database TEXT NOT NULL DEFAULT ''
);
CREATE INDEX idx_data_source_instance_id ON data_source(instance_id);
diff --git a/store/migration/prod/1.10/0005##data_source.sql b/store/migration/prod/1.10/0005##data_source.sql
new file mode 100644
index 0000000000..1a0c0b4037
--- /dev/null
+++ b/store/migration/prod/1.10/0005##data_source.sql
@@ -0,0 +1,10 @@
+ALTER TABLE data_source RENAME COLUMN host_override TO host;
+ALTER TABLE data_source RENAME COLUMN port_override TO port;
+ALTER TABLE data_source ADD COLUMN database TEXT NOT NULL DEFAULT '';
+
+UPDATE data_source
+SET
+ host=(SELECT host FROM instance WHERE id = instance_id),
+ port=(SELECT port FROM instance WHERE id = instance_id),
+ database=(SELECT database FROM instance WHERE id = instance_id)
+WHERE type = 'ADMIN';
diff --git a/store/migration/prod/LATEST.sql b/store/migration/prod/LATEST.sql
index c32c54ca71..2cf50db566 100644
--- a/store/migration/prod/LATEST.sql
+++ b/store/migration/prod/LATEST.sql
@@ -554,10 +554,10 @@ CREATE TABLE data_source (
ssl_key TEXT NOT NULL DEFAULT '',
ssl_cert TEXT NOT NULL DEFAULT '',
ssl_ca TEXT NOT NULL DEFAULT '',
- -- host_override and port_override are used for read-replicas that have different connection addresses.
- host_override TEXT NOT NULL DEFAULT '',
- port_override TEXT NOT NULL DEFAULT '',
- options JSONB NOT NULL DEFAULT '{}'
+ host TEXT NOT NULL DEFAULT '',
+ port TEXT NOT NULL DEFAULT '',
+ options JSONB NOT NULL DEFAULT '{}',
+ database TEXT NOT NULL DEFAULT ''
);
CREATE INDEX idx_data_source_instance_id ON data_source(instance_id);
diff --git a/store/pg_engine_test.go b/store/pg_engine_test.go
index 9660d3dc58..4e2e6698ee 100644
--- a/store/pg_engine_test.go
+++ b/store/pg_engine_test.go
@@ -220,5 +220,5 @@ func TestMigrationCompatibility(t *testing.T) {
func TestGetCutoffVersion(t *testing.T) {
releaseVersion, err := getProdCutoffVersion()
require.NoError(t, err)
- require.Equal(t, semver.MustParse("1.10.4"), releaseVersion)
+ require.Equal(t, semver.MustParse("1.10.5"), releaseVersion)
}
diff --git a/tests/data_source_test.go b/tests/data_source_test.go
index 84c0ffe1a6..20e6f0437e 100644
--- a/tests/data_source_test.go
+++ b/tests/data_source_test.go
@@ -91,18 +91,18 @@ func TestDataSource(t *testing.T) {
err = ctl.removeLicense()
a.NoError(err)
err = ctl.patchDataSource(adminDataSource.DatabaseID, api.DataSourcePatch{
- ID: readOnlyDataSource.ID,
- HostOverride: &dataSourceNewHostOverride,
- PortOverride: &dataSourceNewPortOverride,
+ ID: readOnlyDataSource.ID,
+ Host: &dataSourceNewHostOverride,
+ Port: &dataSourceNewPortOverride,
})
a.Equal(err.Error(), "http response error code 403 body \"{\\\"message\\\":\\\"Read replica connection is a ENTERPRISE feature, please upgrade to access it.\\\"}\\n\"")
err = ctl.setLicense()
a.NoError(err)
err = ctl.patchDataSource(adminDataSource.DatabaseID, api.DataSourcePatch{
- ID: readOnlyDataSource.ID,
- HostOverride: &dataSourceNewHostOverride,
- PortOverride: &dataSourceNewPortOverride,
+ ID: readOnlyDataSource.ID,
+ Host: &dataSourceNewHostOverride,
+ Port: &dataSourceNewPortOverride,
})
a.NoError(err)