using Microsoft.EntityFrameworkCore;
using SmartAquaViewer.DataAnalysis;
using System.Collections.Generic;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;


namespace SmartAquaViewer.DataAnalisys
{
    public class AppDbContext : DbContext
    {


        //dotnet tool install --global dotnet-ef
        //dotnet ef migrations add InitialCreate --project SmartAquaViewer
        //dotnet ef database update --project SmartAquaViewer

        //dotnet ef migrations add AddMultipleTables --project SmartAquaViewer
        //dotnet ef database update --project SmartAquaViewer



        public DbSet<WaterQualityVO> WaterQualities { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            // MySQL 연결 문자열 (일반적인 형태)
            var connectionString = "Server=192.168.10.143;Port=3306;Database=smart_aqua;User=root;Password=znqk123!;";

            // MySQL Server Version 설정 (버전에 맞춰 변경)
            var serverVersion = new MySqlServerVersion(new Version(8, 0, 36));

            optionsBuilder.UseMySql(connectionString, serverVersion);
        }

    }
}
