File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ WORKDIR /src
5
5
COPY *.csproj ./
6
6
RUN dotnet restore
7
7
8
+ # Install EF tools
9
+ RUN dotnet tool install --global dotnet-ef
10
+ ENV PATH="$PATH:/root/.dotnet/tools"
11
+
8
12
# Copy everything else and build
9
13
COPY . ./
10
14
RUN dotnet publish -c Release -o /app
Original file line number Diff line number Diff line change 123
123
124
124
using ( var scope = app . Services . CreateScope ( ) )
125
125
{
126
- var services = scope . ServiceProvider ;
127
- var seeder = services . GetRequiredService < IdentitySeeder > ( ) ;
126
+ var db = scope . ServiceProvider . GetRequiredService < ApplicationDbContext > ( ) ;
127
+ db . Database . Migrate ( ) ; // This applies pending migrations automatically
128
+
129
+ var seeder = scope . ServiceProvider . GetRequiredService < IdentitySeeder > ( ) ;
128
130
await seeder . SeedAsync ( ) ;
129
131
}
130
132
Original file line number Diff line number Diff line change 1
1
{
2
2
"ConnectionStrings" : {
3
- "DefaultConnection" : " Host=admin-hub-api:europe-west9:adminhub-db ;Database=adminhub;Username=postgres;Password=&,~/Yhr@&G<Ker}+"
3
+ "DefaultConnection" : " Host=34.155.97.182 ;Database=adminhub;Username=postgres;Password=&,~/Yhr@&G<Ker}+"
4
4
},
5
5
"Logging" : {
6
6
"LogLevel" : {
You can’t perform that action at this time.
0 commit comments