/*!
Forwards request to generateDropFieldSql() on the otherSchema() object.
767860
function generateDropFieldSql( $table, $field_name, $params )
    {
        return $this->OtherSchema->generateDropFieldSql( $table, $field_name, $params );
    }
690682
@Override
    /**
     * Export schema handles the handleOperation method.
     */
    public void exportSchema(final String persistenceUnit, List<TableInfo> schemas)
    {
        cql_version = externalProperties != null ? (String) externalProperties.get(CassandraConstants.CQL_VERSION)
                : CassandraConstants.CQL_VERSION_2_0;
        super.exportSchema(persistenceUnit, schemas);
    }
136063
public void addForwardedField(int sourceField, int destinationField) {
		FieldSet fs;
		if((fs = this.forwardedFields.get(sourceField)) != null) {
			fs.add(destinationField);
		} else {
			fs = new FieldSet(destinationField);
			this.forwardedFields.put(sourceField, fs);
		}
	}
784359
protected function add_additional_fields_schema( $schema ) {
		if ( empty( $schema['title'] ) ) {
			return $schema;
		}

		/**
		 * Can't use $this->get_object_type otherwise we cause an inf loop.
		 */
		$object_type = $schema['title'];

		$additional_fields = $this->get_additional_fields( $object_type );

		foreach ( $additional_fields as $field_name => $field_options ) {
			if ( ! $field_options['schema'] ) {
				continue;
			}

			$schema['properties'][ $field_name ] = $field_options['schema'];
		}

		return $schema;
	}
902937
def forwards(self, orm):
        ""
        if not db.dry_run:
            for pl in orm['core.Placement'].objects.all():
                pl.listing_set.update(publishable=pl.publishable)
                publishable = pl.publishable
                publishable.publish_from = pl.publish_from
                publishable.static = pl.static
                publishable.publish_to = pl.publish_to
                publishable.save(force_update=True)
210638
protected function generateChangeFieldSql( $tableName, $fieldName, ezcDbSchemaField $fieldDefinition )
    {
        $fieldType = strstr(  $this->generateFieldSql( $fieldName, $fieldDefinition ), ' ' );
        if ( $fieldDefinition->autoIncrement ) 
        {
            $this->queries[] = "CREATE SEQUENCE \"{$tableName}_{$fieldName}_seq\"";
            $this->queries[] = "ALTER TABLE \"$tableName\" ALTER \"$fieldName\" TYPE INTEGER";
            $this->queries[] = "ALTER TABLE \"$tableName\" ALTER COLUMN \"$fieldName\" SET DEFAULT nextval('{$tableName}_{$fieldName}_seq')";
            $this->queries[] = "ALTER TABLE \"$tableName\" ALTER COLUMN \"$fieldName\" SET NOT NULL";
        }
        else
        {
            $this->queries[] = "ALTER TABLE \"$tableName\" ALTER \"$fieldName\" TYPE".$fieldType." USING CAST(\"$fieldName\" AS $fieldType)";
        }
    }
139157
function instrumentSchemaForExpressGraphQL(schema) {
  addTracingToResolvers(schema);
  addSchemaLevelResolveFunction(schema, (root, args, ctx, info) => {
    const operation = print(info.operation);
    const fragments = Object.keys(info.fragments).map(k => print(info.fragments[k])).join('\n');

    ctx.tracer.log('request.query', `${operation}\n${fragments}`);
    ctx.tracer.log('request.variables', info.variableValues);
    ctx.tracer.log('request.operationName', info.operation.name);
    return root;
  });
}
371898
protected function generateSchemaAsSql()
    {
        $prefix = ezcDbSchema::$options->tableNamePrefix;
        foreach ( $this->schema as $tableName => $tableDefinition )
        {
            $this->generateDropTableSql( $prefix . $tableName );
            $this->generateCreateTableSql( $prefix . $tableName, $tableDefinition );
        }
    }
1214036
protected function applyWhitelist() {
		if ($this->dbsType == 'sql') {
			// fetch full schema
			if (!$this->fluid && isset(self::$schema_cache[$key=$this->table.$this->db->uuid()]))
				$schema = self::$schema_cache[$key];
			else {
				$schema = $this->mapper->schema();
				self::$schema_cache[$this->table.$this->db->uuid()] = $schema;
			}
			// apply reduced fields schema
			if ($this->whitelist)
				$schema = array_intersect_key($schema, array_flip($this->whitelist));
			$this->mapper->schema($schema);
			$this->mapper->reset();
		}
	}
669421
def forwards(self, orm):
        ""
        # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
        if not db.dry_run:
            orm['gnotty.IRCMessage'].objects.filter(message="joins").update(join_or_leave=True)
            orm['gnotty.IRCMessage'].objects.filter(message="leaves").update(join_or_leave=True)
1344161
function generateTableInsert( $tableName, $tableDef, $dataEntries, $params )
    {
        return $this->OtherSchema->generateTableInsert( $tableName, $tableDef, $dataEntries, $params );
    }
