Files
mws.backend.dotnet/mws.infrastructure/Migrations/20260812124332_AddMemberDocumentPermissions.cs
T
namdh f72aaa2329 Commit MWS backend source tree
The ASP.NET Core solution (mws.api/mws.application/mws.domain/
mws.infrastructure) existed only as untracked working files. Adding
it to version control, plus a .gitignore for build output and local
tooling directories, so the CQRS/mediator refactor plan has a real
git history to branch and diff against.
2026-08-13 23:10:22 +07:00

66 lines
2.2 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Mws.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddMemberDocumentPermissions : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "CanCreateDocuments",
table: "project_members",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "CanDeleteDocuments",
table: "project_members",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "CanEditDocuments",
table: "project_members",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "CanViewDocuments",
table: "project_members",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.Sql("UPDATE \"project_members\" SET \"CanViewDocuments\" = true, \"CanCreateDocuments\" = true, \"CanEditDocuments\" = true, \"CanDeleteDocuments\" = true WHERE \"Role\" = 'Owner';");
migrationBuilder.Sql("UPDATE \"project_members\" SET \"CanViewDocuments\" = true WHERE \"Role\" = 'Member';");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CanCreateDocuments",
table: "project_members");
migrationBuilder.DropColumn(
name: "CanDeleteDocuments",
table: "project_members");
migrationBuilder.DropColumn(
name: "CanEditDocuments",
table: "project_members");
migrationBuilder.DropColumn(
name: "CanViewDocuments",
table: "project_members");
}
}
}