Description attribut not used in MySql

Issue #230 resolved
Максим Сысоев created an issue

When Marshmallow generate MySQL database - not used description attribute.

 [Column('Number', [], 50, 'Номер')]

Номер - is description for field

Comments (10)

  1. Stefan Glienke repo owner

    Please provide the create table SQL statement that is being generated and executed.

  2. Максим Сысоев reporter

    Its simple model in project

    unit Model.Specialist;
    
    interface
    
    uses
      Spring.Persistence.Mapping.Attributes;
    
    Type
      [Entity]
      [Table('Specialists')]
      [SequenceAttribute('seq', 1, 1)]
      TpsSpecialist = Class
      private
        [UniqueConstraint]
        [AutoGenerated]
        [Column('SID', [cpRequired, cpNotNull, cpPrimaryKey], 0, 0, 0, 'Primary Key')]
        FId: Integer;
        FFio: String;
        FPost: String;
      public
        property ID: Integer read FId;
        [Column('Fio', [], 50, 'ФИО')]
        property Fio: String read FFio write FFio;
        [Column('Post', [], 200, 'Должность')]
        property Post: String read FPost write FPost;
      End;
    
    implementation
    
    end.
    

    Code create for SQL (from Heidy SQL)

    CREATE TABLE `specialists` (
        `SID` INT(11) NOT NULL AUTO_INCREMENT,
        `Fio` VARCHAR(50) NULL DEFAULT NULL COLLATE 'ucs2_general_ci',
        `Post` VARCHAR(200) NULL DEFAULT NULL COLLATE 'ucs2_general_ci',
        PRIMARY KEY (`SID`)
    )
    COLLATE='utf8_general_ci'
    ENGINE=MyISAM
    AUTO_INCREMENT=4
    ;
    

    created sql not contained COMMENT field.

    SQL with COMMENT field

    CREATE TABLE `specialists` (
        `SID` INT(11) NOT NULL AUTO_INCREMENT,
        `Fio` VARCHAR(50) NULL DEFAULT NULL COMMENT 'ФИО' COLLATE 'ucs2_general_ci',
        `Post` VARCHAR(200) NULL DEFAULT NULL COMMENT 'Должность' COLLATE 'ucs2_general_ci',
        PRIMARY KEY (`SID`)
    )
    COLLATE='utf8_general_ci'
    ENGINE=MyISAM
    AUTO_INCREMENT=4
    ;
    

    and statement from log ORM:

    CREATE TABLE Specialists (
    `SID` INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, 
    `Fio` VARCHAR(50) CHARACTER SET ucs2 NULL  , 
    `Post` VARCHAR(200) CHARACTER SET ucs2 NULL  
    )
    
  3. Stefan Glienke repo owner
    • changed status to open

    Looks like the DoGenerateCreateTable methods in the SQL generators are not considering the column description being passed in the column lists (TSQLCreateField.Description).

  4. Log in to comment