Lines 100.00% 1 / 1
Functions and Methods 100.00% 1 / 1
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
SchemaChange 100.00% 1 / 1 100.00% 1 / 1 1 100.00% 1 / 1
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace BlueprintAU\Radiant\Database\Schema;
6
7use BlueprintAU\Radiant\Database\Schema\Enums\SchemaOperation;
8
9/**
10 * One planned schema change, classified for the host's safety gate.
11 */
12final class SchemaChange
13{
14    /**
15     * Create a schema change.
16     *
17     * @param  string  $table
18     * @param  SchemaOperation  $operation
19     * @param  Blueprint  $blueprint  The full desired shape of the table.
20     * @param  bool  $destructive  Whether the change can lose data.
21     * @param  string  $description
22     * @param  bool  $possibleRename  Whether this change is half of a rename-shaped diff.
23     * @param  string|null  $renameOf  The paired change's table, when part of a flagged pair.
24     * @param  list<string>|null  $subject  The columns this change acts on; null means the whole blueprint.
25     */
26    public function __construct(
27        public readonly string $table,
28        public readonly SchemaOperation $operation,
29        public readonly Blueprint $blueprint,
30        public readonly bool $destructive,
31        public readonly string $description,
32        public readonly bool $possibleRename = false,
33        public readonly string|null $renameOf = null,
34        public readonly array|null $subject = null,
35    ) {}
36}