Sequel.migration do
  up do
    root_dir = File.expand_path('../ddl/views', __dir__)

    sql = File.read(File.join(root_dir, 'vw_carton_label_lbl', '202203301115_vw_carton_label_lbl.sql'))
    run 'DROP VIEW public.vw_carton_label_lbl;'
    run sql

    sql = File.read(File.join(root_dir, 'vw_carton_label_pseq', '202203301115_vw_carton_label_pseq.sql'))
    run 'DROP VIEW public.vw_carton_label_pseq;'
    run sql

    sql = File.read(File.join(root_dir, 'vw_carton_label_pset', '202203311527_vw_carton_label_pset.sql'))
    run 'DROP VIEW public.vw_carton_label_pset;'
    run sql
  end

  down do
    root_dir = File.expand_path('../ddl/views', __dir__)

    sql = File.read(File.join(root_dir, 'vw_carton_label_lbl', '202203021654_vw_carton_label_lbl.sql'))
    run 'DROP VIEW public.vw_carton_label_lbl;'
    run sql

    sql = File.read(File.join(root_dir, 'vw_carton_label_pseq', '202203021654_vw_carton_label_pseq.sql'))
    run 'DROP VIEW public.vw_carton_label_pseq;'
    run sql

    sql = File.read(File.join(root_dir, 'vw_carton_label_pset', '202203021654_vw_carton_label_pset.sql'))
    run 'DROP VIEW public.vw_carton_label_pset;'
    run sql
  end
end
