From 57528e5b09f2fea9708d06ec99c3fb0200275534 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 13 Jun 2013 12:07:55 +0200 Subject: [PATCH] Nicht benutzte Spalte employee.role entfernen --- SL/DB/MetaSetup/Employee.pm | 1 - SL/User.pm | 6 +++--- sql/Pg-upgrade2/remove_role_from_employee.sql | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 sql/Pg-upgrade2/remove_role_from_employee.sql diff --git a/SL/DB/MetaSetup/Employee.pm b/SL/DB/MetaSetup/Employee.pm index a99121dfd..b7b06be86 100644 --- a/SL/DB/MetaSetup/Employee.pm +++ b/SL/DB/MetaSetup/Employee.pm @@ -15,7 +15,6 @@ __PACKAGE__->meta->setup( startdate => { type => 'date', default => 'now' }, enddate => { type => 'date' }, notes => { type => 'text' }, - role => { type => 'text' }, sales => { type => 'boolean', default => 'true' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, diff --git a/SL/User.pm b/SL/User.pm index e984dbf0f..2159d9243 100644 --- a/SL/User.pm +++ b/SL/User.pm @@ -614,11 +614,11 @@ sub create_employee_entry { ($can_delete) = selectrow_query($form, $dbh, qq|SELECT tag FROM schema_info WHERE tag = ?|, 'employee_deleted') if $good_db; if (!$id) { - my $query = qq|INSERT INTO employee (login, name, workphone, role) VALUES (?, ?, ?, ?)|; - do_query($form, $dbh, $query, ($self->{login}, $myconfig->{name}, $myconfig->{tel}, "user")); + my $query = qq|INSERT INTO employee (login, name, workphone) VALUES (?, ?, ?)|; + do_query($form, $dbh, $query, ($self->{login}, $myconfig->{name}, $myconfig->{tel})); } elsif ($update_existing && $can_delete) { - my $query = qq|UPDATE employee SET name = ?, workphone = ?, role = 'user', deleted = 'f' WHERE id = ?|; + my $query = qq|UPDATE employee SET name = ?, workphone = ?, deleted = 'f' WHERE id = ?|; do_query($form, $dbh, $query, $myconfig->{name}, $myconfig->{tel}, $id); } diff --git a/sql/Pg-upgrade2/remove_role_from_employee.sql b/sql/Pg-upgrade2/remove_role_from_employee.sql new file mode 100644 index 000000000..0e8b48174 --- /dev/null +++ b/sql/Pg-upgrade2/remove_role_from_employee.sql @@ -0,0 +1,5 @@ +-- @tag: remove_role_from_employee +-- @description: Nicht benutzte Spalte employee.role entfernen +-- @depends: clients +-- @charset: utf-8 +ALTER TABLE employee DROP COLUMN role; -- 2.20.1