Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void onCreate(SQLiteDatabase db) {
- String CONDITIONALLY_CREATE_VENDORS_TABLE = "CREATE TABLE IF NOT EXISTS " +
- TABLE_VENDORS + "("
- + COLUMN_ID + " INTEGER PRIMARY KEY," + COLUMN_VENDORID
- + " TEXT," + COLUMN_COMPANYNAME + " TEXT" + ")";
- db.execSQL(CONDITIONALLY_CREATE_VENDORS_TABLE);
- // add more tables as needed following the pattern above
- }
- @Override
- public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
- //db.execSQL("DROP TABLE IF EXISTS " + TABLE_VENDORS); <= Only need to DROP if the table's structure changes; so comment such a line out for the particular table in that case
- onCreate(db);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement