Files
Fuchs_Intranet/db/dbo.fuchs_planner_groups.Table.sql

69 lines
6.4 KiB
Transact-SQL

USE [site_fuchs]
GO
ALTER TABLE [dbo].[fuchs_planner_groups] DROP CONSTRAINT [FK_fuchs_planner_groups_fuchs_planner_groups]
GO
ALTER TABLE [dbo].[fuchs_planner_groups] DROP CONSTRAINT [FK_fuchs_planner_groups_fuchs_planner]
GO
ALTER TABLE [dbo].[fuchs_planner_groups] DROP CONSTRAINT [DF_fuchs_planner_groups_hide]
GO
ALTER TABLE [dbo].[fuchs_planner_groups] DROP CONSTRAINT [DF_fuchs_planner_groups_final]
GO
ALTER TABLE [dbo].[fuchs_planner_groups] DROP CONSTRAINT [DF_fuchs_planner_groups_order]
GO
/****** Object: Index [IX_fuchs_planner_groups] Script Date: 02.12.2020 21:05:05 ******/
DROP INDEX [IX_fuchs_planner_groups] ON [dbo].[fuchs_planner_groups]
GO
/****** Object: Table [dbo].[fuchs_planner_groups] Script Date: 02.12.2020 21:05:05 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[fuchs_planner_groups]') AND type in (N'U'))
DROP TABLE [dbo].[fuchs_planner_groups]
GO
/****** Object: Table [dbo].[fuchs_planner_groups] Script Date: 02.12.2020 21:05:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[fuchs_planner_groups](
[group_id] [int] NOT NULL,
[code] AS ([dbo].[ott_b26]([group_id])),
[planner_id] [tinyint] NOT NULL,
[sequence_order] [tinyint] NOT NULL,
[parent_codes] [varchar](50) NULL,
[condition] [varchar](50) NULL,
[shortname] [varchar](15) NULL,
[name] [varchar](100) NULL,
[description] [varchar](max) NULL,
[selection_type] [varchar](10) NULL,
[final] [bit] NOT NULL,
[hide] [bit] NOT NULL,
CONSTRAINT [PK_fuchs_planner_groups] PRIMARY KEY CLUSTERED
(
[group_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER AUTHORIZATION ON [dbo].[fuchs_planner_groups] TO SCHEMA OWNER
GO
/****** Object: Index [IX_fuchs_planner_groups] Script Date: 02.12.2020 21:05:06 ******/
CREATE UNIQUE NONCLUSTERED INDEX [IX_fuchs_planner_groups] ON [dbo].[fuchs_planner_groups]
(
[planner_id] ASC,
[sequence_order] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[fuchs_planner_groups] ADD CONSTRAINT [DF_fuchs_planner_groups_order] DEFAULT ((0)) FOR [sequence_order]
GO
ALTER TABLE [dbo].[fuchs_planner_groups] ADD CONSTRAINT [DF_fuchs_planner_groups_final] DEFAULT ((0)) FOR [final]
GO
ALTER TABLE [dbo].[fuchs_planner_groups] ADD CONSTRAINT [DF_fuchs_planner_groups_hide] DEFAULT ((0)) FOR [hide]
GO
ALTER TABLE [dbo].[fuchs_planner_groups] WITH CHECK ADD CONSTRAINT [FK_fuchs_planner_groups_fuchs_planner] FOREIGN KEY([planner_id])
REFERENCES [dbo].[fuchs_planner] ([planner_id])
GO
ALTER TABLE [dbo].[fuchs_planner_groups] CHECK CONSTRAINT [FK_fuchs_planner_groups_fuchs_planner]
GO
ALTER TABLE [dbo].[fuchs_planner_groups] WITH CHECK ADD CONSTRAINT [FK_fuchs_planner_groups_fuchs_planner_groups] FOREIGN KEY([group_id])
REFERENCES [dbo].[fuchs_planner_groups] ([group_id])
GO
ALTER TABLE [dbo].[fuchs_planner_groups] CHECK CONSTRAINT [FK_fuchs_planner_groups_fuchs_planner_groups]
GO