availability serf reference;

fix copying last month;
This commit is contained in:
Dobromir Popov
2024-03-28 22:55:35 +02:00
parent a6b7c62768
commit a26dd954c0
11 changed files with 163 additions and 90 deletions

View File

@ -4,12 +4,18 @@
- You are about to drop the column `isTentative` on the `Assignment` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE `Assignment`
ADD COLUMN `isBySystem` BOOLEAN NOT NULL DEFAULT false;
ALTER TABLE `Assignment`
ADD COLUMN `isBySystem` BOOLEAN NOT NULL DEFAULT FALSE;
-- Depending on your DBMS, you might need to execute one statement at a time.
-- Especially, the UPDATE statement should be run separately.
UPDATE `Assignment` SET `isBySystem` = isTentative;
ALTER TABLE `Assignment` DROP COLUMN `isTentative`,
-- Drop the isTentative column
ALTER TABLE `Assignment` DROP COLUMN `isTentative`;
-- AlterTable
ALTER TABLE `Report` ADD COLUMN `type` ENUM('ServiceReport', 'Experience', 'Feedback_Problem', 'Feedback_Suggestion', 'Feedback') NOT NULL DEFAULT 'ServiceReport';
ALTER TABLE `Report`
ADD COLUMN `type` ENUM('ServiceReport', 'Experience', 'Feedback_Problem', 'Feedback_Suggestion', 'Feedback') NOT NULL DEFAULT 'ServiceReport';

View File

@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE `availability` ADD COLUMN `parentAvailabilityId` INTEGER NULL;
-- AddForeignKey
ALTER TABLE `Availability` ADD CONSTRAINT `Availability_parentAvailabilityId_fkey` FOREIGN KEY (`parentAvailabilityId`) REFERENCES `Availability`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

View File

@ -141,7 +141,10 @@ model Availability {
repeatWeekly Boolean? // New field to indicate weekly repetition // until now dayofweek was used for repetition when dayOfMonth is null
repeatFrequency Int? // New field to indicate repetition frequency
endDate DateTime? // New field for the end date of repetition
dateOfEntry DateTime? //NEW v1.0.1 trade storage for intuintivity
dateOfEntry DateTime? //NEW v1.0.1
parentAvailabilityId Int?
parentAvailability Availability? @relation("ParentAvailability", fields: [parentAvailabilityId], references: [id])
ChildAvailabilities Availability[] @relation("ParentAvailability")
}
model CartEvent {