package com.axelby.gpodder;

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

public class DBAdapter extends SQLiteOpenHelper {
	private static final String DATABASE_NAME = "gpodder.db";
	private static final int DATABASE_VERSION = 1;

	public DBAdapter(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL("CREATE TABLE subscriptions(url TEXT PRIMARY KEY);");
		db.execSQL("CREATE TABLE pending_add(url TEXT PRIMARY KEY NOT NULL);");
		db.execSQL("CREATE TABLE pending_remove(url TEXT PRIMARY KEY NOT NULL);");
	}

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

}

@@ -309,9 +309,9 @@
 N = 
-1
+2
 ;%0A%0A%09
@@ -770,14 +770,269 @@
 sion) %7B%0A
+%09%09if (newVersion %3C 2) %7B%0A%09%09%09// cleared to clean out sync errors%0A%09%09%09clearDB(db);%0A%09%09%7D%0A%09%7D%0A%0A%09private void clearDB(SQLiteDatabase db) %7B%0A%09%09db.delete(%22subscriptions%22, null, null);%0A%09%09db.delete(%22pending_add%22, null, null);%0A%09%09db.delete(%22pending_remove%22, null, null);%0A
 %09%7D%0A%0A%7D%0A

reset DB for next version