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, "formatVersion": 1,
"database": { "database": {
"version": 55, "version": 55,
"identityHash": "1619f332d43a0e3ac67b5e53497149fe", "identityHash": "298da0475e0b181e5298ea1e05302000",
"entities": [ "entities": [
{ {
"tableName": "notification", "tableName": "notification",
@ -690,7 +690,7 @@
}, },
{ {
"tableName": "caldav_account", "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": [ "fields": [
{ {
"fieldPath": "id", "fieldPath": "id",
@ -727,6 +727,18 @@
"columnName": "ctag", "columnName": "ctag",
"affinity": "TEXT", "affinity": "TEXT",
"notNull": false "notNull": false
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "username",
"columnName": "username",
"affinity": "TEXT",
"notNull": false
} }
], ],
"primaryKey": { "primaryKey": {
@ -797,7 +809,7 @@
], ],
"setupQueries": [ "setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", "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") @ColumnInfo(name = "ctag")
private String ctag; private String ctag;
@ColumnInfo(name = "url")
private String url;
@ColumnInfo(name = "username")
private String username;
public CaldavAccount() { public CaldavAccount() {
} }
@ -44,6 +50,8 @@ public final class CaldavAccount implements Parcelable {
color = source.readInt(); color = source.readInt();
deleted = source.readLong(); deleted = source.readLong();
ctag = source.readString(); ctag = source.readString();
url = source.readString();
username = source.readString();
} }
public long getId() { public long getId() {
@ -94,6 +102,22 @@ public final class CaldavAccount implements Parcelable {
this.ctag = ctag; 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() { public boolean isDeleted() {
return deleted > 0; return deleted > 0;
} }
@ -123,6 +147,8 @@ public final class CaldavAccount implements Parcelable {
dest.writeInt(color); dest.writeInt(color);
dest.writeLong(deleted); dest.writeLong(deleted);
dest.writeString(ctag); dest.writeString(ctag);
dest.writeString(url);
dest.writeString(username);
} }
@Override @Override
@ -134,6 +160,8 @@ public final class CaldavAccount implements Parcelable {
", color=" + color + ", color=" + color +
", deleted=" + deleted + ", deleted=" + deleted +
", ctag='" + ctag + '\'' + ", ctag='" + ctag + '\'' +
", url='" + url + '\'' +
", username='" + username + '\'' +
'}'; '}';
} }
} }

@ -146,7 +146,7 @@ public class Migrations {
private static final Migration MIGRATION_54_55 = new Migration(54, 55) { private static final Migration MIGRATION_54_55 = new Migration(54, 55) {
@Override @Override
public void migrate(@NonNull SupportSQLiteDatabase database) { 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)"); 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