[gom/wip/hadess/builder-debug: 2/3] gom: command-builder: Add debug to table and column creation




commit b0468c60f5cbf1b1e607343b98196ca524e7f9f4
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jun 23 10:49:15 2022 +0200

    gom: command-builder: Add debug to table and column creation

 gom/gom-command-builder.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/gom/gom-command-builder.c b/gom/gom-command-builder.c
index d4ee21f..5bc8a5e 100644
--- a/gom/gom-command-builder.c
+++ b/gom/gom-command-builder.c
@@ -459,6 +459,8 @@ gom_command_builder_build_create (GomCommandBuilder *builder,
 
    /* Create the table if it doesn't already exist */
    if (table_is_new_in_version(klass, version)) {
+      g_debug ("Creating table '%s' new in version %d (if it does not exist)", klass->table, version);
+
       str = g_string_new("CREATE TABLE IF NOT EXISTS ");
       add_table_name(str, klass);
       g_string_append(str, "(");
@@ -493,6 +495,9 @@ gom_command_builder_build_create (GomCommandBuilder *builder,
      if (pspecs[i] != primary_pspec &&
          is_mapped(pspecs[i]) &&
          is_new_in_version(pspecs[i], version)) {
+       g_debug ("Adding column '%s' to table '%s' new in version %d",
+                pspecs[i]->name, klass->table, version);
+
        str = g_string_new("ALTER TABLE ");
        add_table_name(str, klass);
        g_string_append(str, " ADD COLUMN ");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]