mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 23:05:50 +00:00
added 'drugs' table to db
This commit is contained in:
parent
6e4c31c681
commit
29e757cf9b
3 changed files with 16 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue