-- ----------------------------
-- Table structure for anwesenheit
-- ----------------------------
DROP TABLE IF EXISTS "anwesenheit";
CREATE TABLE "anwesenheit" (
    "counter_id" bigserial PRIMARY KEY,
    "timestamp" timestamp(6),
    "card_uid" varchar(255),
    "check_in_out" int2,
    "geraet_id" int2
);
COMMENT ON COLUMN "anwesenheit"."check_in_out" IS '1=Check In 2=Check Out , 3=Check in Manuell, 4=Check out manuell255=Automatic Check Out';
COMMENT ON COLUMN "anwesenheit"."geraet_id" IS 'ID des Lesegerätes';

-- ----------------------------
-- Table structure for personal_daten
-- ----------------------------
DROP TABLE IF EXISTS "personal_daten";
CREATE TABLE "personal_daten" (
    "personal_nummer" int4 NOT NULL PRIMARY KEY,
    "aktiv_beschaeftigt" bool,
    "vorname" varchar(255),
    "nachname" varchar(255),
    "geburtsdatum" date,
    "plz" varchar(255),
    "adresse" varchar(255),
    "geschlecht" int2,
    "card_uid" varchar(255),
    "hauptbeschaeftigungs_ort" int2,
    "arbeitszeit_per_tag" float4,
    "arbeitszeit_min_start" time(6),
    "arbeitszeit_max_ende" time(6),
    "vorgesetzter_pers_nr" int4
);
COMMENT ON COLUMN "personal_daten"."geschlecht" IS '1==weiblich, 2==maennlich, 3==divers';
