-- +goose Up
-- +goose StatementBegin

ALTER TABLE gestor_notificacoes ADD COLUMN IF NOT EXISTS lida BOOLEAN NOT NULL DEFAULT false;
CREATE INDEX IF NOT EXISTS idx_gestor_notificacoes_nao_lidas ON gestor_notificacoes(tenant_id, lida, criado_em DESC);

-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin
ALTER TABLE gestor_notificacoes DROP COLUMN IF EXISTS lida;
-- +goose StatementEnd
