Merge pull request #5173 from eugene7646/image_gallery_paths_5418

Modified IG tables to store strings as TEXT instead of VARCHAR(255)
This commit is contained in:
Richard Cordovano 2019-09-12 14:32:40 -04:00 committed by GitHub
commit 74550f2698
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -572,12 +572,12 @@ public final class DrawableDB {
String sql = "CREATE TABLE if not exists drawable_files " //NON-NLS String sql = "CREATE TABLE if not exists drawable_files " //NON-NLS
+ "( obj_id BIGINT PRIMARY KEY, " //NON-NLS + "( obj_id BIGINT PRIMARY KEY, " //NON-NLS
+ " data_source_obj_id BIGINT NOT NULL, " + " data_source_obj_id BIGINT NOT NULL, "
+ " path VARCHAR(255), " //NON-NLS + " path TEXT, " //NON-NLS
+ " name VARCHAR(255), " //NON-NLS + " name TEXT, " //NON-NLS
+ " created_time integer, " //NON-NLS + " created_time integer, " //NON-NLS
+ " modified_time integer, " //NON-NLS + " modified_time integer, " //NON-NLS
+ " make VARCHAR(255) DEFAULT NULL, " //NON-NLS + " make TEXT DEFAULT NULL, " //NON-NLS
+ " model VARCHAR(255) DEFAULT NULL, " //NON-NLS + " model TEXT DEFAULT NULL, " //NON-NLS
+ " analyzed integer DEFAULT 0)"; //NON-NLS + " analyzed integer DEFAULT 0)"; //NON-NLS
stmt.execute(sql); stmt.execute(sql);
} catch (SQLException ex) { } catch (SQLException ex) {
@ -588,7 +588,7 @@ public final class DrawableDB {
try { try {
String sql = "CREATE TABLE if not exists hash_sets " //NON-NLS String sql = "CREATE TABLE if not exists hash_sets " //NON-NLS
+ "( hash_set_id INTEGER primary key," //NON-NLS + "( hash_set_id INTEGER primary key," //NON-NLS
+ " hash_set_name VARCHAR(255) UNIQUE NOT NULL)"; //NON-NLS + " hash_set_name TEXT UNIQUE NOT NULL)"; //NON-NLS
stmt.execute(sql); stmt.execute(sql);
} catch (SQLException ex) { } catch (SQLException ex) {
logger.log(Level.SEVERE, "Failed to create hash_sets table", ex); //NON-NLS logger.log(Level.SEVERE, "Failed to create hash_sets table", ex); //NON-NLS
@ -692,8 +692,8 @@ public final class DrawableDB {
String tableSchema String tableSchema
= "( group_id " + autogenKeyType + " PRIMARY KEY, " //NON-NLS = "( group_id " + autogenKeyType + " PRIMARY KEY, " //NON-NLS
+ " data_source_obj_id BIGINT DEFAULT 0, " + " data_source_obj_id BIGINT DEFAULT 0, "
+ " value VARCHAR(255) not null, " //NON-NLS + " value TEXT not null, " //NON-NLS
+ " attribute VARCHAR(255) not null, " //NON-NLS + " attribute TEXT not null, " //NON-NLS
+ " is_analyzed integer DEFAULT 0, " + " is_analyzed integer DEFAULT 0, "
+ " UNIQUE(data_source_obj_id, value, attribute) )"; //NON-NLS + " UNIQUE(data_source_obj_id, value, attribute) )"; //NON-NLS