From 044b8f0f84b94c3f26cb2f29e9e3dd5fb35d3234 Mon Sep 17 00:00:00 2001 From: Cristiano Teles Date: Tue, 3 Mar 2020 23:44:05 -0300 Subject: [PATCH 1/2] [FIX] Invalid class name for schema table The migration class name is being generated as schema.table instead of schemaTable --- src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php b/src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php index 1fca95a..727de00 100644 --- a/src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php +++ b/src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php @@ -325,7 +325,7 @@ protected function getTemplateData() } return [ - 'CLASS' => ucwords(Str::camel($this->migrationName)), + 'CLASS' => ucwords(Str::camel(str_replace('.', '', $this->migrationName))), 'UP' => $up, 'DOWN' => $down ]; From 0a777895b28a5eac744ed52f51071b805965a8ff Mon Sep 17 00:00:00 2001 From: Cristiano Teles Date: Wed, 4 Mar 2020 00:35:28 -0300 Subject: [PATCH 2/2] [FIX] Invalid class name for schema table The migration class name is being generated as schema.table instead of schemaTable --- src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php b/src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php index 727de00..96dc664 100644 --- a/src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php +++ b/src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php @@ -240,7 +240,7 @@ protected function generateTablesAndIndices( array $tables ) foreach ( $tables as $table ) { $this->table = $table; - $this->migrationName = 'create_'. $this->table .'_table'; + $this->migrationName = 'create_' . str_replace('.', '', $this->table) . '_table'; $this->fields = $this->schemaGenerator->getFields( $this->table ); $this->generate(); @@ -325,7 +325,7 @@ protected function getTemplateData() } return [ - 'CLASS' => ucwords(Str::camel(str_replace('.', '', $this->migrationName))), + 'CLASS' => ucwords(Str::camel($this->migrationName)), 'UP' => $up, 'DOWN' => $down ];