Skip to main content

public.rental

Description

Columns

NameTypeDefaultNullableChildrenParentsComment
rental_idintegernextval('rental_rental_id_seq'::regclass)falsepublic.payment_p2022_01 public.payment_p2022_02 public.payment_p2022_03 public.payment_p2022_04 public.payment_p2022_05 public.payment_p2022_06
rental_datetimestamp with time zonefalse
inventory_idintegerfalsepublic.inventory
customer_idintegerfalsepublic.customer
return_datetimestamp with time zonetrue
staff_idintegerfalsepublic.staff
last_updatetimestamp with time zonenow()false

Constraints

NameTypeDefinition
rental_customer_id_fkeyFOREIGN KEYFOREIGN KEY (customer_id) REFERENCES customer(customer_id) ON UPDATE CASCADE ON DELETE RESTRICT
rental_inventory_id_fkeyFOREIGN KEYFOREIGN KEY (inventory_id) REFERENCES inventory(inventory_id) ON UPDATE CASCADE ON DELETE RESTRICT
rental_pkeyPRIMARY KEYPRIMARY KEY (rental_id)
rental_staff_id_fkeyFOREIGN KEYFOREIGN KEY (staff_id) REFERENCES staff(staff_id) ON UPDATE CASCADE ON DELETE RESTRICT

Indexes

NameDefinition
rental_pkeyCREATE UNIQUE INDEX rental_pkey ON public.rental USING btree (rental_id)
idx_fk_inventory_idCREATE INDEX idx_fk_inventory_id ON public.rental USING btree (inventory_id)
idx_unq_rental_rental_date_inventory_id_customer_idCREATE UNIQUE INDEX idx_unq_rental_rental_date_inventory_id_customer_id ON public.rental USING btree (rental_date, inventory_id, customer_id)

Triggers

NameDefinition
last_updatedCREATE TRIGGER last_updated BEFORE UPDATE ON public.rental FOR EACH ROW EXECUTE FUNCTION last_updated()

Relations

er