Advertisement
Stefan_Stanchev

Untitled

Mar 25th, 2023
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.93 KB | None | 0 0
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2.  
  3. #nullable disable
  4.  
  5. namespace BankSystem.Migrations
  6. {
  7.     /// <inheritdoc />
  8.     public partial class bank : Migration
  9.     {
  10.         /// <inheritdoc />
  11.         protected override void Up(MigrationBuilder migrationBuilder)
  12.         {
  13.             migrationBuilder.AlterDatabase()
  14.                 .Annotation("MySQL:Charset", "utf8mb4");
  15.  
  16.             migrationBuilder.CreateTable(
  17.                 name: "CreditBooleanInfos",
  18.                 columns: table => new
  19.                 {
  20.                     Card_number = table.Column<string>(type: "varchar(255)", nullable: false),
  21.                     Has_taken_credit = table.Column<bool>(type: "tinyint(1)", nullable: false)
  22.                 },
  23.                 constraints: table =>
  24.                 {
  25.                     table.PrimaryKey("PK_CreditBooleanInfos", x => x.Card_number);
  26.                 })
  27.                 .Annotation("MySQL:Charset", "utf8mb4");
  28.  
  29.             migrationBuilder.CreateTable(
  30.                 name: "CreditDateInfos",
  31.                 columns: table => new
  32.                 {
  33.                     Card_number = table.Column<string>(type: "varchar(255)", nullable: false),
  34.                     Credit_taken_date = table.Column<string>(type: "longtext", nullable: false),
  35.                     Credit_toReturn_date = table.Column<string>(type: "longtext", nullable: false)
  36.                 },
  37.                 constraints: table =>
  38.                 {
  39.                     table.PrimaryKey("PK_CreditDateInfos", x => x.Card_number);
  40.                 })
  41.                 .Annotation("MySQL:Charset", "utf8mb4");
  42.  
  43.             migrationBuilder.CreateTable(
  44.                 name: "CreditMoneyInfos",
  45.                 columns: table => new
  46.                 {
  47.                     Card_number = table.Column<string>(type: "varchar(255)", nullable: false),
  48.                     Credit_amount = table.Column<double>(type: "double", nullable: false),
  49.                     Credit_interest = table.Column<double>(type: "double", nullable: false),
  50.                     Credit_ToBePaid = table.Column<double>(type: "double", nullable: false)
  51.                 },
  52.                 constraints: table =>
  53.                 {
  54.                     table.PrimaryKey("PK_CreditMoneyInfos", x => x.Card_number);
  55.                 })
  56.                 .Annotation("MySQL:Charset", "utf8mb4");
  57.  
  58.             migrationBuilder.CreateTable(
  59.                 name: "UserBankInfos",
  60.                 columns: table => new
  61.                 {
  62.                     Card_number = table.Column<string>(type: "varchar(255)", nullable: false),
  63.                     PIN = table.Column<string>(type: "longtext", nullable: false),
  64.                     IBAN = table.Column<string>(type: "longtext", nullable: false),
  65.                     EGN = table.Column<string>(type: "longtext", nullable: false),
  66.                     Balance = table.Column<double>(type: "double", nullable: false)
  67.                 },
  68.                 constraints: table =>
  69.                 {
  70.                     table.PrimaryKey("PK_UserBankInfos", x => x.Card_number);
  71.                 })
  72.                 .Annotation("MySQL:Charset", "utf8mb4");
  73.  
  74.             migrationBuilder.CreateTable(
  75.                 name: "UserIBANInfos",
  76.                 columns: table => new
  77.                 {
  78.                     IBAN = table.Column<string>(type: "varchar(255)", nullable: false)
  79.                 },
  80.                 constraints: table =>
  81.                 {
  82.                     table.PrimaryKey("PK_UserIBANInfos", x => x.IBAN);
  83.                 })
  84.                 .Annotation("MySQL:Charset", "utf8mb4");
  85.  
  86.             migrationBuilder.CreateTable(
  87.                 name: "UserInfos",
  88.                 columns: table => new
  89.                 {
  90.                     EGN = table.Column<string>(type: "varchar(255)", nullable: false),
  91.                     First_name = table.Column<string>(type: "longtext", nullable: false),
  92.                     Last_name = table.Column<string>(type: "longtext", nullable: false),
  93.                     Email = table.Column<string>(type: "longtext", nullable: false)
  94.                 },
  95.                 constraints: table =>
  96.                 {
  97.                     table.PrimaryKey("PK_UserInfos", x => x.EGN);
  98.                 })
  99.                 .Annotation("MySQL:Charset", "utf8mb4");
  100.         }
  101.  
  102.         /// <inheritdoc />
  103.         protected override void Down(MigrationBuilder migrationBuilder)
  104.         {
  105.             migrationBuilder.DropTable(
  106.                 name: "CreditBooleanInfos");
  107.  
  108.             migrationBuilder.DropTable(
  109.                 name: "CreditDateInfos");
  110.  
  111.             migrationBuilder.DropTable(
  112.                 name: "CreditMoneyInfos");
  113.  
  114.             migrationBuilder.DropTable(
  115.                 name: "UserBankInfos");
  116.  
  117.             migrationBuilder.DropTable(
  118.                 name: "UserIBANInfos");
  119.  
  120.             migrationBuilder.DropTable(
  121.                 name: "UserInfos");
  122.         }
  123.     }
  124. }
  125.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement