示例#1
0
        public void CreateTable()
        {
            List <TableColumn> lpColumns = new List <TableColumn>()
            {
                new TableColumn("id", "BIGINT", allowNulls: false, isPrimaryKey: true, isIdentity: true),
                new TableColumn("start_date", "DATETIME", allowNulls: false),
                new TableColumn("end_date", "DATETIME", allowNulls: true),
                new TableColumn("source", "VARCHAR(20)", allowNulls: true),
                new TableColumn("source_id", "BIGINT", allowNulls: true),
                new TableColumn("process_name", "VARCHAR(100)", allowNulls: false)
                {
                    DefaultValue = "'N/A'"
                },
                new TableColumn("start_message", "VARCHAR(2000)", allowNulls: true),
                new TableColumn("is_running", "SMALLINT", allowNulls: false)
                {
                    DefaultValue = "1"
                },
                new TableColumn("end_message", "VARCHAR(2000)", allowNulls: true),
                new TableColumn("was_successful", "SMALLINT", allowNulls: false)
                {
                    DefaultValue = "0"
                },
                new TableColumn("abort_message", "VARCHAR(2000)", allowNulls: true),
                new TableColumn("was_aborted", "SMALLINT", allowNulls: false)
                {
                    DefaultValue = "0"
                }
            };
            CreateTableTask LoadProcessTable = new CreateTableTask(TableName, lpColumns)
            {
                DisableLogging = true
            };

            LoadProcessTable.CopyLogTaskProperties(this);
            LoadProcessTable.ConnectionManager = this.ConnectionManager;
            LoadProcessTable.DisableLogging    = true;
            LoadProcessTable.CreateIfNotExists();
            Logging.LoadProcessTable = TableName;
        }
示例#2
0
文件: LogTask.cs 项目: etlbox/etlbox
        public void CreateLogTable()
        {
            List <TableColumn> columns = new List <TableColumn>()
            {
                new TableColumn("id", "BIGINT", allowNulls: false, isPrimaryKey: true, isIdentity: true),
                new TableColumn("log_date", "DATETIME", allowNulls: false),
                new TableColumn("level", "VARCHAR(10)", allowNulls: true),
                new TableColumn("stage", "VARCHAR(20)", allowNulls: true),
                new TableColumn("message", "VARCHAR(4000)", allowNulls: true),
                new TableColumn("task_name", "VARCHAR(1000)", allowNulls: true),
                new TableColumn("task_type", "VARCHAR(200)", allowNulls: true),
                new TableColumn("action", "VARCHAR(5)", allowNulls: true),
                new TableColumn("task_hash", "CHAR(40)", allowNulls: true),
                new TableColumn("source", "VARCHAR(20)", allowNulls: true),
                new TableColumn("load_process_id", "BIGINT", allowNulls: true)
            };
            var logTable = new CreateTableTask(TableName, columns);

            logTable.CopyLogTaskProperties(this);
            logTable.ConnectionManager = this.ConnectionManager;
            logTable.DisableLogging    = true;
            logTable.CreateIfNotExists();
            Logging.LogTable = TableName;
        }