mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-10 17:31:36 +01:00
Removed Table#removeAllData
This commit is contained in:
parent
bdcba82735
commit
5e8cbf1a88
@ -101,13 +101,6 @@ public abstract class Table {
|
|||||||
return tableName;
|
return tableName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes all data from the table.
|
|
||||||
*/
|
|
||||||
public void removeAllData() {
|
|
||||||
db.execute("DELETE FROM " + tableName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return tableName;
|
return tableName;
|
||||||
|
@ -55,16 +55,11 @@ public class BatchOperationTable extends Table {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void removeAllData() {
|
|
||||||
db.executeTransaction(new RemoveEverythingTransaction());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void copyEverything(BatchOperationTable toDB) {
|
public void copyEverything(BatchOperationTable toDB) {
|
||||||
if (toDB.equals(this)) {
|
if (toDB.equals(this)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
toDB.removeAllData();
|
toDB.db.executeTransaction(new RemoveEverythingTransaction());
|
||||||
|
|
||||||
copyServers(toDB);
|
copyServers(toDB);
|
||||||
copyUsers(toDB);
|
copyUsers(toDB);
|
||||||
|
@ -33,7 +33,6 @@ public class SQLBackupOps extends SQLOps implements BackupOperations {
|
|||||||
BatchOperationTable toDB = new BatchOperationTable((SQLDB) toDatabase);
|
BatchOperationTable toDB = new BatchOperationTable((SQLDB) toDatabase);
|
||||||
BatchOperationTable fromDB = new BatchOperationTable(db);
|
BatchOperationTable fromDB = new BatchOperationTable(db);
|
||||||
|
|
||||||
toDB.removeAllData();
|
|
||||||
fromDB.copyEverything(toDB);
|
fromDB.copyEverything(toDB);
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Database was not a SQL database - backup not implemented.");
|
throw new IllegalArgumentException("Database was not a SQL database - backup not implemented.");
|
||||||
|
Loading…
Reference in New Issue
Block a user