Skip to content

Migration sql script will output incorrect content when include create view command. #37628

@CoreDX9

Description

@CoreDX9

Bug description

Create view command must be unique command in a batch, but script-migration command will remove ‘GO’ from custom sql. I need to re edit the output script text to fix the errors.

Your code

var sql = "GO\r\nCREATE VIEW view1 AS xxx;\r\nGO";
migrationBuilder.Sql(sql);

Script-Migration 0

Stack traces


Verbose output


EF Core version

10.0.0

Database provider

Microsoft.EntityFrameworkCore.SqlServer

Target framework

.Net 10.0

Operating system

No response

IDE

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions