Bug 362244

Summary: Generated SQL incomplete due to CHECK constraints not being terminated with ;
Product: [Applications] umbrello Reporter: Matthew Wild <matthew.wild>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: normal CC: ralf.habacker
Priority: NOR    
Version: 2.18.3 (KDE Applications 15.12.3)   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 2.19.1 (KDE Applications 16.04.1)

Description Matthew Wild 2016-04-25 14:27:50 UTC
When generating SQL form an ERD using the PostgreSQL or MySQL code generator, the resultant SQL file is wrong if a table contains a CHECK constraint. The ALTER TABLE command is correctly generated but the line is not ended with a ; and therefore will fail when pushed to the database.

Reproducible: Always

Steps to Reproduce:
1. Create ERD
2. Create Table
3. Create CHECK constraint on field within table
4. Generate PostgreSQL/MySQL code

Actual Results:  
-- 
ALTER TABLE SSA_Sensor_Site ADD CONSTRAINT range_check_constraint CHECK (Range>=0)


Expected Results:  
-- 
ALTER TABLE SSA_Sensor_Site ADD CONSTRAINT range_check_constraint CHECK (Range>=0);
Comment 1 Matthew Wild 2016-04-25 14:29:29 UTC
Sorry, meant to say this is against version 2.18.3 of Unmbrello which wasn't on the list of options in the bug form.
Comment 2 Ralf Habacker 2016-04-25 14:52:47 UTC
Git commit 067044d982e96500b55b574df032e10c8234a38b by Ralf Habacker.
Committed on 25/04/2016 at 14:43.
Pushed by habacker into branch 'Applications/16.04'.

Fix 'Generated SQL incomplete due to CHECK constraints not being terminated with ;'.
FIXED-IN:2.19.1 (KDE Applications 16.04.1)

M  +1    -1    umbrello/codegenerators/sql/sqlwriter.cpp

http://commits.kde.org/umbrello/067044d982e96500b55b574df032e10c8234a38b