Skip to content

Commit

Permalink
Implement for table/compo schema - WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
SOHELAHMED7 committed Nov 18, 2024
1 parent af961aa commit d549831
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/AttributeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public function resolve(): DbModel
//For valid primary keys for junction tables
'junctionCols' => $this->isJunctionSchema ? $this->junctions->junctionCols($this->schemaName) : [],
'isNotDb' => $this->componentSchema->isNonDb(),
'descriptionIsComment' => $this->componentSchema->{CustomSpecAttr::DESC_IS_COMMENT},
],
]);
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/items/DbModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ class DbModel extends BaseObject
*/
public $scenarioDefaultDescription = "Scenario {scenarioName}";

public bool $descriptionIsComment = false;

/**
* @var array Automatically generated scenarios from the model 'x-scenarios'.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/lib/migrations/MysqlMigrationBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ protected function compareColumns(ColumnSchema $current, ColumnSchema $desired):
];
if (!empty($this->config->getOpenApi()->{CustomSpecAttr::DESC_IS_COMMENT})) {
$properties[] = 'comment';
} elseif ($this->model->descriptionIsComment) { // TODO
$properties[] = 'comment';
}
foreach ($properties as $attr) {
if ($attr === 'defaultValue') {
Expand Down

0 comments on commit d549831

Please sign in to comment.