Skip to content

Commit 639fc54

Browse files
authored
Merge pull request #16 from Mteheran/veronica
Update Cities and departments
2 parents 830cb9c + 0265988 commit 639fc54

8 files changed

+727
-12
lines changed

api/Data/Configs/CityConfig.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ public void Configure(EntityTypeBuilder<City> city)
1313
city.Property(p => p.Description).IsRequired(false);
1414
city.Property(p => p.Population);
1515
city.Property(p => p.Surface);
16-
city.Property(p => p.PostalCode).HasMaxLength(10); ;
17-
city.Property(p => p.PhonePrefix).HasMaxLength(5);
16+
city.Property(p => p.PostalCode).HasMaxLength(10);
1817
city.Property(p => p.DepartamentId);
1918
city.HasOne(p => p.Departament).WithMany(p => p.Cities).HasForeignKey(p => p.DepartamentId);
2019
}

api/Migrations/20230202004538_UpdateCityDepartments.Designer.cs

Lines changed: 328 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System;
2+
using Microsoft.EntityFrameworkCore.Migrations;
3+
4+
#nullable disable
5+
6+
namespace api.Migrations
7+
{
8+
public partial class UpdateCityDepartments : Migration
9+
{
10+
protected override void Up(MigrationBuilder migrationBuilder)
11+
{
12+
migrationBuilder.DropColumn(
13+
name: "Municipalities",
14+
table: "Department");
15+
16+
migrationBuilder.DropColumn(
17+
name: "PhonePrefix",
18+
table: "City");
19+
}
20+
21+
protected override void Down(MigrationBuilder migrationBuilder)
22+
{
23+
migrationBuilder.AddColumn<string[]>(
24+
name: "Municipalities",
25+
table: "Department",
26+
type: "text[]",
27+
nullable: true);
28+
29+
migrationBuilder.AddColumn<string>(
30+
name: "PhonePrefix",
31+
table: "City",
32+
type: "character varying(5)",
33+
maxLength: 5,
34+
nullable: true);
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)