<commit_before>package eu.nerro.wolappla.provider;

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

import static eu.nerro.wolappla.provider.DeviceContract.DevicesColumns;
import static eu.nerro.wolappla.util.LogUtils.LOGD;
import static eu.nerro.wolappla.util.LogUtils.LOGW;
import static eu.nerro.wolappla.util.LogUtils.makeLogTag;

/**
 * Helper for managing {@link SQLiteDatabase} that stores data for {@link DeviceProvider}.
 */
public class DeviceDatabase extends SQLiteOpenHelper {
  private static final String TAG = makeLogTag(DeviceDatabase.class);

  private static final String DATABASE_NAME = "devices.db";
  private static final int DATABASE_VERSION = 1;

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

  @Override
  public void onCreate(SQLiteDatabase database) {
    database.execSQL("CREATE TABLE " + Tables.DEVICES + " ("
        + BaseColumns._ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
        + DevicesColumns.DEVICE_NAME + " TEXT NOT NULL,"
        + DevicesColumns.DEVICE_MAC_ADDRESS + " TEXT NOT NULL,"
        + DevicesColumns.DEVICE_IP_ADDRESS + " TEXT NOT NULL,"
        + DevicesColumns.DEVICE_PORT + " INTEGER NOT NULL)");
  }

  @Override
  public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) {
    LOGD(TAG, "onUpgrade() from " + oldVersion + " to " + newVersion);

    LOGW(TAG, "Destroying old data during upgrade");
    database.execSQL("DROP TABLE IF EXISTS " + Tables.DEVICES);
    onCreate(database);
  }

  interface Tables {
    String DEVICES = "devices";
  }
}<commit_msg>Add debug logs for creating database<commit_after>package eu.nerro.wolappla.provider;

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

import static eu.nerro.wolappla.provider.DeviceContract.DevicesColumns;
import static eu.nerro.wolappla.util.LogUtils.LOGD;
import static eu.nerro.wolappla.util.LogUtils.LOGW;
import static eu.nerro.wolappla.util.LogUtils.makeLogTag;

/**
 * Helper for managing {@link SQLiteDatabase} that stores data for {@link DeviceProvider}.
 */
public class DeviceDatabase extends SQLiteOpenHelper {
  private static final String TAG = makeLogTag(DeviceDatabase.class);

  private static final String DATABASE_NAME = "devices.db";
  private static final int DATABASE_VERSION = 1;

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

  @Override
  public void onCreate(SQLiteDatabase database) {
    LOGD(TAG, "onCreate() for version " + DATABASE_VERSION);
    database.execSQL("CREATE TABLE " + Tables.DEVICES + " ("
        + BaseColumns._ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
        + DevicesColumns.DEVICE_NAME + " TEXT NOT NULL,"
        + DevicesColumns.DEVICE_MAC_ADDRESS + " TEXT NOT NULL,"
        + DevicesColumns.DEVICE_IP_ADDRESS + " TEXT NOT NULL,"
        + DevicesColumns.DEVICE_PORT + " INTEGER NOT NULL)");
  }

  @Override
  public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) {
    LOGD(TAG, "onUpgrade() from " + oldVersion + " to " + newVersion);

    LOGW(TAG, "Destroying old data during upgrade");
    database.execSQL("DROP TABLE IF EXISTS " + Tables.DEVICES);
    onCreate(database);
  }

  interface Tables {
    String DEVICES = "devices";
  }
}
{'fraction_non_alphanumeric': 0.1002840909090909, 'fraction_numerical': 0.0005681818181818182, 'mean_word_length': 4.359208523592085, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6647287', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1041, 'n_words': 258}