using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Exferia_EntityFramework.Script_Actualizacion
{
    public class Scripts_Version_1111
    {
        public static Version G_VRS_VERSION = new Version("1.1.1.1");
        public static long G_LNG_VERSION = 1111;
        public static int G_INT_TIPO = 0;
        public static string G_STR_SCRIPT =
                                    //AÑADIR el campo saldoInicial a la tabla MAE_Tesorerias
                                    "IF not exists " +
                                      "( " +
                                      "    SELECT * " +
                                      "    FROM INFORMATION_SCHEMA.COLUMNS " +
                                      "    WHERE COLUMN_NAME='saldoInicial' AND TABLE_NAME = 'MAE_Tesorerias' " +
                                      ") " +
                                    "BEGIN " +
                                        " ALTER TABLE [MAE_Tesorerias]ADD[saldoInicial] decimal (18,4) NULL " +
                                    "END " +
                                    //AÑADIR el campo fechaSaldo a la tabla MAE_Tesorerias
                                    "IF not exists " +
                                      "( " +
                                      "    SELECT * " +
                                      "    FROM INFORMATION_SCHEMA.COLUMNS " +
                                      "    WHERE COLUMN_NAME='fechaSaldo' AND TABLE_NAME = 'MAE_Tesorerias' " +
                                      ") " +
                                    "BEGIN " +
                                        " ALTER TABLE [MAE_Tesorerias]ADD[fechaSaldo] datetime NULL " +
                                    "END " +
                                    //BORRAR TABLA PRE_SaldosIniciales
                                    " IF exists " +
                                    " ( " +
                                        " SELECT * " +
                                        " FROM INFORMATION_SCHEMA.TABLES " +
                                        " WHERE TABLE_NAME = 'PRE_SaldosIniciales' " +
                                    " ) " +
                                    "BEGIN " +
                                        " DROP TABLE PRE_SaldosIniciales " +
                                    "END ";



    }
}
