-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce50491
commit 7a57180
Showing
2 changed files
with
23 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
ALTER TABLE `consultas` | ||
CHANGE COLUMN `status` `status` VARCHAR(250) NOT NULL COLLATE 'utf8mb4_unicode_ci' AFTER `obs`; | ||
ALTER TABLE `cabecalhos` ADD `endereco` VARCHAR NOT NULL DEFAULT 'n/d' AFTER `id`; | ||
ALTER TABLE `cabecalhos` ADD `telefone` VARCHAR NOT NULL DEFAULT 'n/d' AFTER `id`; | ||
ALTER TABLE `receituarios` ADD `controle` TINYINT(1) NOT NULL DEFAULT '0' AFTER `id`; | ||
|
||
|
||
CREATE TABLE IF NOT EXISTS `modelos` ( | ||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
`titulo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, | ||
`conteudo` text COLLATE utf8mb4_unicode_ci NOT NULL, | ||
`medico_id` int(10) unsigned NOT NULL, | ||
PRIMARY KEY (`id`), | ||
KEY `modelos_medico_id_foreign` (`medico_id`), | ||
CONSTRAINT `modelos_medico_id_foreign` FOREIGN KEY (`medico_id`) REFERENCES `usuarios` (`id`) ON DELETE CASCADE | ||
CREATE TABLE `permissoes` ( | ||
`id` int(10) UNSIGNED NOT NULL, | ||
`medico_id` int(10) UNSIGNED NOT NULL, | ||
`sec_id` int(10) UNSIGNED NOT NULL | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; | ||
ALTER TABLE `permissoes` | ||
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; | ||
|
||
ALTER TABLE `permissoes` | ||
ADD CONSTRAINT `permissoes_medico_id_foreign` FOREIGN KEY (`medico_id`) REFERENCES `usuarios` (`id`) ON DELETE CASCADE, | ||
ADD CONSTRAINT `permissoes_sec_id_foreign` FOREIGN KEY (`sec_id`) REFERENCES `usuarios` (`id`) ON DELETE CASCADE; | ||
|