Establish consistency in the terminology used for updation timestamp

This commit is contained in:
Vishnu Mohandas 2020-07-14 03:33:58 +05:30
parent e7a1e93e90
commit da94f954a5
3 changed files with 12 additions and 13 deletions

View file

@ -183,12 +183,11 @@ class FileDB {
}
}
Future<int> update(
int generatedId, int uploadedId, int updateTimestamp) async {
Future<int> update(int generatedId, int uploadedId, int updationTime) async {
final db = await instance.database;
final values = new Map<String, dynamic>();
values[columnUploadedFileId] = uploadedId;
values[columnUpdationTime] = updateTimestamp;
values[columnUpdationTime] = updationTime;
return await db.update(
table,
values,

View file

@ -18,7 +18,7 @@ class FolderDB {
static final columnOwner = 'owner';
static final columnDeviceFolder = 'device_folder';
static final columnSharedWith = 'shared_with';
static final columnUpdateTimestamp = 'update_timestamp';
static final columnUpdationTime = 'updation_time';
FolderDB._privateConstructor();
static final FolderDB instance = FolderDB._privateConstructor();
@ -45,7 +45,7 @@ class FolderDB {
$columnOwner TEXT NOT NULL,
$columnDeviceFolder TEXT NOT NULL,
$columnSharedWith TEXT NOT NULL,
$columnUpdateTimestamp INTEGER NOT NULL,
$columnUpdationTime INTEGER NOT NULL,
UNIQUE($columnOwner, $columnDeviceFolder)
)
''');
@ -61,7 +61,7 @@ class FolderDB {
final db = await instance.database;
final results = await db.query(
table,
orderBy: '$columnUpdateTimestamp DESC',
orderBy: '$columnUpdationTime DESC',
);
return _convertToFolders(results);
}
@ -90,7 +90,7 @@ class FolderDB {
row[columnOwner] = folder.owner;
row[columnDeviceFolder] = folder.deviceFolder;
row[columnSharedWith] = jsonEncode(folder.sharedWith.toList());
row[columnUpdateTimestamp] = folder.updateTimestamp;
row[columnUpdationTime] = folder.updationTime;
return row;
}
@ -103,7 +103,7 @@ class FolderDB {
(jsonDecode(row[columnSharedWith]) as List<dynamic>)
.cast<String>()
.toSet(),
row[columnUpdateTimestamp],
row[columnUpdationTime],
);
}
}

View file

@ -8,7 +8,7 @@ class Folder {
final String owner;
final String deviceFolder;
final Set<String> sharedWith;
final int updateTimestamp;
final int updationTime;
File thumbnailPhoto;
Folder(
@ -17,7 +17,7 @@ class Folder {
this.owner,
this.deviceFolder,
this.sharedWith,
this.updateTimestamp,
this.updationTime,
);
static Folder fromMap(Map<String, dynamic> map) {
@ -29,13 +29,13 @@ class Folder {
map['owner'],
map['deviceFolder'],
Set<String>.from(map['sharedWith']),
map['updateTimestamp'],
map['updationTime'],
);
}
@override
String toString() {
return 'Folder(id: $id, name: $name, owner: $owner, deviceFolder: $deviceFolder, sharedWith: $sharedWith, updateTimestamp: $updateTimestamp)';
return 'Folder(id: $id, name: $name, owner: $owner, deviceFolder: $deviceFolder, sharedWith: $sharedWith, updationTime: $updationTime)';
}
Map<String, dynamic> toMap() {
@ -45,7 +45,7 @@ class Folder {
'owner': owner,
'deviceFolder': deviceFolder,
'sharedWith': sharedWith.toList(),
'updateTimestamp': updateTimestamp,
'updationTime': updationTime,
};
}