mirror of
https://github.com/NoiTheCat/WorldTime.git
synced 2024-11-25 01:44:12 +00:00
Noi
745fba06ab
Turned existing database setup into a migration, and all helper methods were moved to the new class for easy migration to the new system.
33 lines
1.1 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|