WorldTime/Data/Migrations/20220628235704_InitialMigration.cs
Noi 745fba06ab Switch to Entity Framework
Turned existing database setup into a migration, and all helper methods
were moved to the new class for easy migration to the new system.
2022-06-28 17:27:31 -07:00

33 lines
1.1 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WorldTime.Data.Migrations
{
public partial class InitialMigration : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "userdata",
columns: table => new
{
guild_id = table.Column<long>(type: "bigint", nullable: false),
user_id = table.Column<long>(type: "bigint", nullable: false),
zone = table.Column<string>(type: "text", nullable: false),
last_active = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()")
},
constraints: table =>
{
table.PrimaryKey("userdata_pkey", x => new { x.guild_id, x.user_id });
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "userdata");
}
}
}