Azure / Azure/postgresql

"CREATE TABLE IF NOT EXISTS" results in a false-positive error if table already exists

Open
#52 1 comment 0 reactions 0 assignees View on GitHub
need-to-triage
Dominant language
TypeScript
Stars
25
Forks
22
PR merge metrics
No merged PRs in 30d

Description

Take a script like the auto-generated migration history table creation by Entity Framework:

```sql
CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
"MigrationId" character varying(150) NOT NULL,
"ProductVersion" character varying(32) NOT NULL,
CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
);
```

This results in a false error if the table actually already exists:

```
psql:/home/runner/work/somethingsomething.sql:5: NOTICE: relation "__EFMigrationsHistory" already exists, skipping
[...]
Error: Error occurred while running action:
Error: error in file: /home/runner/work/somethingsomething.sql
psql:/home/runner/work/somethingsomething.sql:5: NOTICE: relation "__EFMigrationsHistory" already exists, skipping
```

Which subsequently and wrongly fails the build.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.