CREATE TABLE public.schedule (
	id            SERIAL                              NOT NULL,
	user_id       INT4                                NOT NULL,
	node_id       INT4                                NOT NULL,
	schedule_uuid CHAR(36)  DEFAULT GEN_RANDOM_UUID() NOT NULL,
	"time"        TIMESTAMP                           NOT NULL,
	description   VARCHAR   DEFAULT ''                NOT NULL,
	acknowledged  BOOL      DEFAULT false             NOT NULL,

	CONSTRAINT schedule_pk PRIMARY KEY (id),
	CONSTRAINT schedule_uuid UNIQUE (schedule_uuid),
	CONSTRAINT schedule_node_fk FOREIGN KEY (node_id) REFERENCES public.node(id) ON DELETE CASCADE ON UPDATE CASCADE,
	CONSTRAINT schedule_user_fk FOREIGN KEY (user_id) REFERENCES "_webservice"."user"(id) ON DELETE CASCADE ON UPDATE CASCADE
);
