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