Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 03f5aaa3

Von Sven Schöling vor mehr als 10 Jahren hinzugefügt

  • ID 03f5aaa3c601956206f0c2a142c1e19f6981b326
  • Vorgänger 1600ef67
  • Nachfolger f3aa6818

Projekte: Attribute aus Bob

Unterschiede anzeigen:

SL/DB/Helper/Mappings.pm
150 150
  pricegroup                     => 'pricegroup',
151 151
  printers                       => 'printer',
152 152
  project                        => 'project',
153
  project_types                  => 'ProjectType',
153
  project_participants           => 'project_participant',
154
  project_phase_participants     => 'project_phase_participant',
155
  project_phases                 => 'project_phase',
156
  project_roles                  => 'project_role',
157
  project_status                 => 'project_status',
158
  project_types                  => 'project_type',
154 159
  record_links                   => 'record_link',
155 160
  requirement_spec_acceptance_statuses => 'RequirementSpecAcceptanceStatus',
156 161
  requirement_spec_complexities        => 'RequirementSpecComplexity',
SL/DB/MetaSetup/Project.pm
9 9
__PACKAGE__->meta->table('project');
10 10

  
11 11
__PACKAGE__->meta->columns(
12
  active          => { type => 'boolean', default => 'true' },
13
  customer_id     => { type => 'integer' },
14
  description     => { type => 'text' },
15
  id              => { type => 'integer', not_null => 1, sequence => 'id' },
16
  itime           => { type => 'timestamp', default => 'now()' },
17
  mtime           => { type => 'timestamp' },
18
  project_type_id => { type => 'integer', not_null => 1 },
19
  projectnumber   => { type => 'text' },
20
  valid           => { type => 'boolean', default => 'true' },
12
  active               => { type => 'boolean', default => 'true' },
13
  billable_customer_id => { type => 'integer' },
14
  budget_cost          => { type => 'numeric', default => '0', not_null => 1, precision => 5, scale => 15 },
15
  budget_minutes       => { type => 'integer', default => '0', not_null => 1 },
16
  customer_id          => { type => 'integer' },
17
  description          => { type => 'text' },
18
  end_date             => { type => 'date' },
19
  id                   => { type => 'integer', not_null => 1, sequence => 'id' },
20
  itime                => { type => 'timestamp', default => 'now()' },
21
  mtime                => { type => 'timestamp' },
22
  order_value          => { type => 'numeric', default => '0', not_null => 1, precision => 5, scale => 15 },
23
  project_status_id    => { type => 'integer' },
24
  project_type_id      => { type => 'integer', not_null => 1 },
25
  projectnumber        => { type => 'text' },
26
  start_date           => { type => 'date' },
27
  timeframe            => { type => 'boolean', default => 'false', not_null => 1 },
28
  type                 => { type => 'text' },
29
  valid                => { type => 'boolean', default => 'true' },
21 30
);
22 31

  
23 32
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
......
36 45
    class       => 'SL::DB::ProjectType',
37 46
    key_columns => { project_type_id => 'id' },
38 47
  },
48

  
49
  billable_customer => {
50
    class       => 'SL::DB::Customer',
51
    key_columns => { billable_customer_id => 'id' },
52
  },
53

  
54
  customer => {
55
    class       => 'SL::DB::Customer',
56
    key_columns => { customer_id => 'id' },
57
  },
58

  
59
  project_type => {
60
    class       => 'SL::DB::ProjectType',
61
    key_columns => { project_type_id => 'id' },
62
  },
