Attempting to use PostgreSQL (9.6.22) with BaGet Docker image.
To Reproduce
Steps to reproduce the behavior:
connect to Postgres and create BaGet-related DB objects
CREATE DATABASE baget;
CREATE USER baget WITH PASSWORD 'baget';
GRANT ALL ON DATABASE baget TO baget;
\connect baget;
CREATE SCHEMA baget;
GRANT USAGE ON SCHEMA baget TO baget;
GRANT CREATE ON SCHEMA baget TO **baget**;
docker run --rm --env-file .env --volume baget-data:/vol/baget loicsharma/baget
error
fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
Failed executing DbCommand (6ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId";
Unhandled exception. Npgsql.PostgresException (0x80004005): 42P01: relation "__EFMigrationsHistory" does not exist
at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming)
at Npgsql.NpgsqlCommand.ExecuteReaderAsync(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.GetAppliedMigrationsAsync(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken)
at BaGet.Core.AbstractContext`1.RunMigrationsAsync(CancellationToken cancellationToken) in /src/BaGet.Core/Entities/AbstractContext.cs:line 36
at BaGet.Database.PostgreSql.PostgreSqlContext.RunMigrationsAsync(CancellationToken cancellationToken) in /src/BaGet.Database.PostgreSql/PostgreSqlContext.cs:line 38
at BaGet.Web.IHostExtensions.RunMigrationsAsync(IHost host, CancellationToken cancellationToken) in /src/BaGet.Web/Extensions/IHostExtensions.cs:line 35
at BaGet.Program.<>c__DisplayClass0_0.<<Main>b__1>d.MoveNext() in /src/BaGet/Program.cs:line 52
--- End of stack trace from previous location where exception was thrown ---
at McMaster.Extensions.CommandLineUtils.CommandLineApplicationExtensions.<>c__DisplayClass9_0.<<OnExecuteAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
at BaGet.Program.Main(String[] args) in /src/BaGet/Program.cs:line 55
at BaGet.Program.<Main>(String[] args)
Exception data:
Severity: ERROR
SqlState: 42P01
MessageText: relation "__EFMigrationsHistory" does not exist
Position: 45
File: parse_relation.c
Line: 1160
Routine: parserOpenTable
Describe the bug
Attempting to use PostgreSQL (9.6.22) with BaGet Docker image.
To Reproduce
Steps to reproduce the behavior:
connect to Postgres and create BaGet-related DB objects
create a
.env
file with this content:create the volume
start the container
error
Expected behavior
The BaGet server starts.