+ + - Create a Mysql Database using the following database schema. + + ```sql + CREATE DATABASE IF NOT EXISTS PET_DB; + + CREATE TABLE PET_DB.Pet ( + id VARCHAR(255) PRIMARY KEY, + name VARCHAR(255) NOT NULL, + breed VARCHAR(255) NOT NULL, + dateOfBirth VARCHAR(255) NOT NULL, + owner VARCHAR(255) NOT NULL + ); + + CREATE TABLE PET_DB.Vaccination ( + id INT AUTO_INCREMENT PRIMARY KEY, + petId VARCHAR(255) NOT NULL, + name VARCHAR(255) NOT NULL, + lastVaccinationDate VARCHAR(255) NOT NULL, + nextVaccinationDate VARCHAR(255), + enableAlerts BOOLEAN NOT NULL DEFAULT 0, + FOREIGN KEY (petId) REFERENCES Pet(id) ON DELETE CASCADE + ); + + CREATE TABLE PET_DB.Thumbnail ( + id INT AUTO_INCREMENT PRIMARY KEY, + fileName VARCHAR(255) NOT NULL, + content MEDIUMBLOB NOT NULL, + petId VARCHAR(255) NOT NULL, + FOREIGN KEY (petId) REFERENCES Pet(id) ON DELETE CASCADE + ); + + CREATE TABLE PET_DB.Settings ( + owner VARCHAR(255) NOT NULL, + notifications_enabled BOOLEAN NOT NULL, + notifications_emailAddress VARCHAR(255), + PRIMARY KEY (owner) + ); + ``` + + - Make sure your database is publicly accessible and that your database service allows Choreo IP addresses. Please refer the guide [Connect with Protected Third Party Applications](https://wso2.com/choreo/docs/reference/connect-with-protected-third-party-applications/#connect-with-protected-third-party-applications) for more information. + + - Configure the following **Defaultable Configurables** after setting up the database. + + | Field | Value | + | ---------- | -------- | + | dbHost | Database Host. eg: mysql–instance1.123456789012.us-east-1.rds.amazonaws.com | + | dbUsername | Database username | + | dbPassword | Database password | + | dbDatabase | Database name. eg: PET_DB | + | dbPort | Database port. eg: 3306| + +
++ + - In order to send emails to the users, you need to create a client for the SMTP server. Here is a guide for setting up a SMTP client for the **GMail**. + - You can generate a password for the email username using [https://myaccount.google.com/apppasswords](https://myaccount.google.com/apppasswords). + - Configure the following **Defaultable Configurables** for the email configuration. + + | Field | Value | + | ---------- | -------- | + | emailHost | SMTP Host. eg: smtp.gmail.com | + | emailUsername | Email address | + | emailPassword | Email password (The app password generated in the above.) | + +
+- - - Create a Mysql Database using the following database schema. - - ```sql - CREATE DATABASE IF NOT EXISTS PET_DB; - - CREATE TABLE PET_DB.Pet ( - id VARCHAR(255) PRIMARY KEY, - name VARCHAR(255) NOT NULL, - breed VARCHAR(255) NOT NULL, - dateOfBirth VARCHAR(255) NOT NULL, - owner VARCHAR(255) NOT NULL - ); - - CREATE TABLE PET_DB.Vaccination ( - id INT AUTO_INCREMENT PRIMARY KEY, - petId VARCHAR(255) NOT NULL, - name VARCHAR(255) NOT NULL, - lastVaccinationDate VARCHAR(255) NOT NULL, - nextVaccinationDate VARCHAR(255), - enableAlerts BOOLEAN NOT NULL DEFAULT 0, - FOREIGN KEY (petId) REFERENCES Pet(id) ON DELETE CASCADE - ); - - CREATE TABLE PET_DB.Thumbnail ( - id INT AUTO_INCREMENT PRIMARY KEY, - fileName VARCHAR(255) NOT NULL, - content MEDIUMBLOB NOT NULL, - petId VARCHAR(255) NOT NULL, - FOREIGN KEY (petId) REFERENCES Pet(id) ON DELETE CASCADE - ); - - CREATE TABLE PET_DB.Settings ( - owner VARCHAR(255) NOT NULL, - notifications_enabled BOOLEAN NOT NULL, - notifications_emailAddress VARCHAR(255), - PRIMARY KEY (owner) - ); - ``` - - - Make sure your database is publicly accessible and that your database service allows Choreo IP addresses. Please refer the guide [Connect with Protected Third Party Applications](https://wso2.com/choreo/docs/reference/connect-with-protected-third-party-applications/#connect-with-protected-third-party-applications) for more information. - - - Configure the following **Defaultable Configurables** after setting up the database. - - | Field | Value | - | ---------- | -------- | - | dbHost | Database Host. eg: mysql–instance1.123456789012.us-east-1.rds.amazonaws.com | - | dbUsername | Database username | - | dbPassword | Database password | - | dbDatabase | Database name. eg: PET_DB | - | dbPort | Database port. eg: 3306| - -
-- - - In order to send emails to the users, you need to create a client for the SMTP server. Here is a guide for setting up a SMTP client for the **GMail**. - - You can generate a password for the email username using [https://myaccount.google.com/apppasswords](https://myaccount.google.com/apppasswords). - - Configure the following **Defaultable Configurables** for the email configuration. - - | Field | Value | - | ---------- | -------- | - | emailHost | SMTP Host. eg: smtp.gmail.com | - | emailUsername | Email address | - | emailPassword | Email password (The app password generated in the above.) | - -
-City Vet Hospital
+Pet Care