Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 44e85149

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID 44e85149949968a98d02f2e07ae750deacf7ddba
  • Vorgänger 980917db
  • Nachfolger 4dabc760

PurchaseBasketItem: Datenbankscript und DB-Dateien

Positionsebene für den Einkaufskorb

Unterschiede anzeigen:

SL/DB/Helper/ALL.pm
109 109
use SL::DB::ProjectRole;
110 110
use SL::DB::ProjectStatus;
111 111
use SL::DB::ProjectType;
112
use SL::DB::PurchaseBasketItem;
112 113
use SL::DB::PurchaseInvoice;
113 114
use SL::DB::Reclamation;
114 115
use SL::DB::ReclamationItem;
SL/DB/Helper/Mappings.pm
188 188
  project_roles                  => 'project_role',
189 189
  project_statuses               => 'project_status',
190 190
  project_types                  => 'project_type',
191
  purchase_basket_items          => 'purchase_basket_item',
191 192
  reclamations                   => 'Reclamation',
192 193
  reclamation_items              => 'ReclamationItem',
193 194
  reclamation_reasons            => 'ReclamationReason',
SL/DB/Manager/PurchaseBasketItem.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::PurchaseBasketItem;
5

  
6
use strict;
7

  
8
use parent qw(SL::DB::Helper::Manager);
9

  
10
sub object_class { 'SL::DB::PurchaseBasketItem' }
11

  
12
__PACKAGE__->make_manager_methods;
13

  
14
1;
SL/DB/MetaSetup/PurchaseBasketItem.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::PurchaseBasketItem;
4

  
5
use strict;
6

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

  
9
__PACKAGE__->meta->table('purchase_basket_items');
10

  
11
__PACKAGE__->meta->columns(
12
  cleared    => { type => 'boolean', default => 'false', not_null => 1 },
13
  id         => { type => 'serial', not_null => 1 },
14
  itime      => { type => 'timestamp', default => 'now()' },
15
  mtime      => { type => 'timestamp' },
16
  orderer_id => { type => 'integer' },
17
  part_id    => { type => 'integer' },
18
  qty        => { type => 'numeric', not_null => 1, precision => 15, scale => 5 },
19
);
20

  
21
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
22

  
23
__PACKAGE__->meta->allow_inline_column_values(1);
24

  
25
__PACKAGE__->meta->foreign_keys(
26
  orderer => {
27
    class       => 'SL::DB::Employee',
28
    key_columns => { orderer_id => 'id' },
29
  },
30

  
31
  part => {
32
    class       => 'SL::DB::Part',
33
    key_columns => { part_id => 'id' },
34
  },
35
);
36

  
37
1;
38
;
SL/DB/PurchaseBasketItem.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::PurchaseBasketItem;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::PurchaseBasketItem;
9
use SL::DB::Manager::PurchaseBasketItem;
10

  
11
__PACKAGE__->meta->initialize;
12

  
13
1;
sql/Pg-upgrade2/purchase_basket_items.sql
1
-- @tag: purchase_basket_items
2
-- @description: Tabelle für den Dispositionsmanager
3
-- @depends: release_3_8_0
4
-- @ignore: 0
5

  
6
CREATE TABLE purchase_basket_items (
7
  id SERIAL   PRIMARY KEY,
8
  part_id     INTEGER REFERENCES parts(id),
9
  orderer_id  INTEGER REFERENCES employee(id),
10
  qty         NUMERIC(15,5) NOT NULL,
11
  cleared     BOOLEAN NOT NULL            DEFAULT FALSE,
12
  itime       TIMESTAMP without time zone DEFAULT now(),
13
  mtime       TIMESTAMP without time zone
14
);
15
CREATE TRIGGER mtime_purchase_basket_items
16
  BEFORE UPDATE ON purchase_basket_items
17
  FOR EACH ROW EXECUTE PROCEDURE set_mtime();

Auch abrufbar als: Unified diff