using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace SmartAquaViewer.Migrations
{
    /// <inheritdoc />
    public partial class InitialCreate : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterDatabase()
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "WaterQuality",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    WaterTankNum = table.Column<int>(type: "int", nullable: false),
                    DO = table.Column<double>(type: "double", nullable: false),
                    PH = table.Column<double>(type: "double", nullable: false),
                    Temperature = table.Column<double>(type: "double", nullable: false),
                    WaterLevel = table.Column<double>(type: "double", nullable: false),
                    FlowRate = table.Column<double>(type: "double", nullable: false),
                    ElectricalConductivity = table.Column<double>(type: "double", nullable: false),
                    Turbidity = table.Column<double>(type: "double", nullable: false),
                    Salinity = table.Column<double>(type: "double", nullable: false),
                    ORP = table.Column<double>(type: "double", nullable: false),
                    TSS = table.Column<double>(type: "double", nullable: false),
                    TotalNitrogen = table.Column<double>(type: "double", nullable: false),
                    TotalPhosphorus = table.Column<double>(type: "double", nullable: false),
                    Timestamp = table.Column<DateTime>(type: "datetime(6)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WaterQuality", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "WaterQuality");
        }
    }
}
