BEGIN;
SELECT _v.register_patch('exchange-0009', NULL, NULL);
SET search_path TO exchange;
CREATE FUNCTION alter_table_batch_deposits9()
RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
  ALTER TABLE batch_deposits
    ADD COLUMN total_without_fee taler_amount;
  UPDATE batch_deposits
    SET total_without_fee=total_amount;
  ALTER TABLE batch_deposits
    ALTER COLUMN total_without_fee SET NOT NULL;
END
$$;
INSERT INTO exchange_tables
    (name
    ,version
    ,action
    ,partitioned
    ,by_range)
  VALUES
    ('batch_deposits9'
    ,'exchange-0009'
    ,'alter'
    ,TRUE
    ,FALSE);
COMMIT;
