fix
This commit is contained in:
@@ -182,7 +182,7 @@ public class IikoHandler {
|
|||||||
report_type_id INT AUTO_INCREMENT PRIMARY KEY,
|
report_type_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
name VARCHAR(50) UNIQUE NOT NULL,
|
name VARCHAR(50) UNIQUE NOT NULL,
|
||||||
description TEXT NOT NULL
|
description TEXT NOT NULL
|
||||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
|
||||||
""";
|
""";
|
||||||
|
|
||||||
String createFieldsCommon = """
|
String createFieldsCommon = """
|
||||||
@@ -196,7 +196,7 @@ public class IikoHandler {
|
|||||||
aggregation_allowed BOOLEAN NOT NULL DEFAULT 0,
|
aggregation_allowed BOOLEAN NOT NULL DEFAULT 0,
|
||||||
grouping_allowed BOOLEAN NOT NULL DEFAULT 0,
|
grouping_allowed BOOLEAN NOT NULL DEFAULT 0,
|
||||||
filtering_allowed BOOLEAN NOT NULL DEFAULT 0
|
filtering_allowed BOOLEAN NOT NULL DEFAULT 0
|
||||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
|
||||||
""";
|
""";
|
||||||
|
|
||||||
String createReportTypeFields = """
|
String createReportTypeFields = """
|
||||||
@@ -206,14 +206,14 @@ public class IikoHandler {
|
|||||||
PRIMARY KEY (report_type_id, field_id),
|
PRIMARY KEY (report_type_id, field_id),
|
||||||
FOREIGN KEY (report_type_id) REFERENCES iiko_report_types(report_type_id) ON DELETE CASCADE,
|
FOREIGN KEY (report_type_id) REFERENCES iiko_report_types(report_type_id) ON DELETE CASCADE,
|
||||||
FOREIGN KEY (field_id) REFERENCES iiko_fields_common(field_id) ON DELETE CASCADE
|
FOREIGN KEY (field_id) REFERENCES iiko_fields_common(field_id) ON DELETE CASCADE
|
||||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
|
||||||
""";
|
""";
|
||||||
|
|
||||||
String createTags = """
|
String createTags = """
|
||||||
CREATE TABLE IF NOT EXISTS iiko_tags (
|
CREATE TABLE IF NOT EXISTS iiko_tags (
|
||||||
tag_id INT AUTO_INCREMENT PRIMARY KEY,
|
tag_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
tag_name VARCHAR(100) UNIQUE NOT NULL
|
tag_name VARCHAR(100) UNIQUE NOT NULL
|
||||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
|
||||||
""";
|
""";
|
||||||
|
|
||||||
String createFieldTags = """
|
String createFieldTags = """
|
||||||
@@ -223,7 +223,7 @@ public class IikoHandler {
|
|||||||
PRIMARY KEY (field_id, tag_id),
|
PRIMARY KEY (field_id, tag_id),
|
||||||
FOREIGN KEY (field_id) REFERENCES iiko_fields_common(field_id) ON DELETE CASCADE,
|
FOREIGN KEY (field_id) REFERENCES iiko_fields_common(field_id) ON DELETE CASCADE,
|
||||||
FOREIGN KEY (tag_id) REFERENCES iiko_tags(tag_id) ON DELETE CASCADE
|
FOREIGN KEY (tag_id) REFERENCES iiko_tags(tag_id) ON DELETE CASCADE
|
||||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
|
||||||
""";
|
""";
|
||||||
|
|
||||||
String idxKeyNormal = "CREATE INDEX IF NOT EXISTS idx_fields_common_key_normal ON iiko_fields_common(field_key_normal)";
|
String idxKeyNormal = "CREATE INDEX IF NOT EXISTS idx_fields_common_key_normal ON iiko_fields_common(field_key_normal)";
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class OlapQueryService {
|
|||||||
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
FOREIGN KEY (db_connection_id) REFERENCES external_database(id) ON DELETE RESTRICT
|
FOREIGN KEY (db_connection_id) REFERENCES external_database(id) ON DELETE RESTRICT
|
||||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
|
||||||
""";
|
""";
|
||||||
|
|
||||||
String createQueryRestaurantsTable = """
|
String createQueryRestaurantsTable = """
|
||||||
@@ -50,7 +50,7 @@ public class OlapQueryService {
|
|||||||
PRIMARY KEY (query_id, restaurant_id),
|
PRIMARY KEY (query_id, restaurant_id),
|
||||||
FOREIGN KEY (query_id) REFERENCES olap_queries(id) ON DELETE CASCADE,
|
FOREIGN KEY (query_id) REFERENCES olap_queries(id) ON DELETE CASCADE,
|
||||||
FOREIGN KEY (restaurant_id) REFERENCES restaurants(id) ON DELETE CASCADE
|
FOREIGN KEY (restaurant_id) REFERENCES restaurants(id) ON DELETE CASCADE
|
||||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
|
||||||
""";
|
""";
|
||||||
|
|
||||||
return pool.query(createQueriesTable).execute()
|
return pool.query(createQueriesTable).execute()
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ public class ExternalDataBaseService {
|
|||||||
password VARCHAR(255) NOT NULL,
|
password VARCHAR(255) NOT NULL,
|
||||||
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||||
)
|
) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
|
||||||
""";
|
""";
|
||||||
return pool.query(createTable).execute().mapEmpty();
|
return pool.query(createTable).execute().mapEmpty();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class RestaurantService {
|
|||||||
https BOOLEAN DEFAULT FALSE,
|
https BOOLEAN DEFAULT FALSE,
|
||||||
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||||
)
|
) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
|
||||||
""";
|
""";
|
||||||
return pool.query(createTable).execute().mapEmpty();
|
return pool.query(createTable).execute().mapEmpty();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ public class SettingsService {
|
|||||||
CREATE TABLE IF NOT EXISTS app_settings (
|
CREATE TABLE IF NOT EXISTS app_settings (
|
||||||
setting_key VARCHAR(255) PRIMARY KEY,
|
setting_key VARCHAR(255) PRIMARY KEY,
|
||||||
setting_value TEXT
|
setting_value TEXT
|
||||||
)
|
) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
|
||||||
""";
|
""";
|
||||||
return pool.query(createTable).execute()
|
return pool.query(createTable).execute()
|
||||||
.compose(v -> setIfAbsent("site_name", "Admin Panel"))
|
.compose(v -> setIfAbsent("site_name", "Admin Panel"))
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class UserService {
|
|||||||
ip VARCHAR(45),
|
ip VARCHAR(45),
|
||||||
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||||
)
|
) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
|
||||||
""";
|
""";
|
||||||
return pool.query(createTable).execute().mapEmpty();
|
return pool.query(createTable).execute().mapEmpty();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user