From 7124102ca01c4546f0512cea49b83efdedcf8b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Ho=CC=88rler?= Date: Fri, 13 Jul 2018 12:07:04 +0200 Subject: [PATCH] Revert "delete OriginOriginId in Exam Table because i beleve it is not needed." This reverts commit 0afb70f881625e1e8f0564b34d2b47a299ea72d5. --- SQL/EHEC_DB_Query.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SQL/EHEC_DB_Query.sql b/SQL/EHEC_DB_Query.sql index debfe12..2829fce 100644 --- a/SQL/EHEC_DB_Query.sql +++ b/SQL/EHEC_DB_Query.sql @@ -121,6 +121,7 @@ CREATE TABLE [dbo].[Exam] ( [ExamId] int IDENTITY(1,1) NOT NULL, [DoctorId] int NOT NULL, [PatientId] int NOT NULL, + [OriginOriginId] int NOT NULL, [Result_ResultId] int NOT NULL ); GO @@ -237,6 +238,12 @@ ADD CONSTRAINT [FK_Origin] ON DELETE NO ACTION ON UPDATE NO ACTION; GO +-- Creating non-clustered index for FOREIGN KEY 'FK_Origin_Exam' +CREATE INDEX [IX_FK_Origin_Exam] +ON [dbo].[Origin_Exam] + ([OriginOriginId]); +GO + -- Creating foreign key on [ExamId] in table 'Origin_Exam' ALTER TABLE [dbo].[Origin_Exam] ADD CONSTRAINT [FK_Exam]