USE [Clinica]
GO
/****** Object:  Table [Registro].[BitacoraFicha]    Script Date: 18-08-2025 21:38:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [Registro].[BitacoraFicha](
	[IdBitacoraFicha] [int] IDENTITY(1,1) NOT NULL,
	[IdFicha] [int] NOT NULL,
	[IdAtencion] [int] NULL,
	[Fecha] [datetime] NULL,
	[IdUsuario] [int] NOT NULL,
	[Contenido] [varchar](4096) NULL,
PRIMARY KEY CLUSTERED 
(
	[IdBitacoraFicha] 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 [Registro].[BitacoraFicha]  WITH CHECK ADD FOREIGN KEY([IdAtencion])
REFERENCES [Clinica].[Atencion] ([IdAtencion])
GO
ALTER TABLE [Registro].[BitacoraFicha]  WITH CHECK ADD FOREIGN KEY([IdFicha])
REFERENCES [Registro].[Ficha] ([IdFicha])
GO
ALTER TABLE [Registro].[BitacoraFicha]  WITH CHECK ADD FOREIGN KEY([IdUsuario])
REFERENCES [Core].[Usuario] ([IdUsuario])
GO
