/**
 * Copyright (C) 2012 - Florindo Smilari (spherIC)
 */
package ch.spherIC.recurvebowsight.database.scheme.data;

import ch.spherIC.recurvebowsight.database.scheme.masterdata.TblRBSRiser;
import ch.spherIC.recurvebowsight.database.scheme.masterdata.TblRBSSight;


public final class TblRBSArcherySetup {

    public static final String NAME = "RBS_ARCHERYSETUP";

    public static final String COL_ID = "ARCHERYSETUP_ID";
    public static final String COL_NAME = "ARCHERYSETUP_NAME";
    public static final String COL_SIGHT = "ARCHERYSETUP_SIGHT";
    public static final String COL_RISER = "ARCHERYSETUP_RISER";
    public static final String COL_ARROWDIAMETER = "ARCHERYSETUP_ARROWDIAMETER";
    public static final String COL_ARROWCW = "ARCHERYSETUP_ARROWCW";
    public static final String COL_ARROWWEIGHT = "ARCHERYSETUP_ARROWWEIGHT";
    public static final String COL_ARROWV0 = "ARCHERYSETUP_ARROWV0";
    public static final String COL_ARROWCENTERHEIGHT = "ARCHERYSETUP_ARROWCENTERHEIGHT";
    public static final String COL_BOWPULLOUT = "ARCHERYSETUP_BOWPULLOUT";
    public static final String COL_ARROWNOCKHEIGHT = "ARCHERYSETUP_ARROWNOCKHEIGHT";
    public static final String COL_HNA = "ARCHERYSETUP_HNA";
    public static final String COL_DELTATIME = "ARCHERYSETUP_DELTATIME";
    public static final String COL_CALCPRECISION = "ARCHERYSETUP_CALCPRECISION";
    public static final String COL_SIGHTVERTSKALAMIDDLE = "ARCHERYSETUP_SIGHTVERTSKALAMIDDLE";
    public static final String COL_SIGHTHORSETTING = "ARCHERYSETUP_SIGHTHORSETTING";
    public static final String COL_NOCKRAISING = "ARCHERYSETUP_NOCKRAISING";
    public static final String COL_BRACEHEIGHT = "ARCHERYSETUP_BRACEHEIGHT";


    private TblRBSArcherySetup() { }

    public static String getCreateStatement() {
        return "create table " + NAME + "("
               + COL_ID + " Integer primary key autoincrement, "
               + COL_NAME + " Text NOT NULL, "
               + COL_SIGHT + " Integer NOT NULL, "
               + COL_RISER + " Integer NOT NULL, "
               + COL_ARROWDIAMETER + " Real NOT NULL, "
               + COL_ARROWCW + " Real NOT NULL, "
               + COL_ARROWWEIGHT + " Real NOT NULL, "
               + COL_ARROWV0 + " Real NOT NULL, "
               + COL_ARROWCENTERHEIGHT + " Real NOT NULL, "
               + COL_BOWPULLOUT + " Real NOT NULL, "
               + COL_ARROWNOCKHEIGHT + " Real NOT NULL, "
               + COL_HNA + " Real NOT NULL, "
               + COL_DELTATIME + " Real NOT NULL, "
               + COL_CALCPRECISION + " Real NOT NULL, "
               + COL_SIGHTVERTSKALAMIDDLE + " Real NOT NULL, "
               + COL_SIGHTHORSETTING + " Real NOT NULL, "
               + COL_NOCKRAISING + " Real NOT NULL, "
               + COL_BRACEHEIGHT + " Real NOT NULL, "
               + "constraint UNIQUE_ARCHERYSETUP_NAME UNIQUE (" + COL_NAME + "), "
               + "constraint UNIQUE_ARCHERYSETUP_SIGHT_RISER UNIQUE (" + COL_SIGHT + "," + COL_RISER + "),"
               + "FOREIGN KEY(" + COL_SIGHT + ") REFERENCES RBS_SIGHT (" + TblRBSSight.COL_ID + "), "
               + "FOREIGN KEY(" + COL_RISER + ") REFERENCES RBS_RISER (" + TblRBSRiser.COL_ID + ")"
               + ");";
    }

}
