How to run openboxes in Apache Netbeans?

To elaborate, we have a view that depends on a derived data table that is created at runtime. If the view definition is executed before that table is run, we’ll run into this bug.

The temporary fix was to allow the view creation to fail as it would be recreated on the next restart.
https://github.com/openboxes/openboxes/blob/develop/grails-app/migrations/views/changelog.xml#L81

I’m not super happy with that solution, so I would recommend manually executing the following SQL script on your database before restarting the application.

DROP TABLE IF EXISTS product_demand_details_tmp;
CREATE TABLE product_demand_details_tmp AS
    SELECT
        request_id,
        request_status,
        request_number,
        date_created,
        date_requested,
        date_issued,
        origin_id,
        origin_name,
        destination_id,
        destination_name,
        request_item_id,
        product_id,
        product_code,
        product_name,
        quantity_requested,
        quantity_canceled,
        quantity_approved,
        quantity_modified,
        quantity_picked,
        quantity_demand,
        reason_code,
        reason_code_classification
    FROM product_demand;
DROP TABLE IF EXISTS product_demand_details;
CREATE TABLE IF NOT EXISTS product_demand_details LIKE product_demand_details_tmp;
TRUNCATE product_demand_details;
INSERT INTO product_demand_details SELECT * FROM product_demand_details_tmp;
ALTER TABLE product_demand_details ADD INDEX (product_id, origin_id, destination_id, date_issued, date_requested);