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


import com.nisemoe.generated.Public
import com.nisemoe.generated.indexes.IDX_SCORES_BEATMAP_ID
import com.nisemoe.generated.indexes.IDX_SCORES_BEATMAP_ID_REPLAY_ID
import com.nisemoe.generated.indexes.IDX_SCORES_BEATMAP_ID_REPLAY_ID_UR
import com.nisemoe.generated.indexes.IDX_SCORES_REPLAY_ID
import com.nisemoe.generated.indexes.IDX_SCORES_UR
import com.nisemoe.generated.indexes.IDX_SCORES_USER_ID
import com.nisemoe.generated.keys.REPLAY_ID_UNIQUE
import com.nisemoe.generated.keys.SCORES_PKEY
import com.nisemoe.generated.tables.records.ScoresRecord

import java.time.LocalDateTime
import java.time.OffsetDateTime

import kotlin.collections.List

import org.jooq.Field
import org.jooq.ForeignKey
import org.jooq.Index
import org.jooq.Name
import org.jooq.Record
import org.jooq.Schema
import org.jooq.Table
import org.jooq.TableField
import org.jooq.TableOptions
import org.jooq.UniqueKey
import org.jooq.impl.DSL
import org.jooq.impl.Internal
import org.jooq.impl.SQLDataType
import org.jooq.impl.TableImpl


/**
 * This class is generated by jOOQ.
 */
