From c7dc63706d8dfcf6f6f1b7ce175eafd173a6748e Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Mon, 18 Jul 2022 17:02:36 +0200 Subject: [PATCH] Support comments on table indexes via table designer. Closes #128 --- source/dbconnection.pas | 3 +++ source/table_editor.dfm | 7 ++++++- source/table_editor.pas | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/source/dbconnection.pas b/source/dbconnection.pas index 97a01de1..031a8c40 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -10589,6 +10589,9 @@ begin if Algorithm <> '' then Result := Result + ' USING ' + Algorithm; + + if not Comment.IsEmpty then + Result := Result + ' COMMENT ' + FConnection.EscapeString(Comment); end; procedure TTableKeyList.Assign(Source: TTableKeyList); diff --git a/source/table_editor.dfm b/source/table_editor.dfm index 44c916f2..29d8d23f 100644 --- a/source/table_editor.dfm +++ b/source/table_editor.dfm @@ -280,7 +280,7 @@ object frmTableEditor: TfrmTableEditor Options = [coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus] Position = 0 Text = 'Name' - Width = 434 + Width = 214 end item Options = [coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus] @@ -292,6 +292,11 @@ object frmTableEditor: TfrmTableEditor Position = 2 Text = 'Algorithm' Width = 80 + end + item + Position = 3 + Text = 'Comment' + Width = 120 end> end object tlbIndexes: TToolBar diff --git a/source/table_editor.pas b/source/table_editor.pas index a0b0e3ff..74560870 100644 --- a/source/table_editor.pas +++ b/source/table_editor.pas @@ -1797,6 +1797,7 @@ begin CellText := TblKey.Name; 1: CellText := TblKey.IndexType; 2: CellText := TblKey.Algorithm; + 3: CellText := TblKey.Comment; end; end; 1: begin @@ -2100,6 +2101,7 @@ begin TblKey.Name := TTableKey.PRIMARY; end; 2: TblKey.Algorithm := NewText; + 3: TblKey.Comment := NewText; end; // Needs to be called manually for Name and IndexType properties: TblKey.Modification(Sender);