package com.example.reminder_proj01;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

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


public class DB extends SQLiteOpenHelper
{

	public static final String DB_NAME = "remindme.db";
	public static final int DB_VERSION = 1;
	
	public DB(Context context) 
	{
		super(context, DB_NAME, null, DB_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) 
	{
		db.execSQL(Alarm.Sql_table());
		db.execSQL(AlarmTime.Sql_table());
		db.execSQL(AlarmMsg.Sql_table());
		
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
	{
		db.execSQL("DROP TABLE IF EXISTS " + Alarm.TABLE_NAME);
		db.execSQL("DROP TABLE IF EXISTS " + AlarmTime.TABLE_NAME);
		db.execSQL("DROP TABLE IF EXISTS " + AlarmMsg.TABLE_NAME);
		
		onCreate(db);				
	}
	
}
