From: Moritz Bunkus Date: Mon, 20 Jan 2014 12:54:55 +0000 (+0100) Subject: Projekte: Status zum Pflichtfeld gemacht X-Git-Tag: release-3.2.0beta~467^2~30 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=1ae7f9a1d11944a7e9c64ea791540b95db729e9a;p=kivitendo-erp.git Projekte: Status zum Pflichtfeld gemacht --- diff --git a/SL/DB/MetaSetup/Project.pm b/SL/DB/MetaSetup/Project.pm index 5b9926589..9351a24b7 100644 --- a/SL/DB/MetaSetup/Project.pm +++ b/SL/DB/MetaSetup/Project.pm @@ -20,7 +20,7 @@ __PACKAGE__->meta->columns( itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, order_value => { type => 'numeric', default => '0', not_null => 1, precision => 5, scale => 15 }, - project_status_id => { type => 'integer' }, + project_status_id => { type => 'integer', not_null => 1 }, project_type_id => { type => 'integer', not_null => 1 }, projectnumber => { type => 'text' }, start_date => { type => 'date' }, diff --git a/sql/Pg-upgrade2/project_status_default_entries.sql b/sql/Pg-upgrade2/project_status_default_entries.sql index 0a5e151ee..d4bd437f4 100644 --- a/sql/Pg-upgrade2/project_status_default_entries.sql +++ b/sql/Pg-upgrade2/project_status_default_entries.sql @@ -6,3 +6,13 @@ INSERT INTO project_status (name, description, position) VALUES ('presales', 'Ak INSERT INTO project_status (name, description, position) VALUES ('planning', 'In Planung', 2); INSERT INTO project_status (name, description, position) VALUES ('running', 'In Bearbeitung', 3); INSERT INTO project_status (name, description, position) VALUES ('done', 'Fertiggestellt', 4); + +UPDATE project +SET project_status_id = ( + SELECT id + FROM project_status + WHERE name = 'running' +) +WHERE project_status_id IS NULL; + +ALTER TABLE project ALTER COLUMN project_status_id SET NOT NULL;