pricegroup => 'pricegroup',
printers => 'printer',
project => 'project',
- project_types => 'ProjectType',
+ project_participants => 'project_participant',
+ project_phase_participants => 'project_phase_participant',
+ project_phases => 'project_phase',
+ project_roles => 'project_role',
+ project_status => 'project_status',
+ project_types => 'project_type',
record_links => 'record_link',
requirement_spec_acceptance_statuses => 'RequirementSpecAcceptanceStatus',
requirement_spec_complexities => 'RequirementSpecComplexity',
__PACKAGE__->meta->table('project');
__PACKAGE__->meta->columns(
- active => { type => 'boolean', default => 'true' },
- customer_id => { type => 'integer' },
- description => { type => 'text' },
- id => { type => 'integer', not_null => 1, sequence => 'id' },
- itime => { type => 'timestamp', default => 'now()' },
- mtime => { type => 'timestamp' },
- project_type_id => { type => 'integer', not_null => 1 },
- projectnumber => { type => 'text' },
- valid => { type => 'boolean', default => 'true' },
+ active => { type => 'boolean', default => 'true' },
+ billable_customer_id => { type => 'integer' },
+ budget_cost => { type => 'numeric', default => '0', not_null => 1, precision => 5, scale => 15 },
+ budget_minutes => { type => 'integer', default => '0', not_null => 1 },
+ customer_id => { type => 'integer' },
+ description => { type => 'text' },
+ end_date => { type => 'date' },
+ id => { type => 'integer', not_null => 1, sequence => 'id' },
+ 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_type_id => { type => 'integer', not_null => 1 },
+ projectnumber => { type => 'text' },
+ start_date => { type => 'date' },
+ timeframe => { type => 'boolean', default => 'false', not_null => 1 },
+ type => { type => 'text' },
+ valid => { type => 'boolean', default => 'true' },
);
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
class => 'SL::DB::ProjectType',
key_columns => { project_type_id => 'id' },
},
+
+ billable_customer => {
+ class => 'SL::DB::Customer',
+ key_columns => { billable_customer_id => 'id' },
+ },
+
+ customer => {
+ class => 'SL::DB::Customer',
+ key_columns => { customer_id => 'id' },
+ },
+
+ project_type => {
+ class => 'SL::DB::ProjectType',
+ key_columns => { project_type_id => 'id' },
+ },
);
1;
--- /dev/null
+# This file has been auto-generated. Do not modify it; it will be overwritten
+# by rose_auto_create_model.pl automatically.
+package SL::DB::ProjectParticipant;
+
+use strict;
+
+use base qw(SL::DB::Object);
+
+__PACKAGE__->meta->setup(
+ table => 'project_participants',
+
+ columns => [
+ id => { type => 'serial', not_null => 1 },
+ project_id => { type => 'integer', not_null => 1 },
+ employee_id => { type => 'integer', not_null => 1 },
+ project_role_id => { type => 'integer', not_null => 1 },
+ minutes => { type => 'integer', default => '0', not_null => 1 },
+ cost_per_hour => { type => 'numeric', precision => 5, scale => 15 },
+ itime => { type => 'timestamp', default => '06.05.2013 14:26:18.81159' },
+ mtime => { type => 'timestamp' },
+ ],
+
+ primary_key_columns => [ 'id' ],
+
+ foreign_keys => [
+ employee => {
+ class => 'SL::DB::Employee',
+ key_columns => { employee_id => 'id' },
+ },
+
+ project => {
+ class => 'SL::DB::Project',
+ key_columns => { project_id => 'id' },
+ },
+
+ project_role => {
+ class => 'SL::DB::ProjectRole',
+ key_columns => { project_role_id => 'id' },
+ },
+ ],
+);
+
+1;
+;
--- /dev/null
+# This file has been auto-generated. Do not modify it; it will be overwritten
+# by rose_auto_create_model.pl automatically.
+package SL::DB::ProjectPhaseParticipant;
+
+use strict;
+
+use base qw(SL::DB::Object);
+
+__PACKAGE__->meta->setup(
+ table => 'project_phase_participants',
+
+ columns => [
+ id => { type => 'serial', not_null => 1 },
+ project_phase_id => { type => 'integer', not_null => 1 },
+ employee_id => { type => 'integer', not_null => 1 },
+ project_role_id => { type => 'integer', not_null => 1 },
+ minutes => { type => 'integer', default => '0', not_null => 1 },
+ cost_per_hour => { type => 'numeric', precision => 5, scale => 15 },
+ itime => { type => 'timestamp', default => '06.05.2013 14:26:18.81159' },
+ mtime => { type => 'timestamp' },
+ ],
+
+ primary_key_columns => [ 'id' ],
+
+ foreign_keys => [
+ employee => {
+ class => 'SL::DB::Employee',
+ key_columns => { employee_id => 'id' },
+ },
+
+ project_role => {
+ class => 'SL::DB::ProjectRole',
+ key_columns => { project_role_id => 'id' },
+ },
+ ],
+);
+
+1;
+;
--- /dev/null
+# This file has been auto-generated. Do not modify it; it will be overwritten
+# by rose_auto_create_model.pl automatically.
+package SL::DB::ProjectRole;
+
+use strict;
+
+use base qw(SL::DB::Object);
+
+__PACKAGE__->meta->setup(
+ table => 'project_roles',
+
+ columns => [
+ id => { type => 'serial', not_null => 1 },
+ name => { type => 'text', not_null => 1 },
+ description => { type => 'text', not_null => 1 },
+ position => { type => 'integer', not_null => 1 },
+ itime => { type => 'timestamp', default => '06.05.2013 14:26:18.81159' },
+ mtime => { type => 'timestamp' },
+ ],
+
+ primary_key_columns => [ 'id' ],
+);
+
+1;
+;
--- /dev/null
+# This file has been auto-generated. Do not modify it; it will be overwritten
+# by rose_auto_create_model.pl automatically.
+package SL::DB::ProjectStatus;
+
+use strict;
+
+use base qw(SL::DB::Object);
+
+__PACKAGE__->meta->setup(
+ table => 'project_status',
+
+ columns => [
+ id => { type => 'serial', not_null => 1 },
+ name => { type => 'text', not_null => 1 },
+ description => { type => 'text', not_null => 1 },
+ position => { type => 'integer', not_null => 1 },
+ itime => { type => 'timestamp', default => '06.05.2013 14:26:18.81159' },
+ mtime => { type => 'timestamp' },
+ ],
+
+ primary_key_columns => [ 'id' ],
+
+ relationships => [
+ project => {
+ class => 'SL::DB::Project',
+ column_map => { id => 'project_status_id' },
+ type => 'one to many',
+ },
+ ],
+);
+
+1;
+;
__PACKAGE__->meta->columns(
description => { type => 'text' },
id => { type => 'serial', not_null => 1 },
+ internal => { type => 'boolean', default => 'false', not_null => 1 },
position => { type => 'integer', not_null => 1 },
);
--- /dev/null
+# This file has been auto-generated only because it didn't exist.
+# Feel free to modify it at will; it will not be overwritten automatically.
+
+package SL::DB::ProjectParticipant;
+
+use strict;
+
+use SL::DB::MetaSetup::ProjectParticipant;
+
+# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
+__PACKAGE__->meta->make_manager_class;
+
+1;
--- /dev/null
+# This file has been auto-generated only because it didn't exist.
+# Feel free to modify it at will; it will not be overwritten automatically.
+
+package SL::DB::ProjectPhaseParticipant;
+
+use strict;
+
+use SL::DB::MetaSetup::ProjectPhaseParticipant;
+
+# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
+__PACKAGE__->meta->make_manager_class;
+
+1;
--- /dev/null
+# This file has been auto-generated only because it didn't exist.
+# Feel free to modify it at will; it will not be overwritten automatically.
+
+package SL::DB::ProjectRole;
+
+use strict;
+
+use SL::DB::MetaSetup::ProjectRole;
+
+# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
+__PACKAGE__->meta->make_manager_class;
+
+1;
--- /dev/null
+# This file has been auto-generated only because it didn't exist.
+# Feel free to modify it at will; it will not be overwritten automatically.
+
+package SL::DB::ProjectStatus;
+
+use strict;
+
+use SL::DB::MetaSetup::ProjectStatus;
+
+# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
+__PACKAGE__->meta->make_manager_class;
+
+1;
--- /dev/null
+-- @tag: project_bob_attributes
+-- @description: Projekte: Zusätzliche Tabellen und Spalten
+-- @depends: project_customer_type_valid
+-- @charset: utf-8
+
+-- 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
+-- note: flags changing the behaviour of hours are still called so and not minutes
+-- no refcounts. we use adhoc counts to decide wether delete is possible or not
+-- no hour_approval
+-- nothing relevant to notifications
+
+
+
+
+CREATE TABLE project_status (
+ id SERIAL NOT NULL PRIMARY KEY,
+ name TEXT NOT NULL,
+ description TEXT NOT NULL,
+ position INTEGER NOT NULL,
+ itime TIMESTAMP DEFAULT 'now()',
+ mtime TIMESTAMP
+);
+
+ALTER TABLE project ADD COLUMN start_date DATE;
+ALTER TABLE project ADD COLUMN end_date DATE;
+ALTER TABLE project ADD COLUMN billable_customer_id INTEGER REFERENCES customer(id);
+ALTER TABLE project ADD COLUMN budget_cost NUMERIC(15,5) NOT NULL DEFAULT 0;
+ALTER TABLE project ADD COLUMN order_value NUMERIC(15,5) NOT NULL DEFAULT 0;
+ALTER TABLE project ADD COLUMN budget_minutes INTEGER NOT NULL DEFAULT 0;
+ALTER TABLE project ADD COLUMN timeframe BOOLEAN NOT NULL DEFAULT FALSE;
+ALTER TABLE project ADD COLUMN project_status_id INTEGER REFERENCES project_status(id);
+
+ALTER TABLE project_types ADD COLUMN internal BOOLEAN NOT NULL DEFAULT FALSE;
+
+CREATE TABLE project_phases (
+ id SERIAL NOT NULL PRIMARY KEY,
+ project_id INTEGER REFERENCES project(id),
+ start_date DATE,
+ end_date DATE,
+ name TEXT NOT NULL,
+ description TEXT NOT NULL,
+ budget_minutes INTEGER NOT NULL DEFAULT 0,
+ budget_cost NUMERIC (15,5) NOT NULL DEFAULT 0,
+ general_minutes INTEGER NOT NULL DEFAULT 0,
+ general_cost_per_hour NUMERIC (15,5) NOT NULL DEFAULT 0,
+ itime TIMESTAMP DEFAULT 'now()',
+ mtime TIMESTAMP
+);
+
+CREATE TABLE project_roles (
+ id SERIAL NOT NULL PRIMARY KEY,
+ name TEXT NOT NULL,
+ description TEXT NOT NULL,
+ position INTEGER NOT NULL,
+ itime TIMESTAMP DEFAULT 'now()',
+ mtime TIMESTAMP
+);
+
+CREATE TABLE project_participants (
+ id SERIAL NOT NULL PRIMARY KEY,
+ project_id INTEGER NOT NULL REFERENCES project(id),
+ employee_id INTEGER NOT NULL REFERENCES employee(id),
+ project_role_id INTEGER NOT NULL REFERENCES project_roles(id),
+ minutes INTEGER NOT NULL DEFAULT 0,
+ cost_per_hour NUMERIC (15,5),
+ itime TIMESTAMP DEFAULT 'now()',
+ mtime TIMESTAMP
+);
+
+CREATE TABLE project_phase_participants (
+ id SERIAL NOT NULL PRIMARY KEY,
+ project_phase_id INTEGER NOT NULL REFERENCES project_phases(id),
+ employee_id INTEGER NOT NULL REFERENCES employee(id),
+ project_role_id INTEGER NOT NULL REFERENCES project_roles(id),
+ minutes INTEGER NOT NULL DEFAULT 0,
+ cost_per_hour NUMERIC (15,5),
+ itime TIMESTAMP DEFAULT 'now()',
+ mtime TIMESTAMP
+);
+
+CREATE TRIGGER mtime_project_status BEFORE UPDATE ON project_status FOR EACH ROW EXECUTE PROCEDURE set_mtime();
+CREATE TRIGGER mtime_project_phases BEFORE UPDATE ON project_phases FOR EACH ROW EXECUTE PROCEDURE set_mtime();
+CREATE TRIGGER mtime_project_roles BEFORE UPDATE ON project_roles FOR EACH ROW EXECUTE PROCEDURE set_mtime();
+CREATE TRIGGER mtime_project_participants BEFORE UPDATE ON project_participants FOR EACH ROW EXECUTE PROCEDURE set_mtime();
+CREATE TRIGGER mtime_project_phase_paticipants BEFORE UPDATE ON project_phase_participants FOR EACH ROW EXECUTE PROCEDURE set_mtime();
+