using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Modules.Rating.Api.Migrations { /// public partial class M001 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Rates"); migrationBuilder.CreateTable( name: "Votes", columns: table => new { ObjectId = table.Column(type: "uuid", nullable: false), SubjectId = table.Column(type: "uuid", nullable: false), RatingPercentage = table.Column(type: "integer", nullable: false), LastUpdate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), VoteDate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()") }, constraints: table => { table.PrimaryKey("PK_Votes", x => new { x.SubjectId, x.ObjectId }); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Votes"); migrationBuilder.CreateTable( name: "Rates", columns: table => new { SubjectId = table.Column(type: "uuid", nullable: false), ObjectId = table.Column(type: "uuid", nullable: false), LastUpdate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), RatePercentage = table.Column(type: "integer", nullable: false), VoteDate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()") }, constraints: table => { table.PrimaryKey("PK_Rates", x => new { x.SubjectId, x.ObjectId }); }); } } }