Skip to content

Commit

Permalink
mod
Browse files Browse the repository at this point in the history
  • Loading branch information
ShibuyaKosuke committed Sep 5, 2021
1 parent 77fc97a commit 989168b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Exports/DdlExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace ShibuyaKosuke\LaravelDdlExport\Exports;

use Illuminate\Console\OutputStyle;
use Illuminate\Support\Collection;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\WithEvents;
Expand Down Expand Up @@ -33,7 +34,7 @@ class DdlExport implements WithMultipleSheets, WithEvents
* @param mixed $output
* @param Collection|TableInterface[] $tables
*/
public function __construct($output, $tables)
public function __construct(OutputStyle $output, Collection $tables)
{
$this->output = $output;
$this->tables = $tables;
Expand Down
3 changes: 3 additions & 0 deletions src/Models/Contracts/TableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
* @property-read string name
* @property-read string comment
* @property-read Collection|ColumnInterface[] columns
* @property-read Collection|ColumnInterface[] indexes
* @property-read Collection|ColumnInterface[] referencing
* @property-read Collection|ColumnInterface[] referenced
*
*/
interface TableInterface
Expand Down
3 changes: 2 additions & 1 deletion src/Models/Repositories/MysqlManageView.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class MysqlManageView implements ManageViewInterface
*/
public function __construct()
{
$this->sql = File::get(__DIR__ . '/../../sql/mysql_create_view.sql');
$sql = File::get(__DIR__ . '/../../sql/mysql_create_view.sql');
$this->sql = str_replace(':DATABASE_NAME', DB::getDatabaseName(), $sql);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/sql/mysql_create_view.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ FROM information_schema.key_column_usage usg
ON usg.table_schema = cst.table_schema
AND usg.constraint_name = cst.constraint_name
WHERE cst.constraint_type = 'FOREIGN KEY'
and usg.table_schema = 'bizocean_portal'
and usg.table_schema = ':DATABASE_NAME'

0 comments on commit 989168b

Please sign in to comment.