コード例 #1
0
        /// <summary>
        /// This ensures that the framework migrations have run for the distributed locking feature, as existing Boying installations will not have the required tables when upgrading.
        /// </summary>
        private void EnsureDistributedLockSchemaExists()
        {
            // Ensure the distributed lock record schema exists.
            var schemaBuilder = new SchemaBuilder(_dataMigrationInterpreter);
            var distributedLockSchemaBuilder = new DistributedLockSchemaBuilder(_shellSettings, schemaBuilder);

            if (!distributedLockSchemaBuilder.SchemaExists())
            {
                // Workaround to avoid some Transaction issue for PostgreSQL.
                _transactionManager.RequireNew();
                distributedLockSchemaBuilder.CreateSchema();
            }
        }
コード例 #2
0
        /// <summary>
        /// This ensures that the framework migrations have run for the distributed locking feature, as existing Tomelt installations will not have the required tables when upgrading.
        /// </summary>
        private void EnsureDistributedLockSchemaExists()
        {
            // Ensure the distributed lock record schema exists.
            var schemaBuilder = new SchemaBuilder(_dataMigrationInterpreter);
            var distributedLockSchemaBuilder = new DistributedLockSchemaBuilder(_shellSettings, schemaBuilder);

            if (!distributedLockSchemaBuilder.SchemaExists())
            {
                // Workaround to avoid some Transaction issue for PostgreSQL.
                if (_shellSettings.DataProvider.Equals("PostgreSql", StringComparison.OrdinalIgnoreCase))
                {
                    _transactionManager.RequireNew();
                    distributedLockSchemaBuilder.CreateSchema();
                    return;
                }

                distributedLockSchemaBuilder.CreateSchema();
                _transactionManager.RequireNew();
            }
        }