package com.hc.lib.store;

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

/**
 * Created by yunhaipiaodi on 2017/9/18.
 */

public class TvDB extends SQLiteOpenHelper {
    public static final String DATABASENAME = "houchuan_tv.db";
    private static final int VERSION = 1;
    private static TvDB instance = null;
    private static Context mContext;

    public TvDB(Context context) {
        super(context, DATABASENAME, null, VERSION);
        mContext = context;
    }

    public static final synchronized TvDB getInstance(final Context context){
        if(instance ==null){
            instance = new TvDB(context);
        }
        return instance;
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        LastPlayTimeStore.getInstance(mContext).onCreate(db);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
