@ -1,43 +0,0 @@ | |||
using System; | |||
using Microsoft.EntityFrameworkCore.Migrations; | |||
#nullable disable | |||
namespace Acme.BookStore.Migrations | |||
{ | |||
/// <inheritdoc /> | |||
public partial class Created_Book_Entity : Migration | |||
{ | |||
/// <inheritdoc /> | |||
protected override void Up(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.CreateTable( | |||
name: "AppBooks", | |||
columns: table => new | |||
{ | |||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | |||
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), | |||
Type = table.Column<int>(type: "int", nullable: false), | |||
PublishDate = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
Price = table.Column<float>(type: "real", nullable: false), | |||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false), | |||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false), | |||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), | |||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) | |||
}, | |||
constraints: table => | |||
{ | |||
table.PrimaryKey("PK_AppBooks", x => x.Id); | |||
}); | |||
} | |||
/// <inheritdoc /> | |||
protected override void Down(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.DropTable( | |||
name: "AppBooks"); | |||
} | |||
} | |||
} |
@ -1,50 +0,0 @@ | |||
using System; | |||
using Microsoft.EntityFrameworkCore.Migrations; | |||
#nullable disable | |||
namespace Acme.BookStore.Migrations | |||
{ | |||
/// <inheritdoc /> | |||
public partial class Added_Authors : Migration | |||
{ | |||
/// <inheritdoc /> | |||
protected override void Up(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.CreateTable( | |||
name: "AppAuthors", | |||
columns: table => new | |||
{ | |||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | |||
Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), | |||
BirthDate = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
ShortBio = table.Column<string>(type: "nvarchar(max)", nullable: false), | |||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false), | |||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false), | |||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), | |||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), | |||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) | |||
}, | |||
constraints: table => | |||
{ | |||
table.PrimaryKey("PK_AppAuthors", x => x.Id); | |||
}); | |||
migrationBuilder.CreateIndex( | |||
name: "IX_AppAuthors_Name", | |||
table: "AppAuthors", | |||
column: "Name"); | |||
} | |||
/// <inheritdoc /> | |||
protected override void Down(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.DropTable( | |||
name: "AppAuthors"); | |||
} | |||
} | |||
} |
@ -1,47 +0,0 @@ | |||
using System; | |||
using Microsoft.EntityFrameworkCore.Migrations; | |||
#nullable disable | |||
namespace Acme.BookStore.Migrations | |||
{ | |||
/// <inheritdoc /> | |||
public partial class Added_Customers : Migration | |||
{ | |||
/// <inheritdoc /> | |||
protected override void Up(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.CreateTable( | |||
name: "AppCustomers", | |||
columns: table => new | |||
{ | |||
Id = table.Column<int>(type: "int", nullable: false) | |||
.Annotation("SqlServer:Identity", "1, 1"), | |||
firstName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false), | |||
lastName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false), | |||
phone = table.Column<string>(type: "nvarchar(14)", maxLength: 14, nullable: false), | |||
address = table.Column<string>(type: "nvarchar(max)", nullable: false), | |||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false), | |||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false), | |||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), | |||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), | |||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) | |||
}, | |||
constraints: table => | |||
{ | |||
table.PrimaryKey("PK_AppCustomers", x => x.Id); | |||
}); | |||
} | |||
/// <inheritdoc /> | |||
protected override void Down(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.DropTable( | |||
name: "AppCustomers"); | |||
} | |||
} | |||
} |
@ -1,50 +0,0 @@ | |||
using System; | |||
using Microsoft.EntityFrameworkCore.Migrations; | |||
#nullable disable | |||
namespace Acme.BookStore.Migrations | |||
{ | |||
/// <inheritdoc /> | |||
public partial class Added_BookIssued : Migration | |||
{ | |||
/// <inheritdoc /> | |||
protected override void Up(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.EnsureSchema( | |||
name: "BKN"); | |||
migrationBuilder.CreateTable( | |||
name: "AppBookIssued", | |||
schema: "BKN", | |||
columns: table => new | |||
{ | |||
Id = table.Column<int>(type: "int", nullable: false) | |||
.Annotation("SqlServer:Identity", "1, 1"), | |||
bookId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | |||
customerId = table.Column<int>(type: "int", nullable: false), | |||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false), | |||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false), | |||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), | |||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), | |||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) | |||
}, | |||
constraints: table => | |||
{ | |||
table.PrimaryKey("PK_AppBookIssued", x => x.Id); | |||
}); | |||
} | |||
/// <inheritdoc /> | |||
protected override void Down(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.DropTable( | |||
name: "AppBookIssued", | |||
schema: "BKN"); | |||
} | |||
} | |||
} |
@ -0,0 +1,126 @@ | |||
using System; | |||
using Microsoft.EntityFrameworkCore.Migrations; | |||
#nullable disable | |||
namespace Acme.BookStore.Migrations | |||
{ | |||
/// <inheritdoc /> | |||
public partial class Change_Table_ColumnType : Migration | |||
{ | |||
/// <inheritdoc /> | |||
protected override void Up(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.CreateTable( | |||
name: "AppAuthors", | |||
columns: table => new | |||
{ | |||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | |||
Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), | |||
BirthDate = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
ShortBio = table.Column<string>(type: "nvarchar(max)", nullable: false), | |||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false), | |||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false), | |||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), | |||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), | |||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) | |||
}, | |||
constraints: table => | |||
{ | |||
table.PrimaryKey("PK_AppAuthors", x => x.Id); | |||
}); | |||
migrationBuilder.CreateTable( | |||
name: "AppBookIssued", | |||
columns: table => new | |||
{ | |||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | |||
bookId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | |||
customerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | |||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false), | |||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false), | |||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), | |||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), | |||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) | |||
}, | |||
constraints: table => | |||
{ | |||
table.PrimaryKey("PK_AppBookIssued", x => x.Id); | |||
}); | |||
migrationBuilder.CreateTable( | |||
name: "AppBooks", | |||
columns: table => new | |||
{ | |||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | |||
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), | |||
Type = table.Column<int>(type: "int", nullable: false), | |||
PublishDate = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
Price = table.Column<float>(type: "real", nullable: false), | |||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false), | |||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false), | |||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), | |||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) | |||
}, | |||
constraints: table => | |||
{ | |||
table.PrimaryKey("PK_AppBooks", x => x.Id); | |||
}); | |||
migrationBuilder.CreateTable( | |||
name: "AppCustomers", | |||
columns: table => new | |||
{ | |||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | |||
firstName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false), | |||
lastName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false), | |||
phone = table.Column<string>(type: "nvarchar(14)", maxLength: 14, nullable: false), | |||
address = table.Column<string>(type: "nvarchar(max)", nullable: false), | |||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false), | |||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false), | |||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), | |||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), | |||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) | |||
}, | |||
constraints: table => | |||
{ | |||
table.PrimaryKey("PK_AppCustomers", x => x.Id); | |||
}); | |||
migrationBuilder.CreateIndex( | |||
name: "IX_AppAuthors_Name", | |||
table: "AppAuthors", | |||
column: "Name"); | |||
} | |||
/// <inheritdoc /> | |||
protected override void Down(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.DropTable( | |||
name: "AppAuthors"); | |||
migrationBuilder.DropTable( | |||
name: "AppBookIssued"); | |||
migrationBuilder.DropTable( | |||
name: "AppBooks"); | |||
migrationBuilder.DropTable( | |||
name: "AppCustomers"); | |||
} | |||
} | |||
} |