Skip to content

Commit

Permalink
Update toml dependency and refactor Extension struct (#902)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuajerin authored Aug 12, 2024
1 parent cf5de86 commit 387d724
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
12 changes: 6 additions & 6 deletions tembo-cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tembo-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ serde_yaml = "0.9.17"
home = "0.5.5"
semver = "1.0.18"
mockall = "0.11.4"
toml = "0.7.6"
toml = "0.8.19"
chrono = { version = "0.4.29", features = ["serde"] }
simplelog = { version = "^0.12.1", features = ["paris"] }
clerk-rs = "0.1.7"
Expand Down
7 changes: 1 addition & 6 deletions tembo-cli/src/cli/tembo_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,10 @@ fn default_extensions() -> Option<HashMap<String, Extension>> {
Some(HashMap::new())
}

fn default_as_true() -> bool {
true
}

#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct Extension {
pub version: Option<String>,
#[serde(default = "default_as_true")]
pub enabled: bool,
pub enabled: Option<bool>,
pub trunk_project: Option<String>,
pub trunk_project_version: Option<String>,
}
Expand Down
4 changes: 2 additions & 2 deletions tembo-cli/src/cmd/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ fn get_extensions(
database: Some("postgres".to_string()),
schema: None,
version: version,
enabled: extension.enabled,
enabled: extension.enabled.unwrap_or(false),
}];

vec_extensions.push(Extension {
Expand All @@ -971,7 +971,7 @@ fn get_extensions_controller(
database: String::new(),
schema: None,
version: None,
enabled: extension.enabled,
enabled: extension.enabled.unwrap_or(false),
});

vec_extensions.push(ControllerExtension {
Expand Down

0 comments on commit 387d724

Please sign in to comment.