From 756b97da8a339618e4e2278662bf571c9ba7e9f4 Mon Sep 17 00:00:00 2001 From: Ty Date: Sun, 18 Feb 2024 20:42:20 -0700 Subject: [PATCH] Cascade key deletions --- .../migrations/src/m_20242801_000002_create_profiles_table.rs | 2 +- src/commands/keys/delete.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/migrations/src/m_20242801_000002_create_profiles_table.rs b/crates/migrations/src/m_20242801_000002_create_profiles_table.rs index 19ec781..ac6cc8d 100644 --- a/crates/migrations/src/m_20242801_000002_create_profiles_table.rs +++ b/crates/migrations/src/m_20242801_000002_create_profiles_table.rs @@ -61,7 +61,7 @@ impl MigrationTrait for Migration { super::m_20230701_000001_create_keys_table::Keys::Fingerprint ) .on_update(ForeignKeyAction::Cascade) - .on_delete(ForeignKeyAction::Restrict) + .on_delete(ForeignKeyAction::Cascade) ) .col( ColumnDef::new(Profiles::Name) diff --git a/src/commands/keys/delete.rs b/src/commands/keys/delete.rs index 4c8fcff..47b595c 100644 --- a/src/commands/keys/delete.rs +++ b/src/commands/keys/delete.rs @@ -80,7 +80,7 @@ impl AspmSubcommand for KeysDeleteCommand { }; let confirmation = Confirm::with_theme(&ColorfulTheme::default()) - .with_prompt("Are you sure you want to delete this key?") + .with_prompt("Are you sure you want to delete this key? This will also remove any profiles that use this key!") .interact_on(&Term::stderr()) .context("Unable to prompt on stderr")?;