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

Version1040Date20200506111214.php « Migration « lib - github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4b1f3ad5693f1255449c724618f9ada42d3cbd3d (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
80
81
82
83
84
85
86
87
88
<?php

declare(strict_types=1);

namespace OCA\Mail\Migration;

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

class Version1040Date20200506111214 extends SimpleMigrationStep {

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

		$table = $schema->createTable('mail_classifiers');
		$table->addColumn('id', 'integer', [
			'autoincrement' => true,
			'notnull' => true,
			'length' => 20,
		]);
		$table->addColumn('account_id', 'integer', [
			'notnull' => true,
			'length' => 20,
		]);
		$table->addColumn('type', 'string', [
			'notnull' => true,
			'length' => 255,
		]);
		$table->addColumn('estimator', 'string', [
			'notnull' => true,
			'length' => 255,
		]);
		$table->addColumn('app_version', 'string', [
			'notnull' => true,
			'length' => 31,
		]);
		$table->addColumn('training_set_size', 'integer', [
			'notnull' => true,
			'length' => 4,
		]);
		$table->addColumn('validation_set_size', 'integer', [
			'notnull' => true,
			'length' => 4,
		]);
		$table->addColumn('recall_important', 'decimal', [
			'notnull' => true,
			'precision' => 10,
			'scale' => 5,
		]);
		$table->addColumn('precision_important', 'decimal', [
			'notnull' => true,
			'precision' => 10,
			'scale' => 5,
		]);
		$table->addColumn('f1_score_important', 'decimal', [
			'notnull' => true,
			'precision' => 10,
			'scale' => 5,
		]);
		$table->addColumn('duration', 'integer', [
			'notnull' => true,
			'length' => 4,
		]);
		$table->addColumn('active', 'boolean', [
			'notnull' => false,
			'default' => false,
		]);
		$table->addColumn('created_at', 'integer', [
			'notnull' => true,
			'length' => 4,
		]);

		$table->setPrimaryKey(['id']);
		$table->addIndex(['account_id', 'type'], 'mail_clssfr_accnt_id_type');

		return $schema;
	}
}