Skip to content

Commit d549831

Browse files
committed
Implement for table/compo schema - WIP
1 parent af961aa commit d549831

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/lib/AttributeResolver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public function resolve(): DbModel
117117
//For valid primary keys for junction tables
118118
'junctionCols' => $this->isJunctionSchema ? $this->junctions->junctionCols($this->schemaName) : [],
119119
'isNotDb' => $this->componentSchema->isNonDb(),
120+
'descriptionIsComment' => $this->componentSchema->{CustomSpecAttr::DESC_IS_COMMENT},
120121
],
121122
]);
122123
}

src/lib/items/DbModel.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ class DbModel extends BaseObject
8888
*/
8989
public $scenarioDefaultDescription = "Scenario {scenarioName}";
9090

91+
public bool $descriptionIsComment = false;
92+
9193
/**
9294
* @var array Automatically generated scenarios from the model 'x-scenarios'.
9395
*/

src/lib/migrations/MysqlMigrationBuilder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ protected function compareColumns(ColumnSchema $current, ColumnSchema $desired):
6666
];
6767
if (!empty($this->config->getOpenApi()->{CustomSpecAttr::DESC_IS_COMMENT})) {
6868
$properties[] = 'comment';
69+
} elseif ($this->model->descriptionIsComment) { // TODO
70+
$properties[] = 'comment';
6971
}
7072
foreach ($properties as $attr) {
7173
if ($attr === 'defaultValue') {

0 commit comments

Comments
 (0)