Add consumption logic and endpoints
This commit is contained in:
@@ -12,7 +12,7 @@ using Vegasco.WebApi.Persistence;
|
||||
namespace Vegasco.WebApi.Persistence.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20240817153531_Initial")]
|
||||
[Migration("20240818105918_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
/// <inheritdoc />
|
||||
@@ -70,7 +70,7 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
|
||||
b.HasIndex("CarId");
|
||||
|
||||
b.ToTable("Consumption");
|
||||
b.ToTable("Consumptions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Users.User", b =>
|
||||
@@ -42,7 +42,7 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Consumption",
|
||||
name: "Consumptions",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
@@ -54,9 +54,9 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Consumption", x => x.Id);
|
||||
table.PrimaryKey("PK_Consumptions", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Consumption_Cars_CarId",
|
||||
name: "FK_Consumptions_Cars_CarId",
|
||||
column: x => x.CarId,
|
||||
principalTable: "Cars",
|
||||
principalColumn: "Id",
|
||||
@@ -69,8 +69,8 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Consumption_CarId",
|
||||
table: "Consumption",
|
||||
name: "IX_Consumptions_CarId",
|
||||
table: "Consumptions",
|
||||
column: "CarId");
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Consumption");
|
||||
name: "Consumptions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Cars");
|
||||
@@ -67,7 +67,7 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
|
||||
b.HasIndex("CarId");
|
||||
|
||||
b.ToTable("Consumption");
|
||||
b.ToTable("Consumptions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Users.User", b =>
|
||||
|
||||
Reference in New Issue
Block a user