mirror of
https://github.com/BarkProductions/barkman.git
synced 2026-06-13 06:11:55 +00:00
forgot migrations
This commit is contained in:
+109
@@ -0,0 +1,109 @@
|
|||||||
|
// <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("20250124040847_status")]
|
||||||
|
partial class status
|
||||||
|
{
|
||||||
|
/// <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<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.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("Items")
|
||||||
|
.HasForeignKey("StatusId")
|
||||||
|
.HasConstraintName("fk_inventory_item_status_status_id");
|
||||||
|
|
||||||
|
b.Navigation("Status");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("barkmanapi.ItemStatus", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Items");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace barkmanapi.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class status : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "item_status",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<string>(type: "text", nullable: false),
|
||||||
|
name = table.Column<string>(type: "text", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_item_status", x => x.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "inventory",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
name = table.Column<string>(type: "text", nullable: false),
|
||||||
|
brand = table.Column<string>(type: "text", nullable: false),
|
||||||
|
serial_number = table.Column<string>(type: "text", nullable: true),
|
||||||
|
status_id = table.Column<string>(type: "text", nullable: true),
|
||||||
|
rental_price = table.Column<float>(type: "real", nullable: true),
|
||||||
|
replacement_cost = table.Column<float>(type: "real", nullable: true),
|
||||||
|
notes = table.Column<string>(type: "text", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_inventory", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_inventory_item_status_status_id",
|
||||||
|
column: x => x.status_id,
|
||||||
|
principalTable: "item_status",
|
||||||
|
principalColumn: "id");
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_inventory_status_id",
|
||||||
|
table: "inventory",
|
||||||
|
column: "status_id");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "inventory");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "item_status");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
using barkmanapi;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace barkmanapi.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BarkContext))]
|
||||||
|
partial class BarkContextModelSnapshot : ModelSnapshot
|
||||||
|
{
|
||||||
|
protected override void BuildModel(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<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.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("Items")
|
||||||
|
.HasForeignKey("StatusId")
|
||||||
|
.HasConstraintName("fk_inventory_item_status_status_id");
|
||||||
|
|
||||||
|
b.Navigation("Status");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("barkmanapi.ItemStatus", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Items");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user