Merge branch 'tibor' into 'master'
API 1.0.16 ExerciseDevice.sort, place See merge request bossanyit/aitrainer_server!27
This commit is contained in:
commit
75a1d57302
@ -11,7 +11,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.aitrainer"
|
group = "com.aitrainer"
|
||||||
version = "1.0.15"
|
version = "1.0.16"
|
||||||
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -374,6 +374,8 @@ CREATE TABLE `customer_property` (
|
|||||||
`property_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
`property_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
`property_value` DOUBLE UNSIGNED NOT NULL DEFAULT '0',
|
`property_value` DOUBLE UNSIGNED NOT NULL DEFAULT '0',
|
||||||
`date_add` DATETIME NULL DEFAULT NULL,
|
`date_add` DATETIME NULL DEFAULT NULL,
|
||||||
|
`sort` INT(11) NULL DEFAULT '0',
|
||||||
|
`place` TINYINT(4) NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`customer_property_id`) USING BTREE
|
PRIMARY KEY (`customer_property_id`) USING BTREE
|
||||||
)
|
)
|
||||||
COLLATE='utf8_hungarian_ci'
|
COLLATE='utf8_hungarian_ci'
|
||||||
@ -391,9 +393,11 @@ COLLATE='utf8_hungarian_ci'
|
|||||||
ENGINE=InnoDB
|
ENGINE=InnoDB
|
||||||
;
|
;
|
||||||
|
|
||||||
INSERT INTO `exercise_device` (`exercise_device_id`, `name`, `description`, `image_url`) VALUES (1, 'Weight', NULL, NULL);
|
INSERT INTO `exercise_device` (`exercise_device_id`, `name`, `description`, `image_url`, `sort`, `place`) VALUES (1, 'Weight', NULL, NULL, 5, 0);
|
||||||
INSERT INTO `exercise_device` (`exercise_device_id`, `name`, `description`, `image_url`) VALUES (2, 'Own Weight', NULL, NULL);
|
INSERT INTO `exercise_device` (`exercise_device_id`, `name`, `description`, `image_url`, `sort`, `place`) VALUES (2, 'Own Weight', NULL, NULL, 4, 0);
|
||||||
|
INSERT INTO `exercise_device` (`exercise_device_id`, `name`, `description`, `image_url`, `sort`, `place`) VALUES (3, 'Machine', '', 'images/csengo2.png', 3, 0);
|
||||||
|
INSERT INTO `exercise_device` (`exercise_device_id`, `name`, `description`, `image_url`, `sort`, `place`) VALUES (4, 'HOME', NULL, NULL, 1, 1);
|
||||||
|
INSERT INTO `exercise_device` (`exercise_device_id`, `name`, `description`, `image_url`, `sort`, `place`) VALUES (5, 'STREET', NULL, NULL, 2, 1);
|
||||||
|
|
||||||
CREATE TABLE `exercise_device_translation` (
|
CREATE TABLE `exercise_device_translation` (
|
||||||
`translation_id` INT(11) NOT NULL AUTO_INCREMENT,
|
`translation_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
5
data/db/update_1_0_16.sql
Normal file
5
data/db/update_1_0_16.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
ALTER TABLE `exercise_device`
|
||||||
|
ADD COLUMN `sort` INT NULL DEFAULT '0' AFTER `image_url`,
|
||||||
|
ADD COLUMN `place` TINYINT NULL DEFAULT '0' AFTER `sort`;
|
||||||
|
|
||||||
|
UPDATE configuration set config_value = "1.0.16", date_change=CURRENT_DATE WHERE config_key = "db_version";
|
@ -13,7 +13,9 @@ data class ExerciseDevice (
|
|||||||
|
|
||||||
@get: NotBlank var name: String = "",
|
@get: NotBlank var name: String = "",
|
||||||
@get: NotBlank var description: String = "",
|
@get: NotBlank var description: String = "",
|
||||||
@get: NotBlank var imageUrl: String = ""
|
@get: NotBlank var imageUrl: String = "",
|
||||||
|
@get: NotBlank var sort: Int = 0,
|
||||||
|
@get: NotBlank var place: Int = 0
|
||||||
){
|
){
|
||||||
@OneToMany(cascade = [(CascadeType.ALL)], fetch = FetchType.EAGER, mappedBy = "exerciseDevice")
|
@OneToMany(cascade = [(CascadeType.ALL)], fetch = FetchType.EAGER, mappedBy = "exerciseDevice")
|
||||||
@Fetch(value = FetchMode.SUBSELECT)
|
@Fetch(value = FetchMode.SUBSELECT)
|
||||||
|
@ -16,6 +16,6 @@ logging.config=classpath:logback-spring.xml
|
|||||||
logging.file=logs
|
logging.file=logs
|
||||||
|
|
||||||
# if the database structure has been changed, increment this version number
|
# if the database structure has been changed, increment this version number
|
||||||
application.version=1.0.15
|
application.version=1.0.16
|
||||||
|
|
||||||
jwt.secret=aitrainer
|
jwt.secret=aitrainer
|
@ -16,6 +16,6 @@ logging.config=classpath:logback-spring.xml
|
|||||||
logging.file=logs
|
logging.file=logs
|
||||||
|
|
||||||
# if the database structure has been changed, increment this version number
|
# if the database structure has been changed, increment this version number
|
||||||
application.version=1.0.15
|
application.version=1.0.16
|
||||||
|
|
||||||
jwt.secret=aitrainer
|
jwt.secret=aitrainer
|
@ -26,10 +26,11 @@ class ExerciseDeviceTest {
|
|||||||
|
|
||||||
assertTrue(properties is List)
|
assertTrue(properties is List)
|
||||||
assertTrue(properties.isNotEmpty())
|
assertTrue(properties.isNotEmpty())
|
||||||
assertEquals(properties.size, 3)
|
assertEquals(properties.size, 5)
|
||||||
assertEquals(properties[0].name, "Weight")
|
assertEquals(properties[0].name, "Weight")
|
||||||
assertEquals(properties[0].translations[0].name, "Súlyzó")
|
assertEquals(properties[0].translations[0].name, "Súlyzó")
|
||||||
assertEquals(properties[1].name, "Own Weight")
|
assertEquals(properties[1].name, "Own Weight")
|
||||||
|
assertEquals(properties[3].place, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user