Skip to content

Commit d22e004

Browse files
committed
TD-4672-Table constraint altered to add utc date
1 parent 97783c5 commit d22e004

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
5+
[Migration(202409300912)]
6+
public class AlterConstraintForCandidateAssessmentsAddUtcDate : Migration
7+
{
8+
public override void Up()
9+
{
10+
Execute.Sql(@$"ALTER TABLE [dbo].[CandidateAssessments] DROP CONSTRAINT [DF_CandidateAssessments_StartedDate];
11+
ALTER TABLE [dbo].[CandidateAssessments] ADD CONSTRAINT [DF_CandidateAssessments_StartedDate] DEFAULT (GETUTCDATE()) FOR [StartedDate];");
12+
}
13+
public override void Down()
14+
{
15+
Execute.Sql(@$"ALTER TABLE [dbo].[CandidateAssessments] DROP CONSTRAINT [DF_CandidateAssessments_StartedDate];
16+
ALTER TABLE [dbo].[CandidateAssessments] ADD CONSTRAINT [DF_CandidateAssessments_StartedDate] DEFAULT (GETDATE()) FOR [StartedDate];");
17+
}
18+
19+
}
20+
}

0 commit comments

Comments
 (0)