using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace Demo1.Migrations { /// public partial class InitialCreate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Groups", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Name = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Groups", x => x.Id); }); migrationBuilder.CreateTable( name: "Presence", columns: table => new { Id = table.Column(type: "uuid", nullable: false), Date = table.Column(type: "timestamp with time zone", nullable: false), LessonNumber = table.Column(type: "integer", nullable: false), IsAttendance = table.Column(type: "boolean", nullable: false), UserId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Presence", x => x.Id); }); migrationBuilder.CreateTable( name: "Users", columns: table => new { Id = table.Column(type: "uuid", nullable: false), FIO = table.Column(type: "text", nullable: false), GroupID = table.Column(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Groups"); migrationBuilder.DropTable( name: "Presence"); migrationBuilder.DropTable( name: "Users"); } } }