Skip to content
Snippets Groups Projects

New: Add the Contact Changing functionality to the database and backend

2 files
+ 29
1
Compare changes
  • Side-by-side
  • Inline
Files
2
using FluentMigrator;
namespace Coscine.Migrations.Migrations
{
//yyyymmddhhmm
[Migration(202102021140)]
public class Migration202102021140ContactChange : FluentMigrator.Migration
{
public override void Down()
{
Delete.Table("ContactChange");
}
public override void Up()
{
Create.Table("ContactChange")
.WithColumn("RelationId").AsGuid().PrimaryKey().WithDefault(SystemMethods.NewGuid)
.WithColumn("UserId").AsGuid()
.WithColumn("NewEmail").AsString(200).NotNullable()
.WithColumn("EditDate").AsDateTime().Nullable()
.WithColumn("ConfirmationToken").AsGuid().NotNullable().WithDefault(SystemMethods.NewGuid);
Create.ForeignKey()
.FromTable("ContactChange").ForeignColumn("UserId")
.ToTable("Users").PrimaryColumn("Id");
}
}
}
Loading