Set news date as DateTime.

This commit is contained in:
2019-05-18 23:05:54 +01:00
parent b8614aca51
commit c93e29b181
6 changed files with 1946 additions and 6 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Cicm.Database.Migrations
{
public partial class NewsDateAsDateTime : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>("date", "news", "datetime", nullable: false,
oldClrType: typeof(string), oldType: "char(20)",
oldDefaultValueSql: "''");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>("date", "news", "char(20)", nullable: false, defaultValueSql: "''",
oldClrType: typeof(DateTime), oldType: "datetime");
}
}
}

View File

@@ -498,8 +498,7 @@ namespace Cicm.Database.Migrations
b.Property<int>("AddedId").ValueGeneratedOnAdd().HasColumnName("added_id").HasColumnType("int(11)")
.HasDefaultValueSql("'0'");
b.Property<string>("Date").IsRequired().ValueGeneratedOnAdd().HasColumnName("date")
.HasColumnType("char(20)").HasDefaultValueSql("''");
b.Property<DateTime>("Date").HasColumnName("date").HasColumnType("datetime");
b.Property<int>("Type").ValueGeneratedOnAdd().HasColumnName("type").HasColumnType("int(11)")
.HasDefaultValueSql("'0'");