соединение с базой!

This commit is contained in:
Антон
2025-08-24 17:08:36 +03:00
parent 029f9c2fd3
commit 918db80742
5 changed files with 53 additions and 11 deletions
+9 -9
View File
@@ -52,6 +52,15 @@ CREATE TABLE `up_and_down`.`anxiety` (
PRIMARY KEY (`level`)
);
CREATE TABLE `up_and_down`.`user_treatment_schemes` (
`guid` CHAR(36) NOT NULL,
`user_guid` CHAR(36) NOT NULL,
`treatment_name` TEXT NOT NULL,
`instructions` TEXT,
PRIMARY KEY (`guid`),
FOREIGN KEY (`user_guid`) REFERENCES `users`(`guid`)
);
CREATE TABLE `up_and_down`.`diaries` (
`guid` CHAR(36) NOT NULL,
`user_guid` CHAR(36) NOT NULL,
@@ -93,15 +102,6 @@ CREATE TABLE `up_and_down`.`treatment_schemes` (
FOREIGN KEY (`medication_guid`) REFERENCES `medications`(`guid`)
);
CREATE TABLE `up_and_down`.`user_treatment_schemes` (
`guid` CHAR(36) NOT NULL,
`user_guid` CHAR(36) NOT NULL,
`treatment_name` TEXT NOT NULL,
`instructions` TEXT,
PRIMARY KEY (`guid`),
FOREIGN KEY (`user_guid`) REFERENCES `users`(`guid`)
);
-- insert constants
INSERT INTO `up_and_down`.`mania` (`level`, `description`) VALUES (1, 'Полное отсутствие мании');
INSERT INTO `up_and_down`.`mania` (`level`, `description`) VALUES (2, 'Слегка приподнятое настроение');