USE [site_fuchs] GO ALTER TABLE [dbo].[ocms_template_properties] DROP CONSTRAINT [FK_ocms_template_properties_ocms_items] GO ALTER TABLE [dbo].[ocms_template_properties] DROP CONSTRAINT [DF_ocms_template_properties_order] GO ALTER TABLE [dbo].[ocms_template_properties] DROP CONSTRAINT [DF_ocms_template_properties_mandatory] GO /****** Object: Index [ocms_template_properties__ix1] Script Date: 02.12.2020 21:05:05 ******/ DROP INDEX [ocms_template_properties__ix1] ON [dbo].[ocms_template_properties] GO /****** Object: Table [dbo].[ocms_template_properties] Script Date: 02.12.2020 21:05:05 ******/ IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ocms_template_properties]') AND type in (N'U')) DROP TABLE [dbo].[ocms_template_properties] GO /****** Object: Table [dbo].[ocms_template_properties] Script Date: 02.12.2020 21:05:06 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ocms_template_properties]( [ocms_tpid] [bigint] NOT NULL, [ocms_tid] [bigint] NOT NULL, [key] [varchar](50) NOT NULL, [mandatory] [bit] NOT NULL, [type] [varchar](50) NOT NULL, [default] [nvarchar](max) NULL, [condition] [varchar](max) NULL, [order] [int] NOT NULL, CONSTRAINT [PK_ocms_template_properties] PRIMARY KEY CLUSTERED ( [ocms_tpid] 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].[ocms_template_properties] TO SCHEMA OWNER GO SET ANSI_PADDING ON GO /****** Object: Index [ocms_template_properties__ix1] Script Date: 02.12.2020 21:05:06 ******/ CREATE UNIQUE NONCLUSTERED INDEX [ocms_template_properties__ix1] ON [dbo].[ocms_template_properties] ( [ocms_tid] ASC, [key] 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_template_properties] ADD CONSTRAINT [DF_ocms_template_properties_mandatory] DEFAULT ((0)) FOR [mandatory] GO ALTER TABLE [dbo].[ocms_template_properties] ADD CONSTRAINT [DF_ocms_template_properties_order] DEFAULT ((0)) FOR [order] GO ALTER TABLE [dbo].[ocms_template_properties] WITH CHECK ADD CONSTRAINT [FK_ocms_template_properties_ocms_items] FOREIGN KEY([ocms_tid]) REFERENCES [dbo].[ocms_templates] ([ocms_tid]) GO ALTER TABLE [dbo].[ocms_template_properties] CHECK CONSTRAINT [FK_ocms_template_properties_ocms_items] GO