// Path: app/src/main/java/ca/rmen/android/scrumchatter/Constants.java
// public class Constants {
//     public static final String TAG = "ScrumChatter";
//     public static final String PREF_TEAM_ID = "team_id";
//     public static final int DEFAULT_TEAM_ID = 1;
//     public static final String DEFAULT_TEAM_NAME = "Team A";
// }
// 
// Path: app/src/main/java/ca/rmen/android/scrumchatter/util/Log.java
// @SuppressWarnings("unused")
// public class Log {
//     public static void v(String tag, String message) {
//         if (BuildConfig.DEBUG) android.util.Log.v(tag, message);
//     }
// 
//     public static void v(String tag, String message, Throwable t) {
//         if (BuildConfig.DEBUG) android.util.Log.v(tag, message, t);
//     }
// 
//     public static void d(String tag, String message) {
//         if (BuildConfig.DEBUG) android.util.Log.d(tag, message);
//     }
// 
//     public static void d(String tag, String message, Throwable t) {
//         if (BuildConfig.DEBUG) android.util.Log.d(tag, message, t);
//     }
// 
//     public static void i(String tag, String message) {
//         android.util.Log.i(tag, message);
//     }
// 
//     public static void i(String tag, String message, Throwable t) {
//         android.util.Log.i(tag, message, t);
//     }
// 
//     public static void w(String tag, String message) {
//         android.util.Log.w(tag, message);
//     }
// 
//     public static void w(String tag, String message, Throwable t) {
//         android.util.Log.w(tag, message, t);
//     }
// 
//     public static void e(String tag, String message) {
//         android.util.Log.e(tag, message);
//     }
// 
//     public static void e(String tag, String message, Throwable t) {
//         android.util.Log.e(tag, message, t);
//     }
// 
//     public static void wtf(String tag, String message) {
//         android.util.Log.wtf(tag, message);
//     }
// 
//     public static void wtf(String tag, String message, Throwable t) {
//         android.util.Log.wtf(tag, message, t);
//     }
// }


