2018-06-26 17:25:37 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2024-05-24 19:43:47 +02:00
|
|
|
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2018-06-26 17:25:37 +02:00
|
|
|
*/
|
|
|
|
namespace OC\Core\Migrations;
|
|
|
|
|
|
|
|
use OCP\DB\ISchemaWrapper;
|
|
|
|
use OCP\Migration\SimpleMigrationStep;
|
|
|
|
|
|
|
|
class Version14000Date20180626223656 extends SimpleMigrationStep {
|
|
|
|
public function changeSchema(\OCP\Migration\IOutput $output, \Closure $schemaClosure, array $options) {
|
|
|
|
/** @var ISchemaWrapper $schema */
|
|
|
|
$schema = $schemaClosure();
|
2020-04-10 14:19:56 +02:00
|
|
|
if (!$schema->hasTable('whats_new')) {
|
2018-06-26 17:25:37 +02:00
|
|
|
$table = $schema->createTable('whats_new');
|
2018-06-28 21:58:54 +02:00
|
|
|
$table->addColumn('id', 'integer', [
|
|
|
|
'autoincrement' => true,
|
|
|
|
'notnull' => true,
|
|
|
|
'length' => 4,
|
|
|
|
'unsigned' => true,
|
|
|
|
]);
|
2018-06-26 17:25:37 +02:00
|
|
|
$table->addColumn('version', 'string', [
|
|
|
|
'notnull' => true,
|
|
|
|
'length' => 64,
|
|
|
|
'default' => '11',
|
|
|
|
]);
|
|
|
|
$table->addColumn('etag', 'string', [
|
|
|
|
'notnull' => true,
|
|
|
|
'length' => 64,
|
|
|
|
'default' => '',
|
|
|
|
]);
|
|
|
|
$table->addColumn('last_check', 'integer', [
|
|
|
|
'notnull' => true,
|
|
|
|
'length' => 4,
|
|
|
|
'unsigned' => true,
|
|
|
|
'default' => 0,
|
|
|
|
]);
|
|
|
|
$table->addColumn('data', 'text', [
|
|
|
|
'notnull' => true,
|
|
|
|
'default' => '',
|
|
|
|
]);
|
2018-06-28 21:58:54 +02:00
|
|
|
$table->setPrimaryKey(['id']);
|
2019-03-27 11:42:33 +01:00
|
|
|
$table->addUniqueIndex(['version'], 'version');
|
2018-06-26 17:25:37 +02:00
|
|
|
$table->addIndex(['version', 'etag'], 'version_etag_idx');
|
|
|
|
}
|
|
|
|
|
|
|
|
return $schema;
|
|
|
|
}
|
|
|
|
}
|