1.1 --- a/schema.c Mon Jan 11 13:37:28 2010 +1100
1.2 +++ b/schema.c Mon Jan 11 13:41:35 2010 +1100
1.3 @@ -28,6 +28,11 @@
1.4 return(0);
1.5 }
1.6
1.7 +int schema_column_callback(char *field_name,char *field_type)
1.8 +{
1.9 + ui_list_append(&fields,0,field_name,field_type);
1.10 +}
1.11 +
1.12 /* Name of column to be created */
1.13 char schema_column_name[BUFFERLENGTH];
1.14
1.15 @@ -36,6 +41,10 @@
1.16 {
1.17 sprintf(db_command,"alter table %s add %s %s;",db_table_name,schema_column_name,string);
1.18 db_execute(schema_callback,db_command);
1.19 + ui_free_list(fields);
1.20 + fields = NULL;
1.21 + db_list_columns(schema_column_callback,db_table_name);
1.22 + ui_list_display(fields);
1.23 }
1.24
1.25 /* User has entered a column name */
1.26 @@ -51,11 +60,6 @@
1.27 ui_edit_field("Enter new column name","",schema_enter_column);
1.28 }
1.29
1.30 -int schema_column_callback(char *field_name,char *field_type)
1.31 -{
1.32 - ui_list_append(&fields,0,field_name,field_type);
1.33 -}
1.34 -
1.35 /* Callback to delete a column */
1.36 int schema_delete_column()
1.37 {