<?php

/**
 * Migration 0036 — restaurant host waitlist
 *
 * A live queue of walk-in parties waiting for a table. The host adds a party
 * (name, size, phone), the guest gets a "your table is ready" text when the
 * host taps Notify, and the party is marked seated or removed. Separate from
 * reservations (which are future, timed) — this is the right-now door queue.
 */

if ( ! defined( 'ABSPATH' ) ) exit;

return [
    'description' => 'Create inst_instinctor_waitlist (restaurant host waitlist)',

    'up' => [
        "CREATE TABLE IF NOT EXISTS {prefix}instinctor_waitlist (
            id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
            name varchar(255) NOT NULL,
            phone varchar(50) NOT NULL DEFAULT '',
            party_size int NOT NULL DEFAULT 1,
            status varchar(20) NOT NULL DEFAULT 'waiting',
            note varchar(255) NOT NULL DEFAULT '',
            created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
            notified_at datetime NULL DEFAULT NULL,
            seated_at datetime NULL DEFAULT NULL,
            PRIMARY KEY (id),
            KEY status (status),
            KEY created_at (created_at)
        ) {charset}",
    ],

    'down' => [
        "DROP TABLE IF EXISTS {prefix}instinctor_waitlist",
    ],
];
