New: Description
This commit is contained in:
30
Server/Migrations/01000001_AddDescriptionColumn.cs
Normal file
30
Server/Migrations/01000001_AddDescriptionColumn.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Oqtane.Databases.Interfaces;
|
||||||
|
using Oqtane.Migrations;
|
||||||
|
using SZUAbsolventenverein.Module.BlackBoard.Migrations.EntityBuilders;
|
||||||
|
using SZUAbsolventenverein.Module.BlackBoard.Repository;
|
||||||
|
|
||||||
|
namespace SZUAbsolventenverein.Module.BlackBoard.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(BlackBoardContext))]
|
||||||
|
[Migration("SZUAbsolventenverein.Module.BlackBoard.01.00.00.01")]
|
||||||
|
public class AddDescriptionColumn : MultiDatabaseMigration
|
||||||
|
{
|
||||||
|
public AddDescriptionColumn(IDatabase database) : base(database)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
var entityBuilder = new BlackBoardEntityBuilder(migrationBuilder, ActiveDatabase);
|
||||||
|
entityBuilder.AddStringColumn("Description", 1000, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
var entityBuilder = new BlackBoardEntityBuilder(migrationBuilder, ActiveDatabase);
|
||||||
|
entityBuilder.DropColumn("Description");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@ namespace SZUAbsolventenverein.Module.BlackBoard.Models
|
|||||||
public int ModuleId { get; set; }
|
public int ModuleId { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public int ImageID { get; set; }
|
public int ImageID { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public string ModuleName => "BlackBoard";
|
public string ModuleName => "BlackBoard";
|
||||||
|
|||||||
Reference in New Issue
Block a user