Revision 16d62a38
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
SL/DB/MetaSetup/ProjectStatus.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use base qw(SL::DB::Object); |
8 | 8 |
|
9 |
__PACKAGE__->meta->table('project_status'); |
|
9 |
__PACKAGE__->meta->table('project_statuses');
|
|
10 | 10 |
|
11 | 11 |
__PACKAGE__->meta->columns( |
12 | 12 |
description => { type => 'text', not_null => 1 }, |
sql/Pg-upgrade2/project_bob_attributes.sql | ||
---|---|---|
5 | 5 |
-- changes over bob: |
6 | 6 |
-- no scon/support_contract values here |
7 | 7 |
-- no include or expclude flags for workload |
8 |
-- statuses renamed to status (we dont use rails weird plurals) |
|
9 | 8 |
-- created_at/updated_at renamed to itime/mtime, |
10 | 9 |
-- varchars retyped to text |
11 | 10 |
-- hours (numeric) changed to minutes (integer) since the code already calculates in minutes |
sql/Pg-upgrade2/project_bob_attributes_fix_project_status_table_name.sql | ||
---|---|---|
1 |
-- @tag: project_bob_attributes_fix_project_status_table_name |
|
2 |
-- @description: Tabellennamen project_status in project_statuses korrigieren |
|
3 |
-- @depends: project_bob_attributes |
|
4 |
ALTER TABLE project_status RENAME TO project_statuses; |
sql/Pg-upgrade2/project_status_default_entries.sql | ||
---|---|---|
1 | 1 |
-- @tag: project_status_default_entries |
2 | 2 |
-- @description: Standardeinträge für Projektstatus |
3 |
-- @depends: project_bob_attributes |
|
3 |
-- @depends: project_bob_attributes_fix_project_status_table_name
|
|
4 | 4 |
|
5 |
INSERT INTO project_status (name, description, position) VALUES ('presales', 'Akquise', 1); |
|
6 |
INSERT INTO project_status (name, description, position) VALUES ('planning', 'In Planung', 2); |
|
7 |
INSERT INTO project_status (name, description, position) VALUES ('running', 'In Bearbeitung', 3); |
|
8 |
INSERT INTO project_status (name, description, position) VALUES ('done', 'Fertiggestellt', 4); |
|
5 |
INSERT INTO project_statuses (name, description, position) VALUES ('presales', 'Akquise', 1);
|
|
6 |
INSERT INTO project_statuses (name, description, position) VALUES ('planning', 'In Planung', 2);
|
|
7 |
INSERT INTO project_statuses (name, description, position) VALUES ('running', 'In Bearbeitung', 3);
|
|
8 |
INSERT INTO project_statuses (name, description, position) VALUES ('done', 'Fertiggestellt', 4);
|
|
9 | 9 |
|
10 | 10 |
UPDATE project |
11 | 11 |
SET project_status_id = ( |
12 | 12 |
SELECT id |
13 |
FROM project_status |
|
13 |
FROM project_statuses
|
|
14 | 14 |
WHERE name = 'running' |
15 | 15 |
) |
16 | 16 |
WHERE project_status_id IS NULL; |
Auch abrufbar als: Unified diff
Tabelle »project_status« in »project_statuses« umbenennen
Im Englischen ist der Plural von »status« nun einmal
»statuses«. Außerdem heißen die Tabellen in Legacy-Bob-Code ebenfalls
»project_statuses«.