Bug 350238

Summary: postgresql sequence export uses uncommon sequence name
Product: [Applications] umbrello Reporter: Ralf Habacker <ralf.habacker>
Component: generalAssignee: Ralf Habacker <ralf.habacker>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 2.16.3 (KDE Applications 15.04.3)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 2.16.80 (KDE Applications 15.07.80)

Description Ralf Habacker 2015-07-15 10:18:25 UTC
postgresql converts the 'serial' datatype internal into a sequence using the name scheme <tablename>_<fieldname>_seq, which is not followed by umbrello exporting an entity attribute with auto increment enabled.

Reproducible: Always

Steps to Reproduce:
1. start umbrello
2. create an entity 'limited_areas_towns'
2. Add an attribute 'lat_id' and set autoincrement
3. select postgresql as active language
4. export the entity


Actual Results:  
The following statements are created 
CREATE SEQUENCE limited_areas_towns_lat_id START 1 INCREMENT 1 ;
ALTER TABLE limited_areas_towns ALTER COLUMN lat_id SET NOT NULL;
ALTER TABLE limited_areas_towns ALTER COLUMN lat_id SET DEFAULT nextval('limited_areas_towns_lat_id');


Expected Results:  
The following statements should be created (note the appended '_seq')

CREATE SEQUENCE limited_areas_towns_lat_id_seq START 1 INCREMENT 1 ;
ALTER TABLE limited_areas_towns ALTER COLUMN lat_id SET NOT NULL;
ALTER TABLE limited_areas_towns ALTER COLUMN lat_id SET DEFAULT nextval('limited_areas_towns_lat_id_seq');
Comment 1 Ralf Habacker 2015-07-16 08:14:33 UTC
Git commit 2fd8576eb197cf848804ce1eba177af49c967f94 by Ralf Habacker.
Committed on 16/07/2015 at 08:14.
Pushed by habacker into branch 'master'.

Fix 'postgresql sequence export uses uncommon sequence name'.
FIXED-IN:2.16.80 (KDE Applications 15.07.80)

M  +2    -2    umbrello/codegenerators/sql/postgresqlwriter.cpp

http://commits.kde.org/umbrello/2fd8576eb197cf848804ce1eba177af49c967f94