Skip to content

Commit

Permalink
Add Notes attribute to Resident model
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
RyanNerd committed May 20, 2021
1 parent 36d247f commit ef635a2
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 69 deletions.
2 changes: 0 additions & 2 deletions sql/ResidentNotes.sql

This file was deleted.

137 changes: 70 additions & 67 deletions sql/RxChart.sql
Original file line number Diff line number Diff line change
@@ -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 */;
Expand All @@ -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 */;

--
Expand All @@ -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 */;

--
Expand All @@ -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 */;

--
Expand All @@ -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 */;
Expand All @@ -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
-- Dump completed on 2021-05-20 2:11:42

0 comments on commit ef635a2

Please sign in to comment.