package com.codvision.db.versionctl.task;

import com.codvision.db.versionctl.chain.DbVersionCtlAbstractTask;
import com.codvision.db.versionctl.chain.DbVersionCtlContext;
import lombok.extern.slf4j.Slf4j;

/**
 * 任务:删除数据库版本控制表
 *
 * @author lingee
 */
@Slf4j
@SuppressWarnings("unused")
public class DropVersionTblTask extends DbVersionCtlAbstractTask {
    public DropVersionTblTask(DbVersionCtlContext context) {
        super(context);
    }

    @Override
    public boolean runTask() {
        log.info("DropVersionTblTask begin...");
        String dbVersionTableName = this.context.getDbVersionCtlProps().getDbVersionTableName();
        String dropTblSql = "drop table " + dbVersionTableName;
        this.jdbcUtil.execute(dropTblSql);
        log.info("DropVersionTblTask end...");

        return true;
    }
}
