USE [Clinica]
GO
/****** Object:  Table [Resultado].[CuentaCorrientePaciente]    Script Date: 18-08-2025 21:40:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [Resultado].[CuentaCorrientePaciente](
	[IdCuentaCorrientePaciente] [int] IDENTITY(1,1) NOT NULL,
	[IdPaciente] [int] NOT NULL,
	[FechaHora] [datetime] NULL,
	[Monto] [decimal](16, 2) NULL,
	[IdUsuario] [int] NOT NULL,
	[IndEliminado] [tinyint] NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[IdCuentaCorrientePaciente] 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 [Resultado].[CuentaCorrientePaciente] ADD  DEFAULT ((0)) FOR [IndEliminado]
GO
ALTER TABLE [Resultado].[CuentaCorrientePaciente]  WITH CHECK ADD  CONSTRAINT [FK__CuentaCor__IdPac__28ED12D1] FOREIGN KEY([IdPaciente])
REFERENCES [Clinica].[Paciente] ([IdPaciente])
GO
ALTER TABLE [Resultado].[CuentaCorrientePaciente] CHECK CONSTRAINT [FK__CuentaCor__IdPac__28ED12D1]
GO
ALTER TABLE [Resultado].[CuentaCorrientePaciente]  WITH CHECK ADD FOREIGN KEY([IdUsuario])
REFERENCES [Core].[Usuario] ([IdUsuario])
GO
