details:   https://code.tryton.org/tryton/commit/8fa10a4e241d
branch:    default
user:      Cédric Krier <[email protected]>
date:      Thu Feb 19 09:54:48 2026 +0100
description:
        Do not add comment on table nor column

        Closes #14614
diffstat:

 trytond-gis/trytond_gis/postgis/table.py    |   9 +++++----
 trytond/trytond/backend/postgresql/table.py |  16 +---------------
 trytond/trytond/backend/sqlite/table.py     |   9 ++++-----
 trytond/trytond/backend/table.py            |   2 +-
 4 files changed, 11 insertions(+), 25 deletions(-)

diffs (115 lines):

diff -r 21569807a4b3 -r 8fa10a4e241d trytond-gis/trytond_gis/postgis/table.py
--- a/trytond-gis/trytond_gis/postgis/table.py  Fri Feb 27 12:55:11 2026 +0100
+++ b/trytond-gis/trytond_gis/postgis/table.py  Thu Feb 19 09:54:48 2026 +0100
@@ -12,15 +12,16 @@
 
 class TableHandler(PGTableHandler):
 
-    def add_column(self, column_name, abstract_type, default=None, comment=''):
+    def add_column(self, column_name, abstract_type, default=None):
         if abstract_type.startswith('GIS_'):
             column_adder = self.add_geometry_column
         else:
             column_adder = super().add_column
-        column_adder(column_name, abstract_type, default, comment)
+        column_adder(column_name, abstract_type, default)
 
-    def add_geometry_column(self, column_name, abstract_type, default_fun=None,
-            fill_default=True, comment=''):
+    def add_geometry_column(
+            self, column_name, abstract_type, default_fun=None,
+            fill_default=True):
         cursor = Transaction().connection.cursor()
 
         match = GIS_SQL_TYPE_RE.match(abstract_type)
diff -r 21569807a4b3 -r 8fa10a4e241d trytond/trytond/backend/postgresql/table.py
--- a/trytond/trytond/backend/postgresql/table.py       Fri Feb 27 12:55:11 
2026 +0100
+++ b/trytond/trytond/backend/postgresql/table.py       Thu Feb 19 09:54:48 
2026 +0100
@@ -56,11 +56,6 @@
         if view_exists:
             return
 
-        if model.__doc__ and self.is_owner:
-            cursor.execute(SQL('COMMENT ON TABLE {} IS %s').format(
-                        Identifier(self.table_name)),
-                (model.__doc__,))
-
         def migrate_to_identity(table, column):
             previous_seq_name = f"{table}_{column}_seq"
             cursor.execute(
@@ -324,7 +319,7 @@
                 .format(Identifier(self.table_name), Identifier(column_name)),
                 (value,))
 
-    def add_column(self, column_name, sql_type, default=None, comment=''):
+    def add_column(self, column_name, sql_type, default=None):
         cursor = ClientCursor(Transaction().connection)
         database = Transaction().database
 
@@ -332,13 +327,6 @@
         match = VARCHAR_SIZE_RE.match(sql_type)
         field_size = int(match.group(1)) if match else None
 
-        def add_comment():
-            if comment and self.is_owner:
-                cursor.execute(
-                    SQL('COMMENT ON COLUMN {}.{} IS %s').format(
-                        Identifier(self.table_name),
-                        Identifier(column_name)),
-                    (comment,))
         if self.column_exist(column_name):
             if (column_name in ('create_date', 'write_date')
                     and column_type[1].lower() != 'timestamp(6)'):
@@ -350,7 +338,6 @@
                         Identifier(self.table_name),
                         Identifier(column_name)))
 
-            add_comment()
             base_type = column_type[0].lower()
             typname = self._columns[column_name]['typname']
             if base_type != typname:
@@ -411,7 +398,6 @@
                 Identifier(self.table_name),
                 Identifier(column_name),
                 SQL(column_type)))
-        add_comment()
 
         if default:
             # check if table is non-empty:
diff -r 21569807a4b3 -r 8fa10a4e241d trytond/trytond/backend/sqlite/table.py
--- a/trytond/trytond/backend/sqlite/table.py   Fri Feb 27 12:55:11 2026 +0100
+++ b/trytond/trytond/backend/sqlite/table.py   Thu Feb 19 09:54:48 2026 +0100
@@ -190,17 +190,16 @@
     def db_default(self, column_name, value):
         pass
 
-    def add_column(self, column_name, sql_type, default=None, comment=''):
+    def add_column(self, column_name, sql_type, default=None):
         database = Transaction().database
         column_type = database.sql_type(sql_type)
         match = VARCHAR_SIZE_RE.match(sql_type)
         field_size = int(match.group(1)) if match else None
 
-        self._add_raw_column(column_name, column_type, default, field_size,
-            comment)
+        self._add_raw_column(column_name, column_type, default, field_size)
 
-    def _add_raw_column(self, column_name, column_type, default=None,
-            field_size=None, string=''):
+    def _add_raw_column(
+            self, column_name, column_type, default=None, field_size=None):
         if self.column_exist(column_name):
             base_type = column_type[0].upper()
             if base_type != self._columns[column_name]['typname']:
diff -r 21569807a4b3 -r 8fa10a4e241d trytond/trytond/backend/table.py
--- a/trytond/trytond/backend/table.py  Fri Feb 27 12:55:11 2026 +0100
+++ b/trytond/trytond/backend/table.py  Thu Feb 19 09:54:48 2026 +0100
@@ -71,7 +71,7 @@
     def db_default(self, column_name, value):
         raise NotImplementedError
 
-    def add_column(self, column_name, abstract_type, default=None, comment=''):
+    def add_column(self, column_name, abstract_type, default=None):
         raise NotImplementedError
 
     def add_fk(self, columns, reference, ref_columns=None, on_delete=None):

Reply via email to