-- modify "anwesenheit" table
ALTER TABLE "anwesenheit" ALTER COLUMN "card_uid" SET NOT NULL, ALTER COLUMN "check_in_out" SET NOT NULL, ADD COLUMN "anwesenheit_typ" smallint NULL;
-- modify "wochen_report" table
ALTER TABLE "wochen_report" ADD COLUMN "ueberstunden" smallint NULL;
-- create "s_abwesenheit_typen" table
CREATE TABLE "s_abwesenheit_typen" (
  "abwesenheit_id" smallint NOT NULL,
  "abwesenheit_name" character varying(255) NULL,
  PRIMARY KEY ("abwesenheit_id")
);
-- create "s_anwesenheit_typen" table
CREATE TABLE "s_anwesenheit_typen" (
  "anwesenheit_id" smallint NOT NULL,
  "anwesenheit_name" character varying(255) NULL,
  PRIMARY KEY ("anwesenheit_id")
);
-- create "s_personal_daten" table
CREATE TABLE "s_personal_daten" (
  "personal_nummer" integer NOT NULL,
  "aktiv_beschaeftigt" boolean NULL,
  "vorname" character varying(255) NULL,
  "nachname" character varying(255) NULL,
  "geburtsdatum" date NULL,
  "plz" character varying(255) NULL,
  "adresse" character varying(255) NULL,
  "geschlecht" smallint NULL,
  "card_uid" character varying(255) NULL,
  "hauptbeschaeftigungs_ort" smallint NULL,
  "arbeitszeit_per_tag" real NULL,
  "arbeitszeit_min_start" time NULL,
  "arbeitszeit_max_ende" time NULL,
  "vorgesetzter_pers_nr" integer NULL,
  PRIMARY KEY ("personal_nummer")
);
-- set comment to column: "geschlecht" on table: "s_personal_daten"
COMMENT ON COLUMN "s_personal_daten"."geschlecht" IS '1==weiblich, 2==maennlich, 3==divers';
-- drop "personal_daten" table
DROP TABLE "personal_daten";
