/*
 * This file is generated by jOOQ.
 */
package com.nisemoe.generated.tables.records


import com.nisemoe.generated.tables.FlywaySchemaHistory

import java.time.LocalDateTime

import org.jooq.Field
import org.jooq.Record1
import org.jooq.Record10
import org.jooq.Row10
import org.jooq.impl.UpdatableRecordImpl


/**
 * This class is generated by jOOQ.
 */
@Suppress("UNCHECKED_CAST")
open class FlywaySchemaHistoryRecord private constructor() : UpdatableRecordImpl<FlywaySchemaHistoryRecord>(FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY), Record10<Int?, String?, String?, String?, String?, Int?, String?, LocalDateTime?, Int?, Boolean?> {

    open var installedRank: Int
        set(value): Unit = set(0, value)
        get(): Int = get(0) as Int

    open var version: String?
        set(value): Unit = set(1, value)
        get(): String? = get(1) as String?

    open var description: String
        set(value): Unit = set(2, value)
        get(): String = get(2) as String

    open var type: String
        set(value): Unit = set(3, value)
        get(): String = get(3) as String

    open var script: String
        set(value): Unit = set(4, value)
        get(): String = get(4) as String

    open var checksum: Int?
        set(value): Unit = set(5, value)
        get(): Int? = get(5) as Int?

    open var installedBy: String
        set(value): Unit = set(6, value)
        get(): String = get(6) as String

    open var installedOn: LocalDateTime?
        set(value): Unit = set(7, value)
        get(): LocalDateTime? = get(7) as LocalDateTime?

    open var executionTime: Int
        set(value): Unit = set(8, value)
        get(): Int = get(8) as Int

    open var success: Boolean
        set(value): Unit = set(9, value)
        get(): Boolean = get(9) as Boolean

    // -------------------------------------------------------------------------
    // Primary key information
    // -------------------------------------------------------------------------

    override fun key(): Record1<Int?> = super.key() as Record1<Int?>

    // -------------------------------------------------------------------------
    // Record10 type implementation
    // -------------------------------------------------------------------------

    override fun fieldsRow(): Row10<Int?, String?, String?, String?, String?, Int?, String?, LocalDateTime?, Int?, Boolean?> = super.fieldsRow() as Row10<Int?, String?, String?, String?, String?, Int?, String?, LocalDateTime?, Int?, Boolean?>
    override fun valuesRow(): Row10<Int?, String?, String?, String?, String?, Int?, String?, LocalDateTime?, Int?, Boolean?> = super.valuesRow() as Row10<Int?, String?, String?, String?, String?, Int?, String?, LocalDateTime?, Int?, Boolean?>
    override fun field1(): Field<Int?> = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.INSTALLED_RANK
    override fun field2(): Field<String?> = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.VERSION
    override fun field3(): Field<String?> = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.DESCRIPTION
    override fun field4(): Field<String?> = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.TYPE
    override fun field5(): Field<String?> = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.SCRIPT
    override fun field6(): Field<Int?> = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.CHECKSUM
    override fun field7(): Field<String?> = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.INSTALLED_BY
    override fun field8(): Field<LocalDateTime?> = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.INSTALLED_ON
    override fun field9(): Field<Int?> = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.EXECUTION_TIME
    override fun field10(): Field<Boolean?> = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.SUCCESS
    override fun component1(): Int = installedRank
    override fun component2(): String? = version
    override fun component3(): String = description
    override fun component4(): String = type
    override fun component5(): String = script
    override fun component6(): Int? = checksum
    override fun component7(): String = installedBy
    override fun component8(): LocalDateTime? = installedOn
    override fun component9(): Int = executionTime
    override fun component10(): Boolean = success
    override fun value1(): Int = installedRank
    override fun value2(): String? = version
    override fun value3(): String = description
    override fun value4(): String = type
    override fun value5(): String = script
    override fun value6(): Int? = checksum
    override fun value7(): String = installedBy
    override fun value8(): LocalDateTime? = installedOn
    override fun value9(): Int = executionTime
    override fun value10(): Boolean = success

    override fun value1(value: Int?): FlywaySchemaHistoryRecord {
        set(0, value)
        return this
    }

    override fun value2(value: String?): FlywaySchemaHistoryRecord {
        set(1, value)
        return this
    }

    override fun value3(value: String?): FlywaySchemaHistoryRecord {
        set(2, value)
        return this
    }

    override fun value4(value: String?): FlywaySchemaHistoryRecord {
        set(3, value)
        return this
    }

    override fun value5(value: String?): FlywaySchemaHistoryRecord {
        set(4, value)
        return this
    }

    override fun value6(value: Int?): FlywaySchemaHistoryRecord {
        set(5, value)
        return this
    }

    override fun value7(value: String?): FlywaySchemaHistoryRecord {
        set(6, value)
        return this
    }

    override fun value8(value: LocalDateTime?): FlywaySchemaHistoryRecord {
        set(7, value)
        return this
    }

    override fun value9(value: Int?): FlywaySchemaHistoryRecord {
        set(8, value)
        return this
    }

    override fun value10(value: Boolean?): FlywaySchemaHistoryRecord {
        set(9, value)
        return this
    }

    override fun values(value1: Int?, value2: String?, value3: String?, value4: String?, value5: String?, value6: Int?, value7: String?, value8: LocalDateTime?, value9: Int?, value10: Boolean?): FlywaySchemaHistoryRecord {
        this.value1(value1)
        this.value2(value2)
        this.value3(value3)
        this.value4(value4)
        this.value5(value5)
        this.value6(value6)
        this.value7(value7)
        this.value8(value8)
        this.value9(value9)
        this.value10(value10)
        return this
    }

    /**
     * Create a detached, initialised FlywaySchemaHistoryRecord
     */
    constructor(installedRank: Int, version: String? = null, description: String, type: String, script: String, checksum: Int? = null, installedBy: String, installedOn: LocalDateTime? = null, executionTime: Int, success: Boolean): this() {
        this.installedRank = installedRank
        this.version = version
        this.description = description
        this.type = type
        this.script = script
        this.checksum = checksum
        this.installedBy = installedBy
        this.installedOn = installedOn
        this.executionTime = executionTime
        this.success = success
        resetChangedOnNotNull()
    }
}
