CREATE TABLE IF NOT EXISTS persons (
    id SERIAL PRIMARY KEY,
    first_name TEXT NOT NULL,
    last_name TEXT NOT NULL,
    grade INTEGER,
    parent_name TEXT,
    parent_phone_number TEXT,
    checked_in BOOLEAN NOT NULL DEFAULT FALSE,
    inside BOOLEAN NOT NULL DEFAULT FALSE,
    visitor BOOLEAN NOT NULL DEFAULT FALSE,
    sleeping_spot BOOLEAN NOT NULL DEFAULT FALSE
);

CREATE INDEX idx_persons_first_name_trgm ON persons USING GIN (first_name gin_trgm_ops);
CREATE INDEX idx_persons_last_name_trgm ON persons USING GIN (last_name gin_trgm_ops);
CREATE INDEX idx_persons_parent_name_trgm ON persons USING GIN (parent_name gin_trgm_ops);
CREATE INDEX idx_persons_parent_phone_number ON persons (parent_phone_number);
