Advertisement
XfreeBG

Untitled

Mar 24th, 2023
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.07 KB | None | 0 0
  1. public partial class InitialMigration : Migration
  2. {
  3. protected override void Up(MigrationBuilder migrationBuilder)
  4. {
  5. migrationBuilder.CreateTable(
  6. name: "CreditMoneyInfos",
  7. columns: table => new
  8. {
  9. card_number = table.Column<string>(type: "char(19)", nullable: false),
  10. credit_amount = table.Column<double>(nullable: false),
  11. credit_interest = table.Column<double>(nullable: false),
  12. credit_toBePaid = table.Column<double>(nullable: false)
  13. },
  14. constraints: table =>
  15. {
  16. table.PrimaryKey("PK_CreditMoneyInfos", x => x.card_number);
  17. });
  18.  
  19. migrationBuilder.CreateTable(
  20. name: "CreditDateInfos",
  21. columns: table => new
  22. {
  23. card_number = table.Column<string>(type: "char(19)", nullable: false),
  24. credit_taken_date = table.Column<DateTime>(type: "date", nullable: false),
  25. credit_toReturn_date = table.Column<DateTime>(type: "date", nullable: false)
  26. },
  27. constraints: table =>
  28. {
  29. table.PrimaryKey("PK_CreditDateInfos", x => x.card_number);
  30. });
  31.  
  32. migrationBuilder.CreateTable(
  33. name: "CreditBooleanInfos",
  34. columns: table => new
  35. {
  36. card_number = table.Column<string>(type: "char(19)", nullable: false),
  37. has_taken_credit = table.Column<bool>(nullable: false, defaultValue: false)
  38. },
  39. constraints: table =>
  40. {
  41. table.PrimaryKey("PK_CreditBooleanInfos", x => x.card_number);
  42. table.ForeignKey(
  43. name: "fk_CreditBooleanInfos_CreditDateInfos",
  44. column: x => x.card_number,
  45. principalTable: "CreditDateInfos",
  46. principalColumn: "card_number",
  47. onDelete: ReferentialAction.Cascade);
  48. table.ForeignKey(
  49. name: "fk_CreditBooleanInfos_CreditMoneyInfos",
  50. column: x => x.card_number,
  51. principalTable: "CreditMoneyInfos",
  52. principalColumn: "card_number",
  53. onDelete: ReferentialAction.Cascade);
  54. });
  55.  
  56. migrationBuilder.CreateTable(
  57. name: "UserIBANInfos",
  58. columns: table => new
  59. {
  60. IBAN = table.Column<string>(type: "char(20)", nullable: false)
  61. },
  62. constraints: table =>
  63. {
  64. table.PrimaryKey("PK_UserIBANInfos", x => x.IBAN);
  65. });
  66.  
  67. migrationBuilder.CreateTable(
  68. name: "UserInfos",
  69. columns: table => new
  70. {
  71. EGN = table.Column<string>(type: "char(10)", nullable: false),
  72. first_name = table.Column<string>(type: "varchar(20)", nullable: false),
  73. last_name = table.Column<string>(type: "varchar(20)", nullable: false),
  74. email = table.Column<string>(type: "varchar(30)", nullable: true)
  75. },
  76. constraints: table =>
  77. {
  78. table.PrimaryKey("PK_UserInfos", x => x.EGN);
  79. });
  80.  
  81. migrationBuilder.CreateTable(
  82. name: "UserBankInfos",
  83. columns: table => new
  84. {
  85. card_number = table.Column<string>(type: "char(19)", nullable: false),
  86. pin = table.Column<string>(type: "char(4)", nullable: false),
  87. IBAN = table.Column<string>(type: "char(20)", nullable: false),
  88. EGN = table.Column<string>(type: "char(10)", nullable: false),
  89. balance = table.Column<double>(nullable: false)
  90. },
  91. constraints: table =>
  92. {
  93. table.PrimaryKey("PK_UserBankInfos", x => x.card_number);
  94. table.ForeignKey(
  95. name: "fk_UserBankInfos_UserIBANInfos",
  96. column: x =>
  97.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement