* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
- /** @var ISchemaWrapper $schema */
- $schema = $schemaClosure();
+ // /** @var ISchemaWrapper $schema */
+ // $schema = $schemaClosure();
- if (!$schema->hasTable('file_metadata')) {
- $table = $schema->createTable('file_metadata');
- $table->addColumn('id', Types::BIGINT, [
- 'notnull' => true,
- ]);
- $table->addColumn('group_name', Types::STRING, [
- 'notnull' => true,
- 'length' => 50,
- ]);
- $table->addColumn('value', Types::TEXT, [
- 'notnull' => false,
- 'default' => '',
- ]);
- $table->setPrimaryKey(['id', 'group_name'], 'file_metadata_idx');
+ // if (!$schema->hasTable('file_metadata')) {
+ // $table = $schema->createTable('file_metadata');
+ // $table->addColumn('id', Types::BIGINT, [
+ // 'notnull' => true,
+ // ]);
+ // $table->addColumn('group_name', Types::STRING, [
+ // 'notnull' => true,
+ // 'length' => 50,
+ // ]);
+ // $table->addColumn('value', Types::TEXT, [
+ // 'notnull' => false,
+ // 'default' => '',
+ // ]);
+ // $table->setPrimaryKey(['id', 'group_name'], 'file_metadata_idx');
- return $schema;
- }
+ // return $schema;
+ // }
return null;
}
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
- /** @var ISchemaWrapper $schema */
- $schema = $schemaClosure();
- $metadataTable = $schema->getTable('file_metadata');
+ // /** @var ISchemaWrapper $schema */
+ // $schema = $schemaClosure();
+ // $metadataTable = $schema->getTable('file_metadata');
- if ($metadataTable->hasColumn('value')) {
- return null;
- }
+ // if ($metadataTable->hasColumn('value')) {
+ // return null;
+ // }
- $metadataTable->addColumn('value', Types::TEXT, [
- 'notnull' => false,
- 'default' => '',
- ]);
- return $schema;
+ // $metadataTable->addColumn('value', Types::TEXT, [
+ // 'notnull' => false,
+ // 'default' => '',
+ // ]);
+ // return $schema;
+ return null;
}
*/
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
/** @var ISchemaWrapper $schema */
- $schema = $schemaClosure();
- $metadataTable = $schema->getTable('file_metadata');
+ // $schema = $schemaClosure();
+ // $metadataTable = $schema->getTable('file_metadata');
- if (!$metadataTable->hasColumn('metadata')) {
- return;
- }
+ // if (!$metadataTable->hasColumn('metadata')) {
+ // return;
+ // }
- $this->connection
- ->getQueryBuilder()
- ->update('file_metadata')
- ->set('value', 'metadata')
- ->executeStatement();
+ // $this->connection
+ // ->getQueryBuilder()
+ // ->update('file_metadata')
+ // ->set('value', 'metadata')
+ // ->executeStatement();
}
}
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
- /** @var ISchemaWrapper $schema */
- $schema = $schemaClosure();
- $metadataTable = $schema->getTable('file_metadata');
+ // /** @var ISchemaWrapper $schema */
+ // $schema = $schemaClosure();
+ // $metadataTable = $schema->getTable('file_metadata');
- if ($metadataTable->hasColumn('metadata')) {
- $metadataTable->dropColumn('metadata');
- return $schema;
- }
+ // if ($metadataTable->hasColumn('metadata')) {
+ // $metadataTable->dropColumn('metadata');
+ // return $schema;
+ // }
return null;
}