USE [Clinica]
GO
/****** Object:  Table [Clinica].[BitacoraCita]    Script Date: 18-08-2025 21:38:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [Clinica].[BitacoraCita](
	[IdBitacoraCita] [int] IDENTITY(1,1) NOT NULL,
	[IdTipoBitacora] [int] NOT NULL,
	[IdCita] [int] NOT NULL,
	[FechaHora] [datetime] NULL,
	[Contenido] [varchar](4096) NULL,
	[IdUsuario] [int] NOT NULL,
	[IndEliminado] [tinyint] NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[IdBitacoraCita] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [Clinica].[BitacoraCita] ADD  DEFAULT ((0)) FOR [IndEliminado]
GO
ALTER TABLE [Clinica].[BitacoraCita]  WITH CHECK ADD  CONSTRAINT [FK__BitacoraC__IdCit__2057CCD0] FOREIGN KEY([IdCita])
REFERENCES [Clinica].[Cita] ([IdCita])
GO
ALTER TABLE [Clinica].[BitacoraCita] CHECK CONSTRAINT [FK__BitacoraC__IdCit__2057CCD0]
GO
ALTER TABLE [Clinica].[BitacoraCita]  WITH CHECK ADD FOREIGN KEY([IdTipoBitacora])
REFERENCES [Clinica].[TipoBitacora] ([IdTipoBitacora])
GO
ALTER TABLE [Clinica].[BitacoraCita]  WITH CHECK ADD FOREIGN KEY([IdUsuario])
REFERENCES [Core].[Usuario] ([IdUsuario])
GO
