Closed sam-piper-lendus closed 7 months ago
I found a solution to this issue, which may help others using EF Core 8.
I updated the build stage in my pipeline to script the SQL file directly using dotnet tools, which produced slightly different output than the previous wrapper task I was using to generate SQL, steps below:
- name: Install EF Core Tools
run: dotnet tool install --global dotnet-ef
- name: Generate SQL Migration Script
run: dotnet ef migrations script --idempotent --context SqlDbContext --output ../migrations/migrations.sql
working-directory: ./apps/project-containing-db-context
The latest EF tooling appears to generate a SQL script that works correctly with go-sqlcmd.
Closing as the issue was resolved without requiring any changes to sql-action usage.
I'm trying to use an Azure/sql-action@v2.2.1 step in my workflow file to deploy an EF Core migrations script generated in the previous build stage, but it's failing because the GO batch separation lines in the script aren't being respected.
Here's the relevant parts of the pipeline file:
And the SQL script, which is generated entirely by the EF Core tools:
The log output from execution is this:
If GO statements in the script were working as expected then these errors wouldn't occur and the script should run fine.
Is there a way to configure the step so that batch termination using GO works?