Skip to content

Commit

Permalink
Moved table creation to onCreate()
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitrees committed Sep 13, 2017
1 parent 87e369f commit 8bbff44
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/src/main/java/com/snatik/matches/common/SQLiteDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.Settings;

import static android.R.attr.data;

/**
* Created by Dimitris on 25/8/2017.
*/
Expand All @@ -25,10 +27,6 @@ public SQLiteDB(Context context, String name, SQLiteDatabase.CursorFactory facto

@Override public void onCreate(SQLiteDatabase db){

}

public void createTable() {
SQLiteDatabase db = getWritableDatabase();
String initQuery = "CREATE TABLE IF NOT EXISTS " +TABLE_NAME + " ( " + COLUMN_TIME + " INTEGER, " +
COLUMN_THEME + " INTEGER, " + COLUMN_DIFFICULTY + " INTEGER, PRIMARY KEY( " +COLUMN_THEME +", " +
COLUMN_DIFFICULTY + ") );";
Expand All @@ -38,6 +36,7 @@ public void createTable() {
System.out.println(DB_NAME);

System.out.println("EVERYTHING WENT ALRIGHT!!");

}

public void dropTable () {
Expand Down

0 comments on commit 8bbff44

Please sign in to comment.