Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
aqche committed Feb 19, 2020
1 parent 816bc1c commit e5f358a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions azurerm/internal/services/sql/resource_arm_sql_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ func resourceArmSqlDatabaseCreateUpdate(d *schema.ResourceData, meta interface{}
resourceGroup := d.Get("resource_group_name").(string)
location := azure.NormalizeLocation(d.Get("location").(string))
createMode := d.Get("create_mode").(string)
zoneRedundant := d.Get("zone_redundant").(bool)
t := d.Get("tags").(map[string]interface{})

if features.ShouldResourcesBeImported() && d.IsNewResource() {
Expand All @@ -379,7 +380,8 @@ func resourceArmSqlDatabaseCreateUpdate(d *schema.ResourceData, meta interface{}
properties := sql.Database{
Location: utils.String(location),
DatabaseProperties: &sql.DatabaseProperties{
CreateMode: sql.CreateMode(createMode),
CreateMode: sql.CreateMode(createMode),
ZoneRedundant: utils.Bool(zoneRedundant),
},
Tags: tags.Expand(t),
}
Expand Down Expand Up @@ -454,10 +456,6 @@ func resourceArmSqlDatabaseCreateUpdate(d *schema.ResourceData, meta interface{}
properties.DatabaseProperties.ReadScale = sql.ReadScaleDisabled
}

if v, ok := d.GetOkExists("zone_redundant"); ok {
properties.DatabaseProperties.ZoneRedundant = utils.Bool(v.(bool))
}

// The requested Service Objective Name does not match the requested Service Objective Id.
if d.HasChange("requested_service_objective_name") && !d.HasChange("requested_service_objective_id") {
properties.DatabaseProperties.RequestedServiceObjectiveID = nil
Expand Down Expand Up @@ -580,8 +578,6 @@ func resourceArmSqlDatabaseRead(d *schema.ResourceData, meta interface{}) error
d.Set("read_scale", false)
}

if zoneRedundant := props.ZoneRedundant; zoneRedundant != nil {
d.Set("zone_redundant", zoneRedundant)
d.Set("zone_redundant", props.ZoneRedundant)
}

Expand Down

0 comments on commit e5f358a

Please sign in to comment.