20240131192339_addCompany.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace MTWorkHR.Infrastructure.Migrations
  5. {
  6. /// <inheritdoc />
  7. public partial class addCompany : Migration
  8. {
  9. /// <inheritdoc />
  10. protected override void Up(MigrationBuilder migrationBuilder)
  11. {
  12. migrationBuilder.CreateTable(
  13. name: "Companies",
  14. columns: table => new
  15. {
  16. Id = table.Column<long>(type: "bigint", nullable: false)
  17. .Annotation("SqlServer:Identity", "1, 1"),
  18. CreateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
  19. UpdateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
  20. CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
  21. UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
  22. UserId = table.Column<long>(type: "bigint", nullable: false),
  23. CompanyName = table.Column<string>(type: "nvarchar(max)", nullable: false),
  24. CRNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
  25. TaxNumber = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
  26. IsDeleted = table.Column<bool>(type: "bit", nullable: false)
  27. },
  28. constraints: table =>
  29. {
  30. table.PrimaryKey("PK_Companies", x => x.Id);
  31. });
  32. }
  33. /// <inheritdoc />
  34. protected override void Down(MigrationBuilder migrationBuilder)
  35. {
  36. migrationBuilder.DropTable(
  37. name: "Companies");
  38. }
  39. }
  40. }