39 63
);
40 64

  
41 65
1;
SL/DB/MetaSetup/ProjectParticipant.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::ProjectParticipant;
4

  
5
use strict;
6

  
7
use base qw(SL::DB::Object);
8

  
9
__PACKAGE__->meta->setup(
10
  table   => 'project_participants',
11

  
12
  columns => [
13
    id              => { type => 'serial', not_null => 1 },
14
    project_id      => { type => 'integer', not_null => 1 },
15
    employee_id     => { type => 'integer', not_null => 1 },
16
    project_role_id => { type => 'integer', not_null => 1 },
17
    minutes         => { type => 'integer', default => '0', not_null => 1 },
18
    cost_per_hour   => { type => 'numeric', precision => 5, scale => 15 },
19
    itime           => { type => 'timestamp', default => '06.05.2013 14:26:18.81159' },
20
    mtime           => { type => 'timestamp' },
21
  ],
22

  
23
  primary_key_columns => [ 'id' ],
24

  
25
  foreign_keys => [
26
    employee => {
27
      class       => 'SL::DB::Employee',
28
      key_columns => { employee_id => 'id' },
29
    },
30

  
31
    project => {
32
      class       => 'SL::DB::Project',
33
      key_columns => { project_id => 'id' },
34
    },
35

  
36
    project_role => {
37
      class       => 'SL::DB::ProjectRole',
38
      key_columns => { project_role_id => 'id' },
39
    },
40
  ],
41
);
42

  
43
1;
44
;
SL/DB/MetaSetup/ProjectPhaseParticipant.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::ProjectPhaseParticipant;
4

  
5
use strict;
6

  
7
use base qw(SL::DB::Object);
8

  
9
__PACKAGE__->meta->setup(
10
  table   => 'project_phase_participants',
11

  
12
  columns => [
13
    id               => { type => 'serial', not_null => 1 },
14
    project_phase_id => { type => 'integer', not_null => 1 },
15
    employee_id      => { type => 'integer', not_null => 1 },
16
    project_role_id  => { type => 'integer', not_null => 1 },
17
    minutes          => { type => 'integer', default => '0', not_null => 1 },
18
    cost_per_hour    => { type => 'numeric', precision => 5, scale => 15 },
19
    itime            => { type => 'timestamp', default => '06.05.2013 14:26:18.81159' },
20
    mtime            => { type => 'timestamp' },
21
  ],
22

  
23
  primary_key_columns => [ 'id' ],
24

  
25
  foreign_keys => [
26
    employee => {
27
      class       => 'SL::DB::Employee',
28
      key_columns => { employee_id => 'id' },
29
    },
30

  
31
    project_role => {
32
      class       => 'SL::DB::ProjectRole',
33
      key_columns => { project_role_id => 'id' },
34
    },
35
  ],
36
);
37

  
38
1;
39
;
SL/DB/MetaSetup/ProjectRole.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::ProjectRole;
4

  
5
use strict;
6

  
7
use base qw(SL::DB::Object);
8

  
9
__PACKAGE__->meta->setup(
10
  table   => 'project_roles',
11

  
12
  columns => [
13
    id          => { type => 'serial', not_null => 1 },
14
    name        => { type => 'text', not_null => 1 },
15
    description => { type => 'text', not_null => 1 },
16
    position    => { type => 'integer', not_null => 1 },
17
    itime       => { type => 'timestamp', default => '06.05.2013 14:26:18.81159' },
18
    mtime       => { type => 'timestamp' },
19
  ],
20

  
21
  primary_key_columns => [ 'id' ],
22
);
23

  
24
1;
25
;
SL/DB/MetaSetup/ProjectStatus.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::ProjectStatus;
4

  
5
use strict;
6

  
7
use base qw(SL::DB::Object);
8

  
9
__PACKAGE__->meta->setup(
10
  table   => 'project_status',
11

  
12
  columns => [
13
    id          => { type => 'serial', not_null => 1 },
14
    name        => { type => 'text', not_null => 1 },
15
    description => { type => 'text', not_null => 1 },
16
    position    => { type => 'integer', not_null => 1 },
17
    itime       => { type => 'timestamp', default => '06.05.2013 14:26:18.81159' },
18
    mtime       => { type => 'timestamp' },
19
  ],
20

  
21
  primary_key_columns => [ 'id' ],
22

  
23
  relationships => [
24
    project => {
25
      class      => 'SL::DB::Project',
26
      column_map => { id => 'project_status_id' },
27
      type       => 'one to many',
28
    },
29
  ],
30
);
31

  
32
1;
33
;
SL/DB/MetaSetup/ProjectType.pm
11 11
__PACKAGE__->meta->columns(
12 12
  description => { type => 'text' },
13 13
  id          => { type => 'serial', not_null => 1 },
14
  internal    => { type => 'boolean', default => 'false', not_null => 1 },
14 15
  position    => { type => 'integer', not_null => 1 },
15 16
);
16 17

  
SL/DB/ProjectParticipant.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::ProjectParticipant;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::ProjectParticipant;
9

  
10
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
11
__PACKAGE__->meta->make_manager_class;
12

  
13
1;
SL/DB/ProjectPhaseParticipant.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::ProjectPhaseParticipant;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::ProjectPhaseParticipant;
9

  
10
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
11
__PACKAGE__->meta->make_manager_class;
12

  
13
1;
SL/DB/ProjectRole.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::ProjectRole;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::ProjectRole;
9

  
10
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
11
__PACKAGE__->meta->make_manager_class;
12

  
13
1;
SL/DB/ProjectStatus.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::ProjectStatus;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::ProjectStatus;
9

  
10
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
11
__PACKAGE__->meta->make_manager_class;
12

  
13
1;
sql/Pg-upgrade2/project_bob_attributes.sql
1
-- @tag: project_bob_attributes
2
-- @description: Projekte: Zusätzliche Tabellen und Spalten
3
-- @depends:  project_customer_type_valid
4
-- @charset: utf-8
5

  
6
-- changes over bob:
7
-- no scon/support_contract values here
8
-- no include or expclude flags for workload
9
-- statuses renamed to status (we dont use rails weird plurals)
10
-- created_at/updated_at renamed to itime/mtime,
11
-- varchars retyped to text
12
-- hours (numeric) changed to minutes (integer) since the code already calculates in minutes
13
--  note: flags changing the behaviour of hours are still called so and not minutes
14
-- no refcounts. we use adhoc counts to decide wether delete is possible or not
15
-- no hour_approval
16
-- nothing relevant to notifications
17

  
18

  
19

  
20

  
21
CREATE TABLE project_status (
22
  id          SERIAL    NOT NULL PRIMARY KEY,
23
  name        TEXT      NOT NULL,
24
  description TEXT      NOT NULL,
25
  position    INTEGER   NOT NULL,
26
  itime       TIMESTAMP DEFAULT 'now()',
27
  mtime       TIMESTAMP
28
);
29

  
30
ALTER TABLE project ADD COLUMN start_date           DATE;
31
ALTER TABLE project ADD COLUMN end_date             DATE;
32
ALTER TABLE project ADD COLUMN billable_customer_id INTEGER REFERENCES customer(id);
33
ALTER TABLE project ADD COLUMN budget_cost          NUMERIC(15,5) NOT NULL DEFAULT 0;
34
ALTER TABLE project ADD COLUMN order_value          NUMERIC(15,5) NOT NULL DEFAULT 0;
35
ALTER TABLE project ADD COLUMN budget_minutes       INTEGER       NOT NULL DEFAULT 0;
36
ALTER TABLE project ADD COLUMN timeframe            BOOLEAN       NOT NULL DEFAULT FALSE;
37
ALTER TABLE project ADD COLUMN project_status_id    INTEGER                REFERENCES project_status(id);
38

  
39
ALTER TABLE project_types ADD COLUMN internal BOOLEAN NOT NULL DEFAULT FALSE;
40

  
41
CREATE TABLE project_phases (
42
  id              SERIAL NOT NULL PRIMARY KEY,
43
  project_id      INTEGER REFERENCES project(id),
44
  start_date      DATE,
45
  end_date        DATE,
46
  name            TEXT                 NOT NULL,
47
  description     TEXT                 NOT NULL,
48
  budget_minutes  INTEGER              NOT NULL DEFAULT 0,
49
  budget_cost     NUMERIC (15,5)       NOT NULL DEFAULT 0,
50
  general_minutes INTEGER              NOT NULL DEFAULT 0,
51
  general_cost_per_hour NUMERIC (15,5) NOT NULL DEFAULT 0,
52
  itime           TIMESTAMP DEFAULT 'now()',
53
  mtime           TIMESTAMP
54
);
55

  
56
CREATE TABLE project_roles (
57
  id           SERIAL  NOT NULL PRIMARY KEY,
58
  name         TEXT    NOT NULL,
59
  description  TEXT    NOT NULL,
60
  position     INTEGER NOT NULL,
61
  itime        TIMESTAMP DEFAULT 'now()',
62
  mtime        TIMESTAMP
63
);
64

  
65
CREATE TABLE project_participants (
66
  id              SERIAL  NOT NULL PRIMARY KEY,
67
  project_id      INTEGER NOT NULL REFERENCES project(id),
68
  employee_id     INTEGER NOT NULL REFERENCES employee(id),
69
  project_role_id INTEGER NOT NULL REFERENCES project_roles(id),
70
  minutes         INTEGER NOT NULL DEFAULT 0,
71
  cost_per_hour   NUMERIC (15,5),
72
  itime           TIMESTAMP DEFAULT 'now()',
73
  mtime           TIMESTAMP
74
);
75

  
76
CREATE TABLE project_phase_participants (
77
  id               SERIAL  NOT NULL PRIMARY KEY,
78
  project_phase_id INTEGER NOT NULL REFERENCES project_phases(id),
79
  employee_id      INTEGER NOT NULL REFERENCES employee(id),
80
  project_role_id  INTEGER NOT NULL REFERENCES project_roles(id),
81
  minutes          INTEGER NOT NULL DEFAULT 0,
82
  cost_per_hour    NUMERIC (15,5),
83
  itime            TIMESTAMP DEFAULT 'now()',
84
  mtime            TIMESTAMP
85
);
86

  
87
CREATE TRIGGER mtime_project_status            BEFORE UPDATE ON project_status             FOR EACH ROW EXECUTE PROCEDURE set_mtime();
88
CREATE TRIGGER mtime_project_phases            BEFORE UPDATE ON project_phases             FOR EACH ROW EXECUTE PROCEDURE set_mtime();
89
CREATE TRIGGER mtime_project_roles             BEFORE UPDATE ON project_roles              FOR EACH ROW EXECUTE PROCEDURE set_mtime();
90
CREATE TRIGGER mtime_project_participants      BEFORE UPDATE ON project_participants       FOR EACH ROW EXECUTE PROCEDURE set_mtime();
91
CREATE TRIGGER mtime_project_phase_paticipants BEFORE UPDATE ON project_phase_participants FOR EACH ROW EXECUTE PROCEDURE set_mtime();
92

  

Auch abrufbar als: Unified diff