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

namespace Exferia_EntityFramework.Script_Actualizacion
{
    class Scripts_Version_1190
    {
        public static Version G_VRS_VERSION = new Version("1.1.9.0");
        public static long G_LNG_VERSION = 1190;
        public static int G_INT_TIPO = 0;
        public static string G_STR_SCRIPT = 
                                            //CREAR TABLA SNC_SincronizacionForzar
                                            " IF not exists " +
                                            " ( " +
                                                " SELECT * " +
                                                " FROM INFORMATION_SCHEMA.TABLES " +
                                                " WHERE TABLE_NAME = 'SNC_SincronizacionForzar' " +
                                            " ) " +
                                            " BEGIN " +
                                                " CREATE TABLE SNC_SincronizacionForzar " +
                                                " ( " +
                                                    " [id] [bigint] IDENTITY (1,1) NOT NULL, " +
                                                    " [idProducto] [bigint] NOT NULL, " +
                                                    " [fechaForzado] datetime NOT NULL, " +
                                                " CONSTRAINT[PK_SNC_SincronizacionForzar] PRIMARY KEY CLUSTERED " +
                                                " ( " +
                                                " [id] ASC " +
                                                " )WITH(PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON[PRIMARY] " +
                                                " ) ON[PRIMARY] " +

                                                //Relaciones
                                                " ALTER TABLE SNC_SincronizacionForzar WITH CHECK ADD CONSTRAINT[FK_SNC_SincronizacionForzar_PRV_Productos] FOREIGN KEY([idProducto]) REFERENCES [PRV_Productos] ([id]) ON DELETE CASCADE " +
                                                " ALTER TABLE SNC_SincronizacionForzar CHECK CONSTRAINT[FK_SNC_SincronizacionForzar_PRV_Productos] " +
                                            " END ";
    }
}