import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import ca.rmen.android.scrumchatter.Constants;
import ca.rmen.android.scrumchatter.util.Log;
import ca.rmen.android.scrumchatter.R;
    private static final String SQL_DROP_TABLE_MEETING_TEMP = "DROP TABLE " + MeetingColumns.TABLE_NAME + TEMP_SUFFIX;
    private static final String SQL_CREATE_VIEW_MEMBER_STATS = "CREATE VIEW "
            + MemberStatsColumns.VIEW_NAME + " AS " + " SELECT "
            + MemberColumns.TABLE_NAME + "." + MemberColumns._ID + " AS " + MemberColumns._ID + ", "
            + MemberColumns.TABLE_NAME + "." + MemberColumns.NAME + " AS " + MemberColumns.NAME + ", "
            + MemberColumns.TABLE_NAME + "." + MemberColumns.DELETED + " AS " + MemberColumns.DELETED + ", "
            + MemberColumns.TABLE_NAME + "." + MemberColumns.TEAM_ID + " AS " + MemberStatsColumns.TEAM_ID + ", "
            + " SUM(" + MeetingMemberColumns.TABLE_NAME + "." + MeetingMemberColumns.DURATION + ") AS " + MemberStatsColumns.SUM_DURATION + ","
            + " AVG(" + MeetingMemberColumns.TABLE_NAME + "." + MeetingMemberColumns.DURATION + ") AS " + MemberStatsColumns.AVG_DURATION
            + " FROM "
            + MemberColumns.TABLE_NAME + " LEFT OUTER JOIN "
            + MeetingMemberColumns.TABLE_NAME + " ON " + MemberColumns.TABLE_NAME + "." + MemberColumns._ID + " = " + MeetingMemberColumns.TABLE_NAME + "." + MeetingMemberColumns.MEMBER_ID
            + " AND " + MeetingMemberColumns.TABLE_NAME + "." + MeetingMemberColumns.DURATION + "> 0"
            + " GROUP BY "
            + MemberColumns.TABLE_NAME + "." + MemberColumns._ID + ", "
            + MemberColumns.TABLE_NAME + "." + MemberColumns.NAME + ", "
            + MemberColumns.TABLE_NAME + "." + MemberColumns.DELETED + ", "
            + MemberColumns.TABLE_NAME + "." + MemberColumns.TEAM_ID;

    private static final String SQL_DROP_VIEW_MEMBER_STATS = "DROP VIEW " + MemberStatsColumns.VIEW_NAME;

    private final Context mContext;

    ScrumChatterDatabase(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
        mContext = context;
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
// Path: app/src/main/java/ca/rmen/android/scrumchatter/Constants.java
// public class Constants {
//     public static final String TAG = "ScrumChatter";
//     public static final String PREF_TEAM_ID = "team_id";
//     public static final int DEFAULT_TEAM_ID = 1;
//     public static final String DEFAULT_TEAM_NAME = "Team A";
// }
// 
// Path: app/src/main/java/ca/rmen/android/scrumchatter/util/Log.java
// @SuppressWarnings("unused")
// public class Log {
//     public static void v(String tag, String message) {
//         if (BuildConfig.DEBUG) android.util.Log.v(tag, message);
//     }
// 
//     public static void v(String tag, String message, Throwable t) {
//         if (BuildConfig.DEBUG) android.util.Log.v(tag, message, t);
//     }
// 
//     public static void d(String tag, String message) {
//         if (BuildConfig.DEBUG) android.util.Log.d(tag, message);
//     }
// 
//     public static void d(String tag, String message, Throwable t) {
//         if (BuildConfig.DEBUG) android.util.Log.d(tag, message, t);
//     }
// 
//     public static void i(String tag, String message) {
//         android.util.Log.i(tag, message);
//     }
// 
//     public static void i(String tag, String message, Throwable t) {
//         android.util.Log.i(tag, message, t);
//     }
// 
//     public static void w(String tag, String message) {
//         android.util.Log.w(tag, message);
//     }
// 
//     public static void w(String tag, String message, Throwable t) {
//         android.util.Log.w(tag, message, t);
//     }
// 
//     public static void e(String tag, String message) {
//         android.util.Log.e(tag, message);
//     }
// 
//     public static void e(String tag, String message, Throwable t) {
//         android.util.Log.e(tag, message, t);
//     }
// 
//     public static void wtf(String tag, String message) {
//         android.util.Log.wtf(tag, message);
//     }
// 
//     public static void wtf(String tag, String message, Throwable t) {
//         android.util.Log.wtf(tag, message, t);
//     }
// }


// Path: app/src/main/java/ca/rmen/android/scrumchatter/provider/ScrumChatterDatabase.java
import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import ca.rmen.android.scrumchatter.Constants;
import ca.rmen.android.scrumchatter.util.Log;
import ca.rmen.android.scrumchatter.R;

    private static final String SQL_DROP_TABLE_MEETING_TEMP = "DROP TABLE " + MeetingColumns.TABLE_NAME + TEMP_SUFFIX;
    private static final String SQL_CREATE_VIEW_MEMBER_STATS = "CREATE VIEW "
            + MemberStatsColumns.VIEW_NAME + " AS " + " SELECT "
            + MemberColumns.TABLE_NAME + "." + MemberColumns._ID + " AS " + MemberColumns._ID + ", "
            + MemberColumns.TABLE_NAME + "." + MemberColumns.NAME + " AS " + MemberColumns.NAME + ", "
            + MemberColumns.TABLE_NAME + "." + MemberColumns.DELETED + " AS " + MemberColumns.DELETED + ", "
            + MemberColumns.TABLE_NAME + "." + MemberColumns.TEAM_ID + " AS " + MemberStatsColumns.TEAM_ID + ", "
            + " SUM(" + MeetingMemberColumns.TABLE_NAME + "." + MeetingMemberColumns.DURATION + ") AS " + MemberStatsColumns.SUM_DURATION + ","
            + " AVG(" + MeetingMemberColumns.TABLE_NAME + "." + MeetingMemberColumns.DURATION + ") AS " + MemberStatsColumns.AVG_DURATION
            + " FROM "
            + MemberColumns.TABLE_NAME + " LEFT OUTER JOIN "
            + MeetingMemberColumns.TABLE_NAME + " ON " + MemberColumns.TABLE_NAME + "." + MemberColumns._ID + " = " + MeetingMemberColumns.TABLE_NAME + "." + MeetingMemberColumns.MEMBER_ID
            + " AND " + MeetingMemberColumns.TABLE_NAME + "." + MeetingMemberColumns.DURATION + "> 0"
            + " GROUP BY "
            + MemberColumns.TABLE_NAME + "." + MemberColumns._ID + ", "
            + MemberColumns.TABLE_NAME + "." + MemberColumns.NAME + ", "
            + MemberColumns.TABLE_NAME + "." + MemberColumns.DELETED + ", "
            + MemberColumns.TABLE_NAME + "." + MemberColumns.TEAM_ID;

    private static final String SQL_DROP_VIEW_MEMBER_STATS = "DROP VIEW " + MemberStatsColumns.VIEW_NAME;

    private final Context mContext;

    ScrumChatterDatabase(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
        mContext = context;
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        Log.d(TAG, "onCreate");