package jp.agentec.abook.abv.bl.data.tables;

import java.util.ArrayList;
import java.util.List;

import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
import jp.agentec.abook.abv.bl.data.DatabaseVersions;

/**
 * Created by leej on 2018/08/31.
 */

public class TTask extends SQLiteTableScript {

    public TTask() {
        super();
    }

    @Override
    public List<String> getCreateScript(int version) {
        List<String> ddl = new ArrayList<String>();
        StringBuffer sql = new StringBuffer();

        sql.append(" CREATE TABLE t_task ( ");
        sql.append("        task_key TEXT NOT NULL ");
        sql.append("      , task_id BIGINT ");
        sql.append("      , operation_id BIGINT NOT NULL ");
        sql.append("      , task_code VARCHAR(64) ");
        sql.append("      , task_status INTEGER ");
        sql.append("      , task_hotspot_info TEXT ");
        sql.append("      , del_flg BOOLEAN DEFAULT 0 ");
        sql.append("      , hotspot_changed_flg BOOLEAN DEFAULT 0 ");
        sql.append("      , PRIMARY KEY (task_key) ");
        sql.append(" ) ");
        ddl.add(sql.toString());

        return ddl;
    }


    @Override
    public List<String> getUpgradeScript(int oldVersion, int newVersion) {
        return null;
    }

    @Override
    public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object[] params) {
        return null;
    }
}
