@@ 33-43 (lines=11) @@ | ||
30 | * @param FieldType $type |
|
31 | * @param AssignmentInterface $assignment |
|
32 | */ |
|
33 | public function addColumn($table, FieldType $type, AssignmentInterface $assignment) |
|
34 | { |
|
35 | $schema = $type->getSchema(); |
|
36 | ||
37 | $this->schema->table( |
|
38 | $table, |
|
39 | function (Blueprint $table) use ($schema, $assignment) { |
|
40 | $schema->addColumn($table, $assignment); |
|
41 | } |
|
42 | ); |
|
43 | } |
|
44 | ||
45 | /** |
|
46 | * Update a column. |
|
@@ 52-62 (lines=11) @@ | ||
49 | * @param FieldType $type |
|
50 | * @param AssignmentInterface $assignment |
|
51 | */ |
|
52 | public function updateColumn($table, FieldType $type, AssignmentInterface $assignment) |
|
53 | { |
|
54 | $schema = $type->getSchema(); |
|
55 | ||
56 | $this->schema->table( |
|
57 | $table, |
|
58 | function (Blueprint $table) use ($schema, $assignment) { |
|
59 | $schema->updateColumn($table, $assignment); |
|
60 | } |
|
61 | ); |
|
62 | } |
|
63 | ||
64 | /** |
|
65 | * Rename a column. |