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.

20230802213747_about.cs 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace Karsha_Site.Persistance.Migrations
  4. {
  5. public partial class about : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.CreateTable(
  10. name: "Abouts",
  11. columns: table => new
  12. {
  13. ID = table.Column<int>(type: "int", nullable: false)
  14. .Annotation("SqlServer:Identity", "1, 1"),
  15. Title = table.Column<string>(type: "nvarchar(max)", nullable: true),
  16. Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
  17. PostiCode = table.Column<int>(type: "int", nullable: true),
  18. PostiSandogh = table.Column<int>(type: "int", nullable: true),
  19. Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
  20. Instagram = table.Column<string>(type: "nvarchar(max)", nullable: true),
  21. InsertTime = table.Column<DateTime>(type: "datetime2", nullable: false),
  22. UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
  23. IsRemoved = table.Column<bool>(type: "bit", nullable: false),
  24. RemoveTime = table.Column<DateTime>(type: "datetime2", nullable: true)
  25. },
  26. constraints: table =>
  27. {
  28. table.PrimaryKey("PK_Abouts", x => x.ID);
  29. });
  30. migrationBuilder.CreateTable(
  31. name: "AboutAddress",
  32. columns: table => new
  33. {
  34. ID = table.Column<int>(type: "int", nullable: false)
  35. .Annotation("SqlServer:Identity", "1, 1"),
  36. AboutID = table.Column<int>(type: "int", nullable: false),
  37. DisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true),
  38. Address = table.Column<string>(type: "nvarchar(max)", nullable: true),
  39. IsMain = table.Column<bool>(type: "bit", nullable: false),
  40. InsertTime = table.Column<DateTime>(type: "datetime2", nullable: false),
  41. UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
  42. IsRemoved = table.Column<bool>(type: "bit", nullable: false),
  43. RemoveTime = table.Column<DateTime>(type: "datetime2", nullable: true)
  44. },
  45. constraints: table =>
  46. {
  47. table.PrimaryKey("PK_AboutAddress", x => x.ID);
  48. table.ForeignKey(
  49. name: "FK_AboutAddress_Abouts_AboutID",
  50. column: x => x.AboutID,
  51. principalTable: "Abouts",
  52. principalColumn: "ID",
  53. onDelete: ReferentialAction.Cascade);
  54. });
  55. migrationBuilder.CreateTable(
  56. name: "AboutTels",
  57. columns: table => new
  58. {
  59. ID = table.Column<int>(type: "int", nullable: false)
  60. .Annotation("SqlServer:Identity", "1, 1"),
  61. AboutID = table.Column<int>(type: "int", nullable: false),
  62. Title = table.Column<string>(type: "nvarchar(max)", nullable: true),
  63. TelNo = table.Column<int>(type: "int", nullable: false),
  64. IsMain = table.Column<bool>(type: "bit", nullable: false),
  65. InsertTime = table.Column<DateTime>(type: "datetime2", nullable: false),
  66. UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
  67. IsRemoved = table.Column<bool>(type: "bit", nullable: false),
  68. RemoveTime = table.Column<DateTime>(type: "datetime2", nullable: true)
  69. },
  70. constraints: table =>
  71. {
  72. table.PrimaryKey("PK_AboutTels", x => x.ID);
  73. table.ForeignKey(
  74. name: "FK_AboutTels_Abouts_AboutID",
  75. column: x => x.AboutID,
  76. principalTable: "Abouts",
  77. principalColumn: "ID",
  78. onDelete: ReferentialAction.Cascade);
  79. });
  80. migrationBuilder.CreateIndex(
  81. name: "IX_AboutAddress_AboutID",
  82. table: "AboutAddress",
  83. column: "AboutID");
  84. migrationBuilder.CreateIndex(
  85. name: "IX_AboutTels_AboutID",
  86. table: "AboutTels",
  87. column: "AboutID");
  88. }
  89. protected override void Down(MigrationBuilder migrationBuilder)
  90. {
  91. migrationBuilder.DropTable(
  92. name: "AboutAddress");
  93. migrationBuilder.DropTable(
  94. name: "AboutTels");
  95. migrationBuilder.DropTable(
  96. name: "Abouts");
  97. }
  98. }
  99. }