11 changed files with 6537 additions and 71 deletions
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,76 @@
@@ -0,0 +1,76 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
#nullable disable |
||||
|
||||
namespace Bit.MySqlMigrations.Migrations; |
||||
|
||||
public partial class FixNavigationProperties : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
name: "FK_CollectionUsers_User_UserId", |
||||
table: "CollectionUsers"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
name: "FK_GroupUser_User_UserId", |
||||
table: "GroupUser"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
name: "IX_GroupUser_UserId", |
||||
table: "GroupUser"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
name: "IX_CollectionUsers_UserId", |
||||
table: "CollectionUsers"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
name: "UserId", |
||||
table: "GroupUser"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
name: "UserId", |
||||
table: "CollectionUsers"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<Guid>( |
||||
name: "UserId", |
||||
table: "GroupUser", |
||||
type: "char(36)", |
||||
nullable: true, |
||||
collation: "ascii_general_ci"); |
||||
|
||||
migrationBuilder.AddColumn<Guid>( |
||||
name: "UserId", |
||||
table: "CollectionUsers", |
||||
type: "char(36)", |
||||
nullable: true, |
||||
collation: "ascii_general_ci"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
name: "IX_GroupUser_UserId", |
||||
table: "GroupUser", |
||||
column: "UserId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
name: "IX_CollectionUsers_UserId", |
||||
table: "CollectionUsers", |
||||
column: "UserId"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
name: "FK_CollectionUsers_User_UserId", |
||||
table: "CollectionUsers", |
||||
column: "UserId", |
||||
principalTable: "User", |
||||
principalColumn: "Id"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
name: "FK_GroupUser_User_UserId", |
||||
table: "GroupUser", |
||||
column: "UserId", |
||||
principalTable: "User", |
||||
principalColumn: "Id"); |
||||
} |
||||
} |
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,74 @@
@@ -0,0 +1,74 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
#nullable disable |
||||
|
||||
namespace Bit.PostgresMigrations.Migrations; |
||||
|
||||
public partial class FixNavigationProperties : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
name: "FK_CollectionUsers_User_UserId", |
||||
table: "CollectionUsers"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
name: "FK_GroupUser_User_UserId", |
||||
table: "GroupUser"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
name: "IX_GroupUser_UserId", |
||||
table: "GroupUser"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
name: "IX_CollectionUsers_UserId", |
||||
table: "CollectionUsers"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
name: "UserId", |
||||
table: "GroupUser"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
name: "UserId", |
||||
table: "CollectionUsers"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<Guid>( |
||||
name: "UserId", |
||||
table: "GroupUser", |
||||
type: "uuid", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<Guid>( |
||||
name: "UserId", |
||||
table: "CollectionUsers", |
||||
type: "uuid", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
name: "IX_GroupUser_UserId", |
||||
table: "GroupUser", |
||||
column: "UserId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
name: "IX_CollectionUsers_UserId", |
||||
table: "CollectionUsers", |
||||
column: "UserId"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
name: "FK_CollectionUsers_User_UserId", |
||||
table: "CollectionUsers", |
||||
column: "UserId", |
||||
principalTable: "User", |
||||
principalColumn: "Id"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
name: "FK_GroupUser_User_UserId", |
||||
table: "GroupUser", |
||||
column: "UserId", |
||||
principalTable: "User", |
||||
principalColumn: "Id"); |
||||
} |
||||
} |
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,74 @@
@@ -0,0 +1,74 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
#nullable disable |
||||
|
||||
namespace Bit.SqliteMigrations.Migrations; |
||||
|
||||
public partial class FixNavigationProperties : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
name: "FK_CollectionUsers_User_UserId", |
||||
table: "CollectionUsers"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
name: "FK_GroupUser_User_UserId", |
||||
table: "GroupUser"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
name: "IX_GroupUser_UserId", |
||||
table: "GroupUser"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
name: "IX_CollectionUsers_UserId", |
||||
table: "CollectionUsers"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
name: "UserId", |
||||
table: "GroupUser"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
name: "UserId", |
||||
table: "CollectionUsers"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<Guid>( |
||||
name: "UserId", |
||||
table: "GroupUser", |
||||
type: "TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<Guid>( |
||||
name: "UserId", |
||||
table: "CollectionUsers", |
||||
type: "TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
name: "IX_GroupUser_UserId", |
||||
table: "GroupUser", |
||||
column: "UserId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
name: "IX_CollectionUsers_UserId", |
||||
table: "CollectionUsers", |
||||
column: "UserId"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
name: "FK_CollectionUsers_User_UserId", |
||||
table: "CollectionUsers", |
||||
column: "UserId", |
||||
principalTable: "User", |
||||
principalColumn: "Id"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
name: "FK_GroupUser_User_UserId", |
||||
table: "GroupUser", |
||||
column: "UserId", |
||||
principalTable: "User", |
||||
principalColumn: "Id"); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue