Fix multi-line comments in YAML and JSON producers
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Producer / JSON.pm
index 0095316..890a958 100644 (file)
@@ -72,7 +72,7 @@ sub view_table {
         'name'        => $table->name,
         'order'       => $table->order,
         'options'     => $table->options  || [],
-        $table->comments ? ('comments'    => $table->comments ) : (),
+        $table->comments ? ('comments'    => [ $table->comments ] ) : (),
         'constraints' => [
             map { view_constraint($_) } $table->get_constraints
         ],
@@ -119,7 +119,7 @@ sub view_field {
         'is_primary_key'    => scalar $field->is_primary_key,
         'is_unique'         => scalar $field->is_unique,
         $field->is_auto_increment ? ('is_auto_increment' => 1) : (),
-        $field->comments ? ('comments' => $field->comments) : (),
+        $field->comments ? ('comments' => [ $field->comments ]) : (),
         keys %{$field->extra} ? ('extra' => { $field->extra } ) : (),
     };
 }