Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

34 wiersze
1.1 KiB

  1. using Microsoft.EntityFrameworkCore.Metadata;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. using System;
  4. using System.Collections.Generic;
  5. namespace Sample.RabbitMQ.SqlServer.Migrations
  6. {
  7. public partial class AddPersons : Migration
  8. {
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.CreateTable(
  12. name: "Persons",
  13. columns: table => new
  14. {
  15. Id = table.Column<int>(type: "int", nullable: false)
  16. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  17. Age = table.Column<int>(type: "int", nullable: false),
  18. Name = table.Column<string>(type: "nvarchar(max)", nullable: true)
  19. },
  20. constraints: table =>
  21. {
  22. table.PrimaryKey("PK_Persons", x => x.Id);
  23. });
  24. }
  25. protected override void Down(MigrationBuilder migrationBuilder)
  26. {
  27. migrationBuilder.DropTable(
  28. name: "Persons");
  29. }
  30. }
  31. }