using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Api.Database.Migrations
{
///
public partial class CreateDb : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Students",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
FirstName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
LastName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
AlbumNumber = table.Column(type: "nvarchar(6)", maxLength: 6, nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false),
LastModifiedAt = table.Column(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Students", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Students_AlbumNumber",
table: "Students",
column: "AlbumNumber",
unique: true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Students");
}
}
}