76 lines
2.3 KiB
C#
76 lines
2.3 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Cloud.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddUsersAndSyncCardNotes : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropPrimaryKey(
|
|
name: "PK_CardNotes",
|
|
table: "CardNotes");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "Username",
|
|
table: "CardNotes",
|
|
type: "text",
|
|
nullable: false,
|
|
defaultValue: "");
|
|
|
|
migrationBuilder.AddColumn<DateTime>(
|
|
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<string>(type: "text", nullable: false),
|
|
Password = table.Column<string>(type: "text", nullable: false),
|
|
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Users", x => x.Username);
|
|
});
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
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");
|
|
}
|
|
}
|
|
}
|