   first_name VARCHAR(50) NOT NULL,
   last_name VARCHAR(50) NOT NULL,
   pin VARCHAR(10),
+  active BOOLEAN NOT NULL,
   CONSTRAINT device_user_pk PRIMARY KEY (id)
 );
 


CREATE TABLE public.rental (
  id INTEGER NOT NULL DEFAULT nextval('public.rental_id_seq'),
  user_id INTEGER NOT NULL,
  device_id INTEGER NOT NULL,
  rental_time TIMESTAMP NOT NULL,
  CONSTRAINT rental_pk PRIMARY KEY (id)
);


ON UPDATE CASCADE
  NOT DEFERRABLE;

ALTER TABLE public.rental ADD CONSTRAINT device_user_rental_fk
FOREIGN KEY (returner)
REFERENCES public.device_user (id)
ON DELETE NO ACTION
ON UPDATE CASCADE
  DEFERRABLE INITIALLY DEFERRED;

ALTER TABLE public.rental ADD CONSTRAINT device_rental_fk
FOREIGN KEY (device_id)
REFERENCES public.device (id)
