mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
[AC-1943] Add ProviderInvoiceItem table (#4163)
* Add ProviderInvoiceItem table * Run dotnet format
This commit is contained in:
2631
util/SqliteMigrations/Migrations/20240606152401_ProviderInvoiceItem.Designer.cs
generated
Normal file
2631
util/SqliteMigrations/Migrations/20240606152401_ProviderInvoiceItem.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,57 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.SqliteMigrations.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class ProviderInvoiceItem : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ProviderInvoiceItem",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
ProviderId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
InvoiceId = table.Column<string>(type: "TEXT", nullable: true),
|
||||
InvoiceNumber = table.Column<string>(type: "TEXT", nullable: true),
|
||||
ClientName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
PlanName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
AssignedSeats = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
UsedSeats = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Total = table.Column<decimal>(type: "TEXT", nullable: false),
|
||||
Created = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ProviderInvoiceItem", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ProviderInvoiceItem_Provider_ProviderId",
|
||||
column: x => x.ProviderId,
|
||||
principalTable: "Provider",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ProviderInvoiceItem_Id_InvoiceId",
|
||||
table: "ProviderInvoiceItem",
|
||||
columns: new[] { "Id", "InvoiceId" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ProviderInvoiceItem_ProviderId",
|
||||
table: "ProviderInvoiceItem",
|
||||
column: "ProviderId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ProviderInvoiceItem");
|
||||
}
|
||||
}
|
@ -671,6 +671,48 @@ namespace Bit.SqliteMigrations.Migrations
|
||||
b.ToTable("WebAuthnCredential", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderInvoiceItem", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("AssignedSeats")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ClientName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("InvoiceId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("InvoiceNumber")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("PlanName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid>("ProviderId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("Total")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("UsedSeats")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProviderId");
|
||||
|
||||
b.HasIndex("Id", "InvoiceId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("ProviderInvoiceItem", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderPlan", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@ -2048,6 +2090,17 @@ namespace Bit.SqliteMigrations.Migrations
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderInvoiceItem", b =>
|
||||
{
|
||||
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider.Provider", "Provider")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProviderId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Provider");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderPlan", b =>
|
||||
{
|
||||
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider.Provider", "Provider")
|
||||
|
Reference in New Issue
Block a user