106519
public function generateAlteredFields()
    {
        /* @var $oldField Field */
        /* @var $newField Field */
        foreach ($this->keptModelKeys as $modelName) {
            $oldFieldKeys = $this->oldFieldKeys[$modelName];
            $newFieldKeys = $this->newFieldKeys[$modelName];

            $keptFieldKeys = array_intersect($oldFieldKeys, $newFieldKeys);

            $oldModelName = $this->getOldModelName($modelName);

            foreach ($keptFieldKeys as $keptField) {
                $oldFieldName = $this->getOldFieldName($modelName, $keptField);
                $oldField = $this->oldRegistry->getModel($oldModelName)
                    ->getMeta()
                    ->getField($oldFieldName);

                $meta = $this->newRegistry->getModel(
                    $modelName
                )->getMeta();
                $newField = $meta->getField($keptField);

                $oldDec = $this->deepDeconstruct($oldField);
                $newDec = $this->deepDeconstruct($newField);

                if ($oldDec !== $newDec) {
                    $bothM2M = ($newField instanceof ManyToManyField &&
                        $oldField instanceof ManyToManyField);
                    $neitherM2M = (!$newField instanceof ManyToManyField &&
                        !$oldField instanceof ManyToManyField);

                    // Either both fields are m2m or neither is
                    if ($bothM2M || $neitherM2M) {
                        $preserveDefault = true;

                        if ($oldField->isNull() && !$newField->isNull() &&
                            !$newField->hasDefault() &&
                            !$newField instanceof ManyToManyField
                        ) {
                            $field = $newField->deepClone();
                            $default = MigrationQuestion::askNotNullAlteration(
                                $this->asker,
                                $modelName,
                                $keptField
                            );

                            if (NOT_PROVIDED !== $default) {
                                $field->default = $default;
                                $preserveDefault = false;
                            }
                        } else {
                            $field = $newField;
                        }

                        $this->addOperation(
                            $meta->getAppName(),
                            AlterField::createObject(
                                [
                                    'modelName' => $modelName,
                                    'name' => $keptField,
                                    'field' => $field,
                                    'preserveDefault' => $preserveDefault,
                                ]
                            )
                        );
                    } else {
                        // We cannot alter between m2m and concrete fields
                        $this->findRemovedFields($modelName, $keptField);
                        $this->findAddedFields($modelName, $keptField);
                    }
                }
            }
        }
    }
303074
static function diffField( $field1, $field2, $schema1Type, $schema2Type )
    {
        /* Type is always available */
        if ( $field1['type'] != $field2['type'] )
        {
            return array( 'different-options' => array( 'type' ), 'field-def' => $field2 );
        }

        $test_fields = array( 'default', 'not_null' );
        
        // Ignore length for int types
        if ( $field1['type'] === $field2['type'] && $field1['type'] !== 'int' )
            $test_fields[] = 'length';

        $different_options = array();

        foreach ( $test_fields as $test_field )
        {
            if ( isset( $field1[$test_field] ) )
            {
                if ( !isset( $field2[$test_field] ) ||
                     ( $field1[$test_field] != $field2[$test_field] ) )
                {
                    $different_options[] = $test_field;
                }
            }
            else
            {
                if ( isset( $field2[$test_field] ) && $field2[$test_field] )
                {
                    $different_options[] = $test_field;
                }
            }
        }

        if ( $different_options )
            return array( 'different-options' => $different_options, 'field-def' => $field2 );
        else
            return false;
    }
1189671
def forwards(self, orm):
        ""
        orm['avocado.DataConcept'].objects.filter(name='Sample')\
                .update(queryable=False)
240906
protected function generateEntitiesListFromQuery(): void
    {
        $query = $this->getAttribute('tableModel')->query();
        $this->applyQueryClosure($query);
        $this->checkColumnsValidity();
        $this->applySearchClauses($query);
        $this->applySortClauses($query);
        $this->paginateList($query);
        $this->applyClosuresOnPaginatedList();
    }
824214
function generateDataFile( $schema, $data, $params )
    {
        $params = array_merge( array( 'allow_multi_insert' => false,
                                      'diff_friendly' => false ),
                               $params );
        $sql = '';

        $i = 0;
        foreach ( $schema as $tableName => $tableDef )
        {
            // Skip the info structure, this is not a table
            if ( $tableName == '_info' )
                continue;

            if ( !isset( $data[$tableName] ) )
                continue;
            if ( $i > 0 )
                $sql .= "\n\n";
            $dataEntries = $data[$tableName];
            $sql .= $this->generateTableInsert( $tableName, $tableDef, $dataEntries, $params );
            ++$i;
        }

        return $sql;
    }
634966
async function getSchema() {
  const fakeSchemaQueryResult = {
    rows: schemaRows,
    incomplete: false
  };
  await wait(Math.random() * 5000);
  return formatSchemaQueryResults(fakeSchemaQueryResult);
}