Commits (8)
......@@ -4,7 +4,7 @@
<RootNamespace>Coscine.Migrations</RootNamespace>
<AssemblyName>Coscine.Migrations</AssemblyName>
<TargetFrameworks>net5.0;net461</TargetFrameworks>
<Version>2.2.1</Version>
<Version>2.3.0</Version>
</PropertyGroup>
<PropertyGroup>
<Authors>RWTH Aachen University</Authors>
......
using FluentMigrator;
namespace Coscine.Migrations.Migrations
{
//yyyymmddhhmm
[Migration(202104221020)]
public class Migration202104221020RemoveQuotaDefault : Migration
{
public override void Down()
{
Alter.Column("Quota").OnTable("ProjectQuotas").AsInt32().NotNullable().WithDefaultValue(25);
}
public override void Up()
{
Alter.Column("Quota").OnTable("ProjectQuotas").AsInt32().NotNullable().WithDefaultValue(0);
}
}
}
using FluentMigrator;
namespace Coscine.Migrations.Migrations
{
//yyyymmddhhmm
[Migration(202104281216)]
public class Migration202104281216InvitationTabel : FluentMigrator.Migration
{
public override void Down()
{
Delete.Table("Invitations");
}
public override void Up()
{
Create.Table("Invitations")
.WithColumn("Id").AsGuid().NotNullable().PrimaryKey().WithDefault(SystemMethods.NewGuid)
.WithColumn("Project").AsGuid().NotNullable()
.WithColumn("Issuer").AsGuid().NotNullable()
.WithColumn("Role").AsGuid().NotNullable()
.WithColumn("InviteeEmail").AsString(200).NotNullable()
.WithColumn("Expiration").AsDateTime().NotNullable()
.WithColumn("Token").AsGuid().NotNullable().WithDefault(SystemMethods.NewGuid);
Create.ForeignKey()
.FromTable("Invitations").ForeignColumn("Project")
.ToTable("Projects").PrimaryColumn("Id");
Create.ForeignKey()
.FromTable("Invitations").ForeignColumn("Issuer")
.ToTable("Users").PrimaryColumn("Id");
Create.ForeignKey()
.FromTable("Invitations").ForeignColumn("Role")
.ToTable("Roles").PrimaryColumn("Id");
}
}
}