-- --------------------------------------------------------
-- 主機:                           127.0.0.1
-- 伺服器版本:                        10.5.18-MariaDB - mariadb.org binary distribution
-- 伺服器作業系統:                      Win64
-- HeidiSQL 版本:                  11.3.0.6295
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;


-- 傾印 goat 的資料庫結構
CREATE DATABASE IF NOT EXISTS `goat` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci */;
USE `goat`;

-- 傾印  資料表 goat.disease 結構
CREATE TABLE IF NOT EXISTS `disease` (
  `did` int(11) NOT NULL AUTO_INCREMENT,
  `gid` int(11) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `diseasetype` varchar(50) DEFAULT NULL,
  `drugname` varchar(50) DEFAULT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `mid` int(11) NOT NULL,
  `Smedication` date NOT NULL,
  `confirm` int(11) DEFAULT NULL,
  `add_time` date DEFAULT NULL,
  `out` int(11) DEFAULT NULL,
  PRIMARY KEY (`did`),
  KEY `FK_disease_member` (`mid`),
  KEY `FK_disease_goatdata` (`gid`),
  CONSTRAINT `FK_disease_goatdata` FOREIGN KEY (`gid`) REFERENCES `goatdata` (`gid`),
  CONSTRAINT `FK_disease_member` FOREIGN KEY (`mid`) REFERENCES `member` (`mid`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

-- 正在傾印表格  goat.disease 的資料：~13 rows (近似值)
/*!40000 ALTER TABLE `disease` DISABLE KEYS */;
REPLACE INTO `disease` (`did`, `gid`, `date`, `diseasetype`, `drugname`, `remark`, `mid`, `Smedication`, `confirm`, `add_time`, `out`) VALUES
	(12, 21, '2023-12-17', '氣管炎', '新感冒靈、林可黴素', '無', 1, '2023-12-31', 1, '2023-12-18', 0),
	(13, 21, '2024-01-09', '氣管炎', '新感冒靈、林可黴素', '無', 1, '2024-01-23', 1, '2024-01-06', 0),
	(14, 161, '2024-01-02', '腸胃炎', 'Povidone lodine 2%', '無', 1, '2024-01-16', 1, '2024-01-13', 0),
	(15, 31, '2024-01-08', '放射菌感染病', '泌乳樂(CEROXIM OINTMENT)', '無', 1, '2024-01-22', 1, '2024-01-13', 1),
	(16, 32, '2024-01-07', '氣管炎', '新感冒靈、林可黴素', '無', 1, '2024-01-30', 0, '2024-01-13', 0),
	(17, 28, '2023-12-06', '腸胃炎', '磺胺劑', '無', 1, '2023-12-20', 1, '2024-01-13', 0),
	(18, 27, '2024-01-04', '腸胃炎', '磺胺劑', '無', 1, '2024-01-18', 0, '2024-01-13', 0),
	(19, 162, '2023-12-12', '氣管炎', '新感冒靈、林可黴素', '無', 1, '2023-12-26', 0, '2024-01-13', 0),
	(20, 169, '2024-01-14', '氣管炎', '新感冒靈、林可黴素', '無', 1, '2024-01-28', 0, '2024-01-13', 0),
	(21, 25, '2024-04-15', '腸胃炎', '磺胺劑', '無', 1, '2024-04-29', 0, '2024-01-16', 0),
	(22, 27, '2024-05-01', '腸胃炎', '磺胺劑', '無', 1, '2024-05-15', 0, '2024-05-14', 0),
	(23, 28, '2024-05-02', '氣管炎', '新感冒靈、林可黴素', '無', 1, '2024-05-16', 0, '2024-05-14', 0),
	(24, 190, '2024-05-01', '腸胃炎', '磺胺劑', '無', 1, '2024-05-15', 0, '2024-05-14', 0);
/*!40000 ALTER TABLE `disease` ENABLE KEYS */;

/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
