-- reverse: drop "personal_daten" table
CREATE TABLE "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")
);
COMMENT ON COLUMN "personal_daten"."geschlecht" IS '1==weiblich, 2==maennlich, 3==divers';
-- reverse: set comment to column: "geschlecht" on table: "s_personal_daten"
COMMENT ON COLUMN "s_personal_daten"."geschlecht" IS NULL;
-- reverse: create "s_personal_daten" table
DROP TABLE "s_personal_daten";
-- reverse: create "s_anwesenheit_typen" table
DROP TABLE "s_anwesenheit_typen";
-- reverse: create "s_abwesenheit_typen" table
DROP TABLE "s_abwesenheit_typen";
-- reverse: modify "wochen_report" table
ALTER TABLE "wochen_report" DROP COLUMN "ueberstunden";
-- reverse: modify "anwesenheit" table
ALTER TABLE "anwesenheit" DROP COLUMN "anwesenheit_typ", ALTER COLUMN "check_in_out" DROP NOT NULL, ALTER COLUMN "card_uid" DROP NOT NULL;
