Skip to content

Commit

Permalink
Limpieza de codigo.
Browse files Browse the repository at this point in the history
  • Loading branch information
dnievas04 committed Apr 2, 2020
1 parent 798a9c6 commit 12ecf08
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 57 deletions.
4 changes: 0 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
const logger = require('./logger').logger;
const db = require('./db');
const poll = require('./poll');
const sim = require('./sim'); // Modulo temporal para simular fichadas. Remover en prod

async function main(){
try {
// Establecemos las conexiones a mongo y sqlserver
const mongoDB = await db.connectMongoDB();
const sqlPool = await db.connectSQLServerDB();
// Simulamos las fichadas. Solo para testing del script
// sim.simulateFichadas(sqlPool);
// Sincronizamos
poll.syncFichadas(sqlPool);

Expand All @@ -18,5 +15,4 @@ async function main(){
}
}


main();
54 changes: 1 addition & 53 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,56 +18,4 @@ module.exports = {
diffHours: diffHours,
parseDate: parseDate,
timeout: timeout
}


// USE [Hospital]
// GO

// /****** Object: Table [dbo].[Personal_FichadasSync] Script Date: 01/04/2020 13:15:00 ******/
// SET ANSI_NULLS ON
// GO

// SET QUOTED_IDENTIFIER ON
// GO

// CREATE TABLE [dbo].[Personal_FichadasSync](
// [id] [int] IDENTITY(1,1) NOT NULL,
// [idFichada] [int] NOT NULL,
// [idAgente] [int] NOT NULL,
// [fecha] [datetime] NOT NULL,
// [esEntrada] [bit] NULL,
// [reloj] [int] NOT NULL,
// [format] [varchar](50) NULL,
// [data1] [nvarchar](30) NULL,
// [data2] [nvarchar](30) NULL,
// CONSTRAINT [PK_Personal_FichadaSync] 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]
// GO


// TRIGGER
// USE [Hospital]
// GO

// SET ANSI_NULLS ON
// GO

// SET QUOTED_IDENTIFIER ON
// GO

// -- ========================================================
// -- Author: dnievas
// -- Create date: 01/04/2020
// -- Description: Copia todos los valores insertados a la tabla Personal_FichadasSync
// -- ========================================================
// CREATE trigger [dbo].[trg_Copy_Fichadas] on [dbo].[Personal_FichadasTemp] for INSERT
// AS
// -- Inserta
// INSERT INTO dbo.Personal_FichadasSync
// SELECT * FROM inserted
// GO

}

0 comments on commit 12ecf08

Please sign in to comment.