Skip to content

Commit 0fdc187

Browse files
committed
DROP TABLE before CREATE log_event_dropped
1 parent 5c63279 commit 0fdc187

File tree

1 file changed

+2
-1
lines changed
  • transport/transport-runtime/src/main/java/com/google/android/datatransport/runtime/scheduling/persistence

1 file changed

+2
-1
lines changed

transport/transport-runtime/src/main/java/com/google/android/datatransport/runtime/scheduling/persistence/SchemaManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ final class SchemaManager extends SQLiteOpenHelper {
8484
private static final String DROP_PAYLOADS_SQL = "DROP TABLE IF EXISTS event_payloads";
8585

8686
private static final String CREATE_LOG_EVENT_DROPPED_TABLE =
87-
"CREATE TABLE IF NOT EXISTS log_event_dropped "
87+
"CREATE TABLE log_event_dropped "
8888
+ "(log_source VARCHAR(45) NOT NULL,"
8989
+ "reason INTEGER NOT NULL,"
9090
+ "events_dropped_count BIGINT NOT NULL,"
@@ -131,6 +131,7 @@ final class SchemaManager extends SQLiteOpenHelper {
131131

132132
private static final SchemaManager.Migration MIGRATION_TO_V5 =
133133
db -> {
134+
db.execSQL(DROP_LOG_EVENT_DROPPED_SQL);
134135
db.execSQL(CREATE_LOG_EVENT_DROPPED_TABLE);
135136
db.execSQL(CREATE_GLOBAL_LOG_EVENT_STATE_TABLE);
136137
db.execSQL(CREATE_INITIAL_GLOBAL_LOG_EVENT_STATE_VALUE_SQL);

0 commit comments

Comments
 (0)