using Exferia_Aplicacion.General;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Exferia_Aplicacion.General.Enumerados;

namespace Exferia_EntityFramework.Script_Actualizacion
{
    public class Scripts_Version_1160
    {
        public static Version G_VRS_VERSION = new Version("1.1.6.0");
        public static long G_LNG_VERSION = 1160;
        public static int G_INT_TIPO = 0;
        public static string G_STR_SCRIPT =
                                    //AÑADIR el campo porDefecto a la tabla HPV_Terminales_Salas
                                    "IF not exists " +
                                      "( " +
                                      "    SELECT * " +
                                      "    FROM INFORMATION_SCHEMA.COLUMNS " +
                                      "    WHERE COLUMN_NAME='porDefecto' AND TABLE_NAME = 'HPV_Terminales_Salas' " +
                                      ") " +
                                    "BEGIN " +
                                        " ALTER TABLE [HPV_Terminales_Salas]ADD[porDefecto] bit NOT NULL " +
                                    "END " +
                                    //AÑADIR el campo orden a la tabla HPV_PLV
                                    "IF not exists " +
                                      "( " +
                                      "    SELECT * " +
                                      "    FROM INFORMATION_SCHEMA.COLUMNS " +
                                      "    WHERE COLUMN_NAME='orden' AND TABLE_NAME = 'HPV_PLV' " +
                                      ") " +
                                    "BEGIN " +
                                        " ALTER TABLE [HPV_PLV]ADD[orden] int NULL " +
                                    "END " +
                                    //AÑADIR el campo orden a la tabla HPV_AgrupacionesPLVLineas
                                    "IF not exists " +
                                      "( " +
                                      "    SELECT * " +
                                      "    FROM INFORMATION_SCHEMA.COLUMNS " +
                                      "    WHERE COLUMN_NAME='orden' AND TABLE_NAME = 'HPV_AgrupacionesPLVLineas' " +
                                      ") " +
                                    "BEGIN " +
                                        " ALTER TABLE [HPV_AgrupacionesPLVLineas]ADD[orden] int NULL " +
                                    "END " +
                                    //AÑADIR el campo liquidacionCiega a la tabla HPV_Camareros
                                    "IF not exists " +
                                      "( " +
                                      "    SELECT * " +
                                      "    FROM INFORMATION_SCHEMA.COLUMNS " +
                                      "    WHERE COLUMN_NAME='liquidacionCiega' AND TABLE_NAME = 'HPV_Camareros' " +
                                      ") " +
                                    "BEGIN " +
                                        " ALTER TABLE [HPV_Camareros]ADD[liquidacionCiega] bit NULL " +
                                    "END ";

    }
}
