var mysql = require('mysql');
|
var moment = require('moment');
|
var config = require('./config');
|
|
var mysqlClient = mysql.createConnection(config.mysql_2);
|
mysqlClient.connect(function(error) { if (error) return; });
|
|
for(var i = 0; i < 3; i++) {
|
var partition_name = "p" + moment().add(-8 + i, 'd').format("YYYYMMDD");
|
console.log(partition_name);
|
|
sql = "ALTER TABLE history DROP PARTITION " + partition_name;
|
console.log(sql);
|
|
// mysqlClient.query(sql, function (error, results, fields) { if (error) throw error; });
|
}
|
|
mysqlClient.end();
|