Base solution for your next web application
Open Closed

Can't generate table in Postgre Sql. #6936


User avatar
0
sgeeks created

Hi everyone, I'm having a problem When I'm trying to update-database in Postgre SQL I can't able to create all the table. I'm Using .net core 2.2 with angular

  1. I Install Npgsql.EntityFrameworkCore.PostgreSQL (package (Version 2.2.0))
  2. In GrantVantageDbContextConfigurer.cs i replace the builder.UseSqlServer method with builder.UseNpgsql method.
  3. in Migrations files i replace "SqlServer:ValueGenerationStrategy" with “Npgsql:ValueGenerationStrategy” and "IdentityColumn" with "NpgsqlValueGenerationStrategy.SerialColumn" and MaxLength of Value from 67108864 to 10485760
  4. and change it's connection

but can only able to create only 28 table instead of 35 table. But when i do it with sql server i'm able to create all 35 tables.

When trying to update database getting this error- Posgre SQL- SQL Server - <span class="colour" style="color:rgb(0, 0, 0)">Can anybody help?</span>

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Have you seen this document? https://aspnetboilerplate.com/Pages/Documents/EF-Core-PostgreSql-Integration

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    sgeeks created

    Thanks for your replay. I can't able to find Program.BuildWebHost() and when I Delete the *.EntityFrameworkCore/Migrations folder, it's giving me errors - 

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    maliming created
    Support Team

    Do not delete the Seed directory. Delete the migration file of the Migrations directory, and keep the Seed directory.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    sgeeks created

    I can't able to find Program.BuildWebHost().

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    maliming created
    Support Team

    You can ignore this. Continue to try.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    sgeeks created

    It's working now, Thanks 😃.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)