102 lines
8.5 KiB
Transact-SQL
102 lines
8.5 KiB
Transact-SQL
USE [site_fuchs]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] DROP CONSTRAINT [FK_ocms_items_parent__ocms_items]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] DROP CONSTRAINT [FK_ocms_items_ocms_templates]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] DROP CONSTRAINT [FK_ocms_items_ocms_properties]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] DROP CONSTRAINT [FK_ocms_items_ocms_items]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] DROP CONSTRAINT [DF_ocms_items_DateModified]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] DROP CONSTRAINT [DF_ocms_items_DateCreated]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] DROP CONSTRAINT [DF_ocms_items_order]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] DROP CONSTRAINT [DF_ocms_items_hide]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] DROP CONSTRAINT [DF_ocms_items_view]
|
|
GO
|
|
/****** Object: Index [ocms_items__ix1] Script Date: 02.12.2020 21:05:05 ******/
|
|
DROP INDEX [ocms_items__ix1] ON [dbo].[ocms_items]
|
|
GO
|
|
/****** Object: Index [ocms_items__ix0] Script Date: 02.12.2020 21:05:05 ******/
|
|
DROP INDEX [ocms_items__ix0] ON [dbo].[ocms_items]
|
|
GO
|
|
/****** Object: Table [dbo].[ocms_items] Script Date: 02.12.2020 21:05:05 ******/
|
|
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ocms_items]') AND type in (N'U'))
|
|
DROP TABLE [dbo].[ocms_items]
|
|
GO
|
|
/****** Object: Table [dbo].[ocms_items] Script Date: 02.12.2020 21:05:06 ******/
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
SET QUOTED_IDENTIFIER ON
|
|
GO
|
|
CREATE TABLE [dbo].[ocms_items](
|
|
[ocms_iid] [bigint] NOT NULL,
|
|
[parent_iid] [bigint] NULL,
|
|
[ocms_pid] [bigint] NULL,
|
|
[name] [nvarchar](255) NULL,
|
|
[view] [bit] NOT NULL,
|
|
[template_id] [bigint] NULL,
|
|
[hide] [bit] NOT NULL,
|
|
[order] [int] NOT NULL,
|
|
[DateCreated] [datetime] NULL,
|
|
[DateModified] [datetime] NULL,
|
|
CONSTRAINT [PK_ocms_items] PRIMARY KEY CLUSTERED
|
|
(
|
|
[ocms_iid] 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 AUTHORIZATION ON [dbo].[ocms_items] TO SCHEMA OWNER
|
|
GO
|
|
SET ANSI_PADDING ON
|
|
GO
|
|
/****** Object: Index [ocms_items__ix0] Script Date: 02.12.2020 21:05:06 ******/
|
|
CREATE UNIQUE NONCLUSTERED INDEX [ocms_items__ix0] ON [dbo].[ocms_items]
|
|
(
|
|
[parent_iid] ASC,
|
|
[name] 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
|
|
SET ANSI_PADDING ON
|
|
GO
|
|
/****** Object: Index [ocms_items__ix1] Script Date: 02.12.2020 21:05:06 ******/
|
|
CREATE UNIQUE NONCLUSTERED INDEX [ocms_items__ix1] ON [dbo].[ocms_items]
|
|
(
|
|
[name] 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].[ocms_items] ADD CONSTRAINT [DF_ocms_items_view] DEFAULT ((0)) FOR [view]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] ADD CONSTRAINT [DF_ocms_items_hide] DEFAULT ((0)) FOR [hide]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] ADD CONSTRAINT [DF_ocms_items_order] DEFAULT ((0)) FOR [order]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] ADD CONSTRAINT [DF_ocms_items_DateCreated] DEFAULT (getutcdate()) FOR [DateCreated]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] ADD CONSTRAINT [DF_ocms_items_DateModified] DEFAULT (getutcdate()) FOR [DateModified]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] WITH CHECK ADD CONSTRAINT [FK_ocms_items_ocms_items] FOREIGN KEY([ocms_iid])
|
|
REFERENCES [dbo].[ocms_items] ([ocms_iid])
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] CHECK CONSTRAINT [FK_ocms_items_ocms_items]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] WITH CHECK ADD CONSTRAINT [FK_ocms_items_ocms_properties] FOREIGN KEY([ocms_pid])
|
|
REFERENCES [dbo].[ocms_properties] ([ocms_pid])
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] CHECK CONSTRAINT [FK_ocms_items_ocms_properties]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] WITH CHECK ADD CONSTRAINT [FK_ocms_items_ocms_templates] FOREIGN KEY([template_id])
|
|
REFERENCES [dbo].[ocms_templates] ([ocms_tid])
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] CHECK CONSTRAINT [FK_ocms_items_ocms_templates]
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] WITH CHECK ADD CONSTRAINT [FK_ocms_items_parent__ocms_items] FOREIGN KEY([parent_iid])
|
|
REFERENCES [dbo].[ocms_items] ([ocms_iid])
|
|
GO
|
|
ALTER TABLE [dbo].[ocms_items] CHECK CONSTRAINT [FK_ocms_items_parent__ocms_items]
|
|
GO
|