using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace ASC.Migrations.MySql.Migrations { public partial class CustomDbContextMigrate : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterDatabase() .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "dbip_location", columns: table => new { id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), addr_type = table.Column(type: "enum('ipv4','ipv6')", nullable: false, collation: "utf8_general_ci") .Annotation("MySql:CharSet", "utf8"), ip_start = table.Column(type: "varchar(39)", nullable: false, collation: "utf8_general_ci") .Annotation("MySql:CharSet", "utf8"), ip_end = table.Column(type: "varchar(39)", nullable: false, collation: "utf8_general_ci") .Annotation("MySql:CharSet", "utf8"), country = table.Column(type: "varchar(2)", nullable: false, collation: "utf8_general_ci") .Annotation("MySql:CharSet", "utf8"), stateprov = table.Column(type: "varchar(255)", nullable: false, collation: "utf8_general_ci") .Annotation("MySql:CharSet", "utf8"), district = table.Column(type: "varchar(255)", nullable: true, collation: "utf8_general_ci") .Annotation("MySql:CharSet", "utf8"), city = table.Column(type: "varchar(255)", nullable: false, collation: "utf8_general_ci") .Annotation("MySql:CharSet", "utf8"), zipcode = table.Column(type: "varchar(255)", nullable: true, collation: "utf8_general_ci") .Annotation("MySql:CharSet", "utf8"), latitude = table.Column(type: "float", nullable: true, defaultValueSql: "NULL"), longitude = table.Column(type: "float", nullable: true, defaultValueSql: "NULL"), geoname_id = table.Column(type: "int", nullable: true, defaultValueSql: "NULL"), timezone_offset = table.Column(type: "int", nullable: true, defaultValueSql: "NULL"), timezone_name = table.Column(type: "varchar(255)", nullable: true, collation: "utf8_general_ci") .Annotation("MySql:CharSet", "utf8"), processed = table.Column(type: "int", nullable: false, defaultValueSql: "'1'") }, constraints: table => { table.PrimaryKey("PK_dbip_location", x => x.id); }) .Annotation("MySql:CharSet", "utf8"); migrationBuilder.CreateTable( name: "mobile_app_install", columns: table => new { user_email = table.Column(type: "varchar(255)", nullable: false, collation: "utf8_general_ci") .Annotation("MySql:CharSet", "utf8"), app_type = table.Column(type: "int", nullable: false), registered_on = table.Column(type: "datetime", nullable: false), last_sign = table.Column(type: "datetime", nullable: true, defaultValueSql: "NULL") }, constraints: table => { table.PrimaryKey("PRIMARY", x => new { x.user_email, x.app_type }); }) .Annotation("MySql:CharSet", "utf8"); migrationBuilder.CreateTable( name: "Regions", columns: table => new { Region = table.Column(type: "varchar(255)", nullable: false) .Annotation("MySql:CharSet", "utf8"), Provider = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8"), ConnectionString = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8") }, constraints: table => { table.PrimaryKey("PK_Regions", x => x.Region); }) .Annotation("MySql:CharSet", "utf8"); migrationBuilder.CreateIndex( name: "ip_start", table: "dbip_location", column: "ip_start"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "dbip_location"); migrationBuilder.DropTable( name: "mobile_app_install"); migrationBuilder.DropTable( name: "Regions"); } } }