mirror of
https://github.com/bitwarden/server.git
synced 2025-01-10 20:07:56 +01:00
Add Sqlite Migration (#2760)
This commit is contained in:
parent
6d251236da
commit
26c30f8854
2188
util/SqliteMigrations/Migrations/20230302121757_DomainClaiming.Designer.cs
generated
Normal file
2188
util/SqliteMigrations/Migrations/20230302121757_DomainClaiming.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;
|
||||||
|
|
||||||
|
public partial class DomainClaiming : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "DomainName",
|
||||||
|
table: "Event",
|
||||||
|
type: "TEXT",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "OrganizationDomain",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||||
|
OrganizationId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||||
|
Txt = table.Column<string>(type: "TEXT", nullable: true),
|
||||||
|
DomainName = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
|
||||||
|
CreationDate = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||||
|
VerifiedDate = table.Column<DateTime>(type: "TEXT", nullable: true),
|
||||||
|
NextRunDate = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||||
|
LastCheckedDate = table.Column<DateTime>(type: "TEXT", nullable: true),
|
||||||
|
JobRunCount = table.Column<int>(type: "INTEGER", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_OrganizationDomain", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_OrganizationDomain_Organization_OrganizationId",
|
||||||
|
column: x => x.OrganizationId,
|
||||||
|
principalTable: "Organization",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_OrganizationDomain_OrganizationId",
|
||||||
|
table: "OrganizationDomain",
|
||||||
|
column: "OrganizationId");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "OrganizationDomain");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "DomainName",
|
||||||
|
table: "Event");
|
||||||
|
}
|
||||||
|
}
|
@ -316,6 +316,9 @@ namespace Bit.SqliteMigrations.Migrations
|
|||||||
b.Property<byte?>("DeviceType")
|
b.Property<byte?>("DeviceType")
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
|
b.Property<string>("DomainName")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
b.Property<Guid?>("GroupId")
|
b.Property<Guid?>("GroupId")
|
||||||
.HasColumnType("TEXT");
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
@ -706,6 +709,43 @@ namespace Bit.SqliteMigrations.Migrations
|
|||||||
b.ToTable("OrganizationConnection", (string)null);
|
b.ToTable("OrganizationConnection", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationDomain", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationDate")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<string>("DomainName")
|
||||||
|
.HasMaxLength(255)
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<int>("JobRunCount")
|
||||||
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastCheckedDate")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<DateTime>("NextRunDate")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<Guid>("OrganizationId")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<string>("Txt")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("VerifiedDate")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("OrganizationId");
|
||||||
|
|
||||||
|
b.ToTable("OrganizationDomain", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationSponsorship", b =>
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationSponsorship", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
@ -1625,7 +1665,7 @@ namespace Bit.SqliteMigrations.Migrations
|
|||||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Collection", b =>
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Collection", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization")
|
b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization")
|
||||||
.WithMany()
|
.WithMany("Collections")
|
||||||
.HasForeignKey("OrganizationId")
|
.HasForeignKey("OrganizationId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
@ -1781,6 +1821,17 @@ namespace Bit.SqliteMigrations.Migrations
|
|||||||
b.Navigation("Organization");
|
b.Navigation("Organization");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationDomain", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization")
|
||||||
|
.WithMany("Domains")
|
||||||
|
.HasForeignKey("OrganizationId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Organization");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationSponsorship", b =>
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationSponsorship", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "SponsoredOrganization")
|
b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "SponsoredOrganization")
|
||||||
@ -2075,8 +2126,12 @@ namespace Bit.SqliteMigrations.Migrations
|
|||||||
|
|
||||||
b.Navigation("Ciphers");
|
b.Navigation("Ciphers");
|
||||||
|
|
||||||
|
b.Navigation("Collections");
|
||||||
|
|
||||||
b.Navigation("Connections");
|
b.Navigation("Connections");
|
||||||
|
|
||||||
|
b.Navigation("Domains");
|
||||||
|
|
||||||
b.Navigation("Groups");
|
b.Navigation("Groups");
|
||||||
|
|
||||||
b.Navigation("OrganizationUsers");
|
b.Navigation("OrganizationUsers");
|
||||||
|
Loading…
Reference in New Issue
Block a user