-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the time wiki!
CREATE TABLE benutzerrollen( rollen_id serial NOT NULL, rollen_name character varying(60), CONSTRAINT benutzerrollen_pkey PRIMARY KEY (rollen_id))WITH ( OIDS=FALSE);
CREATE TABLE benutzer(benutzer_id serial NOT NULL,benutzerrollen_rollen_id integer,benutzername character varying(60) NOT NULL, passwort character varying(60) NOT NULL, vorname character varying(60), nachname character varying(60), mailadr character varying(60) NOT NULL, CONSTRAINT benutzer_pkey PRIMARY KEY (benutzer_id), CONSTRAINT benutzer_benutzerrollen_rollen_id_fkey FOREIGN KEY (benutzerrollen_rollen_id) REFERENCES benutzerrollen (rollen_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION)WITH ( OIDS=FALSE);
ALTER TABLE benutzer ADD CONSTRAINT single_name UNIQUE(benutzername);
CREATE TABLE buchart( art character varying(30) NOT NULL, benutzer_id integer, CONSTRAINT buchart_pkey PRIMARY KEY (art) , CONSTRAINT buchart_benutzer_id_fkey FOREIGN KEY (benutzer_id) REFERENCES benutzer (benutzer_id) match simple ON UPDATE CASCADE ON DELETE NO ACTION)WITH ( OIDS=FALSE);
CREATE TABLE task( task_id serial NOT NULL,name character varying(60) NOT NULL, benutzer_id integer,plantaname character varying(60) DEFAULT NULL::character varying, buchart character varying(255), verbuchbar boolean NOT NULL DEFAULT FALSE, CONSTRAINT task_pkey PRIMARY KEY (task_id), CONSTRAINT fk27a9a5b3366523 FOREIGN KEY (buchart) REFERENCES buchart (art) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT task_benutzer_id_fkey FOREIGN KEY (benutzer_id) REFERENCES benutzer (benutzer_id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE NO ACTION)WITH ( OIDS=FALSE);
CREATE TABLE journal( nr serial NOT NULL , datum date NOT NULL, stunden double precision NOT NULL, bemerkung character varying(120), task integer NOT NULL, plantaverbucht boolean DEFAULT FALSE, benutzer_id integer, CONSTRAINT journal_pkey PRIMARY KEY (nr), CONSTRAINT fke9d47177c087fdd FOREIGN KEY (task) REFERENCES task (task_id) ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT journal_benutzer_id_fkey FOREIGN KEY (benutzer_id) REFERENCES benutzer (benutzer_id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE NO ACTION)WITH ( OIDS=FALSE);