mirror of
https://github.com/BarkProductions/barkman.git
synced 2026-06-12 22:11:54 +00:00
added weight field
This commit is contained in:
@@ -0,0 +1,112 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
using barkmanapi;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace barkmanapi.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BarkContext))]
|
||||||
|
[Migration("20250324003014_add-weight")]
|
||||||
|
partial class addweight
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "9.0.1")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("barkmanapi.InventoryItems", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasColumnName("id");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Barcode")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasColumnName("barcode");
|
||||||
|
|
||||||
|
b.Property<string>("Brand")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("brand");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("name");
|
||||||
|
|
||||||
|
b.Property<string>("Notes")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("notes");
|
||||||
|
|
||||||
|
b.Property<float?>("RentalPrice")
|
||||||
|
.HasColumnType("real")
|
||||||
|
.HasColumnName("rental_price");
|
||||||
|
|
||||||
|
b.Property<float?>("ReplacementCost")
|
||||||
|
.HasColumnType("real")
|
||||||
|
.HasColumnName("replacement_cost");
|
||||||
|
|
||||||
|
b.Property<string>("SerialNumber")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("serial_number");
|
||||||
|
|
||||||
|
b.Property<string>("StatusId")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("status_id");
|
||||||
|
|
||||||
|
b.Property<float?>("Weight")
|
||||||
|
.HasColumnType("real")
|
||||||
|
.HasColumnName("weight");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_inventory");
|
||||||
|
|
||||||
|
b.HasIndex("StatusId")
|
||||||
|
.HasDatabaseName("ix_inventory_status_id");
|
||||||
|
|
||||||
|
b.ToTable("inventory", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("barkmanapi.ItemStatus", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("id");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("name");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_item_status");
|
||||||
|
|
||||||
|
b.ToTable("item_status", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("barkmanapi.InventoryItems", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("barkmanapi.ItemStatus", "Status")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("StatusId")
|
||||||
|
.HasConstraintName("fk_inventory_item_status_status_id");
|
||||||
|
|
||||||
|
b.Navigation("Status");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace barkmanapi.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class addweight : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<float>(
|
||||||
|
name: "weight",
|
||||||
|
table: "inventory",
|
||||||
|
type: "real",
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "weight",
|
||||||
|
table: "inventory");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -64,6 +64,10 @@ namespace barkmanapi.Migrations
|
|||||||
.HasColumnType("text")
|
.HasColumnType("text")
|
||||||
.HasColumnName("status_id");
|
.HasColumnName("status_id");
|
||||||
|
|
||||||
|
b.Property<float?>("Weight")
|
||||||
|
.HasColumnType("real")
|
||||||
|
.HasColumnName("weight");
|
||||||
|
|
||||||
b.HasKey("Id")
|
b.HasKey("Id")
|
||||||
.HasName("pk_inventory");
|
.HasName("pk_inventory");
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public class InventoryItems
|
|||||||
public string? SerialNumber { get; set; }
|
public string? SerialNumber { get; set; }
|
||||||
public ItemStatus Status { get; set; }
|
public ItemStatus Status { get; set; }
|
||||||
public string? StatusId { get; set; }
|
public string? StatusId { get; set; }
|
||||||
|
public float? Weight { get; set; }
|
||||||
public float? RentalPrice { get; set; }
|
public float? RentalPrice { get; set; }
|
||||||
public float? ReplacementCost { get; set; }
|
public float? ReplacementCost { get; set; }
|
||||||
public string? Notes { get; set; }
|
public string? Notes { get; set; }
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
#Staging API
|
#Staging API
|
||||||
#VITE_API_URL=https://barkdev.ts.drewr.io
|
VITE_API_URL=https://barkdev.ts.drewr.io
|
||||||
#Local Dev API
|
#Local Dev API
|
||||||
VITE_API_URL=http://localhost:5145
|
#VITE_API_URL=http://localhost:5145
|
||||||
Reference in New Issue
Block a user