using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace ReallifeGamemode.Database.Migrations { public partial class LoginLogoutLogs : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "LoginLogoutLogs", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Username = table.Column(nullable: true), SocialClubName = table.Column(nullable: true), UserId = table.Column(nullable: true), PlayerId = table.Column(nullable: false), IpAddress = table.Column(nullable: true), LoginLogout = table.Column(nullable: false), Time = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_LoginLogoutLogs", x => x.Id); table.ForeignKey( name: "FK_LoginLogoutLogs_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_LoginLogoutLogs_UserId", table: "LoginLogoutLogs", column: "UserId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "LoginLogoutLogs"); } } }