Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b8b112a3

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

  • ID b8b112a39bd601b0bc717646d78de470631da22a
  • Vorgänger c0931303
  • Nachfolger 2d7e4203

MetaSetup neu generiert

Unterschiede anzeigen:

SL/DB/MetaSetup/Unit.pm
6 6

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

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

  
12
  columns => [
13
    name      => { type => 'varchar', length => 20, not_null => 1 },
14
    base_unit => { type => 'varchar', length => 20 },
15
    factor    => { type => 'numeric', precision => 5, scale => 20 },
16
    type      => { type => 'varchar', length => 20 },
17
    sortkey   => { type => 'integer', not_null => 1 },
18
    id        => { type => 'serial', not_null => 1 },
19
  ],
20

  
21
  primary_key_columns => [ 'name' ],
22

  
23
  unique_key => [ 'id' ],
24

  
25
  foreign_keys => [
26
    unit => {
27
      class       => 'SL::DB::Unit',
28
      key_columns => { base_unit => 'name' },
29
    },
30
  ],
9
__PACKAGE__->meta->table('units');
10

  
11
__PACKAGE__->meta->columns(
12
  name      => { type => 'varchar', length => 20, not_null => 1 },
13
  base_unit => { type => 'varchar', length => 20 },
14
  factor    => { type => 'numeric', precision => 5, scale => 20 },
15
  type      => { type => 'varchar', length => 20 },
16
  sortkey   => { type => 'integer', not_null => 1 },
17
  id        => { type => 'serial', not_null => 1 },
31 18
);
32 19

  
20
__PACKAGE__->meta->primary_key_columns([ 'name' ]);
21

  
22
__PACKAGE__->meta->unique_keys([ 'id' ]);
23

  
24
__PACKAGE__->meta->foreign_keys(
25
  unit => {
26
    class       => 'SL::DB::Unit',
27
    key_columns => { base_unit => 'name' },
28
  },
29
);
30

  
31
# __PACKAGE__->meta->initialize;
32

  
33 33
1;
34 34
;

Auch abrufbar als: Unified diff