Created
March 17, 2014 10:18
-
-
Save novotnyr/9596959 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DayGridDatabaseOpenHelper extends SQLiteOpenHelper { | |
public DayGridDatabaseOpenHelper(Context context) { | |
super(context, Database.NAME, DEFAULT_CURSOR_FACTORY, Database.VERSION); | |
} | |
@Override | |
public void onCreate(SQLiteDatabase db) { | |
String sql = "CREATE TABLE %s (" + | |
"%s INTEGER PRIMARY KEY AUTOINCREMENT, " + | |
"%s DATE NOT NULL, " + | |
"%s INTEGER NOT NULL" + | |
")"; | |
sql = String.format(sql, | |
Database.DayColor.TABLE_NAME, | |
Database.DayColor._ID, | |
Database.DayColor.TIMESTAMP, | |
Database.DayColor.COLOR); | |
db.execSQL(sql); | |
} | |
@Override | |
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { | |
// not supported | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment