mirror of
https://github.com/bitwarden/server.git
synced 2025-01-06 19:28:08 +01:00
feat(NewDeviceVerification) : database migration scripts for VerifyDevices column in [dbo].[User].
This commit is contained in:
parent
eb9a061e6f
commit
826e7a1906
@ -72,6 +72,7 @@ public class User : ITableObject<Guid>, IStorableSubscriber, IRevisable, ITwoFac
|
||||
public DateTime? LastKdfChangeDate { get; set; }
|
||||
public DateTime? LastKeyRotationDate { get; set; }
|
||||
public DateTime? LastEmailChangeDate { get; set; }
|
||||
public bool VerifyDevices { get; set; } = true;
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
|
@ -0,0 +1,8 @@
|
||||
IF COL_LENGTH('[dbo].[User]', 'VerifyDevices') IS NULL
|
||||
BEGIN
|
||||
ALTER TABLE
|
||||
[dbo].[User]
|
||||
ADD
|
||||
[VerifyDevices] BIT NOT NULL DEFAULT 1
|
||||
END
|
||||
GO
|
2997
util/MySqlMigrations/Migrations/20241219035803_AlterUser_AddVerifyDevice.Designer.cs
generated
Normal file
2997
util/MySqlMigrations/Migrations/20241219035803_AlterUser_AddVerifyDevice.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.MySqlMigrations.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AlterUser_AddVerifyDevice : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "VerifyDevices",
|
||||
table: "User",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "VerifyDevices",
|
||||
table: "User");
|
||||
}
|
||||
}
|
||||
}
|
@ -1662,6 +1662,9 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
b.Property<bool>("UsesKeyConnector")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<bool>("VerifyDevices")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Email")
|
||||
|
3003
util/PostgresMigrations/Migrations/20241219035734_AlterUser_AddVerifyDevice.Designer.cs
generated
Normal file
3003
util/PostgresMigrations/Migrations/20241219035734_AlterUser_AddVerifyDevice.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.PostgresMigrations.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AlterUser_AddVerifyDevice : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "VerifyDevices",
|
||||
table: "User",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "VerifyDevices",
|
||||
table: "User");
|
||||
}
|
||||
}
|
||||
}
|
@ -1668,6 +1668,9 @@ namespace Bit.PostgresMigrations.Migrations
|
||||
b.Property<bool>("UsesKeyConnector")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("VerifyDevices")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Email")
|
||||
|
2986
util/SqliteMigrations/Migrations/20241219035748_AlterUser_AddVerifyDevice.Designer.cs
generated
Normal file
2986
util/SqliteMigrations/Migrations/20241219035748_AlterUser_AddVerifyDevice.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.SqliteMigrations.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AlterUser_AddVerifyDevice : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "VerifyDevices",
|
||||
table: "User",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "VerifyDevices",
|
||||
table: "User");
|
||||
}
|
||||
}
|
||||
}
|
@ -1651,6 +1651,9 @@ namespace Bit.SqliteMigrations.Migrations
|
||||
b.Property<bool>("UsesKeyConnector")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("VerifyDevices")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Email")
|
||||
|
Loading…
Reference in New Issue
Block a user