diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-08-24 20:53:13 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-08-24 20:53:13 +0200 |
commit | 4e791c8a01b1c2eee1b6a5ba870085e924337f6b (patch) | |
tree | 77af0471431e3ab23e53a85a27cdd8bcf4804ef4 /src/eu/siacs/conversations/persistance | |
parent | dce001369dd420a4ddc58018c5ba2e692a9e094f (diff) |
fixed faulty db creation on first install
Diffstat (limited to 'src/eu/siacs/conversations/persistance')
-rw-r--r-- | src/eu/siacs/conversations/persistance/DatabaseBackend.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/eu/siacs/conversations/persistance/DatabaseBackend.java index 20cc6fb75..62736ffa3 100644 --- a/src/eu/siacs/conversations/persistance/DatabaseBackend.java +++ b/src/eu/siacs/conversations/persistance/DatabaseBackend.java @@ -27,10 +27,11 @@ public class DatabaseBackend extends SQLiteOpenHelper { + Contact.SERVERNAME + " TEXT, " + Contact.SYSTEMNAME + " TEXT," + Contact.JID + " TEXT," + Contact.KEYS + " TEXT," + Contact.PHOTOURI + " TEXT," + Contact.OPTIONS + " NUMBER," - + Contact.SYSTEMACCOUNT + " NUMBER, " + "FOREIGN KEY(" - + Contact.ACCOUNT + ") REFERENCES " + Account.TABLENAME + "(" - + Account.UUID + ") ON DELETE CASCADE, UNIQUE(" + Contact.ACCOUNT - + ", " + Contact.JID + ") ON CONFLICT REPLACE);"; + + Contact.SYSTEMACCOUNT + " NUMBER, " + Contact.AVATAR + " TEXT, " + + "FOREIGN KEY(" + Contact.ACCOUNT + ") REFERENCES " + + Account.TABLENAME + "(" + Account.UUID + + ") ON DELETE CASCADE, UNIQUE(" + Contact.ACCOUNT + ", " + + Contact.JID + ") ON CONFLICT REPLACE);"; public DatabaseBackend(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); @@ -43,7 +44,8 @@ public class DatabaseBackend extends SQLiteOpenHelper { + " TEXT PRIMARY KEY," + Account.USERNAME + " TEXT," + Account.SERVER + " TEXT," + Account.PASSWORD + " TEXT," + Account.ROSTERVERSION + " TEXT," + Account.OPTIONS - + " NUMBER, " + Account.KEYS + " TEXT)"); + + " NUMBER, " + Account.AVATAR + " TEXT, " + Account.KEYS + + " TEXT)"); db.execSQL("create table " + Conversation.TABLENAME + " (" + Conversation.UUID + " TEXT PRIMARY KEY, " + Conversation.NAME + " TEXT, " + Conversation.CONTACT + " TEXT, " @@ -58,10 +60,11 @@ public class DatabaseBackend extends SQLiteOpenHelper { + Message.TIME_SENT + " NUMBER, " + Message.COUNTERPART + " TEXT, " + Message.TRUE_COUNTERPART + " TEXT," + Message.BODY + " TEXT, " + Message.ENCRYPTION + " NUMBER, " - + Message.STATUS + " NUMBER," + Message.TYPE - + " NUMBER, FOREIGN KEY(" + Message.CONVERSATION - + ") REFERENCES " + Conversation.TABLENAME + "(" - + Conversation.UUID + ") ON DELETE CASCADE);"); + + Message.STATUS + " NUMBER," + Message.TYPE + " NUMBER, " + + Message.REMOTE_MSG_ID + " TEXT, FOREIGN KEY(" + + Message.CONVERSATION + ") REFERENCES " + + Conversation.TABLENAME + "(" + Conversation.UUID + + ") ON DELETE CASCADE);"); db.execSQL(CREATE_CONTATCS_STATEMENT); } |