package com.yutou.jianr_mg.Databases;

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

import com.yutou.jianr_mg.Application;

public class PlugDatabase extends SQLiteOpenHelper {
    private static PlugDatabase database;
    private SQLiteDatabase writeDatabase,readDatabase;
    private static String TAB_PLUGS="s_plugs";
    public  static  PlugDatabase init(){
        if(database==null){
            database=new PlugDatabase();
            database.writeDatabase=database.getWritableDatabase();
            database.readDatabase=database.getReadableDatabase();
        }
        return database;
    }
    private PlugDatabase() {
        super(Application.application, "plug_db", null, 1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql="create table "+TAB_PLUGS+" (_id integer primary key,id integer,pname verchar(50), fileName verchar(150),md5 verchar(255), version integer)";
        db.execSQL(sql);
    }

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

    }
    public void addPlug(){

    }
}
