Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class InitialMigration : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "CreditMoneyInfos",
- columns: table => new
- {
- card_number = table.Column<string>(type: "char(19)", nullable: false),
- credit_amount = table.Column<double>(nullable: false),
- credit_interest = table.Column<double>(nullable: false),
- credit_toBePaid = table.Column<double>(nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_CreditMoneyInfos", x => x.card_number);
- });
- migrationBuilder.CreateTable(
- name: "CreditDateInfos",
- columns: table => new
- {
- card_number = table.Column<string>(type: "char(19)", nullable: false),
- credit_taken_date = table.Column<DateTime>(type: "date", nullable: false),
- credit_toReturn_date = table.Column<DateTime>(type: "date", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_CreditDateInfos", x => x.card_number);
- });
- migrationBuilder.CreateTable(
- name: "CreditBooleanInfos",
- columns: table => new
- {
- card_number = table.Column<string>(type: "char(19)", nullable: false),
- has_taken_credit = table.Column<bool>(nullable: false, defaultValue: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_CreditBooleanInfos", x => x.card_number);
- table.ForeignKey(
- name: "fk_CreditBooleanInfos_CreditDateInfos",
- column: x => x.card_number,
- principalTable: "CreditDateInfos",
- principalColumn: "card_number",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "fk_CreditBooleanInfos_CreditMoneyInfos",
- column: x => x.card_number,
- principalTable: "CreditMoneyInfos",
- principalColumn: "card_number",
- onDelete: ReferentialAction.Cascade);
- });
- migrationBuilder.CreateTable(
- name: "UserIBANInfos",
- columns: table => new
- {
- IBAN = table.Column<string>(type: "char(20)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_UserIBANInfos", x => x.IBAN);
- });
- migrationBuilder.CreateTable(
- name: "UserInfos",
- columns: table => new
- {
- EGN = table.Column<string>(type: "char(10)", nullable: false),
- first_name = table.Column<string>(type: "varchar(20)", nullable: false),
- last_name = table.Column<string>(type: "varchar(20)", nullable: false),
- email = table.Column<string>(type: "varchar(30)", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_UserInfos", x => x.EGN);
- });
- migrationBuilder.CreateTable(
- name: "UserBankInfos",
- columns: table => new
- {
- card_number = table.Column<string>(type: "char(19)", nullable: false),
- pin = table.Column<string>(type: "char(4)", nullable: false),
- IBAN = table.Column<string>(type: "char(20)", nullable: false),
- EGN = table.Column<string>(type: "char(10)", nullable: false),
- balance = table.Column<double>(nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_UserBankInfos", x => x.card_number);
- table.ForeignKey(
- name: "fk_UserBankInfos_UserIBANInfos",
- column: x =>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement