示例#1
0
        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();
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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);
            }
        }