START TRANSACTION;

CREATE TABLE bot_big_order
(
    id     BIGINT     NOT NULL PRIMARY KEY,
    date   SHORT_TEXT NOT NULL,
    config JSONB      NOT NULL
);

ALTER TABLE bot_configuration
    ADD COLUMN price BIGINT NOT NULL DEFAULT 0;

ALTER TABLE quota_request
    ADD COLUMN order_id BIGINT NULL REFERENCES bot_big_order (id) ON UPDATE CASCADE ON DELETE CASCADE;

ALTER TABLE bot_service_configuration
    ADD COLUMN valid BOOLEAN NOT NULL DEFAULT false;

COMMIT;