using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Knot.Shared.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class InitialSystem : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.EnsureSchema(
                name: "system");

            migrationBuilder.CreateTable(
                name: "DailyStats",
                schema: "system",
                columns: table => new
                {
                    Date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
                    TotalMessages = table.Column<long>(type: "bigint", nullable: false),
                    TotalFilesSize = table.Column<long>(type: "bigint", nullable: false),
                    ActiveUsers = table.Column<long>(type: "bigint", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DailyStats", x => x.Date);
                });

            migrationBuilder.CreateTable(
                name: "Settings",
                schema: "system",
                columns: table => new
                {
                    Key = table.Column<string>(type: "text", nullable: false),
                    EncryptedValue = table.Column<string>(type: "text", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Settings", x => x.Key);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "DailyStats",
                schema: "system");

            migrationBuilder.DropTable(
                name: "Settings",
                schema: "system");
        }
    }
}
