CREATE UNIQUE INDEX `tickets_one_open_waiter_call_per_table` ON `tickets` (`table_id`) WHERE "tickets"."type" = 'waiter_call' AND "tickets"."status" = 'open';