Skip to content

Instantly share code, notes, and snippets.

Avatar

Sébastien Sougnez ssougnez

View GitHub Profile
View umbraco-mysql-sql-server-migration-08.sql
ALTER TABLE [dbo].[cmsContent] WITH CHECK ADD CONSTRAINT [FK_cmsContent_cmsContentType_nodeId] FOREIGN KEY([contentType]) REFERENCES [dbo].[cmsContentType] ([nodeId])
ALTER TABLE [dbo].[cmsContent] CHECK CONSTRAINT [FK_cmsContent_cmsContentType_nodeId]
GO
ALTER TABLE [dbo].[cmsContent] WITH CHECK ADD CONSTRAINT [FK_cmsContent_umbracoNode_id] FOREIGN KEY([nodeId]) REFERENCES [dbo].[umbracoNode] ([id])
ALTER TABLE [dbo].[cmsContent] CHECK CONSTRAINT [FK_cmsContent_umbracoNode_id]
GO
ALTER TABLE [dbo].[cmsContentType] WITH CHECK ADD CONSTRAINT [FK_cmsContentType_umbracoNode_id] FOREIGN KEY([nodeId]) REFERENCES [dbo].[umbracoNode] ([id])
ALTER TABLE [dbo].[cmsContentType] CHECK CONSTRAINT [FK_cmsContentType_umbracoNode_id]
GO
View umbraco-mysql-sql-server-migration-07.sql
CREATE UNIQUE NONCLUSTERED INDEX [IX_cmsContent] ON [dbo].[cmsContent]([nodeId] 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
CREATE UNIQUE NONCLUSTERED INDEX [IX_cmsContentType] ON [dbo].[cmsContentType] ([nodeId] 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
CREATE NONCLUSTERED INDEX [IX_cmsContentType_icon] ON [dbo].[cmsContentType] ([icon] ASC) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
View umbraco-mysql-sql-server-migration-06.sql
ALTER TABLE [dbo].[cmsContent] ADD CONSTRAINT [PK_cmsContent] PRIMARY KEY CLUSTERED ([pk] ASC) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[cmsContentType] ADD CONSTRAINT [PK_cmsContentType] PRIMARY KEY CLUSTERED ([pk] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[cmsContentType2ContentType] ADD CONSTRAINT [PK_cmsContentType2ContentType] PRIMARY KEY CLUSTERED ([parentContentTypeId] ASC, [childContentTypeId] ASC) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
View umbraco-mysql-sql-server-migration-05.sql
EXEC sp_rename 'cmsmacro', 'cmsMacro';
ALTER TABLE [dbo].[cmsMacro] ALTER COLUMN [uniqueId] uniqueidentifier NOT NULL;
ALTER TABLE [dbo].[cmsMacro] ALTER COLUMN [macroUseInEditor] bit;
ALTER TABLE [dbo].[cmsMacro] ALTER COLUMN [macroCacheByPage] bit;
ALTER TABLE [dbo].[cmsMacro] ALTER COLUMN [macroCachePersonalized] bit;
ALTER TABLE [dbo].[cmsMacro] ALTER COLUMN [macroDontRender] bit;
ALTER TABLE [dbo].[cmsMacro] ADD CONSTRAINT [DF_cmsMacro_macroCacheByPage] DEFAULT ('1') FOR [macroCacheByPage]
ALTER TABLE [dbo].[cmsMacro] ADD CONSTRAINT [DF_cmsMacro_macroCachePersonalized] DEFAULT ('0') FOR [macroCachePersonalized]
ALTER TABLE [dbo].[cmsMacro] ADD CONSTRAINT [DF_cmsMacro_macroDontRender] DEFAULT ('0') FOR [macroDontRender]
ALTER TABLE [dbo].[cmsMacro] ADD CONSTRAINT [DF_cmsMacro_macroRefreshRate] DEFAULT ('0') FOR [macroRefreshRate]
View umbraco-mysql-sql-server-migration-04.sql
DECLARE @sql NVARCHAR(MAX);
SET @sql = N'';
select @sql =
(SELECT 'DROP INDEX [' + ix.name + '] ON [' + OBJECT_NAME(ID) + ']; '
FROM sysindexes ix
WHERE ix.Name IS NOT null AND OBJECT_SCHEMA_NAME(ID) LIKE 'dbo'
for xml path(''));
EXEC sp_executesql @sql
GO
View umbraco-mysql-sql-server-migration-03.sql
DECLARE @sql NVARCHAR(MAX);
SET @sql = N'';
SELECT @sql = @sql + N'
ALTER TABLE ' + QUOTENAME(s.name) + N'.'
+ QUOTENAME(t.name) + N' DROP CONSTRAINT '
+ QUOTENAME(c.name) + ';'
FROM sys.objects AS c
INNER JOIN sys.tables AS t
ON c.parent_object_id = t.[object_id]
INNER JOIN sys.schemas AS s
View umbraco-mysql-sql-server-migration-02.sql
DECLARE @sql NVARCHAR(MAX);
SET @sql = N'';
SELECT @sql = @sql + N'
ALTER SCHEMA dbo TRANSFER ' + QUOTENAME(s.Name) + '.' + QUOTENAME(o.Name)
FROM sys.Objects o
INNER JOIN sys.Schemas s on o.schema_id = s.schema_id
WHERE s.Name = 'umbracoprd01'
And (o.Type = 'U' Or o.Type = 'P' Or o.Type = 'V');
View wp-ef-core-warning.cs
services.AddDbContext<WorkflowDatabaseContext>(options =>
{
options
.UseSqlServer("...")
.ConfigureWarnings(w => w.Throw(RelationalEventId.QueryClientEvaluationWarning));
});
View wp-ngDoCheck-05.ts
import { Component, Input, IterableDiffer, IterableDiffers, OnInit, DoCheck, IterableChanges } from '@angular/core';
@Component({
selector: 'data-table',
templateUrl: './data-table.component.html'
})
export class DataTableComponent implements OnInit, DoCheck {
@Input()
public data: number[] = [];
You can’t perform that action at this time.