Ability to add connection/table name in model
polashsust opened this issue · 2 comments
polashsust commented
- Laravel Version: 10.4.0
- PHP Version: 8.2.0
- Blueprint Version: 2.7.0
- Platform: Windows
Issue:
Ability to add connection/table name in model
draft.yaml:
Models:
SystemInformationConversion:
range: string:100
rubric: string:200
specified_value: string:50
softDeletes: true
timestamps: false
table: system_information_conversion
connection: db_connection_name
jasonmccreary commented
You can do this with the meta
tag, right? I assume that's why you closed it?
polashsust commented
Thank you for your reply. I have closed it because it's not actually a bug.
i think the solution is in class ModelLexer implements Lexer
private function buildModel(string $name, array $columns) {
// for table we need this condition
if (isset($columns['table'])) {
if ($columns['table']) {
$model->setTableName($columns['table']);
unset($columns['table']);
}
} do you have other solution? my draft.yaml is
models:
SystemAngabenKonvertierung:
bereich: string:100
rubrik: string:200
angabe_wert: string:50
angabe_zusatz: string:100
info_text: text
konvert_alt_system: string:100
softDeletes: true
timestamps: false
table: sta_system_angaben_konvertierung
…On Wed, May 17, 2023, 15:29 Jason McCreary ***@***.***> wrote:
You can do this with the meta tag, right? I assume that's why you closed
it?
—
Reply to this email directly, view it on GitHub
<#639 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC47PPZ6HBQ5TU6KA3QFSRLXGTHFLANCNFSM6AAAAAAYEZP3UY>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>