USE [DD_ECM]
GO

/****** Object:  Table [dbo].[TBDEX_CFG_OUT_DB]    Script Date: 07.12.2025 23:10:46 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[TBDEX_CFG_OUT_DB](
	[GUID] [bigint] IDENTITY(1,1) NOT NULL,
	[PROFILE_ID] [bigint] NOT NULL,
	[ACTIVE] [bit] NOT NULL,
	[CONTENT_TYPE] [nvarchar](500) NULL,
	[ADDED_WHO] [nvarchar](50) NOT NULL,
	[ADDED_WHEN] [datetime] NOT NULL,
	[CHANGED_WHO] [nvarchar](50) NULL,
	[CHANGED_WHEN] [datetime] NULL,
 CONSTRAINT [PK_TBDEX_CFG_OUT_DB] PRIMARY KEY CLUSTERED 
(
	[GUID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = ON, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[TBDEX_CFG_OUT_DB] ADD  CONSTRAINT [DF_TBDEX_CFG_OUT_DB_ACTIVE]  DEFAULT ((0)) FOR [ACTIVE]
GO

ALTER TABLE [dbo].[TBDEX_CFG_OUT_DB] ADD  CONSTRAINT [DF_TBDEX_CFG_OUT_DB_ADDED_WHO]  DEFAULT ('DEFAULT') FOR [ADDED_WHO]
GO

ALTER TABLE [dbo].[TBDEX_CFG_OUT_DB] ADD  CONSTRAINT [DF_TBDEX_CFG_OUT_DB_ADDED_WHEN]  DEFAULT (getdate()) FOR [ADDED_WHEN]
GO

ALTER TABLE [dbo].[TBDEX_CFG_OUT_DB]  WITH CHECK ADD  CONSTRAINT [FK_TBDEX_CFG_OUT_DB_TBDEX_CFG_PROFILE] FOREIGN KEY([PROFILE_ID])
REFERENCES [dbo].[TBDEX_CFG_PROFILE] ([GUID])
GO

ALTER TABLE [dbo].[TBDEX_CFG_OUT_DB] CHECK CONSTRAINT [FK_TBDEX_CFG_OUT_DB_TBDEX_CFG_PROFILE]
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Link PROFILE_ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TBDEX_CFG_OUT_DB', @level2type=N'CONSTRAINT',@level2name=N'FK_TBDEX_CFG_OUT_DB_TBDEX_CFG_PROFILE'
GO


