当前位置: 首页>>代码示例>>C#>>正文


C# Migration.Update方法代码示例

本文整理汇总了C#中Migration.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Migration.Update方法的具体用法?C# Migration.Update怎么用?C# Migration.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Migration的用法示例。


在下文中一共展示了Migration.Update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialise

        public void Initialise(string connectionString)
        {
            m_connectionString = connectionString;

            m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);

            m_connection = new SqliteConnection(m_connectionString);
            try
            {
                m_connection.Open();
            }
            catch (Exception ex)
            {
                throw new Exception("SQLite has errored out on opening the database. If you are on a 64 bit system, please run OpenSim.32BitLaunch.exe and try again. If this is not a 64 bit error :" + ex);
            }

            Assembly assem = GetType().Assembly;
            Migration m = new Migration(m_connection, assem, "EstateStore");
            m.Update();

            //m_connection.Close();
           // m_connection.Open();

            Type t = typeof(EstateSettings);
            m_Fields = t.GetFields(BindingFlags.NonPublic |
                                   BindingFlags.Instance |
                                   BindingFlags.DeclaredOnly);

            foreach (FieldInfo f in m_Fields)
                if (f.Name.Substring(0, 2) == "m_")
                    m_FieldMap[f.Name.Substring(2)] = f;
        }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:32,代码来源:SQLiteEstateData.cs

示例2: Initialise

        public void Initialise(string connectionString)
        {
            m_connectionString = connectionString;

            try
            {
                m_log.Info("[REGION DB]: MySql - connecting: " + Util.GetDisplayConnectionString(m_connectionString));
            }
            catch (Exception e)
            {
                m_log.Debug("Exception: password not found in connection string\n" + e.ToString());
            }

            GetWaitTimeout();

            using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
            {
                dbcon.Open();

                Assembly assem = GetType().Assembly;
                Migration m = new Migration(dbcon, assem, "EstateStore");
                m.Update();

                Type t = typeof(EstateSettings);
                m_Fields = t.GetFields(BindingFlags.NonPublic |
                                       BindingFlags.Instance |
                                       BindingFlags.DeclaredOnly);

                foreach (FieldInfo f in m_Fields)
                {
                    if (f.Name.Substring(0, 2) == "m_")
                        m_FieldMap[f.Name.Substring(2)] = f;
                }
            }
        }
开发者ID:dreamerc,项目名称:diva-distribution,代码行数:35,代码来源:MySQLEstateData.cs

示例3: Initialise

        public void Initialise(string connectionString)
        {
            m_connectionString = connectionString;

            using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
            {
                dbcon.Open();

                // Apply new Migrations
                //
                Assembly assem = GetType().Assembly;
                Migration m = new Migration(dbcon, assem, "RegionStore");
                m.Update();

                // Clean dropped attachments
                //
                try
                {
                    using (MySqlCommand cmd = dbcon.CreateCommand())
                    {
                        cmd.CommandText = "delete from prims, primshapes using prims " +
                                "left join primshapes on prims.uuid = primshapes.uuid " +
                                "where PCode = 9 and State <> 0";
                        ExecuteNonQuery(cmd);
                    }
                }
                catch (MySqlException ex)
                {
                    m_log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message);
                }
            }
        }
开发者ID:mcortez,项目名称:opensim,代码行数:32,代码来源:MySQLLegacyRegionData.cs

示例4: Initialise

        /// <summary>
        /// Initialises the region datastore
        /// </summary>
        /// <param name="connectionString">The connection string.</param>
        public void Initialise(string connectionString)
        {
            m_connectionString = connectionString;
            _Database = new MSSQLManager(connectionString);

            using (SqlConnection conn = new SqlConnection(connectionString))
            {
                conn.Open();
                //New Migration settings
                Migration m = new Migration(conn, Assembly, "RegionStore");
                m.Update();

                // Clean dropped attachments
                //
                try
                {
                    using (SqlCommand cmd = conn.CreateCommand())
                    {
                        cmd.CommandText = "delete from prims where prims.UUID in (select UUID from primshapes where PCode = 9 and State <> 0); delete from primshapes where PCode = 9 and State <> 0";
                        cmd.ExecuteNonQuery();
                    }
                }
                catch (Exception ex)
                {
                    _Log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message);
                }
            }
        }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:32,代码来源:MSSQLSimulationData.cs

