From ef635a2ee48fe48a1146de1912612b807281f307 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 20 May 2021 02:18:54 -0600 Subject: [PATCH] Add Notes attribute to Resident model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Mutations 👽 nullable fields added to MedHistory, Medicine, and Resident models - composer.json updated to use latest versions: - doctrine/dbal - illuminate/database - php-di/php-di - respect/validatiion - vlucas/phpdotenv - "php": "^8.0" (was ^7.4 || 8.0) - RxChart.sql updated for new Notes column in the Resident table --- sql/ResidentNotes.sql | 2 - sql/RxChart.sql | 137 +++++++++++++++++++++--------------------- 2 files changed, 70 insertions(+), 69 deletions(-) delete mode 100644 sql/ResidentNotes.sql diff --git a/sql/ResidentNotes.sql b/sql/ResidentNotes.sql deleted file mode 100644 index 9046fcb..0000000 --- a/sql/ResidentNotes.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `RxChart`.`Resident` - ADD COLUMN `Notes` VARCHAR(500) NULL DEFAULT NULL AFTER `DOB_DAY`; diff --git a/sql/RxChart.sql b/sql/RxChart.sql index b08a63b..8110a59 100644 --- a/sql/RxChart.sql +++ b/sql/RxChart.sql @@ -1,8 +1,10 @@ --- MySQL dump 10.13 Distrib 8.0.22, for Linux (x86_64) +CREATE DATABASE IF NOT EXISTS `RxChart` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */; +USE `RxChart`; +-- MySQL dump 10.13 Distrib 8.0.25, for Linux (x86_64) -- -- Host: localhost Database: RxChart -- ------------------------------------------------------ --- Server version 8.0.22 +-- Server version 8.0.25 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -23,24 +25,24 @@ DROP TABLE IF EXISTS `MedHistory`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `MedHistory` ( - `Id` int NOT NULL AUTO_INCREMENT, - `ResidentId` int NOT NULL, - `MedicineId` int NOT NULL, - `UserId` int NOT NULL, - `Notes` varchar(500) DEFAULT NULL, - `In` tinyint DEFAULT NULL, - `Out` tinyint DEFAULT NULL, - `Created` timestamp NULL DEFAULT NULL, - `Updated` timestamp NULL DEFAULT NULL, - `deleted_at` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`Id`), - KEY `fk_MedHistory_Resident_idx` (`ResidentId`), - KEY `fk_MedHistory_Medicine_idx` (`MedicineId`), - KEY `fk_MedHistory_User` (`UserId`), - CONSTRAINT `fk_MedHistory_Medicine` FOREIGN KEY (`MedicineId`) REFERENCES `Medicine` (`Id`), - CONSTRAINT `fk_MedHistory_Resident` FOREIGN KEY (`ResidentId`) REFERENCES `Resident` (`Id`), - CONSTRAINT `fk_MedHistory_User` FOREIGN KEY (`UserId`) REFERENCES `User` (`Id`) -) ENGINE=InnoDB AUTO_INCREMENT=41792 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + `Id` int NOT NULL AUTO_INCREMENT, + `ResidentId` int NOT NULL, + `MedicineId` int NOT NULL, + `UserId` int NOT NULL, + `Notes` varchar(500) DEFAULT NULL, + `In` tinyint DEFAULT NULL, + `Out` tinyint DEFAULT NULL, + `Created` timestamp NULL DEFAULT NULL, + `Updated` timestamp NULL DEFAULT NULL, + `deleted_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `fk_MedHistory_Resident_idx` (`ResidentId`), + KEY `fk_MedHistory_Medicine_idx` (`MedicineId`), + KEY `fk_MedHistory_User` (`UserId`), + CONSTRAINT `fk_MedHistory_Medicine` FOREIGN KEY (`MedicineId`) REFERENCES `Medicine` (`Id`), + CONSTRAINT `fk_MedHistory_Resident` FOREIGN KEY (`ResidentId`) REFERENCES `Resident` (`Id`), + CONSTRAINT `fk_MedHistory_User` FOREIGN KEY (`UserId`) REFERENCES `User` (`Id`) +) ENGINE=InnoDB AUTO_INCREMENT=61964 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -51,28 +53,28 @@ DROP TABLE IF EXISTS `Medicine`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `Medicine` ( - `Id` int NOT NULL AUTO_INCREMENT, - `ResidentId` int DEFAULT NULL, - `UserId` int NOT NULL, - `Drug` varchar(100) NOT NULL, - `Strength` varchar(20) DEFAULT NULL, - `Barcode` varchar(150) DEFAULT NULL, - `Directions` varchar(300) DEFAULT NULL, - `FillDateMonth` tinyint DEFAULT NULL, - `FillDateDay` tinyint DEFAULT NULL, - `FillDateYear` int DEFAULT NULL, - `Notes` varchar(500) DEFAULT NULL, - `OTC` tinyint DEFAULT '0', - `Created` timestamp NULL DEFAULT NULL, - `Updated` timestamp NULL DEFAULT NULL, - `deleted_at` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`Id`), - KEY `Medicine_Barcode` (`Barcode`), - KEY `fk_Medicine_Resident_idx` (`ResidentId`), - KEY `fk_Medicine_User` (`UserId`), - CONSTRAINT `fk_Medicine_Resident` FOREIGN KEY (`ResidentId`) REFERENCES `Resident` (`Id`), - CONSTRAINT `fk_Medicine_User` FOREIGN KEY (`UserId`) REFERENCES `User` (`Id`) -) ENGINE=InnoDB AUTO_INCREMENT=3114 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + `Id` int NOT NULL AUTO_INCREMENT, + `ResidentId` int DEFAULT NULL, + `UserId` int NOT NULL, + `Drug` varchar(100) NOT NULL, + `Strength` varchar(20) DEFAULT NULL, + `Barcode` varchar(150) DEFAULT NULL, + `Directions` varchar(300) DEFAULT NULL, + `FillDateMonth` tinyint DEFAULT NULL, + `FillDateDay` tinyint DEFAULT NULL, + `FillDateYear` int DEFAULT NULL, + `Notes` varchar(500) DEFAULT NULL, + `OTC` tinyint DEFAULT '0', + `Created` timestamp NULL DEFAULT NULL, + `Updated` timestamp NULL DEFAULT NULL, + `deleted_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Medicine_Barcode` (`Barcode`), + KEY `fk_Medicine_Resident_idx` (`ResidentId`), + KEY `fk_Medicine_User` (`UserId`), + CONSTRAINT `fk_Medicine_Resident` FOREIGN KEY (`ResidentId`) REFERENCES `Resident` (`Id`), + CONSTRAINT `fk_Medicine_User` FOREIGN KEY (`UserId`) REFERENCES `User` (`Id`) +) ENGINE=InnoDB AUTO_INCREMENT=3885 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -83,21 +85,22 @@ DROP TABLE IF EXISTS `Resident`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `Resident` ( - `Id` int NOT NULL AUTO_INCREMENT, - `UserId` int NOT NULL, - `LastName` varchar(50) NOT NULL, - `FirstName` varchar(50) NOT NULL, - `DOB_YEAR` int DEFAULT NULL, - `DOB_MONTH` tinyint DEFAULT NULL, - `DOB_DAY` tinyint DEFAULT NULL, - `deleted_at` timestamp NULL DEFAULT NULL, - `Created` timestamp NULL DEFAULT NULL, - `Updated` timestamp NULL DEFAULT NULL, - UNIQUE KEY `Resident_Id_IDX` (`Id`) USING BTREE, - UNIQUE KEY `unique_Resident` (`UserId`,`LastName`,`FirstName`,`DOB_YEAR`,`DOB_MONTH`,`DOB_DAY`), - KEY `fk_Resident_User` (`UserId`), - CONSTRAINT `fk_Resident_User` FOREIGN KEY (`UserId`) REFERENCES `User` (`Id`) -) ENGINE=InnoDB AUTO_INCREMENT=704 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + `Id` int NOT NULL AUTO_INCREMENT, + `UserId` int NOT NULL, + `LastName` varchar(50) NOT NULL, + `FirstName` varchar(50) NOT NULL, + `DOB_YEAR` int DEFAULT NULL, + `DOB_MONTH` tinyint DEFAULT NULL, + `DOB_DAY` tinyint DEFAULT NULL, + `Notes` varchar(500) DEFAULT NULL, + `deleted_at` timestamp NULL DEFAULT NULL, + `Created` timestamp NULL DEFAULT NULL, + `Updated` timestamp NULL DEFAULT NULL, + UNIQUE KEY `Resident_Id_IDX` (`Id`) USING BTREE, + UNIQUE KEY `unique_Resident` (`UserId`,`LastName`,`FirstName`,`DOB_YEAR`,`DOB_MONTH`,`DOB_DAY`), + KEY `fk_Resident_User` (`UserId`), + CONSTRAINT `fk_Resident_User` FOREIGN KEY (`UserId`) REFERENCES `User` (`Id`) +) ENGINE=InnoDB AUTO_INCREMENT=865 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -108,15 +111,15 @@ DROP TABLE IF EXISTS `User`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `User` ( - `Id` int NOT NULL AUTO_INCREMENT, - `Organization` varchar(100) DEFAULT NULL, - `PasswordHash` varchar(300) NOT NULL, - `API_KEY` varchar(100) NOT NULL, - `Created` timestamp NULL DEFAULT NULL, - `Updated` timestamp NULL DEFAULT NULL, - `deleted_at` timestamp NULL DEFAULT NULL, - `UserName` varchar(30) DEFAULT NULL, - UNIQUE KEY `User_Id_IDX` (`Id`) USING BTREE + `Id` int NOT NULL AUTO_INCREMENT, + `Organization` varchar(100) DEFAULT NULL, + `PasswordHash` varchar(300) NOT NULL, + `API_KEY` varchar(100) NOT NULL, + `Created` timestamp NULL DEFAULT NULL, + `Updated` timestamp NULL DEFAULT NULL, + `deleted_at` timestamp NULL DEFAULT NULL, + `UserName` varchar(30) DEFAULT NULL, + UNIQUE KEY `User_Id_IDX` (`Id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -129,4 +132,4 @@ CREATE TABLE `User` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2021-01-21 6:14:12 \ No newline at end of file +-- Dump completed on 2021-05-20 2:11:42