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.
		
		
		
		
		
			
		
			
				
					
					
						
							61 lines
						
					
					
						
							2.4 KiB
						
					
					
				
			
		
		
	
	
							61 lines
						
					
					
						
							2.4 KiB
						
					
					
				| using Microsoft.EntityFrameworkCore.Metadata;
 | |
| using Microsoft.EntityFrameworkCore.Migrations;
 | |
| 
 | |
| namespace Kehyeedra3.Migrations
 | |
| {
 | |
|     public partial class store : Migration
 | |
|     {
 | |
|         protected override void Up(MigrationBuilder migrationBuilder)
 | |
|         {
 | |
|             migrationBuilder.CreateTable(
 | |
|                 name: "StoreFronts",
 | |
|                 columns: table => new
 | |
|                 {
 | |
|                     Id = table.Column<ulong>(nullable: false)
 | |
|                         .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
 | |
|                     UserId = table.Column<ulong>(nullable: false),
 | |
|                     StoreItemType = table.Column<int>(nullable: false)
 | |
|                 },
 | |
|                 constraints: table =>
 | |
|                 {
 | |
|                     table.PrimaryKey("PK_StoreFronts", x => x.Id);
 | |
|                 });
 | |
| 
 | |
|             migrationBuilder.CreateTable(
 | |
|                 name: "StoreInventory",
 | |
|                 columns: table => new
 | |
|                 {
 | |
|                     InvId = table.Column<ulong>(nullable: false)
 | |
|                         .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
 | |
|                     Item = table.Column<string>(nullable: true),
 | |
|                     Amount = table.Column<int>(nullable: false),
 | |
|                     Price = table.Column<int>(nullable: false),
 | |
|                     StoreFrontId = table.Column<ulong>(nullable: true)
 | |
|                 },
 | |
|                 constraints: table =>
 | |
|                 {
 | |
|                     table.PrimaryKey("PK_StoreInventory", x => x.InvId);
 | |
|                     table.ForeignKey(
 | |
|                         name: "FK_StoreInventory_StoreFronts_StoreFrontId",
 | |
|                         column: x => x.StoreFrontId,
 | |
|                         principalTable: "StoreFronts",
 | |
|                         principalColumn: "Id",
 | |
|                         onDelete: ReferentialAction.Restrict);
 | |
|                 });
 | |
| 
 | |
|             migrationBuilder.CreateIndex(
 | |
|                 name: "IX_StoreInventory_StoreFrontId",
 | |
|                 table: "StoreInventory",
 | |
|                 column: "StoreFrontId");
 | |
|         }
 | |
| 
 | |
|         protected override void Down(MigrationBuilder migrationBuilder)
 | |
|         {
 | |
|             migrationBuilder.DropTable(
 | |
|                 name: "StoreInventory");
 | |
| 
 | |
|             migrationBuilder.DropTable(
 | |
|                 name: "StoreFronts");
 | |
|         }
 | |
|     }
 | |
| }
 | |
| 
 |