USE [Clinica]
GO
/****** Object:  Table [Caja].[AbonoAtencion]    Script Date: 18-08-2025 21:38:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [Caja].[AbonoAtencion](
	[IdAbono] [int] IDENTITY(1,1) NOT NULL,
	[IdAtencion] [int] NOT NULL,
	[FechaHora] [datetime] NULL,
	[Monto] [decimal](16, 2) NULL,
	[IdUsuario] [int] NOT NULL,
	[IndEliminado] [tinyint] NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[IdAbono] 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 [Caja].[AbonoAtencion] ADD  DEFAULT ((0)) FOR [IndEliminado]
GO
ALTER TABLE [Caja].[AbonoAtencion]  WITH CHECK ADD FOREIGN KEY([IdAtencion])
REFERENCES [Clinica].[Atencion] ([IdAtencion])
GO
ALTER TABLE [Caja].[AbonoAtencion]  WITH CHECK ADD FOREIGN KEY([IdUsuario])
REFERENCES [Core].[Usuario] ([IdUsuario])
GO
