using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace FindAndDrive.Persistence.Migrations { public partial class InitialMigration : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ApiKeys", columns: table => new { ApiKeyId = table.Column(type: "uniqueidentifier", nullable: false), ClientId = table.Column(type: "uniqueidentifier", nullable: false), RoleId = table.Column(type: "uniqueidentifier", nullable: false), KeySecretHash = table.Column(type: "nvarchar(max)", nullable: false), Revoked = table.Column(type: "bit", nullable: false), ModifiedAt = table.Column(type: "datetime2", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ApiKeys", x => x.ApiKeyId); }); migrationBuilder.CreateTable( name: "Clients", columns: table => new { ClientId = table.Column(type: "uniqueidentifier", nullable: false), ClientName = table.Column(type: "nvarchar(max)", nullable: false), Active = table.Column(type: "bit", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false), ModifiedAt = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Clients", x => x.ClientId); }); migrationBuilder.CreateTable( name: "Roles", columns: table => new { RoleId = table.Column(type: "uniqueidentifier", nullable: false), RoleName = table.Column(type: "nvarchar(max)", nullable: false), Permissions = table.Column(type: "nvarchar(max)", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false), ModifiedAt = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Roles", x => x.RoleId); }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ApiKeys"); migrationBuilder.DropTable( name: "Clients"); migrationBuilder.DropTable( name: "Roles"); } } }