using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Cloud.Migrations { /// public partial class AddUsersAndSyncCardNotes : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropPrimaryKey( name: "PK_CardNotes", table: "CardNotes"); migrationBuilder.AddColumn( name: "Username", table: "CardNotes", type: "text", nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "UpdatedAt", table: "CardNotes", type: "timestamp with time zone", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); migrationBuilder.AddPrimaryKey( name: "PK_CardNotes", table: "CardNotes", columns: new[] { "Username", "CardName" }); migrationBuilder.CreateTable( name: "Users", columns: table => new { Username = table.Column(type: "text", nullable: false), Password = table.Column(type: "text", nullable: false), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Username); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Users"); migrationBuilder.DropPrimaryKey( name: "PK_CardNotes", table: "CardNotes"); migrationBuilder.DropColumn( name: "Username", table: "CardNotes"); migrationBuilder.DropColumn( name: "UpdatedAt", table: "CardNotes"); migrationBuilder.AddPrimaryKey( name: "PK_CardNotes", table: "CardNotes", column: "CardName"); } } }