示例5: Initialise

        public void Initialise(string connectionString)
        {
            if (Util.IsWindows())
                Util.LoadArchSpecificWindowsDll("sqlite3.dll");

            m_connectionString = connectionString;

            m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);

            m_connection = new SqliteConnection(m_connectionString);
            m_connection.Open();

            Migration m = new Migration(m_connection, Assembly, "EstateStore");
            m.Update();

            //m_connection.Close();
           // m_connection.Open();

            Type t = typeof(EstateSettings);
            m_Fields = t.GetFields(BindingFlags.NonPublic |
                                   BindingFlags.Instance |
                                   BindingFlags.DeclaredOnly);

            foreach (FieldInfo f in m_Fields)
                if (f.Name.Substring(0, 2) == "m_")
                    m_FieldMap[f.Name.Substring(2)] = f;
        }
开发者ID:JAllard,项目名称:opensim,代码行数:27,代码来源:SQLiteEstateData.cs

示例6: Initialise

        public void Initialise(string connectionString)
        {
            m_connectionString = connectionString;

            m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);

            m_connection = new SqliteConnection(m_connectionString);
            m_connection.Open();

            Assembly assem = GetType().Assembly;
            Migration m = new Migration(m_connection, assem, "EstateStore");
            m.Update();

            //m_connection.Close();
           // m_connection.Open();

            Type t = typeof(EstateSettings);
            m_Fields = t.GetFields(BindingFlags.NonPublic |
                                   BindingFlags.Instance |
                                   BindingFlags.DeclaredOnly);

            foreach (FieldInfo f in m_Fields)
                if (f.Name.Substring(0, 2) == "m_")
                    m_FieldMap[f.Name.Substring(2)] = f;
        }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:25,代码来源:SQLiteEstateData.cs

