Exception: PgSqlTriggers::UnsafeMigrationError

Inherits:
Error
  • Object
show all
Defined in:
lib/pg_sql_triggers/errors.rb

Overview

Error raised when unsafe migrations are attempted

Examples:

raise PgSqlTriggers::UnsafeMigrationError.new(
  "Migration contains unsafe DROP + CREATE operations",
  error_code: "UNSAFE_MIGRATION",
  recovery_suggestion: "Review migration safety or set allow_unsafe_migrations=true",
  context: { violations: [...] }
)

Instance Attribute Summary

Attributes inherited from Error

#context, #error_code, #recovery_suggestion

Instance Method Summary collapse

Methods inherited from Error

#initialize, #to_h, #user_message

Constructor Details

This class inherits a constructor from PgSqlTriggers::Error

Instance Method Details

#default_error_codeObject



202
203
204
# File 'lib/pg_sql_triggers/errors.rb', line 202

def default_error_code
  "UNSAFE_MIGRATION"
end

#default_messageObject



206
207
208
# File 'lib/pg_sql_triggers/errors.rb', line 206

def default_message
  "Migration contains unsafe operations"
end

#default_recovery_suggestionObject



210
211
212
213
214
215
# File 'lib/pg_sql_triggers/errors.rb', line 210

def default_recovery_suggestion
  "Review the migration for unsafe operations. " \
    "If you are certain the migration is safe, you can set " \
    "PgSqlTriggers.configure { |c| c.allow_unsafe_migrations = true } " \
    "or use the kill switch override mechanism."
end