You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20200608133845_002.cs 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using Microsoft.EntityFrameworkCore.Metadata;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace ProRestaurant.Migrations
  4. {
  5. public partial class _002 : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.AddColumn<string>(
  10. name: "Categories",
  11. table: "Restaurants",
  12. nullable: true);
  13. migrationBuilder.AddColumn<string>(
  14. name: "DeliveryTime",
  15. table: "Restaurants",
  16. nullable: true);
  17. migrationBuilder.CreateTable(
  18. name: "RestaurantCategories",
  19. columns: table => new
  20. {
  21. Id = table.Column<int>(nullable: false)
  22. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  23. Description = table.Column<string>(nullable: true)
  24. },
  25. constraints: table =>
  26. {
  27. table.PrimaryKey("PK_RestaurantCategories", x => x.Id);
  28. });
  29. }
  30. protected override void Down(MigrationBuilder migrationBuilder)
  31. {
  32. migrationBuilder.DropTable(
  33. name: "RestaurantCategories");
  34. migrationBuilder.DropColumn(
  35. name: "Categories",
  36. table: "Restaurants");
  37. migrationBuilder.DropColumn(
  38. name: "DeliveryTime",
  39. table: "Restaurants");
  40. }
  41. }
  42. }