Commit f193e02d authored by Wahyu Wibowo's avatar Wahyu Wibowo
parents 08138e80 d96c6761
<component name="ProjectDictionaryState">
<dictionary name="ABI">
<words>
<w>transaksi</w>
</words>
</dictionary>
</component>
\ No newline at end of file
......@@ -43,13 +43,6 @@ public abstract class LocalDatabase extends RoomDatabase {
}
};
public static final Migration MIGRATION_4_5 = new Migration(4, 5) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("CREATE TABLE IF NOT EXISTS Transaksi (orderId INTEGER NOT NULL, " +
"amount INTEGER NOT NULL, status TEXT NOT NULL, PRIMARY KEY(orderId))");
}
};
public static final Migration MIGRATION_2_3 = new Migration(2,3) {
@Override
......@@ -65,6 +58,13 @@ public abstract class LocalDatabase extends RoomDatabase {
}
};
public static final Migration MIGRATION_4_5 = new Migration(4, 5) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("CREATE TABLE IF NOT EXISTS Transaksi (orderId INTEGER NOT NULL, " +
"amount INTEGER NOT NULL, status TEXT NOT NULL, PRIMARY KEY(orderId))");
}
};
public static LocalDatabase getDatabase(Context context) {
if (INSTANCE == null) {
synchronized (LocalDatabase.class) {
......
......@@ -29,6 +29,12 @@ public class Transaksi implements Parcelable {
status = in.readString();
}
public Transaksi(long orderId, long amount, String status){
this.orderId = orderId;
this.amount = amount;
this.status = status;
}
public static final Creator<Transaksi> CREATOR = new Creator<Transaksi>() {
@Override
public Transaksi createFromParcel(Parcel in) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment