Database maintenance c #

4

I have a system in another language and need to create an updater for this system, however it needs to be run scripts in MySQL for the maintenance of the database.

I searched Java and found Maven that has all this maintenance control and reads the scripts written in SQL. In C # the closest I could get was the code First migrations, however I found no example where it executed SQL Scripts.

My big question is if I can do this with migrations , if not, is there another way to do this in C #?

    
asked by anonymous 23.10.2017 / 19:40

2 answers

0

I'll pass you like I do on a system, which does not work with any Framwork ORM:

In the client database, I have a key:

last_upd_sql

I have stored the code of the last update of the database that was received.

On the server, I have a table:

id|descricao|script|data|etc...

where I enter each script that should run on the client base.

A WebService , which receives as a parameter, the id of the last update that the client received, and returns a XML with all the commands after that id.

The client system consumes this WebService by sending the value of last_upd_sql , then it processes each command received by XML by updating the value of last_upd_sql .

This system has been running for some years and I've never had a problem.

    
23.10.2017 / 20:51
0

I appreciate the attention of everyone, but I was looking for something that would work like java maven.

    
23.10.2017 / 22:15