content: package io.github.akueisara.habittracker.data;
  
  import android.content.Context;
  import android.database.sqlite.SQLiteDatabase;
  import android.database.sqlite.SQLiteOpenHelper;
  import io.github.akueisara.habittracker.data.HabitContract.HabitEntry;
  
  /**
   * Created by akueisara on 10/10/2016.
   */
  
  public class HabitDbHelper extends SQLiteOpenHelper {
      private static final String DATABASE_NAME = "habittracker.db";
      private static final int DATABASE_VERSION = 1;
  
      public HabitDbHelper(Context context) {
          super(context, DATABASE_NAME, null, DATABASE_VERSION);
      }
  
      @Override
      public void onCreate(SQLiteDatabase db) {
          String SQL_CREATE_HABITS_TABLE =  "CREATE TABLE " + HabitEntry.TABLE_NAME + " ("
                  + HabitEntry._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
                  + HabitEntry.COLUMN_NAME + " TEXT NOT NULL, "
                  + HabitEntry.COLUMN_START_DATE + " DATETIME NOT NULL DEFAULT CURRENT_DATE, "
                  + HabitEntry.COLUMN_NUMBER_OF_TIMES + " INTEGER NOT NULL DEFAULT 0);";
  
          db.execSQL(SQL_CREATE_HABITS_TABLE);
      }
  
      @Override
      public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
  
      }
  }
  