<commit_before>package org.mattvchandler.progressbars.db;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.provider.BaseColumns;

/*
Copyright (C) 2017 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

// DB Table schema
public class Table implements BaseColumns // TODO: rename
{
    public static final String TABLE_NAME = "progress_bar";

    public static final String ORDER_COL = "order_ind";
    public static final String START_TIME_COL = "start_time";
    public static final String START_TZ_COL = "start_tz";
    public static final String END_TIME_COL = "end_time";
    public static final String END_TZ_COL = "end_tz";

    public static final String REPEATS_COL = "repeats";
    public static final String REPEAT_COUNT_COL = "repeat_count";
    public static final String REPEAT_UNIT_COL = "repeat_unit";
    public static final String REPEAT_DAYS_OF_WEEK_COL = "repeat_days_of_week";

    public static final String TITLE_COL = "title";
    public static final String PRE_TEXT_COL = "pre_text";
    public static final String START_TEXT_COL = "start_text";
    public static final String COUNTDOWN_TEXT_COL = "countdown_text";
    public static final String COMPLETE_TEXT_COL = "complete_text";
    public static final String POST_TEXT_COL = "post_text";

    public static final String PRECISION_COL = "precision";

    public static final String SHOW_START_COL = "show_start";
    public static final String SHOW_END_COL = "show_end";
    public static final String SHOW_PROGRESS_COL = "show_progress";

    public static final String SHOW_YEARS_COL = "show_years";
    public static final String SHOW_MONTHS_COL = "show_months";
    public static final String SHOW_WEEKS_COL = "show_weeks";
    public static final String SHOW_DAYS_COL = "show_days";
    public static final String SHOW_HOURS_COL = "show_hours";
    public static final String SHOW_MINUTES_COL = "show_minutes";
    public static final String SHOW_SECONDS_COL = "show_seconds";

    public static final String TERMINATE_COL = "terminate";
    public static final String NOTIFY_START_COL = "notify_start";
    public static final String NOTIFY_END_COL = "notify_end";

    // Select stmt to get all columns, all rows, ordered by order #
    public static final String SELECT_ALL_ROWS =
            "SELECT * FROM " + TABLE_NAME + " ORDER BY " + ORDER_COL;

    // table schema
    public static final String CREATE_TABLE =
            "CREATE TABLE IF NOT EXISTS " + TABLE_NAME + " (" +
            _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
            ORDER_COL + " INTEGER UNIQUE NOT NULL, " +
            START_TIME_COL + " INTEGER NOT_NULL, " +
            START_TZ_COL + " TEXT NOT NULL, " +
            END_TIME_COL + " INTEGER NOT_NULL, " +
            END_TZ_COL + " TEXT NOT NULL, " +

            REPEATS_COL + " INTEGER NOT NULL, " +
            REPEAT_COUNT_COL + " INTEGER NOT NULL, " +
            REPEAT_UNIT_COL + " INTEGER NOT NULL, " +
            REPEAT_DAYS_OF_WEEK_COL + " INTEGER NOT NULL, " +

            TITLE_COL + " TEXT NOT NULL, " +
            PRE_TEXT_COL + " TEXT, " +
            START_TEXT_COL + " TEXT, " +
            COUNTDOWN_TEXT_COL + " TEXT, " +
            COMPLETE_TEXT_COL + " TEXT, " +
            POST_TEXT_COL + " TEXT, " +

            PRECISION_COL + " INTEGER NOT_NULL, " +

            SHOW_START_COL + " INTEGER NOT_NULL, " +
            SHOW_END_COL + " INTEGER NOT_NULL, " +
            SHOW_PROGRESS_COL + " INTEGER NOT_NULL, " +

            SHOW_YEARS_COL + " INTEGER NOT_NULL, " +
            SHOW_MONTHS_COL + " INTEGER NOT_NULL, " +
            SHOW_WEEKS_COL + " INTEGER NOT_NULL, " +
            SHOW_DAYS_COL + " INTEGER NOT_NULL, " +
            SHOW_HOURS_COL + " INTEGER NOT_NULL, " +
            SHOW_MINUTES_COL + " INTEGER NOT_NULL, " +
            SHOW_SECONDS_COL + " INTEGER NOT_NULL, " +

            TERMINATE_COL + " INTEGER NOT_NULL, " +<commit_msg>fix NOT_NULL -> NOT NULL in Table<commit_after>package org.mattvchandler.progressbars.db;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.provider.BaseColumns;

/*
Copyright (C) 2017 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

// DB Table schema
public class Table implements BaseColumns // TODO: rename
{
    public static final String TABLE_NAME = "progress_bar";

    public static final String ORDER_COL = "order_ind";
    public static final String START_TIME_COL = "start_time";
    public static final String START_TZ_COL = "start_tz";
    public static final String END_TIME_COL = "end_time";
    public static final String END_TZ_COL = "end_tz";

    public static final String REPEATS_COL = "repeats";
    public static final String REPEAT_COUNT_COL = "repeat_count";
    public static final String REPEAT_UNIT_COL = "repeat_unit";
    public static final String REPEAT_DAYS_OF_WEEK_COL = "repeat_days_of_week";

    public static final String TITLE_COL = "title";
    public static final String PRE_TEXT_COL = "pre_text";
    public static final String START_TEXT_COL = "start_text";
    public static final String COUNTDOWN_TEXT_COL = "countdown_text";
    public static final String COMPLETE_TEXT_COL = "complete_text";
    public static final String POST_TEXT_COL = "post_text";

    public static final String PRECISION_COL = "precision";

    public static final String SHOW_START_COL = "show_start";
    public static final String SHOW_END_COL = "show_end";
    public static final String SHOW_PROGRESS_COL = "show_progress";

    public static final String SHOW_YEARS_COL = "show_years";
    public static final String SHOW_MONTHS_COL = "show_months";
    public static final String SHOW_WEEKS_COL = "show_weeks";
    public static final String SHOW_DAYS_COL = "show_days";
    public static final String SHOW_HOURS_COL = "show_hours";
    public static final String SHOW_MINUTES_COL = "show_minutes";
    public static final String SHOW_SECONDS_COL = "show_seconds";

    public static final String TERMINATE_COL = "terminate";
    public static final String NOTIFY_START_COL = "notify_start";
    public static final String NOTIFY_END_COL = "notify_end";

    // Select stmt to get all columns, all rows, ordered by order #
    public static final String SELECT_ALL_ROWS =
            "SELECT * FROM " + TABLE_NAME + " ORDER BY " + ORDER_COL;

    // table schema
    public static final String CREATE_TABLE =
            "CREATE TABLE IF NOT EXISTS " + TABLE_NAME + " (" +
            _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
            ORDER_COL + " INTEGER UNIQUE NOT NULL, " +
            START_TIME_COL + " INTEGER NOT NULL, " +
            START_TZ_COL + " TEXT NOT NULL, " +
            END_TIME_COL + " INTEGER NOT NULL, " +
            END_TZ_COL + " TEXT NOT NULL, " +

            REPEATS_COL + " INTEGER NOT NULL, " +
            REPEAT_COUNT_COL + " INTEGER NOT NULL, " +
            REPEAT_UNIT_COL + " INTEGER NOT NULL, " +
            REPEAT_DAYS_OF_WEEK_COL + " INTEGER NOT NULL, " +

            TITLE_COL + " TEXT NOT NULL, " +
            PRE_TEXT_COL + " TEXT, " +
            START_TEXT_COL + " TEXT, " +
            COUNTDOWN_TEXT_COL + " TEXT, " +
            COMPLETE_TEXT_COL + " TEXT, " +
            POST_TEXT_COL + " TEXT, " +

            PRECISION_COL + " INTEGER NOT NULL, " +

            SHOW_START_COL + " INTEGER NOT NULL, " +
            SHOW_END_COL + " INTEGER NOT NULL, " +
            SHOW_PROGRESS_COL + " INTEGER NOT NULL, " +

            SHOW_YEARS_COL + " INTEGER NOT NULL, " +
            SHOW_MONTHS_COL + " INTEGER NOT NULL, " +
            SHOW_WEEKS_COL + " INTEGER NOT NULL, " +
            SHOW_DAYS_COL + " INTEGER NOT NULL, " +
            SHOW_HOURS_COL + " INTEGER NOT NULL, " +
            SHOW_MINUTES_COL + " INTEGER NOT NULL, " +
            SHOW_SECONDS_COL + " INTEGER NOT NULL, " +

            TERMINATE_COL + " INTEGER NOT NULL, " +
{'fraction_non_alphanumeric': 0.07107306390603225, 'fraction_numerical': 0.0007963368504877563, 'mean_word_length': 3.1413849958779885, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5394819', 'n_tokens_mistral': 3071, 'n_tokens_neox': 2836, 'n_words': 1005}