using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace SportCompetitionsDatabaseImplement.Migrations { /// public partial class aboba : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Competitions", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), CompetitionName = table.Column(type: "text", nullable: false), CompetitionDateHolding = table.Column(type: "timestamp without time zone", nullable: false), CompetitionCity = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Competitions", x => x.Id); }); migrationBuilder.CreateTable( name: "Members", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), MemberFCs = table.Column(type: "text", nullable: false), MemberBirthDate = table.Column(type: "timestamp without time zone", nullable: false), MemberGender = table.Column(type: "text", nullable: false), TeamId = table.Column(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Members", x => x.Id); }); migrationBuilder.CreateTable( name: "Records", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), RecordName = table.Column(type: "text", nullable: false), RecordDecriptiption = table.Column(type: "text", nullable: false), MemberId = table.Column(type: "integer", nullable: false), RecordDate = table.Column(type: "timestamp without time zone", nullable: false), RecordValue = table.Column(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Records", x => x.Id); }); migrationBuilder.CreateTable( name: "Results", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), ResultName = table.Column(type: "text", nullable: false), CompetitionId = table.Column(type: "integer", nullable: false), TeamId = table.Column(type: "integer", nullable: false), ResultPosition = table.Column(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Results", x => x.Id); }); migrationBuilder.CreateTable( name: "Teams", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), TeamName = table.Column(type: "text", nullable: false), TeamCountry = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Teams", x => x.Id); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Competitions"); migrationBuilder.DropTable( name: "Members"); migrationBuilder.DropTable( name: "Records"); migrationBuilder.DropTable( name: "Results"); migrationBuilder.DropTable( name: "Teams"); } } }