USE [Clinica]
GO
/****** Object:  Table [Clinica].[Profesional]    Script Date: 18-08-2025 21:40:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [Clinica].[Profesional](
	[IdProfesional] [int] IDENTITY(1,1) NOT NULL,
	[Rut] [varchar](256) NOT NULL,
	[Nombres] [varchar](256) NULL,
	[Apellidos] [varchar](256) NULL,
	[Direccion] [varchar](256) NULL,
	[IdComuna] [int] NULL,
	[IdRegion] [int] NULL,
	[IdBox] [int] NULL,
	[FechaNacimiento] [date] NULL,
	[Telefono] [varchar](256) NULL,
	[Email] [varchar](256) NULL,
	[IndVigente] [tinyint] NOT NULL,
	[IndEliminado] [tinyint] NOT NULL,
	[IdUsuario] [int] NULL,
 CONSTRAINT [PK__Profesio__BC490D0A356916EF] PRIMARY KEY CLUSTERED 
(
	[IdProfesional] 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].[Profesional] ADD  CONSTRAINT [DF__Profesion__Nombr__4B7734FF]  DEFAULT ('') FOR [Rut]
GO
ALTER TABLE [Clinica].[Profesional] ADD  CONSTRAINT [DF__Profesion__IndVi__4D5F7D71]  DEFAULT ((1)) FOR [IndVigente]
GO
ALTER TABLE [Clinica].[Profesional] ADD  CONSTRAINT [DF__Profesion__IndEl__4E53A1AA]  DEFAULT ((0)) FOR [IndEliminado]
GO
ALTER TABLE [Clinica].[Profesional]  WITH CHECK ADD FOREIGN KEY([IdUsuario])
REFERENCES [Core].[Usuario] ([IdUsuario])
GO
ALTER TABLE [Clinica].[Profesional]  WITH CHECK ADD  CONSTRAINT [FK_Profesional_Comuna] FOREIGN KEY([IdComuna])
REFERENCES [Parametro].[Comuna] ([IdComuna])
GO
ALTER TABLE [Clinica].[Profesional] CHECK CONSTRAINT [FK_Profesional_Comuna]
GO
