feat(DiaryDateActivity, DiaryView): integrate groupId for enhanced activity management
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 42s
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 42s
- Added `groupId` field to the DiaryDateActivity model to support group-specific activities. - Updated create and update methods in DiaryDateActivityService to handle groupId, ensuring proper validation and association with groups. - Enhanced DiaryView component to allow selection of groups for activities, improving user experience and activity organization. - Implemented filtering logic in DiaryView to display activities based on selected group, enhancing data clarity and usability.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
ALTER TABLE `diary_date_activities`
|
||||
ADD COLUMN `group_id` INT NULL AFTER `predefined_activity_id`,
|
||||
ADD CONSTRAINT `fk_diary_date_activities_group_id`
|
||||
FOREIGN KEY (`group_id`) REFERENCES `group`(`id`)
|
||||
ON DELETE SET NULL
|
||||
ON UPDATE CASCADE;
|
||||
|
||||
INSERT INTO `diary_date_activities` (
|
||||
`diary_date_id`,
|
||||
`is_timeblock`,
|
||||
`predefined_activity_id`,
|
||||
`group_id`,
|
||||
`duration`,
|
||||
`duration_text`,
|
||||
`order_id`,
|
||||
`created_at`,
|
||||
`updated_at`
|
||||
)
|
||||
SELECT
|
||||
d.`diary_date_id`,
|
||||
0 AS `is_timeblock`,
|
||||
ga.`custom_activity` AS `predefined_activity_id`,
|
||||
ga.`group_id`,
|
||||
ga.`duration`,
|
||||
ga.`duration_text`,
|
||||
(d.`order_id` * 100) + COALESCE(ga.`order_id`, 1) AS `order_id`,
|
||||
COALESCE(ga.`created_at`, NOW()) AS `created_at`,
|
||||
COALESCE(ga.`updated_at`, NOW()) AS `updated_at`
|
||||
FROM `group_activity` ga
|
||||
INNER JOIN `diary_date_activities` d ON d.`id` = ga.`diary_date_activity`;
|
||||
Reference in New Issue
Block a user