示例7: Initialise

        /// <summary>
        /// Initialises the estatedata class.
        /// </summary>
        /// <param name="connectionString">connectionString.</param>
        public void Initialise(string connectionString)
        {
            if (!string.IsNullOrEmpty(connectionString))
            {
                m_connectionString = connectionString;
                _Database = new PGSQLManager(connectionString);
            }

            //Migration settings
            using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
            {
                conn.Open();
                Migration m = new Migration(conn, GetType().Assembly, "EstateStore");
                m.Update();
            }

            //Interesting way to get parameters! Maybe implement that also with other types
            Type t = typeof(EstateSettings);
            _Fields = t.GetFields(BindingFlags.NonPublic |
                                  BindingFlags.Instance |
                                  BindingFlags.DeclaredOnly);

            foreach (FieldInfo f in _Fields)
            {
                if (f.Name.Substring(0, 2) == "m_")
                    _FieldMap[f.Name.Substring(2)] = f;
            }
        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:32,代码来源:PGSQLEstateData.cs

示例8: Init

        public void Init()
        {
            SuperInit();
            // If we manage to connect to the database with the user
            // and password above it is our test database, and run
            // these tests.  If anything goes wrong, ignore these
            // tests.
            try
            {
                database = new MySQLManager(connect);
                db = new MySQLGridData();
                db.Initialise(connect);
            }
            catch (Exception e)
            {
                m_log.Error("Exception {0}", e);
                Assert.Ignore();
            }

            // This actually does the roll forward assembly stuff
            Assembly assem = GetType().Assembly;

            using (MySqlConnection dbcon = new MySqlConnection(connect))
            {
                dbcon.Open();
                Migration m = new Migration(dbcon, assem, "AssetStore");
                m.Update();
            }
        }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:29,代码来源:MySQLGridTest.cs

示例9: Initialise

        public void Initialise(string connectionString)
        {
            m_ConnectionString = connectionString;

            m_Connection = new MySqlConnection(m_ConnectionString);

            m_Connection.Open();

            // Apply new Migrations
            //
            Assembly assem = GetType().Assembly;
            Migration m = new Migration(m_Connection, assem, "RegionStore");
            m.Update();

            // NOTE: This is a very slow query that times out on regions with a lot of prims.
            // I'm told that it is no longer relevant so it's commented out now, but if it
            // is relevant it should be added as a console command instead of part of the
            // startup phase
            // Clean dropped attachments
            //
            //try
            //{
            //    using (MySqlCommand cmd = m_Connection.CreateCommand())
            //    {
            //        cmd.CommandText = "delete from prims, primshapes using prims " +
            //                "left join primshapes on prims.uuid = primshapes.uuid " +
            //                "where PCode = 9 and State <> 0";
            //        ExecuteNonQuery(cmd);
            //    }
            //}
            //catch (MySqlException ex)
            //{
            //    m_log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message);
            //}
        }
开发者ID:dirkhusemann,项目名称:opensim,代码行数:35,代码来源:MySQLLegacyRegionData.cs

示例10: SQLiteGenericData

        public SQLiteGenericData(string connectionString)
        {
            m_Connection = new SqliteConnection(connectionString);
            m_Connection.Open();

            Migration m = new Migration(m_Connection, this.GetType().Assembly, "GenericStore");
            m.Update();
        }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:8,代码来源:SQLiteGenericData.cs

示例11: MySqlRegionData

//        private int m_LastExpire = 0;

        public MySqlRegionData(string connectionString, string realm)
                : base(connectionString)
        {
            m_Realm = realm;

            Migration m = new Migration(m_Connection, GetType().Assembly, "GridStore");
            m.Update();
        }
开发者ID:dirkhusemann,项目名称:opensim,代码行数:10,代码来源:MySQLRegionData.cs

示例12: MySqlUserAccountData

        public MySqlUserAccountData(string connectionString, string realm)
                : base(connectionString)
        {
            m_Realm = realm;

            Migration m = new Migration(m_Connection, GetType().Assembly, "UserStore");
            m.Update();
        }
开发者ID:Ideia-Boa,项目名称:diva-distribution,代码行数:8,代码来源:MySQLUserAccountData.cs

示例13: Init

 void Init()
 {
     using (NpgsqlConnection dbcon = new NpgsqlConnection(ConnectionString))
     {
         dbcon.Open();
         
         Migration m = new Migration(dbcon, Assembly, "UserProfiles");
         m.Update();
     }
 }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:10,代码来源:PGSQLUserProfilesData.cs

示例14: MSSQLGenericData

 public MSSQLGenericData(string connectionString)
 {
     m_ConnectionString = connectionString;
     using (SqlConnection conn = new SqlConnection(m_ConnectionString))
     {
         conn.Open();
         Migration m = new Migration(conn, GetType().Assembly, "GenericStore");
         m.Update();
     }
 }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:10,代码来源:MSSQLGenericData.cs

示例15: Initialise

        /// <summary>
        /// <para>Initialises Asset interface</para>
        /// <para>
        /// <list type="bullet">
        /// <item>Loads and initialises the MySQL storage plugin.</item>
        /// <item>Warns and uses the obsolete mysql_connection.ini if connect string is empty.</item>
        /// <item>Check for migration</item>
        /// </list>
        /// </para>
        /// </summary>
        /// <param name="connect">connect string</param>
        public override void Initialise(string connect)
        {
            m_connectionString = connect;

            using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
            {
                dbcon.Open();
                Migration m = new Migration(dbcon, Assembly, "AssetStore");
                m.Update();
            }
        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:22,代码来源:MySQLAssetData.cs


注:本文中的Migration.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。