package jp.gihyo.mitoma.android.p011login;

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

public class MemberOpenHelper  extends SQLiteOpenHelper {
    private static final String DB_NAME = "member.db";
    private static final int DB_VERSION = 1;
    public MemberOpenHelper(Context context) {
        super(context, DB_NAME, null, DB_VERSION);
    }

    public void onCreate(SQLiteDatabase db) {
        // 初回作成時に呼ばれる
        db.execSQL("CREATE TABLE member (member_id TEXT PRIMARY KEY, member_name TEXT, password TEXT)");
    }
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // バージョン変更時の処理
        db.execSQL("DROP TABLE IF EXISTS member");
        onCreate(db);
    }
}