package com.nbusy.app.data.sqldb;

import android.provider.BaseColumns;

public final class SQLTables {

    private SQLTables() {}

    public static abstract class ProfileTable implements BaseColumns {
        public static final String TABLE_NAME = "user_profile";
        public static final String USER_ID = "user_id";
        public static final String JWT_TOKEN = "jwt_token";
        public static final String NAME = "name";
        public static final String EMAIL = "email";
        public static final String PICTURE = "picture";
        public static final String CHATS = "chats";
    }

    private static final String TEXT_TYPE = " TEXT";
    private static final String COMMA_SEP = ",";
    private static final String SQL_CREATE_ENTRIES =
            "CREATE TABLE " + ProfileTable.TABLE_NAME + " (" +
                    ProfileTable._ID + " INTEGER PRIMARY KEY," +
                    ProfileTable.USER_ID + TEXT_TYPE + COMMA_SEP +
                    ProfileTable.JWT_TOKEN + TEXT_TYPE + COMMA_SEP +
                    ProfileTable.NAME + TEXT_TYPE + COMMA_SEP +
                    ProfileTable.EMAIL + TEXT_TYPE + COMMA_SEP +
//                    ProfileTable.PICTURE + IMAGE_TYPE + COMMA_SEP +
//                    ProfileTable.CHATS + REF_TYPE + COMMA_SEP +
            " )";

    private static final String SQL_DELETE_ENTRIES = "DROP TABLE IF EXISTS " + ProfileTable.TABLE_NAME;
}

@@ -127,478 +127,171 @@
 () %7B
-%7D%0A
 %0A    
-public static abstract class ProfileTable implements BaseColumns %7B%0A        public static final String TABLE_NAME = %22user_profile%22;%0A        public static final String USER_ID = %22user_id%22;%0A        public static final String JWT_TOKEN = %22jwt_token%22;%0A        public static final String NAME = %22name
+%7D%0A%0A    private static final String COMMA_SEP = %22,%22;%0A%0A    private static final String TEXT_TYPE = %22 TEXT
 %22;%0A    
-  
-  public static final String EMAIL = %22email%22;%0A        public static final String PICTURE = %22picture%22;%0A        public static final String CHATS = %22chats%22;%0A    %7D%0A
+private static final String BLOB_TYPE = %22 BLOB%22;
 %0A   
@@ -311,36 +311,39 @@
 ic final String 
-TEXT
+INTEGER
 _TYPE = %22 TEXT%22;
@@ -340,64 +340,19 @@
 = %22 
-TEXT%22;%0A    private static final String COMMA_SEP = %22,
+INTEGER
 %22;%0A
+%0A
     
@@ -785,34 +785,32 @@
 E + COMMA_SEP +%0A
-//
                 
@@ -840,13 +840,12 @@
 E + 
-IMAGE
+BLOB
 _TYP
@@ -886,173 +886,856 @@
     
-ProfileTable.CHATS + REF_TYPE + COMMA_SEP +%0A            %22 )%22;%0A%0A    private static final String SQL_DELETE_ENTRIES = %22DROP TABLE IF EXISTS %22 + ProfileTable.TABLE_NAME;
+%22FOREIGN KEY(%22 + ProfileTable.TABLE_NAME + Chats.TABLE_NAME + %22) REFERENCES %22 + Chats.TABLE_NAME + %22(%22 + Chats._ID + %22)%22 +%0A                    %22 )%22;%0A%0A    private static final String SQL_DELETE_ENTRIES = %22DROP TABLE IF EXISTS %22 + ProfileTable.TABLE_NAME;%0A%0A    public static abstract class ProfileTable implements BaseColumns %7B%0A        public static final String TABLE_NAME = %22user_profile%22;%0A        public static final String USER_ID = %22user_id%22;%0A        public static final String JWT_TOKEN = %22jwt_token%22;%0A        public static final String NAME = %22name%22;%0A        public static final String EMAIL = %22email%22;%0A        public static final String PICTURE = %22picture%22;%0A        public static final String CHATS = %22chats%22;%0A    %7D%0A%0A    public static abstract class Chats implements BaseColumns %7B%0A        public static final String TABLE_NAME = %22chats%22;%0A    %7D
 %0A%7D%0A

add foreign key stub