package com.example.unodtantos.appqueology2.controlador;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import com.example.unodtantos.appqueology2.modelo.DataBaseManagerUE;

/**
 * Created by unodtantos on 18/03/2015.
 */
public class DbHelperUE extends SQLiteOpenHelper {

    /*--------------------------------------------------------------------------------------------*/

    // <editor-fold defaultstate="collapsed" desc="Atributos de la clase">

    private static final int DB_SCHEME_VERSION = 1;

    // </editor-fold>

    /*--------------------------------------------------------------------------------------------*/

    // <editor-fold defaultstate="collapsed" desc="Constructores de la clase">

    /**
     * Constructor de la clase.
     * @param context
     * @param name
     */
    public DbHelperUE(Context context, String name) {
        super(context, name + ".sqlite", null, DB_SCHEME_VERSION);
    }

    /**
     * Constructor de la clase.
     * @param db
     */
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(DataBaseManagerUE.CREATE_TABLE_GENERAL);
        db.execSQL(DataBaseManagerUE.CREATE_TABLE_PADRES);
    }

    // </editor-fold>

    /*--------------------------------------------------------------------------------------------*/

    // <editor-fold defaultstate="collapsed" desc="Update">

    /**
     * Método que permite actualizar la base de datos.
     * @param db
     * @param oldVersion
     * @param newVersion
     */
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }

    // </editor-fold>

    /*--------------------------------------------------------------------------------------------*/

}
