Bug 350238 - postgresql sequence export uses uncommon sequence name
Summary: postgresql sequence export uses uncommon sequence name
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 2.16.3 (KDE Applications 15.04.3)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Ralf Habacker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-15 10:18 UTC by Ralf Habacker
Modified: 2015-07-20 07:05 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.16.80 (KDE Applications 15.07.80)
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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