dev/actions #26

Merged
tom_trgr merged 41 commits from dev/actions into dev/main 2025-08-29 15:36:00 +02:00
2 changed files with 68 additions and 0 deletions
Showing only changes of commit 3e0f84f618 - Show all commits

10
atlas.hcl Normal file
View File

@@ -0,0 +1,10 @@
# The "dev" environment represents our local testings.
env "local" {
url = "postgres://root:very_secure@:5432/arbeitszeitmessung?search_path=public&sslmode=disable"
migration {
dir = "file://migrations"
format = golang-migrate
}
dev = "docker://postgres/16/dev?search_path=public"
src = "file://schema.sql"
}

58
schema.sql Normal file
View File

@@ -0,0 +1,58 @@
-- Create "abwesenheit" table
CREATE TABLE "abwesenheit" (
"counter_id" bigserial NOT NULL,
"card_uid" character varying(255) NULL,
"abwesenheit_typ" smallint NULL,
"datum" timestamptz NULL DEFAULT (now())::date,
PRIMARY KEY ("counter_id")
);
-- Create "anwesenheit" table
CREATE TABLE "anwesenheit" (
"counter_id" bigserial NOT NULL,
"timestamp" timestamptz NULL DEFAULT CURRENT_TIMESTAMP,
"card_uid" character varying(255) NULL,
"check_in_out" smallint NULL,
"anwesenheit_type" smallint NULL,
"geraet_id" smallint NULL,
PRIMARY KEY ("counter_id")
);
-- Set comment to column: "check_in_out" on table: "anwesenheit"
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';
-- Set comment to column: "geraet_id" on table: "anwesenheit"
COMMENT ON COLUMN "anwesenheit"."geraet_id" IS 'ID des Lesegerätes';
-- Create "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")
);
-- Set comment to column: "geschlecht" on table: "personal_daten"
COMMENT ON COLUMN "personal_daten"."geschlecht" IS '1==weiblich, 2==maennlich, 3==divers';
-- Create "user_password" table
CREATE TABLE "user_password" (
"personal_nummer" integer NOT NULL,
"pass_hash" text NULL,
"zuletzt_geandert" timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY ("personal_nummer")
);
-- Create "wochen_report" table
CREATE TABLE "wochen_report" (
"id" serial NOT NULL,
"personal_nummer" integer NULL,
"woche_start" date NULL,
"bestaetigt" boolean NULL DEFAULT false,
PRIMARY KEY ("id"),
CONSTRAINT "wochen_report_personal_nummer_woche_start_key" UNIQUE ("personal_nummer", "woche_start")
);