

#include "SqlSchema_DELETE.hpp"


using namespace std;

SqlSchema_DELETE::SqlSchema_DELETE(void)
{
// FIXME ????? appendRow();
}


vector<string> SqlSchema_DELETE::getCommand(int sid, const Survey& surv)
{
   string sidStr     = to_string(sid);
   string obsCollStr = surv.getObsCollection();
   string obsTitleStr = surv.getObsTitle();

   vector<string> vDELETE{
/*      {"DELETE FROM cubeboundsgalactic WHERE header_id IN (SELECT header_id FROM headers WHERE survey_id = " + sidStr + ")"},
      {"DELETE FROM cubeboundsicrs     WHERE header_id IN (SELECT header_id FROM headers WHERE survey_id = " + sidStr + ")"},
      {"DELETE FROM verticesgalactic   WHERE header_id IN (SELECT header_id FROM headers WHERE survey_id = " + sidStr + ")"},
      {"DELETE FROM verticesicrs       WHERE header_id IN (SELECT header_id FROM headers WHERE survey_id = " + sidStr + ")"},
      {"DELETE FROM headers            WHERE survey_id = " + sidStr},
*/
      {"DELETE FROM obscore WHERE obs_collection = \'" + obsCollStr + "\' AND obs_title = \'" + obsTitleStr +  "\'"},
   };
   return vDELETE;
}

/* NOTE:

obscore handled separately
obscore_vlkb handled separately

static relative to for-cycle: sid & tabName[headers]

for(tableName : tableNames)
{
   cmdString = "DELETE FROM " + tableName + " WHERE header_id IN (SELECT header_id FROM " + tabName[headers] + " WHERE survey_id = " + to_string(sid) + ")"
   vCmd.push_back(cmdString);
}

*/