@Suppress("UNCHECKED_CAST")
open class Scores(
    alias: Name,
    child: Table<out Record>?,
    path: ForeignKey<out Record, ScoresRecord>?,
    aliased: Table<ScoresRecord>?,
    parameters: Array<Field<*>?>?
): TableImpl<ScoresRecord>(
    alias,
    Public.PUBLIC,
    child,
    path,
    aliased,
    parameters,
    DSL.comment(""),
    TableOptions.table()
) {
    companion object {

        /**
         * The reference instance of <code>public.scores</code>
         */
        val SCORES: Scores = Scores()
    }

    /**
     * The class holding records for this type
     */
    override fun getRecordType(): Class<ScoresRecord> = ScoresRecord::class.java

    /**
     * The column <code>public.scores.id</code>.
     */
    val ID: TableField<ScoresRecord, Int?> = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).defaultValue(DSL.field(DSL.raw("nextval('scores_id_seq1'::regclass)"), SQLDataType.INTEGER)), this, "")

    /**
     * The column <code>public.scores.beatmap_id</code>.
     */
    val BEATMAP_ID: TableField<ScoresRecord, Int?> = createField(DSL.name("beatmap_id"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.scores.count_100</code>.
     */
    val COUNT_100: TableField<ScoresRecord, Int?> = createField(DSL.name("count_100"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.scores.count_300</code>.
     */
    val COUNT_300: TableField<ScoresRecord, Int?> = createField(DSL.name("count_300"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.scores.count_50</code>.
     */
    val COUNT_50: TableField<ScoresRecord, Int?> = createField(DSL.name("count_50"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.scores.count_miss</code>.
     */
    val COUNT_MISS: TableField<ScoresRecord, Int?> = createField(DSL.name("count_miss"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.scores.date</code>.
     */
    val DATE: TableField<ScoresRecord, LocalDateTime?> = createField(DSL.name("date"), SQLDataType.LOCALDATETIME(6), this, "")

    /**
     * The column <code>public.scores.max_combo</code>.
     */
    val MAX_COMBO: TableField<ScoresRecord, Int?> = createField(DSL.name("max_combo"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.scores.mods</code>.
     */
    val MODS: TableField<ScoresRecord, Int?> = createField(DSL.name("mods"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.scores.perfect</code>.
     */
    val PERFECT: TableField<ScoresRecord, Boolean?> = createField(DSL.name("perfect"), SQLDataType.BOOLEAN, this, "")

    /**
     * The column <code>public.scores.pp</code>.
     */
    val PP: TableField<ScoresRecord, Double?> = createField(DSL.name("pp"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.rank</code>.
     */
    val RANK: TableField<ScoresRecord, String?> = createField(DSL.name("rank"), SQLDataType.VARCHAR, this, "")

    /**
     * The column <code>public.scores.replay_available</code>.
     */
    val REPLAY_AVAILABLE: TableField<ScoresRecord, Boolean?> = createField(DSL.name("replay_available"), SQLDataType.BOOLEAN, this, "")

    /**
     * The column <code>public.scores.replay_id</code>.
     */
    val REPLAY_ID: TableField<ScoresRecord, Long?> = createField(DSL.name("replay_id"), SQLDataType.BIGINT, this, "")

    /**
     * The column <code>public.scores.score</code>.
     */
    val SCORE: TableField<ScoresRecord, Long?> = createField(DSL.name("score"), SQLDataType.BIGINT, this, "")

    /**
     * The column <code>public.scores.user_id</code>.
     */
    val USER_ID: TableField<ScoresRecord, Long?> = createField(DSL.name("user_id"), SQLDataType.BIGINT, this, "")

    /**
     * The column <code>public.scores.replay</code>.
     */
    val REPLAY: TableField<ScoresRecord, ByteArray?> = createField(DSL.name("replay"), SQLDataType.BLOB, this, "")

    /**
     * The column <code>public.scores.ur</code>.
     */
    val UR: TableField<ScoresRecord, Double?> = createField(DSL.name("ur"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.frametime</code>.
     */
    val FRAMETIME: TableField<ScoresRecord, Double?> = createField(DSL.name("frametime"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.edge_hits</code>.
     */
    val EDGE_HITS: TableField<ScoresRecord, Int?> = createField(DSL.name("edge_hits"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.scores.snaps</code>.
     */
    val SNAPS: TableField<ScoresRecord, Int?> = createField(DSL.name("snaps"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.scores.is_banned</code>.
     */
    val IS_BANNED: TableField<ScoresRecord, Boolean?> = createField(DSL.name("is_banned"), SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "")

    /**
     * The column <code>public.scores.adjusted_ur</code>.
     */
    val ADJUSTED_UR: TableField<ScoresRecord, Double?> = createField(DSL.name("adjusted_ur"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.mean_error</code>.
     */
    val MEAN_ERROR: TableField<ScoresRecord, Double?> = createField(DSL.name("mean_error"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.error_variance</code>.
     */
    val ERROR_VARIANCE: TableField<ScoresRecord, Double?> = createField(DSL.name("error_variance"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.error_standard_deviation</code>.
     */
    val ERROR_STANDARD_DEVIATION: TableField<ScoresRecord, Double?> = createField(DSL.name("error_standard_deviation"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.minimum_error</code>.
     */
    val MINIMUM_ERROR: TableField<ScoresRecord, Double?> = createField(DSL.name("minimum_error"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.maximum_error</code>.
     */
    val MAXIMUM_ERROR: TableField<ScoresRecord, Double?> = createField(DSL.name("maximum_error"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.error_range</code>.
     */
    val ERROR_RANGE: TableField<ScoresRecord, Double?> = createField(DSL.name("error_range"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.error_coefficient_of_variation</code>.
     */
    val ERROR_COEFFICIENT_OF_VARIATION: TableField<ScoresRecord, Double?> = createField(DSL.name("error_coefficient_of_variation"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.error_kurtosis</code>.
     */
    val ERROR_KURTOSIS: TableField<ScoresRecord, Double?> = createField(DSL.name("error_kurtosis"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.error_skewness</code>.
     */
    val ERROR_SKEWNESS: TableField<ScoresRecord, Double?> = createField(DSL.name("error_skewness"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.sent_discord_notification</code>.
     */
    val SENT_DISCORD_NOTIFICATION: TableField<ScoresRecord, Boolean?> = createField(DSL.name("sent_discord_notification"), SQLDataType.BOOLEAN, this, "")

    /**
     * The column <code>public.scores.added_at</code>.
     */
    val ADDED_AT: TableField<ScoresRecord, OffsetDateTime?> = createField(DSL.name("added_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).defaultValue(DSL.field(DSL.raw("CURRENT_TIMESTAMP"), SQLDataType.TIMESTAMPWITHTIMEZONE)), this, "")

    /**
     * The column <code>public.scores.version</code>.
     */
    val VERSION: TableField<ScoresRecord, Int?> = createField(DSL.name("version"), SQLDataType.INTEGER.defaultValue(DSL.field(DSL.raw("0"), SQLDataType.INTEGER)), this, "")

    /**
     * The column <code>public.scores.keypresses_times</code>.
     */
    val KEYPRESSES_TIMES: TableField<ScoresRecord, Array<Double?>?> = createField(DSL.name("keypresses_times"), SQLDataType.FLOAT.array(), this, "")

    /**
     * The column <code>public.scores.keypresses_median</code>.
     */
    val KEYPRESSES_MEDIAN: TableField<ScoresRecord, Double?> = createField(DSL.name("keypresses_median"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.keypresses_standard_deviation</code>.
     */
    val KEYPRESSES_STANDARD_DEVIATION: TableField<ScoresRecord, Double?> = createField(DSL.name("keypresses_standard_deviation"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.sliderend_release_times</code>.
     */
    val SLIDEREND_RELEASE_TIMES: TableField<ScoresRecord, Array<Double?>?> = createField(DSL.name("sliderend_release_times"), SQLDataType.FLOAT.array(), this, "")

    /**
     * The column <code>public.scores.sliderend_release_median</code>.
     */
    val SLIDEREND_RELEASE_MEDIAN: TableField<ScoresRecord, Double?> = createField(DSL.name("sliderend_release_median"), SQLDataType.DOUBLE, this, "")

    /**
     * The column
     * <code>public.scores.sliderend_release_standard_deviation</code>.
     */
    val SLIDEREND_RELEASE_STANDARD_DEVIATION: TableField<ScoresRecord, Double?> = createField(DSL.name("sliderend_release_standard_deviation"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.keypresses_median_adjusted</code>.
     */
    val KEYPRESSES_MEDIAN_ADJUSTED: TableField<ScoresRecord, Double?> = createField(DSL.name("keypresses_median_adjusted"), SQLDataType.DOUBLE, this, "")

    /**
     * The column
     * <code>public.scores.keypresses_standard_deviation_adjusted</code>.
     */
    val KEYPRESSES_STANDARD_DEVIATION_ADJUSTED: TableField<ScoresRecord, Double?> = createField(DSL.name("keypresses_standard_deviation_adjusted"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.sliderend_release_median_adjusted</code>.
     */
    val SLIDEREND_RELEASE_MEDIAN_ADJUSTED: TableField<ScoresRecord, Double?> = createField(DSL.name("sliderend_release_median_adjusted"), SQLDataType.DOUBLE, this, "")

    /**
     * The column
     * <code>public.scores.sliderend_release_standard_deviation_adjusted</code>.
     */
    val SLIDEREND_RELEASE_STANDARD_DEVIATION_ADJUSTED: TableField<ScoresRecord, Double?> = createField(DSL.name("sliderend_release_standard_deviation_adjusted"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.scores.judgements</code>.
     */
    val JUDGEMENTS: TableField<ScoresRecord, ByteArray?> = createField(DSL.name("judgements"), SQLDataType.BLOB, this, "")

    private constructor(alias: Name, aliased: Table<ScoresRecord>?): this(alias, null, null, aliased, null)
    private constructor(alias: Name, aliased: Table<ScoresRecord>?, parameters: Array<Field<*>?>?): this(alias, null, null, aliased, parameters)

    /**
     * Create an aliased <code>public.scores</code> table reference
     */
    constructor(alias: String): this(DSL.name(alias))

    /**
     * Create an aliased <code>public.scores</code> table reference
     */
    constructor(alias: Name): this(alias, null)

    /**
     * Create a <code>public.scores</code> table reference
     */
    constructor(): this(DSL.name("scores"), null)

    constructor(child: Table<out Record>, key: ForeignKey<out Record, ScoresRecord>): this(Internal.createPathAlias(child, key), child, key, SCORES, null)
    override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC
    override fun getIndexes(): List<Index> = listOf(IDX_SCORES_BEATMAP_ID, IDX_SCORES_BEATMAP_ID_REPLAY_ID, IDX_SCORES_BEATMAP_ID_REPLAY_ID_UR, IDX_SCORES_REPLAY_ID, IDX_SCORES_UR, IDX_SCORES_USER_ID)
    override fun getPrimaryKey(): UniqueKey<ScoresRecord> = SCORES_PKEY
    override fun getUniqueKeys(): List<UniqueKey<ScoresRecord>> = listOf(REPLAY_ID_UNIQUE)
    override fun `as`(alias: String): Scores = Scores(DSL.name(alias), this)
    override fun `as`(alias: Name): Scores = Scores(alias, this)
    override fun `as`(alias: Table<*>): Scores = Scores(alias.getQualifiedName(), this)

    /**
     * Rename this table
     */
    override fun rename(name: String): Scores = Scores(DSL.name(name), null)

    /**
     * Rename this table
     */
    override fun rename(name: Name): Scores = Scores(name, null)

    /**
     * Rename this table
     */
    override fun rename(name: Table<*>): Scores = Scores(name.getQualifiedName(), null)
}
