Revision 129dcc98
Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt
SL/DB/FollowUpDone.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::FollowUpDone; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use SL::DB::MetaSetup::FollowUpDone; |
|
9 |
use SL::DB::Manager::FollowUpDone; |
|
10 |
|
|
11 |
__PACKAGE__->meta->initialize; |
|
12 |
|
|
13 |
1; |
SL/DB/Helper/ALL.pm | ||
---|---|---|
66 | 66 |
use SL::DB::FollowUp; |
67 | 67 |
use SL::DB::FollowUpAccess; |
68 | 68 |
use SL::DB::FollowUpCreatedForEmployee; |
69 |
use SL::DB::FollowUpDone; |
|
69 | 70 |
use SL::DB::FollowUpLink; |
70 | 71 |
use SL::DB::GLTransaction; |
71 | 72 |
use SL::DB::GenericTranslation; |
SL/DB/Helper/Mappings.pm | ||
---|---|---|
148 | 148 |
finanzamt => 'finanzamt', |
149 | 149 |
follow_up_access => 'follow_up_access', |
150 | 150 |
follow_up_created_for_employees => 'follow_up_created_for_employee', |
151 |
follow_up_done => 'follow_up_done', |
|
151 | 152 |
follow_up_links => 'follow_up_link', |
152 | 153 |
follow_ups => 'follow_up', |
153 | 154 |
generic_translations => 'generic_translation', |
SL/DB/Manager/FollowUpDone.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::Manager::FollowUpDone; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use parent qw(SL::DB::Helper::Manager); |
|
9 |
|
|
10 |
sub object_class { 'SL::DB::FollowUpDone' } |
|
11 |
|
|
12 |
__PACKAGE__->make_manager_methods; |
|
13 |
|
|
14 |
1; |
SL/DB/MetaSetup/FollowUp.pm | ||
---|---|---|
10 | 10 |
|
11 | 11 |
__PACKAGE__->meta->columns( |
12 | 12 |
created_by => { type => 'integer', not_null => 1 }, |
13 |
done => { type => 'boolean', default => 'false' }, |
|
14 | 13 |
follow_up_date => { type => 'date', not_null => 1 }, |
15 | 14 |
id => { type => 'integer', not_null => 1, sequence => 'follow_up_id' }, |
16 | 15 |
itime => { type => 'timestamp', default => 'now()' }, |
SL/DB/MetaSetup/FollowUpDone.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::FollowUpDone; |
|
4 |
|
|
5 |
use strict; |
|
6 |
|
|
7 |
use parent qw(SL::DB::Object); |
|
8 |
|
|
9 |
__PACKAGE__->meta->table('follow_up_done'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
done_at => { type => 'timestamp', default => 'now()', not_null => 1 }, |
|
13 |
employee_id => { type => 'integer' }, |
|
14 |
follow_up_id => { type => 'integer', not_null => 1 }, |
|
15 |
id => { type => 'serial', not_null => 1 }, |
|
16 |
); |
|
17 |
|
|
18 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
19 |
|
|
20 |
__PACKAGE__->meta->unique_keys([ 'follow_up_id' ]); |
|
21 |
|
|
22 |
__PACKAGE__->meta->allow_inline_column_values(1); |
|
23 |
|
|
24 |
__PACKAGE__->meta->foreign_keys( |
|
25 |
employee => { |
|
26 |
class => 'SL::DB::Employee', |
|
27 |
key_columns => { employee_id => 'id' }, |
|
28 |
}, |
|
29 |
|
|
30 |
follow_up => { |
|
31 |
class => 'SL::DB::FollowUp', |
|
32 |
key_columns => { follow_up_id => 'id' }, |
|
33 |
rel_type => 'one to one', |
|
34 |
}, |
|
35 |
); |
|
36 |
|
|
37 |
1; |
|
38 |
; |
sql/Pg-upgrade2/follow_up_done.sql | ||
---|---|---|
1 |
-- @tag: follow_up_done |
|
2 |
-- @description: Wiedervorlagen: Tabelle für Infos über abgeschlossene WVs |
|
3 |
-- @depends: follow_ups |
|
4 |
|
|
5 |
CREATE TABLE follow_up_done ( |
|
6 |
id SERIAL NOT NULL PRIMARY KEY, |
|
7 |
follow_up_id INTEGER NOT NULL UNIQUE REFERENCES follow_ups(id) ON DELETE CASCADE, |
|
8 |
done_at TIMESTAMP NOT NULL DEFAULT now(), |
|
9 |
employee_id INTEGER REFERENCES employee(id) |
|
10 |
); |
|
11 |
|
|
12 |
INSERT INTO follow_up_done (follow_up_id, done_at) |
|
13 |
SELECT id, mtime FROM follow_ups WHERE done IS TRUE; |
|
14 |
|
|
15 |
ALTER TABLE follow_ups DROP COLUMN done; |
Auch abrufbar als: Unified diff
Wiedervorlagen: Mehr Infos über Abschluss speichern: DB-Upgrade-Skript und Rose
Gespeichert wird Benutzer und Datum des Abschlusses. Der Benutzer kann
leer sein, da diese Information in schon existierenden Wiedervorlagen nicht
vorhanden ist.
Bei der Migration existierender Wiedervorlagen wird das Abschlussdatum auf
das letzte Änderungsdatum (mtime) gesetzt.