public.rental
Description
Columns
Name | Type | Default | Nullable | Children | Parents | Comment |
---|---|---|---|---|---|---|
rental_id | integer | nextval('rental_rental_id_seq'::regclass) | false | public.payment_p2022_01 public.payment_p2022_02 public.payment_p2022_03 public.payment_p2022_04 public.payment_p2022_05 public.payment_p2022_06 | ||
rental_date | timestamp with time zone | false | ||||
inventory_id | integer | false | public.inventory | |||
customer_id | integer | false | public.customer | |||
return_date | timestamp with time zone | true | ||||
staff_id | integer | false | public.staff | |||
last_update | timestamp with time zone | now() | false |
Constraints
Name | Type | Definition |
---|---|---|
rental_customer_id_fkey | FOREIGN KEY | FOREIGN KEY (customer_id) REFERENCES customer(customer_id) ON UPDATE CASCADE ON DELETE RESTRICT |
rental_inventory_id_fkey | FOREIGN KEY | FOREIGN KEY (inventory_id) REFERENCES inventory(inventory_id) ON UPDATE CASCADE ON DELETE RESTRICT |
rental_pkey | PRIMARY KEY | PRIMARY KEY (rental_id) |
rental_staff_id_fkey | FOREIGN KEY | FOREIGN KEY (staff_id) REFERENCES staff(staff_id) ON UPDATE CASCADE ON DELETE RESTRICT |
Indexes
Name | Definition |
---|---|
rental_pkey | CREATE UNIQUE INDEX rental_pkey ON public.rental USING btree (rental_id) |
idx_fk_inventory_id | CREATE INDEX idx_fk_inventory_id ON public.rental USING btree (inventory_id) |
idx_unq_rental_rental_date_inventory_id_customer_id | CREATE UNIQUE INDEX idx_unq_rental_rental_date_inventory_id_customer_id ON public.rental USING btree (rental_date, inventory_id, customer_id) |
Triggers
Name | Definition |
---|---|
last_updated | CREATE TRIGGER last_updated BEFORE UPDATE ON public.rental FOR EACH ROW EXECUTE FUNCTION last_updated() |