您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

20170824130007_AddPersons.cs 1.1 KiB

123456789101112131415161718192021222324252627282930313233
  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. }