Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Version2000Date20201208130255.php « Migration « lib - github.com/nextcloud/fulltextsearch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dc6d710ab9deb97e563f5df7eaaacc093cc3644e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php

declare(strict_types=1);

namespace OCA\FullTextSearch\Migration;

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

/**
 * Auto-generated migration step: Please modify to your needs!
 */
class Version2000Date20201208130255 extends SimpleMigrationStep {

	/**
	 * @param IOutput $output
	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
	 * @param array $options
	 */
	public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
	}

	/**
	 * @param IOutput $output
	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
	 * @param array $options
	 * @return null|ISchemaWrapper
	 */
	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
		/** @var ISchemaWrapper $schema */
		$schema = $schemaClosure();

		if (!$schema->hasTable('fulltextsearch_ticks')) {
			$table = $schema->createTable('fulltextsearch_ticks');
			$table->addColumn('id', 'bigint', [
				'autoincrement' => true,
				'notnull' => true,
				'length' => 7,
				'unsigned' => true,
			]);
			$table->addColumn('source', 'string', [
				'notnull' => false,
				'length' => 128,
			]);
			$table->addColumn('data', 'string', [
				'notnull' => false,
				'length' => 6000,
			]);
			$table->addColumn('status', 'string', [
				'notnull' => false,
				'length' => 32,
			]);
			$table->addColumn('action', 'string', [
				'notnull' => false,
				'length' => 64,
			]);
			$table->addColumn('first_tick', 'bigint', [
				'notnull' => false,
				'length' => 6,
			]);
			$table->addColumn('tick', 'bigint', [
				'notnull' => false,
				'length' => 6,
			]);
			$table->setPrimaryKey(['id']);
		}
		return $schema;
	}

	/**
	 * @param IOutput $output
	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
	 * @param array $options
	 */
	public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
	}
}