diff --git a/.env.example b/.env.example index 054994c..31b4ddb 100644 --- a/.env.example +++ b/.env.example @@ -38,11 +38,12 @@ ARCADIA_DB_DRIVER=oracle # ARCADIA_DB_TNS= ARCADIA_DB_HOST=127.0.0.1 ARCADIA_DB_PORT=1521 -ARCADIA_DB=XEPDB1 -ARCADIA_DB_SERVICE_NAME=XEPDB1 -ARCADIA_DB_USERNAME=ORACLE +ARCADIA_DB=XE +ARCADIA_DB_SID=XE +# ARCADIA_DB_SERVICE_NAME= +ARCADIA_DB_USERNAME=DIGITAL ARCADIA_DB_PASSWORD=:Oracle.Docker2026 -ARCADIA_DB_SCHEMA=arcadia +ARCADIA_DB_SCHEMA= # ARCADIA_DB_CHARSET=AL32UTF8 # ARCADIA_DB_EDITION=ora$base # ARCADIA_DB_SERVER_VERSION=19c diff --git a/config/database.php b/config/database.php index 4c20bed..fbeeec6 100644 --- a/config/database.php +++ b/config/database.php @@ -41,13 +41,14 @@ return [ 'tns' => env('ARCADIA_DB_TNS', ''), 'host' => env('ARCADIA_DB_HOST', '127.0.0.1'), 'port' => env('ARCADIA_DB_PORT', '1521'), - 'database' => env('ARCADIA_DB', 'XEPDB1'), - 'service_name' => env('ARCADIA_DB_SERVICE_NAME', 'XEPDB1'), - 'username' => env('ARCADIA_DB_USERNAME', 'DIGITAL'), + 'database' => env('ARCADIA_DB', env('ARCADIA_DB_SID', '')), + 'sid' => env('ARCADIA_DB_SID', ''), + 'service_name' => env('ARCADIA_DB_SERVICE_NAME', ''), + 'username' => env('ARCADIA_DB_USERNAME', ''), 'password' => env('ARCADIA_DB_PASSWORD', ''), 'charset' => env('ARCADIA_DB_CHARSET', 'AL32UTF8'), 'prefix' => '', - 'prefix_schema' => env('ARCADIA_DB_SCHEMA', 'DIGITAL'), + 'prefix_schema' => env('ARCADIA_DB_SCHEMA', ''), 'edition' => env('ARCADIA_DB_EDITION', 'ora$base'), 'server_version' => env('ARCADIA_DB_SERVER_VERSION', '19c'), 'max_name_len' => (int) env('ARCADIA_DB_MAX_NAME_LEN', 128), diff --git a/database/arcadia-replicate/Factories/AbstractTableFactory.php b/database/arcadia-replicate/Factories/AbstractTableFactory.php index 0f4a556..6fbfd11 100644 --- a/database/arcadia-replicate/Factories/AbstractTableFactory.php +++ b/database/arcadia-replicate/Factories/AbstractTableFactory.php @@ -25,15 +25,17 @@ abstract class AbstractTableFactory implements TableFactory return resolve(ArcadiaStorageConfig::class)->databaseConnection; } - public static function tableName(): string + public static function tableName(?string $connection = null): string { - return static::table()::name(); + return static::table()::table($connection ?? static::connectionName()); } public static function query(?string $connection = null): Builder { - return DB::connection($connection ?? static::connectionName()) - ->table(static::tableName()); + $connName = $connection ?? static::connectionName(); + + return DB::connection($connName) + ->table(static::tableName($connName)); } public static function count(?string $connection = null): int @@ -96,7 +98,7 @@ abstract class AbstractTableFactory implements TableFactory $data = $this->raw($attributes); DB::connection($this->connection) - ->table(static::tableName()) + ->table(static::tableName($this->connection)) ->insert($data); return $data; diff --git a/database/arcadia-replicate/IdentifiesTableOrView.php b/database/arcadia-replicate/IdentifiesTableOrView.php new file mode 100644 index 0000000..a15ddd6 --- /dev/null +++ b/database/arcadia-replicate/IdentifiesTableOrView.php @@ -0,0 +1,31 @@ +getDriverName(); + } else { + $connectionName = $connection ?? resolve(ArcadiaStorageConfig::class)->databaseConnection; + $driver = DB::connection($connectionName)->getDriverName(); + } + + if ($driver === 'oracle') { + return static::schemaName() . '.' . static::name(); + } + + return static::name(); + } +} diff --git a/database/arcadia-replicate/Migrator.php b/database/arcadia-replicate/Migrator.php index 1854bc3..7b69b0c 100644 --- a/database/arcadia-replicate/Migrator.php +++ b/database/arcadia-replicate/Migrator.php @@ -125,11 +125,34 @@ final class Migrator VisuelExportGenfiView::class, ]; - public function __construct(private readonly string $connection) {} + public function __construct(private readonly string $connection) + { + } public function up(): void { - $this->down(); + $conn = DB::connection($this->connection); + + /** @var list */ + $schemas = []; + + foreach (self::DEFINITIONS as $definition) { + $schemas[$definition::schemaName()] = $definition::schemaName(); + } + + if ($conn->getDriverName() === 'oracle') { + foreach ($schemas as $schemaUser) { + try { + $conn->statement("CREATE USER {$schemaUser} IDENTIFIED BY {$schemaUser} DEFAULT TABLESPACE USERS QUOTA UNLIMITED ON USERS"); + } catch (\Throwable $e) { + unset($e); + } + } + } + + if (app()->environment('local', 'testing')) { + $this->down(); + } $schema = Schema::connection($this->connection); diff --git a/database/arcadia-replicate/TableOrView.php b/database/arcadia-replicate/TableOrView.php index 8688056..3e739fa 100644 --- a/database/arcadia-replicate/TableOrView.php +++ b/database/arcadia-replicate/TableOrView.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate; use Illuminate\Database\Schema\Builder; +use Illuminate\Database\Connection; interface TableOrView { @@ -28,6 +29,11 @@ interface TableOrView */ public static function description(): string; + /** + * Nom complet qualifié de la table (ex: 'REFP.INCO' sous Oracle, 'INCO' sous SQLite/MySQL). + */ + public static function table(?Connection $connection = null): string; + /** * Création de la structure miroir (colonnes, clés, types et commentaires). */ diff --git a/database/arcadia-replicate/Tables/Metap/MetaUtilTable.php b/database/arcadia-replicate/Tables/Metap/MetaUtilTable.php index 43bbc31..23c420e 100644 --- a/database/arcadia-replicate/Tables/Metap/MetaUtilTable.php +++ b/database/arcadia-replicate/Tables/Metap/MetaUtilTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Metap; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class MetaUtilTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'METAP'; @@ -38,10 +41,10 @@ final class MetaUtilTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->string('COD_UTIL', 36)->primary()->comment('Oracle: VARCHAR2(0, 0) [PK]'); $table->text('LIB_UTIL')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->bigInteger('UVERSION')->nullable()->comment('Oracle: NUMBER(0, 0)'); @@ -74,6 +77,6 @@ final class MetaUtilTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/AdditifTable.php b/database/arcadia-replicate/Tables/Refp/AdditifTable.php index dda7a2e..07428b5 100644 --- a/database/arcadia-replicate/Tables/Refp/AdditifTable.php +++ b/database/arcadia-replicate/Tables/Refp/AdditifTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class AdditifTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class AdditifTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->string('COD_EUROPEEN', 40)->primary()->comment('Oracle: VARCHAR2(0, 0) [PK]'); $table->text('MOLECULE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->text('CARAC_GEN')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -59,6 +62,6 @@ final class AdditifTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/ArtRayonTable.php b/database/arcadia-replicate/Tables/Refp/ArtRayonTable.php index d4b6210..39c8690 100644 --- a/database/arcadia-replicate/Tables/Refp/ArtRayonTable.php +++ b/database/arcadia-replicate/Tables/Refp/ArtRayonTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class ArtRayonTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class ArtRayonTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->smallInteger('COD_RAYON')->primary()->comment('Oracle: NUMBER(3, 0) [PK]'); $table->text('LIB_RAYON')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->date('DAT_CRE')->nullable()->comment('Oracle: DATE(0, 0)'); @@ -52,6 +55,6 @@ final class ArtRayonTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/ArticleAssoProduitsTable.php b/database/arcadia-replicate/Tables/Refp/ArticleAssoProduitsTable.php index 4398a78..32cc595 100644 --- a/database/arcadia-replicate/Tables/Refp/ArticleAssoProduitsTable.php +++ b/database/arcadia-replicate/Tables/Refp/ArticleAssoProduitsTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class ArticleAssoProduitsTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class ArticleAssoProduitsTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('ID')->primary()->comment('Oracle: NUMBER(10, 0) [PK]'); $table->smallInteger('CODE_SITE')->nullable()->comment('Oracle: NUMBER(4, 0)'); $table->unsignedBigInteger('NO_ART')->nullable()->comment('Oracle: NUMBER(10, 0)'); @@ -56,6 +59,6 @@ final class ArticleAssoProduitsTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/ArticleRefTable.php b/database/arcadia-replicate/Tables/Refp/ArticleRefTable.php index 9ba0410..c298bba 100644 --- a/database/arcadia-replicate/Tables/Refp/ArticleRefTable.php +++ b/database/arcadia-replicate/Tables/Refp/ArticleRefTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class ArticleRefTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class ArticleRefTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('NO_ART')->comment('Oracle: NUMBER(0, 0) [PK]'); $table->string('LIB_CCIAL', 140)->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->smallInteger('NO_SORTE')->nullable()->comment('Oracle: NUMBER(3, 0)'); @@ -457,6 +460,6 @@ final class ArticleRefTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/AssoCommunesCpTable.php b/database/arcadia-replicate/Tables/Refp/AssoCommunesCpTable.php index d901f25..2964b05 100644 --- a/database/arcadia-replicate/Tables/Refp/AssoCommunesCpTable.php +++ b/database/arcadia-replicate/Tables/Refp/AssoCommunesCpTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class AssoCommunesCpTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class AssoCommunesCpTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->string('NUM_COMMUNES', 20)->comment('Oracle: VARCHAR2(0, 0) [PK]'); $table->string('CP', 191)->comment('Oracle: VARCHAR2(0, 0) [PK]'); $table->unsignedBigInteger('UVERSION')->nullable()->comment('Oracle: NUMBER(10, 0)'); @@ -51,6 +54,6 @@ final class AssoCommunesCpTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/AssoIncoZoneVersioCcialTable.php b/database/arcadia-replicate/Tables/Refp/AssoIncoZoneVersioCcialTable.php index e536f0c..f372fa4 100644 --- a/database/arcadia-replicate/Tables/Refp/AssoIncoZoneVersioCcialTable.php +++ b/database/arcadia-replicate/Tables/Refp/AssoIncoZoneVersioCcialTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class AssoIncoZoneVersioCcialTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class AssoIncoZoneVersioCcialTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->dateTime('DAT_CRE')->nullable()->comment('Oracle: TIMESTAMP(6)(6, 0)'); $table->dateTime('DAT_MAJ')->nullable()->comment('Oracle: TIMESTAMP(6)(6, 0)'); $table->integer('UVERSION')->nullable()->comment('Oracle: NUMBER(5, 0)'); @@ -53,6 +56,6 @@ final class AssoIncoZoneVersioCcialTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/AssoIncoZoneVersioMktTable.php b/database/arcadia-replicate/Tables/Refp/AssoIncoZoneVersioMktTable.php index 1444bdf..8828fb9 100644 --- a/database/arcadia-replicate/Tables/Refp/AssoIncoZoneVersioMktTable.php +++ b/database/arcadia-replicate/Tables/Refp/AssoIncoZoneVersioMktTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class AssoIncoZoneVersioMktTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class AssoIncoZoneVersioMktTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->dateTime('DAT_CRE')->nullable()->comment('Oracle: TIMESTAMP(6)(6, 0)'); $table->dateTime('DAT_MAJ')->nullable()->comment('Oracle: TIMESTAMP(6)(6, 0)'); $table->integer('UVERSION')->nullable()->comment('Oracle: NUMBER(5, 0)'); @@ -53,6 +56,6 @@ final class AssoIncoZoneVersioMktTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/AssoIncoZoneVersioQualTable.php b/database/arcadia-replicate/Tables/Refp/AssoIncoZoneVersioQualTable.php index 765595d..73671db 100644 --- a/database/arcadia-replicate/Tables/Refp/AssoIncoZoneVersioQualTable.php +++ b/database/arcadia-replicate/Tables/Refp/AssoIncoZoneVersioQualTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class AssoIncoZoneVersioQualTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class AssoIncoZoneVersioQualTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->dateTime('DAT_CRE')->nullable()->comment('Oracle: TIMESTAMP(6)(6, 0)'); $table->dateTime('DAT_MAJ')->nullable()->comment('Oracle: TIMESTAMP(6)(6, 0)'); $table->integer('UVERSION')->nullable()->comment('Oracle: NUMBER(5, 0)'); @@ -53,6 +56,6 @@ final class AssoIncoZoneVersioQualTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/CalibreOeufsTable.php b/database/arcadia-replicate/Tables/Refp/CalibreOeufsTable.php index 2a587fb..9ade45c 100644 --- a/database/arcadia-replicate/Tables/Refp/CalibreOeufsTable.php +++ b/database/arcadia-replicate/Tables/Refp/CalibreOeufsTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class CalibreOeufsTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class CalibreOeufsTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->smallInteger('CODE_CALIBRE')->primary()->comment('Oracle: NUMBER(3, 0) [PK]'); $table->string('LIBELLE_CALIBRE', 120)->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->integer('UVERSION')->nullable()->comment('Oracle: NUMBER(6, 0)'); @@ -50,6 +53,6 @@ final class CalibreOeufsTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/FamRgptTable.php b/database/arcadia-replicate/Tables/Refp/FamRgptTable.php index 1dc8693..12d5ba5 100644 --- a/database/arcadia-replicate/Tables/Refp/FamRgptTable.php +++ b/database/arcadia-replicate/Tables/Refp/FamRgptTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class FamRgptTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class FamRgptTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('COD_FAMRGPT')->primary()->comment('Oracle: NUMBER(0, 0) [PK]'); $table->text('LIB_FAMRGPT')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->bigInteger('COD_FAMANA')->nullable()->comment('Oracle: NUMBER(0, 0)'); @@ -55,6 +58,6 @@ final class FamRgptTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/FamVenteTable.php b/database/arcadia-replicate/Tables/Refp/FamVenteTable.php index 10ca7a6..5f2b4e7 100644 --- a/database/arcadia-replicate/Tables/Refp/FamVenteTable.php +++ b/database/arcadia-replicate/Tables/Refp/FamVenteTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class FamVenteTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class FamVenteTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('COD_FAMVTE')->primary()->comment('Oracle: NUMBER(0, 0) [PK]'); $table->text('LIB_FAMVTE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->bigInteger('COD_FAMGEST')->nullable()->comment('Oracle: NUMBER(0, 0)'); @@ -107,6 +110,6 @@ final class FamVenteTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/GroupementQualTable.php b/database/arcadia-replicate/Tables/Refp/GroupementQualTable.php index 8e71d99..fb641ee 100644 --- a/database/arcadia-replicate/Tables/Refp/GroupementQualTable.php +++ b/database/arcadia-replicate/Tables/Refp/GroupementQualTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class GroupementQualTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class GroupementQualTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('ID')->primary()->comment('Oracle: NUMBER(10, 0) [PK]'); $table->text('NOM')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->text('ADRESSE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -55,6 +58,6 @@ final class GroupementQualTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/IncoAllegationsTable.php b/database/arcadia-replicate/Tables/Refp/IncoAllegationsTable.php index 08366fd..35161c7 100644 --- a/database/arcadia-replicate/Tables/Refp/IncoAllegationsTable.php +++ b/database/arcadia-replicate/Tables/Refp/IncoAllegationsTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoAllegationsTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoAllegationsTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('CODE')->primary()->comment('Oracle: NUMBER(10, 0) [PK]'); $table->text('LIBELLE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->integer('UVERSION')->nullable()->comment('Oracle: NUMBER(5, 0)'); @@ -50,6 +53,6 @@ final class IncoAllegationsTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/IncoAllergeneTable.php b/database/arcadia-replicate/Tables/Refp/IncoAllergeneTable.php index 7a8879b..ef25e89 100644 --- a/database/arcadia-replicate/Tables/Refp/IncoAllergeneTable.php +++ b/database/arcadia-replicate/Tables/Refp/IncoAllergeneTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoAllergeneTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoAllergeneTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('ID')->primary()->comment('Oracle: NUMBER(10, 0) [PK]'); $table->text('LIB')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->integer('UVERSION')->nullable()->comment('Oracle: NUMBER(5, 0)'); @@ -50,6 +53,6 @@ final class IncoAllergeneTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/IncoAssoAllergeneTable.php b/database/arcadia-replicate/Tables/Refp/IncoAssoAllergeneTable.php index 5e01b68..c65e8b3 100644 --- a/database/arcadia-replicate/Tables/Refp/IncoAssoAllergeneTable.php +++ b/database/arcadia-replicate/Tables/Refp/IncoAssoAllergeneTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoAssoAllergeneTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoAssoAllergeneTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('ID')->comment('Oracle: NUMBER(10, 0) [PK]'); $table->bigInteger('COD_SITE_GRP')->comment('Oracle: NUMBER(0, 0) [PK]'); $table->text('LST_ALLERGENE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -52,6 +55,6 @@ final class IncoAssoAllergeneTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/IncoAssoTraceTable.php b/database/arcadia-replicate/Tables/Refp/IncoAssoTraceTable.php index c1a52c4..35ac959 100644 --- a/database/arcadia-replicate/Tables/Refp/IncoAssoTraceTable.php +++ b/database/arcadia-replicate/Tables/Refp/IncoAssoTraceTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoAssoTraceTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoAssoTraceTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('ID')->comment('Oracle: NUMBER(10, 0) [PK]'); $table->bigInteger('COD_SITE_GRP')->comment('Oracle: NUMBER(0, 0) [PK]'); $table->text('TRACES_RCT')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -52,6 +55,6 @@ final class IncoAssoTraceTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/IncoBriqueGpcTable.php b/database/arcadia-replicate/Tables/Refp/IncoBriqueGpcTable.php index 9bf5fed..edf3eb5 100644 --- a/database/arcadia-replicate/Tables/Refp/IncoBriqueGpcTable.php +++ b/database/arcadia-replicate/Tables/Refp/IncoBriqueGpcTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoBriqueGpcTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoBriqueGpcTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->string('CODE_BRIQUE', 32)->primary()->comment('Oracle: VARCHAR2(0, 0) [PK]'); $table->text('LIB_BRIQUE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->unsignedBigInteger('UVERSION')->nullable()->comment('Oracle: NUMBER(10, 0)'); @@ -52,6 +55,6 @@ final class IncoBriqueGpcTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/IncoCompoTable.php b/database/arcadia-replicate/Tables/Refp/IncoCompoTable.php index 3e2daf8..94064ba 100644 --- a/database/arcadia-replicate/Tables/Refp/IncoCompoTable.php +++ b/database/arcadia-replicate/Tables/Refp/IncoCompoTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoCompoTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoCompoTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('ID')->primary()->comment('Oracle: NUMBER(10, 0) [PK]'); $table->unsignedBigInteger('ID_INCO')->nullable()->comment('Oracle: NUMBER(10, 0)'); $table->string('NUMERO', 40)->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -229,6 +232,6 @@ final class IncoCompoTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/IncoDoaTable.php b/database/arcadia-replicate/Tables/Refp/IncoDoaTable.php index ab5379c..6e1424c 100644 --- a/database/arcadia-replicate/Tables/Refp/IncoDoaTable.php +++ b/database/arcadia-replicate/Tables/Refp/IncoDoaTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoDoaTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoDoaTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('CLE_SEQ')->primary()->comment('Oracle: NUMBER(10, 0) [PK]'); $table->unsignedBigInteger('NO_ART')->nullable()->comment('Oracle: NUMBER(10, 0)'); $table->unsignedBigInteger('ORI_BIO')->nullable()->comment('Oracle: NUMBER(10, 0)'); @@ -56,6 +59,6 @@ final class IncoDoaTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/IncoInterprofessionTable.php b/database/arcadia-replicate/Tables/Refp/IncoInterprofessionTable.php index 87a6126..fe27ce7 100644 --- a/database/arcadia-replicate/Tables/Refp/IncoInterprofessionTable.php +++ b/database/arcadia-replicate/Tables/Refp/IncoInterprofessionTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoInterprofessionTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoInterprofessionTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('CODE')->primary()->comment('Oracle: NUMBER(10, 0) [PK]'); $table->text('LIBELLE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->integer('UVERSION')->nullable()->comment('Oracle: NUMBER(5, 0)'); @@ -53,6 +56,6 @@ final class IncoInterprofessionTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/IncoNeaTable.php b/database/arcadia-replicate/Tables/Refp/IncoNeaTable.php index 3681f11..436f093 100644 --- a/database/arcadia-replicate/Tables/Refp/IncoNeaTable.php +++ b/database/arcadia-replicate/Tables/Refp/IncoNeaTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoNeaTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoNeaTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('CLE_SEQ')->primary()->comment('Oracle: NUMBER(10, 0) [PK]'); $table->unsignedBigInteger('NO_ART')->nullable()->comment('Oracle: NUMBER(15, 0)'); $table->string('NE', 12)->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -55,6 +58,6 @@ final class IncoNeaTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/IncoOrigininfoTable.php b/database/arcadia-replicate/Tables/Refp/IncoOrigininfoTable.php index 43c295c..efa4d62 100644 --- a/database/arcadia-replicate/Tables/Refp/IncoOrigininfoTable.php +++ b/database/arcadia-replicate/Tables/Refp/IncoOrigininfoTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoOrigininfoTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoOrigininfoTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->date('DAT_CRE')->nullable()->comment('Oracle: DATE(0, 0)'); $table->date('DAT_MAJ')->nullable()->comment('Oracle: DATE(0, 0)'); $table->integer('UVERSION')->nullable()->comment('Oracle: NUMBER(5, 0)'); @@ -54,6 +57,6 @@ final class IncoOrigininfoTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/IncoSitProdTable.php b/database/arcadia-replicate/Tables/Refp/IncoSitProdTable.php index 0e1978d..536692f 100644 --- a/database/arcadia-replicate/Tables/Refp/IncoSitProdTable.php +++ b/database/arcadia-replicate/Tables/Refp/IncoSitProdTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoSitProdTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoSitProdTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->integer('NO_ART')->comment('Oracle: NUMBER(9, 0) [PK]'); $table->unsignedBigInteger('COD_SITE_GRP')->comment('Oracle: NUMBER(10, 0) [PK]'); $table->integer('UVERSION')->nullable()->comment('Oracle: NUMBER(5, 0)'); @@ -52,6 +55,6 @@ final class IncoSitProdTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/IncoSuiviEnvoiTable.php b/database/arcadia-replicate/Tables/Refp/IncoSuiviEnvoiTable.php index 5715dfe..6cc5287 100644 --- a/database/arcadia-replicate/Tables/Refp/IncoSuiviEnvoiTable.php +++ b/database/arcadia-replicate/Tables/Refp/IncoSuiviEnvoiTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoSuiviEnvoiTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoSuiviEnvoiTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('ID')->primary()->comment('Oracle: NUMBER(10, 0) [PK]'); $table->unsignedBigInteger('ID_GESTION_ENVOI')->nullable()->comment('Oracle: NUMBER(10, 0)'); $table->unsignedBigInteger('ID_INCO')->nullable()->comment('Oracle: NUMBER(10, 0)'); @@ -58,6 +61,6 @@ final class IncoSuiviEnvoiTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/IncoTable.php b/database/arcadia-replicate/Tables/Refp/IncoTable.php index f66da5f..cbdb653 100644 --- a/database/arcadia-replicate/Tables/Refp/IncoTable.php +++ b/database/arcadia-replicate/Tables/Refp/IncoTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->date('DAT_CRE')->nullable()->comment('Oracle: DATE(0, 0)'); $table->date('DAT_MAJ')->nullable()->comment('Oracle: DATE(0, 0)'); $table->bigInteger('NO_ART')->primary()->comment('Oracle: NUMBER(0, 0) [PK]'); @@ -219,6 +222,6 @@ final class IncoTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/IncoVersionTable.php b/database/arcadia-replicate/Tables/Refp/IncoVersionTable.php index 3c6a318..41c2b3c 100644 --- a/database/arcadia-replicate/Tables/Refp/IncoVersionTable.php +++ b/database/arcadia-replicate/Tables/Refp/IncoVersionTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoVersionTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoVersionTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->date('DAT_CRE')->nullable()->comment('Oracle: DATE(0, 0)'); $table->date('DAT_MAJ')->nullable()->comment('Oracle: DATE(0, 0)'); $table->integer('UVERSION')->nullable()->comment('Oracle: NUMBER(5, 0)'); @@ -55,6 +58,6 @@ final class IncoVersionTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/InseeCommunesTable.php b/database/arcadia-replicate/Tables/Refp/InseeCommunesTable.php index 56d6b5c..dbf128c 100644 --- a/database/arcadia-replicate/Tables/Refp/InseeCommunesTable.php +++ b/database/arcadia-replicate/Tables/Refp/InseeCommunesTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class InseeCommunesTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class InseeCommunesTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->smallInteger('CODE_CDC')->nullable()->comment('Oracle: NUMBER(4, 0)'); $table->boolean('CHEF_LIEU')->nullable()->comment('Oracle: NUMBER(1, 0)'); $table->smallInteger('CODE_REGION')->nullable()->comment('Oracle: NUMBER(3, 0)'); @@ -63,6 +66,6 @@ final class InseeCommunesTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/MarqueTable.php b/database/arcadia-replicate/Tables/Refp/MarqueTable.php index f37ee3c..867a518 100644 --- a/database/arcadia-replicate/Tables/Refp/MarqueTable.php +++ b/database/arcadia-replicate/Tables/Refp/MarqueTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class MarqueTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class MarqueTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('COD_MARQ')->primary()->comment('Oracle: NUMBER(0, 0) [PK]'); $table->text('LIB_MARQ')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->bigInteger('COD_RGPT_MARQ')->nullable()->comment('Oracle: NUMBER(0, 0)'); @@ -75,6 +78,6 @@ final class MarqueTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/MediaAssoArticleTable.php b/database/arcadia-replicate/Tables/Refp/MediaAssoArticleTable.php index e22b7b1..ce3b3a7 100644 --- a/database/arcadia-replicate/Tables/Refp/MediaAssoArticleTable.php +++ b/database/arcadia-replicate/Tables/Refp/MediaAssoArticleTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class MediaAssoArticleTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class MediaAssoArticleTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('CODE_VISUEL')->comment('Oracle: NUMBER(10, 0) [PK]'); $table->unsignedBigInteger('NO_ART')->comment('Oracle: NUMBER(10, 0) [PK]'); $table->integer('UVERSION')->nullable()->comment('Oracle: NUMBER(5, 0)'); @@ -54,6 +57,6 @@ final class MediaAssoArticleTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/MutTable.php b/database/arcadia-replicate/Tables/Refp/MutTable.php index add7466..860175a 100644 --- a/database/arcadia-replicate/Tables/Refp/MutTable.php +++ b/database/arcadia-replicate/Tables/Refp/MutTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class MutTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class MutTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('ID_MUT')->primary()->comment('Oracle: NUMBER(10, 0) [PK]'); $table->text('LIBELLE_MUT')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->text('VARIANTE_NOM')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -55,6 +58,6 @@ final class MutTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/NdpTable.php b/database/arcadia-replicate/Tables/Refp/NdpTable.php index 355bb1e..d12b911 100644 --- a/database/arcadia-replicate/Tables/Refp/NdpTable.php +++ b/database/arcadia-replicate/Tables/Refp/NdpTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class NdpTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class NdpTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->string('COD_NDP', 100)->primary()->comment('Oracle: VARCHAR2(0, 0) [PK]'); $table->text('LIB_NDP')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->bigInteger('UVERSION')->nullable()->comment('Oracle: NUMBER(0, 0)'); @@ -57,6 +60,6 @@ final class NdpTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/OrgCertifTable.php b/database/arcadia-replicate/Tables/Refp/OrgCertifTable.php index 23fdf9e..c32bb62 100644 --- a/database/arcadia-replicate/Tables/Refp/OrgCertifTable.php +++ b/database/arcadia-replicate/Tables/Refp/OrgCertifTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class OrgCertifTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class OrgCertifTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('ID')->primary()->comment('Oracle: NUMBER(10, 0) [PK]'); $table->text('NOM')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->text('ADRESSE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -55,6 +58,6 @@ final class OrgCertifTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/PaletteIncoTable.php b/database/arcadia-replicate/Tables/Refp/PaletteIncoTable.php index 0c4d59d..366a6b7 100644 --- a/database/arcadia-replicate/Tables/Refp/PaletteIncoTable.php +++ b/database/arcadia-replicate/Tables/Refp/PaletteIncoTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class PaletteIncoTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class PaletteIncoTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->integer('ID')->primary()->comment('Oracle: NUMBER(5, 0) [PK]'); $table->text('LIBELLE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->integer('LONGUEUR')->nullable()->comment('Oracle: NUMBER(5, 0)'); @@ -54,6 +57,6 @@ final class PaletteIncoTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/RuPersonneSirhTable.php b/database/arcadia-replicate/Tables/Refp/RuPersonneSirhTable.php index 9a232d9..da148ef 100644 --- a/database/arcadia-replicate/Tables/Refp/RuPersonneSirhTable.php +++ b/database/arcadia-replicate/Tables/Refp/RuPersonneSirhTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class RuPersonneSirhTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class RuPersonneSirhTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->string('MATRICULE_FIC', 60)->primary()->comment('Oracle: VARCHAR2(0, 0) [PK]'); $table->string('COD_PERSONNE', 40)->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->smallInteger('COD_SOC_GRP')->nullable()->comment('Oracle: NUMBER(4, 0)'); @@ -83,6 +86,6 @@ final class RuPersonneSirhTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/ServiceConsoIncoTable.php b/database/arcadia-replicate/Tables/Refp/ServiceConsoIncoTable.php index f672f4e..10fe074 100644 --- a/database/arcadia-replicate/Tables/Refp/ServiceConsoIncoTable.php +++ b/database/arcadia-replicate/Tables/Refp/ServiceConsoIncoTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class ServiceConsoIncoTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class ServiceConsoIncoTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('ID')->primary()->comment('Oracle: NUMBER(10, 0) [PK]'); $table->text('NOM')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->text('ADRESSE1')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -60,6 +63,6 @@ final class ServiceConsoIncoTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/SiteProdGrpTable.php b/database/arcadia-replicate/Tables/Refp/SiteProdGrpTable.php index 9556735..fc23a72 100644 --- a/database/arcadia-replicate/Tables/Refp/SiteProdGrpTable.php +++ b/database/arcadia-replicate/Tables/Refp/SiteProdGrpTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class SiteProdGrpTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class SiteProdGrpTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('COD_SITE_GRP')->primary()->comment('Oracle: NUMBER(0, 0) [PK]'); $table->text('NOM_SITE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->bigInteger('UVERSION')->nullable()->comment('Oracle: NUMBER(0, 0)'); @@ -122,6 +125,6 @@ final class SiteProdGrpTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/SocieteInvTable.php b/database/arcadia-replicate/Tables/Refp/SocieteInvTable.php index 635bd3e..d044627 100644 --- a/database/arcadia-replicate/Tables/Refp/SocieteInvTable.php +++ b/database/arcadia-replicate/Tables/Refp/SocieteInvTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class SocieteInvTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class SocieteInvTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('ID_SOCIETE')->primary()->comment('Oracle: NUMBER(0, 0) [PK]'); $table->bigInteger('ID_POLE')->nullable()->comment('Oracle: NUMBER(0, 0)'); $table->text('NOM_SOCIETE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -116,6 +119,6 @@ final class SocieteInvTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/SousFamTable.php b/database/arcadia-replicate/Tables/Refp/SousFamTable.php index 83b0a84..6f80c36 100644 --- a/database/arcadia-replicate/Tables/Refp/SousFamTable.php +++ b/database/arcadia-replicate/Tables/Refp/SousFamTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class SousFamTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class SousFamTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('COD_SOUSFAM')->primary()->comment('Oracle: NUMBER(0, 0) [PK]'); $table->text('LIB_SOUSFAM')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->integer('NO_ORDRE')->nullable()->comment('Oracle: NUMBER(5, 0)'); @@ -55,6 +58,6 @@ final class SousFamTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/TypEmbTable.php b/database/arcadia-replicate/Tables/Refp/TypEmbTable.php index 54e0028..1beeb62 100644 --- a/database/arcadia-replicate/Tables/Refp/TypEmbTable.php +++ b/database/arcadia-replicate/Tables/Refp/TypEmbTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class TypEmbTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class TypEmbTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->smallInteger('CODE')->primary()->comment('Oracle: NUMBER(3, 0) [PK]'); $table->text('LIBELLE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->text('COMMENTAIRE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -57,6 +60,6 @@ final class TypEmbTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/TypeConditTable.php b/database/arcadia-replicate/Tables/Refp/TypeConditTable.php index 43de5a1..7402588 100644 --- a/database/arcadia-replicate/Tables/Refp/TypeConditTable.php +++ b/database/arcadia-replicate/Tables/Refp/TypeConditTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class TypeConditTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class TypeConditTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('COD_CONDIT')->primary()->comment('Oracle: NUMBER(0, 0) [PK]'); $table->text('LIB_CONDIT')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->bigInteger('UVERSION')->nullable()->comment('Oracle: NUMBER(0, 0)'); @@ -52,6 +55,6 @@ final class TypeConditTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/TypeConservationTable.php b/database/arcadia-replicate/Tables/Refp/TypeConservationTable.php index ef58448..6ef5e08 100644 --- a/database/arcadia-replicate/Tables/Refp/TypeConservationTable.php +++ b/database/arcadia-replicate/Tables/Refp/TypeConservationTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class TypeConservationTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class TypeConservationTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('COD_CONSERVATION')->primary()->comment('Oracle: NUMBER(0, 0) [PK]'); $table->text('LIB_CONSERVATION')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->smallInteger('FAM_CONSERVATION')->nullable()->comment('Oracle: NUMBER(4, 0)'); @@ -57,6 +60,6 @@ final class TypeConservationTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Tables/Refp/UtilisableTable.php b/database/arcadia-replicate/Tables/Refp/UtilisableTable.php index 146012f..efab090 100644 --- a/database/arcadia-replicate/Tables/Refp/UtilisableTable.php +++ b/database/arcadia-replicate/Tables/Refp/UtilisableTable.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Tables\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class UtilisableTable implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class UtilisableTable implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('COD_UTILISABLE')->primary()->comment('Oracle: NUMBER(0, 0) [PK]'); $table->text('LIB_UTILISABLE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->bigInteger('UVERSION')->nullable()->comment('Oracle: NUMBER(0, 0)'); @@ -51,6 +54,6 @@ final class UtilisableTable implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Views/Gcp/DunIncoInfView.php b/database/arcadia-replicate/Views/Gcp/DunIncoInfView.php index 40541aa..377c18a 100644 --- a/database/arcadia-replicate/Views/Gcp/DunIncoInfView.php +++ b/database/arcadia-replicate/Views/Gcp/DunIncoInfView.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Views\Gcp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class DunIncoInfView implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'GCP'; @@ -38,10 +41,10 @@ final class DunIncoInfView implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('NO_ART')->nullable()->comment('Oracle: NUMBER(0, 0)'); $table->bigInteger('COD_PCB')->nullable()->comment('Oracle: NUMBER(0, 0)'); $table->bigInteger('COD_SOCIETE')->nullable()->comment('Oracle: NUMBER(0, 0)'); @@ -74,6 +77,6 @@ final class DunIncoInfView implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Views/Gcp/IncoLangView.php b/database/arcadia-replicate/Views/Gcp/IncoLangView.php index 6560489..143df16 100644 --- a/database/arcadia-replicate/Views/Gcp/IncoLangView.php +++ b/database/arcadia-replicate/Views/Gcp/IncoLangView.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Views\Gcp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoLangView implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'GCP'; @@ -38,10 +41,10 @@ final class IncoLangView implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('NO_ART')->nullable()->comment('Oracle: NUMBER(0, 0)'); $table->bigInteger('COD_LANG')->nullable()->comment('Oracle: NUMBER(0, 0)'); $table->bigInteger('IS_TRAD')->nullable()->comment('Oracle: NUMBER(0, 0)'); @@ -52,6 +55,6 @@ final class IncoLangView implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Views/Gcp/VIncoArtSiteView.php b/database/arcadia-replicate/Views/Gcp/VIncoArtSiteView.php index db06b1b..31a6b15 100644 --- a/database/arcadia-replicate/Views/Gcp/VIncoArtSiteView.php +++ b/database/arcadia-replicate/Views/Gcp/VIncoArtSiteView.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Views\Gcp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class VIncoArtSiteView implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'GCP'; @@ -38,10 +41,10 @@ final class VIncoArtSiteView implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('ID_SOCIETE')->nullable()->comment('Oracle: NUMBER(10, 0)'); $table->unsignedBigInteger('NO_ART')->nullable()->comment('Oracle: NUMBER(10, 0)'); $table->smallInteger('NIVEAU')->nullable()->comment('Oracle: NUMBER(2, 0)'); @@ -55,6 +58,6 @@ final class VIncoArtSiteView implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Views/Refp/ArticleRefGencodView.php b/database/arcadia-replicate/Views/Refp/ArticleRefGencodView.php index 26cd1d2..e0e60f4 100644 --- a/database/arcadia-replicate/Views/Refp/ArticleRefGencodView.php +++ b/database/arcadia-replicate/Views/Refp/ArticleRefGencodView.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Views\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class ArticleRefGencodView implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class ArticleRefGencodView implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('NO_ART')->comment('Oracle: NUMBER(0, 0) [PK]'); $table->string('LIB_CCIAL', 140)->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->string('GENCOD_POIDS_PRIV', 52)->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -56,6 +59,6 @@ final class ArticleRefGencodView implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Views/Refp/DunIncoNosocView.php b/database/arcadia-replicate/Views/Refp/DunIncoNosocView.php index 492a76c..5fa10ad 100644 --- a/database/arcadia-replicate/Views/Refp/DunIncoNosocView.php +++ b/database/arcadia-replicate/Views/Refp/DunIncoNosocView.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Views\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class DunIncoNosocView implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class DunIncoNosocView implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('NO_ART')->nullable()->comment('Oracle: NUMBER(0, 0)'); $table->text('DUN14')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->string('DUN_PALETTE', 56)->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -85,6 +88,6 @@ final class DunIncoNosocView implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Views/Refp/DunIncoView.php b/database/arcadia-replicate/Views/Refp/DunIncoView.php index ba8c14d..9a90d1c 100644 --- a/database/arcadia-replicate/Views/Refp/DunIncoView.php +++ b/database/arcadia-replicate/Views/Refp/DunIncoView.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Views\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class DunIncoView implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class DunIncoView implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('NO_ART')->nullable()->comment('Oracle: NUMBER(0, 0)'); $table->text('DUN14')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->string('DUN_PALETTE', 56)->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -83,6 +86,6 @@ final class DunIncoView implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Views/Refp/EpurerFamVenteView.php b/database/arcadia-replicate/Views/Refp/EpurerFamVenteView.php index 0aafa61..2712562 100644 --- a/database/arcadia-replicate/Views/Refp/EpurerFamVenteView.php +++ b/database/arcadia-replicate/Views/Refp/EpurerFamVenteView.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Views\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class EpurerFamVenteView implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class EpurerFamVenteView implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('COD_FAMVTE')->nullable()->comment('Oracle: NUMBER(0, 0)'); $table->text('LIB_FAMVTE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->bigInteger('COD_FAMGEST')->nullable()->comment('Oracle: NUMBER(0, 0)'); @@ -107,6 +110,6 @@ final class EpurerFamVenteView implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Views/Refp/IncoArticleView.php b/database/arcadia-replicate/Views/Refp/IncoArticleView.php index 5baa8da..c757561 100644 --- a/database/arcadia-replicate/Views/Refp/IncoArticleView.php +++ b/database/arcadia-replicate/Views/Refp/IncoArticleView.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Views\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoArticleView implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoArticleView implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('NO_ART')->comment('Oracle: NUMBER(0, 0) [PK]'); $table->string('LIB_CCIAL', 140)->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->bigInteger('COD_SOC_IA')->comment('Oracle: NUMBER(0, 0) [PK]'); @@ -83,6 +86,6 @@ final class IncoArticleView implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Views/Refp/IncoCompoNutriscoreView.php b/database/arcadia-replicate/Views/Refp/IncoCompoNutriscoreView.php index eedfb5a..9fbaad2 100644 --- a/database/arcadia-replicate/Views/Refp/IncoCompoNutriscoreView.php +++ b/database/arcadia-replicate/Views/Refp/IncoCompoNutriscoreView.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Views\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoCompoNutriscoreView implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoCompoNutriscoreView implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('ID_INCO')->nullable()->comment('Oracle: NUMBER(0, 0)'); $table->string('NUMERO', 40)->nullable()->comment('Oracle: VARCHAR2(0, 0)'); $table->bigInteger('SCORE_NUTRI')->nullable()->comment('Oracle: NUMBER(0, 0)'); @@ -55,6 +58,6 @@ final class IncoCompoNutriscoreView implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Views/Refp/IncoSocRefIncoView.php b/database/arcadia-replicate/Views/Refp/IncoSocRefIncoView.php index 646d826..20d3046 100644 --- a/database/arcadia-replicate/Views/Refp/IncoSocRefIncoView.php +++ b/database/arcadia-replicate/Views/Refp/IncoSocRefIncoView.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Views\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class IncoSocRefIncoView implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class IncoSocRefIncoView implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('ID_INCO')->primary()->comment('Oracle: NUMBER(0, 0) [PK]'); $table->bigInteger('COD_SOC_FACT')->nullable()->comment('Oracle: NUMBER(0, 0)'); $table->bigInteger('UVERSION')->nullable()->comment('Oracle: NUMBER(0, 0)'); @@ -50,6 +53,6 @@ final class IncoSocRefIncoView implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Views/Refp/SitProdIncoView.php b/database/arcadia-replicate/Views/Refp/SitProdIncoView.php index bc920af..5817b3c 100644 --- a/database/arcadia-replicate/Views/Refp/SitProdIncoView.php +++ b/database/arcadia-replicate/Views/Refp/SitProdIncoView.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Views\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class SitProdIncoView implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class SitProdIncoView implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('NO_ART')->nullable()->comment('Oracle: NUMBER(10, 0)'); $table->bigInteger('COD_SITE_GRP')->nullable()->comment('Oracle: NUMBER(0, 0)'); $table->text('NOM_SITE')->nullable()->comment('Oracle: VARCHAR2(0, 0)'); @@ -59,6 +62,6 @@ final class SitProdIncoView implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Views/Refp/SocDlcIncoView.php b/database/arcadia-replicate/Views/Refp/SocDlcIncoView.php index 71ccb32..83492c8 100644 --- a/database/arcadia-replicate/Views/Refp/SocDlcIncoView.php +++ b/database/arcadia-replicate/Views/Refp/SocDlcIncoView.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Views\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class SocDlcIncoView implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class SocDlcIncoView implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->bigInteger('NO_ART')->nullable()->comment('Oracle: NUMBER(0, 0)'); $table->bigInteger('ID_SOCIETE')->primary()->comment('Oracle: NUMBER(0, 0) [PK]'); $table->smallInteger('DLC_CCIAL')->nullable()->comment('Oracle: NUMBER(4, 0)'); @@ -53,6 +56,6 @@ final class SocDlcIncoView implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/database/arcadia-replicate/Views/Refp/VisuelExportGenfiView.php b/database/arcadia-replicate/Views/Refp/VisuelExportGenfiView.php index 8277539..bbbeeb6 100644 --- a/database/arcadia-replicate/Views/Refp/VisuelExportGenfiView.php +++ b/database/arcadia-replicate/Views/Refp/VisuelExportGenfiView.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Database\ArcadiaReplicate\Views\Refp; +use Database\ArcadiaReplicate\IdentifiesTableOrView; use Database\ArcadiaReplicate\TableOrView; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; @@ -15,6 +16,8 @@ use Illuminate\Database\Schema\Builder; */ final class VisuelExportGenfiView implements TableOrView { + use IdentifiesTableOrView; + public static function schemaName(): string { return 'REFP'; @@ -38,10 +41,10 @@ final class VisuelExportGenfiView implements TableOrView public static function up(Builder $schema): void { if (app()->environment('local', 'testing')) { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } - $schema->create(self::name(), function (Blueprint $table): void { + $schema->create(self::table($schema->getConnection()), function (Blueprint $table): void { $table->unsignedBigInteger('NO_ART')->comment('Oracle: NUMBER(10, 0) [PK]'); $table->unsignedBigInteger('CODE_VISUEL')->comment('Oracle: NUMBER(10, 0) [PK]'); $table->unsignedBigInteger('CODE_TYPEVUE')->nullable()->comment('Oracle: NUMBER(10, 0)'); @@ -56,6 +59,6 @@ final class VisuelExportGenfiView implements TableOrView public static function down(Builder $schema): void { - $schema->dropIfExists(self::name()); + $schema->dropIfExists(self::table($schema->getConnection())); } } diff --git a/docker-compose.yml b/docker-compose.yml index e860592..75308d9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,7 +30,6 @@ services: - "1521:1521" environment: ORACLE_PASSWORD: ":Oracle.Docker2026" - ORACLE_DATABASE: "XEPDB1" volumes: - oracle_data:/opt/oracle/oradata diff --git a/src/Infra/Adapters/Directories/ArcadiaEmployeeDirectory.php b/src/Infra/Adapters/Directories/ArcadiaEmployeeDirectory.php index 9aed126..d420f17 100644 --- a/src/Infra/Adapters/Directories/ArcadiaEmployeeDirectory.php +++ b/src/Infra/Adapters/Directories/ArcadiaEmployeeDirectory.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Infra\Adapters\Directories; +use Database\ArcadiaReplicate\Tables\Refp\RuPersonneSirhTable; use Domain\Models\Entities\Employee; use Domain\Models\ValueObjects\Employees\ArcadiaEmployeeId; use Domain\Models\ValueObjects\Employees\EmployeeFilter; @@ -30,7 +31,7 @@ final class ArcadiaEmployeeDirectory implements EmployeeDirectory EmployeeSorter $sorter, ?EmployeeFilter $filter = null, ): Paginated { - $query = $this->connection->table('RU_PERSONNE_SIRH'); + $query = $this->connection->table(RuPersonneSirhTable::table($this->connection)); if ($filter !== null) { if ($filter->establishment !== null) { @@ -79,7 +80,7 @@ final class ArcadiaEmployeeDirectory implements EmployeeDirectory public function find(ArcadiaEmployeeId $id): ?Employee { $row = $this->connection - ->table('RU_PERSONNE_SIRH') + ->table(RuPersonneSirhTable::table($this->connection)) ->where('MATRICULE_FIC', $id->value) ->first(); diff --git a/src/Infra/Adapters/Directories/ArcadiaIncoCompositionDirectory.php b/src/Infra/Adapters/Directories/ArcadiaIncoCompositionDirectory.php index c52b8e0..1584137 100644 --- a/src/Infra/Adapters/Directories/ArcadiaIncoCompositionDirectory.php +++ b/src/Infra/Adapters/Directories/ArcadiaIncoCompositionDirectory.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Infra\Adapters\Directories; +use Database\ArcadiaReplicate\Tables\Refp\IncoCompoTable; use Domain\Models\Entities\Inco\Composition\IncoComposition; use Domain\Models\ValueObjects\Inco\Composition\IncoCompositionId; use Domain\Models\ValueObjects\Inco\IncoId; @@ -22,7 +23,7 @@ final class ArcadiaIncoCompositionDirectory implements IncoCompositionDirectory public function find(IncoCompositionId $id): ?IncoComposition { $row = $this->connection - ->table('INCO_COMPO') + ->table(IncoCompoTable::table($this->connection)) ->where('ID', $id->value) ->first(); @@ -37,7 +38,7 @@ final class ArcadiaIncoCompositionDirectory implements IncoCompositionDirectory public function findByIncoId(IncoId $incoId): ?IncoComposition { $row = $this->connection - ->table('INCO_COMPO') + ->table(IncoCompoTable::table($this->connection)) ->where('ID_INCO', $incoId->value) ->first(); diff --git a/src/Infra/Adapters/Directories/ArcadiaIncoSheetDirectory.php b/src/Infra/Adapters/Directories/ArcadiaIncoSheetDirectory.php index 02593f1..2ef4e0e 100644 --- a/src/Infra/Adapters/Directories/ArcadiaIncoSheetDirectory.php +++ b/src/Infra/Adapters/Directories/ArcadiaIncoSheetDirectory.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace Infra\Adapters\Directories; +use Database\ArcadiaReplicate\Tables\Refp\FamVenteTable; +use Database\ArcadiaReplicate\Tables\Refp\IncoTable; use Domain\Models\Entities\Inco\IncoSheet; use Domain\Models\ValueObjects\Brand\BrandCode; use Domain\Models\ValueObjects\Inco\IncoId; @@ -34,9 +36,12 @@ final class ArcadiaIncoSheetDirectory implements IncoSheetDirectory IncoSheetSorter $sorter, ?IncoSheetFilter $filter = null ): Paginated { + $incoTable = IncoTable::table($this->connection); + $famVenteTable = FamVenteTable::table($this->connection); + $query = $this->connection - ->table('INCO') - ->leftJoin('FAM_VENTE', 'INCO.FAMILLE_VTE', '=', 'FAM_VENTE.COD_FAMVTE') + ->table($incoTable) + ->leftJoin($famVenteTable, 'INCO.FAMILLE_VTE', '=', 'FAM_VENTE.COD_FAMVTE') ->select(['INCO.*', 'FAM_VENTE.LIB_FAMVTE as FAMILLE_VTE_LIBELLE']); if ($filter !== null) { @@ -80,9 +85,12 @@ final class ArcadiaIncoSheetDirectory implements IncoSheetDirectory Pagination $pagination, BrandCode ...$brands ): Paginated { + $incoTable = IncoTable::table($this->connection); + $famVenteTable = FamVenteTable::table($this->connection); + $dbQuery = $this->connection - ->table('INCO') - ->leftJoin('FAM_VENTE', 'INCO.FAMILLE_VTE', '=', 'FAM_VENTE.COD_FAMVTE') + ->table($incoTable) + ->leftJoin($famVenteTable, 'INCO.FAMILLE_VTE', '=', 'FAM_VENTE.COD_FAMVTE') ->select(['INCO.*', 'FAM_VENTE.LIB_FAMVTE as FAMILLE_VTE_LIBELLE']); $dbQuery->where('INCO.NO_ART', 'LIKE', $query->value); @@ -112,9 +120,12 @@ final class ArcadiaIncoSheetDirectory implements IncoSheetDirectory #[\Override] public function find(IncoId $id): ?IncoSheet { + $incoTable = IncoTable::table($this->connection); + $famVenteTable = FamVenteTable::table($this->connection); + $row = $this->connection - ->table('INCO') - ->leftJoin('FAM_VENTE', 'INCO.FAMILLE_VTE', '=', 'FAM_VENTE.COD_FAMVTE') + ->table($incoTable) + ->leftJoin($famVenteTable, 'INCO.FAMILLE_VTE', '=', 'FAM_VENTE.COD_FAMVTE') ->select(['INCO.*', 'FAM_VENTE.LIB_FAMVTE as FAMILLE_VTE_LIBELLE']) ->where('INCO.NO_ART', $id->value) ->first(); diff --git a/src/Infra/Adapters/Directories/ArcadiaIncoShortSheetDirectory.php b/src/Infra/Adapters/Directories/ArcadiaIncoShortSheetDirectory.php index 5b1241c..f5418ea 100644 --- a/src/Infra/Adapters/Directories/ArcadiaIncoShortSheetDirectory.php +++ b/src/Infra/Adapters/Directories/ArcadiaIncoShortSheetDirectory.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Infra\Adapters\Directories; +use Database\ArcadiaReplicate\Tables\Refp\IncoTable; use Domain\Models\Entities\Inco\IncoShortSheet; use Domain\Models\ValueObjects\Brand\BrandCode; use Domain\Models\ValueObjects\Inco\IncoId; @@ -34,7 +35,7 @@ final class ArcadiaIncoShortSheetDirectory implements IncoShortSheetDirectory ?IncoSheetFilter $filter = null ): Paginated { $query = $this->connection - ->table('INCO') + ->table(IncoTable::table($this->connection)) ->select(IncoShortMapper::SELECT_COLUMNS); if ($filter !== null) { @@ -78,7 +79,7 @@ final class ArcadiaIncoShortSheetDirectory implements IncoShortSheetDirectory BrandCode ...$brands ): Paginated { $dbQuery = $this->connection - ->table('INCO') + ->table(IncoTable::table($this->connection)) ->select(IncoShortMapper::SELECT_COLUMNS); $dbQuery->where('NO_ART', 'LIKE', $query->value); @@ -108,7 +109,7 @@ final class ArcadiaIncoShortSheetDirectory implements IncoShortSheetDirectory public function find(IncoId $id): ?IncoShortSheet { $row = $this->connection - ->table('INCO') + ->table(IncoTable::table($this->connection)) ->select(IncoShortMapper::SELECT_COLUMNS) ->where('NO_ART', $id->value) ->first(); diff --git a/src/Infra/Adapters/Directories/ArcadiaMarqueBrandDirectory.php b/src/Infra/Adapters/Directories/ArcadiaMarqueBrandDirectory.php index 846753b..7e6212a 100644 --- a/src/Infra/Adapters/Directories/ArcadiaMarqueBrandDirectory.php +++ b/src/Infra/Adapters/Directories/ArcadiaMarqueBrandDirectory.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Infra\Adapters\Directories; +use Database\ArcadiaReplicate\Tables\Refp\MarqueTable; use Domain\Models\ValueObjects\Brand\ArcadiaBrand; use Domain\Models\ValueObjects\Brand\ArcadiaId; use Domain\Ports\Directories\ArcadiaBrandDirectory as ArcadiaBrandDirectoryPort; @@ -24,7 +25,7 @@ final class ArcadiaMarqueBrandDirectory implements ArcadiaBrandDirectoryPort public function findAll(): array { $rows = $this->connection - ->table('MARQUE') + ->table(MarqueTable::table($this->connection)) ->get(); $items = []; @@ -46,7 +47,7 @@ final class ArcadiaMarqueBrandDirectory implements ArcadiaBrandDirectoryPort } $row = $this->connection - ->table('MARQUE') + ->table(MarqueTable::table($this->connection)) ->where('COD_MARQ', $id->value) ->first(); diff --git a/src/Infra/Services/Health/LaravelSystemHealthChecker.php b/src/Infra/Services/Health/LaravelSystemHealthChecker.php index 78a1118..0594dd3 100644 --- a/src/Infra/Services/Health/LaravelSystemHealthChecker.php +++ b/src/Infra/Services/Health/LaravelSystemHealthChecker.php @@ -64,9 +64,10 @@ final readonly class LaravelSystemHealthChecker implements HealthChecker $tableName = $definition::name(); $schemaName = $definition::schemaName(); $target = "{$schemaName}.{$tableName}"; + $queryTable = $definition::table($connection); try { - $connection->table($tableName)->limit(0)->get(); + $connection->table($queryTable)->limit(0)->get(); $checks[] = new DirectoryConformityCheck( name: strtolower($tableName), status: ComponentStatus::UP,