From 16d62a38a2a09f189ec48d34be78311970542c8c Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 21 Jan 2014 14:48:56 +0100 Subject: [PATCH] =?utf8?q?Tabelle=20=C2=BBproject=5Fstatus=C2=AB=20in=20?= =?utf8?q?=C2=BBproject=5Fstatuses=C2=AB=20umbenennen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Im Englischen ist der Plural von »status« nun einmal »statuses«. Außerdem heißen die Tabellen in Legacy-Bob-Code ebenfalls »project_statuses«. --- SL/DB/MetaSetup/ProjectStatus.pm | 2 +- sql/Pg-upgrade2/project_bob_attributes.sql | 1 - ..._bob_attributes_fix_project_status_table_name.sql | 4 ++++ sql/Pg-upgrade2/project_status_default_entries.sql | 12 ++++++------ 4 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 sql/Pg-upgrade2/project_bob_attributes_fix_project_status_table_name.sql diff --git a/SL/DB/MetaSetup/ProjectStatus.pm b/SL/DB/MetaSetup/ProjectStatus.pm index b79110a61..4162812f3 100644 --- a/SL/DB/MetaSetup/ProjectStatus.pm +++ b/SL/DB/MetaSetup/ProjectStatus.pm @@ -6,7 +6,7 @@ use strict; use base qw(SL::DB::Object); -__PACKAGE__->meta->table('project_status'); +__PACKAGE__->meta->table('project_statuses'); __PACKAGE__->meta->columns( description => { type => 'text', not_null => 1 }, diff --git a/sql/Pg-upgrade2/project_bob_attributes.sql b/sql/Pg-upgrade2/project_bob_attributes.sql index d651f1038..88ea42fd8 100644 --- a/sql/Pg-upgrade2/project_bob_attributes.sql +++ b/sql/Pg-upgrade2/project_bob_attributes.sql @@ -5,7 +5,6 @@ -- changes over bob: -- no scon/support_contract values here -- no include or expclude flags for workload --- statuses renamed to status (we dont use rails weird plurals) -- created_at/updated_at renamed to itime/mtime, -- varchars retyped to text -- hours (numeric) changed to minutes (integer) since the code already calculates in minutes diff --git a/sql/Pg-upgrade2/project_bob_attributes_fix_project_status_table_name.sql b/sql/Pg-upgrade2/project_bob_attributes_fix_project_status_table_name.sql new file mode 100644 index 000000000..8b2a1ae7e --- /dev/null +++ b/sql/Pg-upgrade2/project_bob_attributes_fix_project_status_table_name.sql @@ -0,0 +1,4 @@ +-- @tag: project_bob_attributes_fix_project_status_table_name +-- @description: Tabellennamen project_status in project_statuses korrigieren +-- @depends: project_bob_attributes +ALTER TABLE project_status RENAME TO project_statuses; diff --git a/sql/Pg-upgrade2/project_status_default_entries.sql b/sql/Pg-upgrade2/project_status_default_entries.sql index d4bd437f4..5120b6ad9 100644 --- a/sql/Pg-upgrade2/project_status_default_entries.sql +++ b/sql/Pg-upgrade2/project_status_default_entries.sql @@ -1,16 +1,16 @@ -- @tag: project_status_default_entries -- @description: Standardeinträge für Projektstatus --- @depends: project_bob_attributes +-- @depends: project_bob_attributes_fix_project_status_table_name -INSERT INTO project_status (name, description, position) VALUES ('presales', 'Akquise', 1); -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); +INSERT INTO project_statuses (name, description, position) VALUES ('presales', 'Akquise', 1); +INSERT INTO project_statuses (name, description, position) VALUES ('planning', 'In Planung', 2); +INSERT INTO project_statuses (name, description, position) VALUES ('running', 'In Bearbeitung', 3); +INSERT INTO project_statuses (name, description, position) VALUES ('done', 'Fertiggestellt', 4); UPDATE project SET project_status_id = ( SELECT id - FROM project_status + FROM project_statuses WHERE name = 'running' ) WHERE project_status_id IS NULL; -- 2.20.1