added 'drugs' table to db

This commit is contained in:
pedro 2019-10-24 11:03:07 +02:00
parent 6e4c31c681
commit 29e757cf9b
3 changed files with 16 additions and 2 deletions

View file

@ -2,6 +2,6 @@
database=mysql
spring.datasource.url=jdbc:mysql://localhost/petclinic
spring.datasource.username=root
spring.datasource.password=petclinic
spring.datasource.password=q1w2e3r4t5
# Uncomment this the first time the app runs
# spring.datasource.initialization-mode=always

View file

@ -1,5 +1,5 @@
# database init, supports mysql too
database=hsqldb
database=hsql
spring.datasource.schema=classpath*:db/${database}/schema.sql
spring.datasource.data=classpath*:db/${database}/data.sql

View file

@ -63,3 +63,17 @@ CREATE TABLE IF NOT EXISTS visits (
description VARCHAR(255),
FOREIGN KEY (pet_id) REFERENCES pets(id)
) engine=InnoDB;
/*
Add table "drugs" to db
*/
CREATE TABLE IF NOT EXISTS drugs (
id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
drug_name VARCHAR(255),
animal_type INT(4) UNSIGNED NOT NULL,
batch_nr INT(4) UNSIGNED NOT NULL,
date_last DATE,
FOREIGN KEY (animal_type) REFERENCES pets(type_id),
FOREIGN KEY (batch_nr) REFERENCES pets(type_id)
) engine=InnoDB;