TFS_ANTIGUO/TPAtesa_Vitalit/BE/InventarioV2/Tablas/General.Notificacion.Table.sql
2026-06-26 09:45:23 -06:00

45 lines
5.6 KiB
Transact-SQL
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

USE [InventarioV2]
GO
/****** Object: Table [General].[Notificacion] Script Date: 23/12/2020 02:53:58 p.m. ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [General].[Notificacion](
[Id_Notificacion] [int] NOT NULL,
[Id_Usuario] [int] NOT NULL,
[Id_Activo] [int] NOT NULL,
[Id_Estado_Operacion] [int] NOT NULL,
[Dias_Notificacion] [int] NULL,
CONSTRAINT [PK_Notificacion] PRIMARY KEY CLUSTERED
(
[Id_Notificacion] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [General].[Notificacion] WITH CHECK ADD CONSTRAINT [FK_Notificacion_Activo] FOREIGN KEY([Id_Activo])
REFERENCES [Activo].[Activo] ([Id_Activo])
GO
ALTER TABLE [General].[Notificacion] CHECK CONSTRAINT [FK_Notificacion_Activo]
GO
ALTER TABLE [General].[Notificacion] WITH CHECK ADD CONSTRAINT [FK_Notificacion_Estado_Operacion] FOREIGN KEY([Id_Estado_Operacion])
REFERENCES [Catalogo].[Estado_Operacion] ([Id_Estado_Operacion])
GO
ALTER TABLE [General].[Notificacion] CHECK CONSTRAINT [FK_Notificacion_Estado_Operacion]
GO
ALTER TABLE [General].[Notificacion] WITH CHECK ADD CONSTRAINT [FK_Notificacion_Usuario] FOREIGN KEY([Id_Usuario])
REFERENCES [Seguridad].[Usuario] ([Id_Usuario])
GO
ALTER TABLE [General].[Notificacion] CHECK CONSTRAINT [FK_Notificacion_Usuario]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Identificador único interno para diferenciar las notificaciones realizadas.' , @level0type=N'SCHEMA',@level0name=N'General', @level1type=N'TABLE',@level1name=N'Notificacion', @level2type=N'COLUMN',@level2name=N'Id_Notificacion'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Identificador foráneo que indica a cuál usuario se le está notificando.' , @level0type=N'SCHEMA',@level0name=N'General', @level1type=N'TABLE',@level1name=N'Notificacion', @level2type=N'COLUMN',@level2name=N'Id_Usuario'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Identificador foráneo que indica de cual activo se está notificando.' , @level0type=N'SCHEMA',@level0name=N'General', @level1type=N'TABLE',@level1name=N'Notificacion', @level2type=N'COLUMN',@level2name=N'Id_Activo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Identificador foráneo que indica cual tipo de movimiento se está notificando.' , @level0type=N'SCHEMA',@level0name=N'General', @level1type=N'TABLE',@level1name=N'Notificacion', @level2type=N'COLUMN',@level2name=N'Id_Estado_Operacion'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Cantidad de días antes en la cual se tiene que notificar.' , @level0type=N'SCHEMA',@level0name=N'General', @level1type=N'TABLE',@level1name=N'Notificacion', @level2type=N'COLUMN',@level2name=N'Dias_Notificacion'
GO