From: Moritz Bunkus Date: Wed, 11 May 2011 06:36:21 +0000 (+0200) Subject: ID-Spalte für Tabelle "units" hinzugefügt X-Git-Tag: release-2.6.3~25^2~65^2~6 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=574c32c009b187782497bf170204dc7a8976b2e0;p=kivitendo-erp.git ID-Spalte für Tabelle "units" hinzugefügt --- diff --git a/SL/DB/MetaSetup/Unit.pm b/SL/DB/MetaSetup/Unit.pm index c22946283..6e05737df 100644 --- a/SL/DB/MetaSetup/Unit.pm +++ b/SL/DB/MetaSetup/Unit.pm @@ -15,10 +15,13 @@ __PACKAGE__->meta->setup( 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', diff --git a/sql/Pg-upgrade2/units_id.sql b/sql/Pg-upgrade2/units_id.sql new file mode 100644 index 000000000..0b20ebb67 --- /dev/null +++ b/sql/Pg-upgrade2/units_id.sql @@ -0,0 +1,6 @@ +-- @tag: units_id +-- @description: ID-Spalte für Tabelle "units" +-- @depends: release_2_6_2 +-- @charset: utf-8 +ALTER TABLE units ADD COLUMN id serial; +ALTER TABLE units ADD CONSTRAINT units_id_unique UNIQUE (id);