using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace ASC.Migrations.PostgreSql.Migrations { public partial class UrlShortenerFakeDbContextMigrate : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "short_links", columns: table => new { id = table.Column(type: "int(10)", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), @short = table.Column(name: "short", type: "varchar(12)", nullable: true, collation: "utf8_general_ci"), link = table.Column(type: "text", nullable: true, collation: "utf8_bin") }, constraints: table => { table.PrimaryKey("PRIMARY", x => x.id); }); migrationBuilder.CreateIndex( name: "IX_short_links_short", table: "short_links", column: "short", unique: true); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "short_links"); } } }