File tree Expand file tree Collapse file tree 5 files changed +57
-8
lines changed
src/main/java/com/amit/db Expand file tree Collapse file tree 5 files changed +57
-8
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ group = 'com.github.amitjangid80'
10
10
11
11
android {
12
12
compileSdkVersion 28
13
- buildToolsVersion " 28.0.3"
14
13
15
14
defaultConfig {
16
15
minSdkVersion 19
@@ -49,11 +48,11 @@ dependencies {
49
48
implementation " com.android.support:appcompat-v7:$supportLibraryVersion "
50
49
implementation ' com.android.support.constraint:constraint-layout:1.1.3'
51
50
52
- implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1 '
53
- implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0 '
51
+ implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2 '
52
+ implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.2 '
54
53
55
54
// RxJava dependencies
56
- implementation ' io.reactivex.rxjava2:rxandroid:2.1.0 '
55
+ implementation ' io.reactivex.rxjava2:rxandroid:2.1.1 '
57
56
58
57
// kotlin dependencies
59
58
implementation" org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion "
Original file line number Diff line number Diff line change @@ -797,6 +797,56 @@ public boolean isTableExists(String tableName)
797
797
}
798
798
}
799
799
800
+ /**
801
+ * 2019 November 19 - Tuesday - 12:49 PM
802
+ * check if column exists method
803
+ *
804
+ * this method will check if a column in a table exists or not
805
+ *
806
+ * @param tableName - table name to check for column name
807
+ *
808
+ * @param columnName - column name to check if exists or not
809
+ *
810
+ * @return returns true if column exists in table or false if not
811
+ **/
812
+ private boolean checkIsColumnExists (String tableName , String columnName )
813
+ {
814
+ try
815
+ {
816
+ boolean isExists = false ;
817
+
818
+ String query = "PRAGMA TABLE_INFO('" + tableName + "')" ;
819
+ Cursor cursor = db .getWritableDatabase ().rawQuery (query , null );
820
+
821
+ if (cursor != null && cursor .moveToFirst ())
822
+ {
823
+ for (int i = 0 ; i < cursor .getCount (); i ++)
824
+ {
825
+ String currentColumnName = cursor .getString (cursor .getColumnIndex ("name" ));
826
+
827
+ if (currentColumnName .equalsIgnoreCase (columnName ))
828
+ {
829
+ isExists = true ;
830
+ Log .e (TAG , "checkIsColumnExists: " + columnName + " found in table " + tableName );
831
+ }
832
+
833
+ cursor .moveToNext ();
834
+ }
835
+
836
+ cursor .close ();
837
+ }
838
+
839
+ return isExists ;
840
+ }
841
+ catch (Exception e )
842
+ {
843
+ Log .e (TAG , "checkIsColumnExists: exception while checking if column exists or not\n " );
844
+ e .printStackTrace ();
845
+
846
+ return false ;
847
+ }
848
+ }
849
+
800
850
//#region COMMENTS FOR getMaxId method
801
851
/**
802
852
* 2018 August 13 - Monday - 12:34 PM
Original file line number Diff line number Diff line change 1
1
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2
2
3
3
buildscript {
4
- ext. kotlinVersion = ' 1.3.41 '
4
+ ext. kotlinVersion = ' 1.3.60 '
5
5
ext. supportLibraryVersion = ' 28.0.0'
6
6
7
7
repositories {
@@ -10,7 +10,7 @@ buildscript {
10
10
}
11
11
12
12
dependencies {
13
- classpath ' com.android.tools.build:gradle:3.4 .2'
13
+ classpath ' com.android.tools.build:gradle:3.5 .2'
14
14
classpath ' com.github.dcendents:android-maven-gradle-plugin:2.1'
15
15
classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion "
16
16
Original file line number Diff line number Diff line change 1
- # Wed Jun 12 16:30:54 IST 2019
1
+ # Wed Oct 16 12:44:32 IST 2019
2
2
distributionBase =GRADLE_USER_HOME
3
3
distributionPath =wrapper/dists
4
4
zipStoreBase =GRADLE_USER_HOME
5
5
zipStorePath =wrapper/dists
6
- distributionUrl =https\://services.gradle.org/distributions/gradle-5.1 .1-all.zip
6
+ distributionUrl =https\://services.gradle.org/distributions/gradle-5.4 .1-all.zip
You can’t perform that action at this time.
0 commit comments