Issues (899)

exif/migrations/m1_init.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * phpBB Gallery - ACP Exif Extension
4
 *
5
 * @package   phpbbgallery/exif
6
 * @author    nickvergessen
7
 * @author    satanasov
8
 * @author    Leinad4Mind
9
 * @copyright 2007-2012 nickvergessen, 2014- satanasov, 2018- Leinad4Mind
10
 * @license   GPL-2.0-only
11
 */
12
13
namespace phpbbgallery\exif\migrations;
14
15
use phpbb\db\migration\migration;
0 ignored issues
show
The type phpbb\db\migration\migration was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
17
class m1_init extends migration
18
{
19
	public static function depends_on(): array
20
	{
21
		return ['\phpbbgallery\core\migrations\release_1_2_0'];
22
	}
23
24
	public function update_data(): array
25
	{
26
		return [
27
			['config.add', ['phpbb_gallery_disp_exifdata', 1]],
28
		];
29
	}
30
31
	// Let's create the needed table
32
	public function update_schema(): array
33
	{
34
		return [
35
			'add_columns' => [
36
				$this->table_prefix . 'gallery_images' => [
37
					'image_has_exif'   => ['UINT:3', 2],
38
					'image_exif_data'  => ['TEXT', ''],
39
				],
40
				$this->table_prefix . 'gallery_users' => [
41
					'user_viewexif'    => ['UINT:1', 0],
42
				],
43
			],
44
		];
45
	}
46
47
	public function revert_schema(): array
48
	{
49
		return [
50
			'drop_columns' => [
51
				$this->table_prefix . 'gallery_images' => [
52
					'image_has_exif',
53
					'image_exif_data',
54
				],
55
				$this->table_prefix . 'gallery_users' => [
56
					'user_viewexif',
57
				],
58
			],
59
		];
60
	}
61
}
62