Add url and username to caldav account

pull/645/head
Alex Baker 6 years ago
parent caed986539
commit 104c93053e

@ -2,7 +2,7 @@
"formatVersion": 1,
"database": {
"version": 55,
"identityHash": "1619f332d43a0e3ac67b5e53497149fe",
"identityHash": "298da0475e0b181e5298ea1e05302000",
"entities": [
{
"tableName": "notification",
@ -690,7 +690,7 @@
},
{
"tableName": "caldav_account",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `uuid` TEXT, `name` TEXT, `color` INTEGER NOT NULL, `deleted` INTEGER NOT NULL, `ctag` TEXT)",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `uuid` TEXT, `name` TEXT, `color` INTEGER NOT NULL, `deleted` INTEGER NOT NULL, `ctag` TEXT, `url` TEXT, `username` TEXT)",
"fields": [
{
"fieldPath": "id",
@ -727,6 +727,18 @@
"columnName": "ctag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "username",
"columnName": "username",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
@ -797,7 +809,7 @@
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"1619f332d43a0e3ac67b5e53497149fe\")"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"298da0475e0b181e5298ea1e05302000\")"
]
}
}

@ -32,6 +32,12 @@ public final class CaldavAccount implements Parcelable {
@ColumnInfo(name = "ctag")
private String ctag;
@ColumnInfo(name = "url")
private String url;
@ColumnInfo(name = "username")
private String username;
public CaldavAccount() {
}
@ -44,6 +50,8 @@ public final class CaldavAccount implements Parcelable {
color = source.readInt();
deleted = source.readLong();
ctag = source.readString();
url = source.readString();
username = source.readString();
}
public long getId() {
@ -94,6 +102,22 @@ public final class CaldavAccount implements Parcelable {
this.ctag = ctag;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public boolean isDeleted() {
return deleted > 0;
}
@ -123,6 +147,8 @@ public final class CaldavAccount implements Parcelable {
dest.writeInt(color);
dest.writeLong(deleted);
dest.writeString(ctag);
dest.writeString(url);
dest.writeString(username);
}
@Override
@ -134,6 +160,8 @@ public final class CaldavAccount implements Parcelable {
", color=" + color +
", deleted=" + deleted +
", ctag='" + ctag + '\'' +
", url='" + url + '\'' +
", username='" + username + '\'' +
'}';
}
}

@ -146,7 +146,7 @@ public class Migrations {
private static final Migration MIGRATION_54_55 = new Migration(54, 55) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("CREATE TABLE IF NOT EXISTS `caldav_account` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `uuid` TEXT, `name` TEXT, `color` INTEGER NOT NULL, `deleted` INTEGER NOT NULL, `ctag` TEXT)");
database.execSQL("CREATE TABLE IF NOT EXISTS `caldav_account` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `uuid` TEXT, `name` TEXT, `color` INTEGER NOT NULL, `deleted` INTEGER NOT NULL, `ctag` TEXT, `url` TEXT, `username` TEXT)");
database.execSQL("CREATE TABLE IF NOT EXISTS `caldav_tasks` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `task` INTEGER NOT NULL, `account` TEXT, `remote_id` TEXT, `etag` TEXT, `last_sync` INTEGER NOT NULL, `deleted` INTEGER NOT NULL)");
}
};

Loading…
Cancel
Save