public void SupRemigration(MySQL_DB pMysql, PostgreSQL_DB pPostgres, string pDate = "1.1.2500") { MySqlDataReader dataReader = pMysql.Select("select distinct payment_method from registrations where payment_method!='';"); pMysql.Message = "payment_method (from registration)- extraction - START"; int counter = 0; while (dataReader.Read()) { pPostgres.Insert("insert into tbl_payment_method(id,name) values('" + ++counter + "', '" + dataReader[0] + "')"); } pPostgres.Message = "tbl_payment_method - extraction - FINISH"; pPostgres.Update("update tbl_payment_method set name ='Credit cards' where name like 'credit_card'"); pPostgres.Update("update tbl_payment_method set name ='Check' where name like 'check'"); pPostgres.Update("update tbl_payment_method set name ='No Balance' where name like 'nobal'"); pPostgres.Insert("insert into tbl_payment_method(id,name) values('" + ++counter + "','Bank transfer')"); }
public void SupRemigration(MySQL_DB pMysql, PostgreSQL_DB pPostgres, string pDate = "1.1.2500") { MySqlDataReader dataReader = pMysql.Select("select * from tbl_jobs;"); pMysql.Message = "tbl_jobs - extraction - START"; while (dataReader.Read()) { if (!String.IsNullOrEmpty(dataReader["update_date"].ToString()) && Convert.ToDateTime(dataReader["update_date"].ToString()) >= Convert.ToDateTime(pDate)) { pPostgres.Update("update tbl_jobs set title = '" + dataReader["title"] + "', jobtype = '" + dataReader["jobtype"] + "', description = '" + dataReader["description"].ToString().Replace("'", "''") + "', views = '" + dataReader["views"] + "', showonsite = '" + CheckBool(dataReader["showonsite"].ToString()) + "' where id = '" + dataReader["id"] + "'"); } if (GetId("select id from tbl_jobs where id = " + dataReader["id"] + ";", pPostgres) == "null" && !String.IsNullOrEmpty(dataReader["insert_date"].ToString()) && Convert.ToDateTime(dataReader["insert_date"].ToString()) >= Convert.ToDateTime(pDate)) { pPostgres.Insert("insert into tbl_jobs(id, title, jobtype, description, views, showonsite) " + "values('" + dataReader["id"] + "','" + dataReader["title"] + "','" + dataReader["jobtype"] + "','" + dataReader["description"].ToString().Replace("'", "''") + "','" + dataReader["views"] + "','" + CheckBool(dataReader["showonsite"].ToString()) + "')"); } } pPostgres.Insert("cluster tbl_jobs"); pPostgres.Message = "tbl_jobs - extraction - FINISH"; }
public void SupRemigration(MySQL_DB pMysql, PostgreSQL_DB pPostgres, string pDate = "1.1.2500") { MySqlDataReader dataReader = pMysql.Select("select id, cast(`range` as CHAR), minimum_age, name " + "from tbl_age_divisions;"); pMysql.Message = "tbl_age_divisions - extraction - START"; string pom; while (dataReader.Read()) { pom = GetId(dataReader[3].ToString(), pPostgres); pPostgres.Insert("insert into tbl_age_divisions(id, range, minimum_age,playlist_workshop_levels_id) " + "values('" + dataReader[0] + "',null,'" + dataReader[2] + "','" + pom + "');"); } pPostgres.Message = "tbl_age_divisions - extraction - FINISH"; pPostgres.Update("update tbl_age_divisions set range='2' where id = '1';"); pPostgres.Update("update tbl_age_divisions set range='1' where id = '2';"); pPostgres.Update("update tbl_age_divisions set range='2' where id = '3';"); pPostgres.Update("update tbl_age_divisions set range='2' where id = '4';"); pPostgres.Update("update tbl_age_divisions set range='2' where id = '5';"); pPostgres.Update("update tbl_age_divisions set range='2' where id = '6';"); pPostgres.Update("update tbl_age_divisions set range='2' where id = '7';"); pPostgres.Update("update tbl_age_divisions set range='100' where id = '8';"); pPostgres.Update("update tbl_age_divisions set range='2' where id = '10';"); pPostgres.Update("update tbl_age_divisions set range='2' where id = '11';"); pPostgres.Update("update tbl_age_divisions set range='5' where id = '12';"); pPostgres.Insert("insert into tbl_age_divisions(id, playlist_workshop_levels_id) values(0,1)"); }