82 lines
3.1 KiB
C#
82 lines
3.1 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Mccn.Modules.Hello.Infrastructure.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class InitialCreate : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.EnsureSchema(
|
|
name: "hello");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "inbox_message_consumers",
|
|
schema: "hello",
|
|
columns: table => new
|
|
{
|
|
inbox_message_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
name = table.Column<string>(type: "text", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_inbox_message_consumers", x => new { x.inbox_message_id, x.name });
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "inbox_messages",
|
|
schema: "hello",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
type = table.Column<string>(type: "text", nullable: false),
|
|
content = table.Column<string>(type: "text", nullable: false),
|
|
occurred_on_utc = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
processed_on_utc = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
|
error = table.Column<string>(type: "text", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_inbox_messages", x => x.id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "welcomed_users",
|
|
schema: "hello",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
user_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
email = table.Column<string>(type: "text", nullable: false),
|
|
first_name = table.Column<string>(type: "text", nullable: false),
|
|
last_name = table.Column<string>(type: "text", nullable: false),
|
|
welcomed_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_welcomed_users", x => x.id);
|
|
});
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "inbox_message_consumers",
|
|
schema: "hello");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "inbox_messages",
|
|
schema: "hello");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "welcomed_users",
|
|
schema: "hello");
|
|
}
|
|
}
|
|
}
|