public void Migrate() { if (!GemFireXDDbi.SchemaExists(SchemaName)) { Migrator.OnMigrateEvent(new MigrateEventArgs( Result.Unknown, String.Format("Migrating database schema {0}...", SchemaName))); GemFireXDDbi.Create(String.Format("CREATE SCHEMA {0}", this.SchemaName)); } if ((!this.Created) && (!GemFireXDDbi.TableExists(this.TableName))) { foreach (String tblFullName in referencedTables) { if (!this.TableFullName.Equals(tblFullName)) { Migrator.GetTableFromList(tblFullName).Migrate(); } } Migrator.OnMigrateEvent(new MigrateEventArgs( Result.Unknown, String.Format("Creating table {0}...", TableFullName))); Helper.Log(GetCreateTableSql()); GemFireXDDbi.Create(GetCreateTableSql()); this.Created = true; Helper.Log(String.Format("Table {0} created", TableFullName)); MigrateData(); } }
public void Migrate() { try { if (!GemFireXDDbi.IndexExists(IndexName) && !Created) { Migrator.OnMigrateEvent(new MigrateEventArgs( Result.Unknown, String.Format("Migrating index {0}...", IndexName))); Util.Helper.Log(GetCreateIndexSql()); GemFireXDDbi.Create(GetCreateIndexSql()); Util.Helper.Log(String.Format("Index {0} created", IndexName)); this.Created = true; } else { Util.Helper.Log(String.Format("Index {0} already exists", IndexName)); } } catch (Exception e) { Migrator.Errorred = true; Util.Helper.Log(e); } }
public void Migrate() { String sql = GetCreateModuleSql(); try { Util.Helper.Log(sql); GemFireXDDbi.Create(sql); Util.Helper.Log(String.Format("Module {0} created", ModuleName)); } catch (Exception e) { Migrator.Errorred = true; Util.Helper.Log(e); } }