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

namespace Exferia_EntityFramework.Script_Actualizacion
{
    class Scripts_Version_1382
    {
        public static Version G_VRS_VERSION = new Version("1.3.8.2");
        public static long G_LNG_VERSION = 1382;
        public static int G_INT_TIPO = 0;
        public static string G_STR_SCRIPT =
                                    //CREAR TABLA USR_Accesos
                                    " IF not exists " +
                                    " ( " +
                                        " SELECT * " +
                                        " FROM INFORMATION_SCHEMA.TABLES " +
                                        " WHERE TABLE_NAME = 'USR_Accesos' " +
                                    " ) " +
                                    " BEGIN " +
                                        " CREATE TABLE USR_Accesos " +
                                        " ( " +
                                            " [id] [bigint] IDENTITY(1,1) NOT NULL, " +
                                            " [fechaHora] [datetime] NOT NULL, " +
                                            " [tipo] [varchar](100) NOT NULL, " +
                                            " [idUsuario][bigint] NULL," +
                                            " [observaciones][varchar](500) NULL," +
                                        " CONSTRAINT[PK_USR_Accesos] 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[dbo].[USR_Accesos] WITH CHECK ADD CONSTRAINT[FK_USR_Accesos_USR_Usuarios] FOREIGN KEY([idUsuario]) REFERENCES[dbo].[USR_Usuarios] ([id]) " +
                                        " ALTER TABLE[dbo].[USR_Accesos] CHECK CONSTRAINT[FK_USR_Accesos_USR_Usuarios] " +
                                    " END ";





    }
}
