mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
Fix Alembic upgrades.
A non-existent constraint was being referenced in the upgrade script. This patch corrects the problem by removing the reference. This patch fixes another realtime problem as well. Our Alembic scripts store booleans as yes or no values. However, Sorcery tries to insert "true" or "false" instead. This patch updates Sorcery to use "yes" and "no" ASTERISK-26128 #close Change-Id: I366dbbf91418a9cb160b3ca74b0e59b5ac284bec
This commit is contained in:
@@ -290,6 +290,12 @@ static int bool_handler_fn(const void *obj, const intptr_t *args, char **buf)
|
||||
return !(*buf = ast_strdup(*field ? "true" : "false")) ? -1 : 0;
|
||||
}
|
||||
|
||||
static int yesno_handler_fn(const void *obj, const intptr_t *args, char **buf)
|
||||
{
|
||||
unsigned int *field = (unsigned int *)(obj + args[0]);
|
||||
return !(*buf = ast_strdup(*field ? "yes" : "no")) ? -1 : 0;
|
||||
}
|
||||
|
||||
static int sockaddr_handler_fn(const void *obj, const intptr_t *args, char **buf)
|
||||
{
|
||||
struct ast_sockaddr *field = (struct ast_sockaddr *)(obj + args[0]);
|
||||
@@ -313,6 +319,7 @@ static sorcery_field_handler sorcery_field_default_handler(enum aco_option_type
|
||||
{
|
||||
switch(type) {
|
||||
case OPT_BOOL_T: return bool_handler_fn;
|
||||
case OPT_YESNO_T: return yesno_handler_fn;
|
||||
case OPT_CHAR_ARRAY_T: return chararray_handler_fn;
|
||||
case OPT_CODEC_T: return codec_handler_fn;
|
||||
case OPT_DOUBLE_T: return double_handler_fn;
|
||||
|
Reference in New Issue
Block a user