Bug 400802

Summary: Postgresql exports incomplete enum types
Product: [Applications] umbrello Reporter: Ralf Habacker <ralf.habacker>
Component: exporterAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 2.26.2 (KDE Applications 18.08.2)   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed In: 2.26.80 (KDE Applications 16.11.80)
Attachments: test case

Description Ralf Habacker 2018-11-07 15:06:49 UTC
Created attachment 116153 [details]
test case

Exporting an entity attribute with enum type results into an incomplete sql statement


STEPS TO REPRODUCE
1. start umbrello
2. open appended file
3. export to postgresql code (perform menu entry "code"->"code generation wizard")
4. inspect generated sql file

OBSERVED RESULT
The export does not create the required enum type e.g. in the following statement

  tipo_empleado ENUM_1 NOT NULL,

ENUM_1 is undefined

EXPECTED RESULT
The exporter should add the enum type e.g. 

CREATE TYPE ENUM_1 AS ENUM ('Supervisor', 'Empleado', 'Obrero', 'Menor');
CREATE TABLE empleado (
  tipo_empleado ENUM_1 NOT NULL,
);
Comment 1 Ralf Habacker 2018-11-08 14:20:01 UTC
Git commit df4a989714be79334fdc7425274fdc7027eca156 by Ralf Habacker.
Committed on 08/11/2018 at 13:15.
Pushed by habacker into branch 'master'.

Missing CREATE TYPE statement for exporting enums for postresql fixed
FIXED-IN:2.26.80 (KDE Applications 16.11.80)

M  +25   -2    umbrello/codegenerators/sql/sqlwriter.cpp
M  +1    -1    umbrello/codegenerators/sql/sqlwriter.h

https://commits.kde.org/umbrello/df4a989714be79334fdc7425274fdc7027eca156