MetaSetup neu generiert
[kivitendo-erp.git] / SL / DB / MetaSetup / Unit.pm
index 6e05737..0849b4e 100644 (file)
@@ -6,29 +6,29 @@ use strict;
 
 use base qw(SL::DB::Object);
 
-__PACKAGE__->meta->setup(
-  table   => 'units',
-
-  columns => [
-    name      => { type => 'varchar', length => 20, not_null => 1 },
-    base_unit => { type => 'varchar', length => 20 },
-    factor    => { type => 'numeric', precision => 5, scale => 20 },
-    type      => { type => 'varchar', length => 20 },
-    sortkey   => { type => 'integer', not_null => 1 },
-    id        => { type => 'serial', not_null => 1 },
-  ],
-
-  primary_key_columns => [ 'name' ],
-
-  unique_key => [ 'id' ],
-
-  foreign_keys => [
-    unit => {
-      class       => 'SL::DB::Unit',
-      key_columns => { base_unit => 'name' },
-    },
-  ],
+__PACKAGE__->meta->table('units');
+
+__PACKAGE__->meta->columns(
+  name      => { type => 'varchar', length => 20, not_null => 1 },
+  base_unit => { type => 'varchar', length => 20 },
+  factor    => { type => 'numeric', precision => 5, scale => 20 },
+  type      => { type => 'varchar', length => 20 },
+  sortkey   => { type => 'integer', not_null => 1 },
+  id        => { type => 'serial', not_null => 1 },
 );
 
+__PACKAGE__->meta->primary_key_columns([ 'name' ]);
+
+__PACKAGE__->meta->unique_keys([ 'id' ]);
+
+__PACKAGE__->meta->foreign_keys(
+  unit => {
+    class       => 'SL::DB::Unit',
+    key_columns => { base_unit => 'name' },
+  },
+);
+
+# __PACKAGE__->meta->initialize;
+
 1;
 ;