ldc-arcadia-api/database/arcadia-replicate/Tables/Refp/InseeCommunesTable.php

72 lines
2.7 KiB
PHP
Raw Normal View History

<?php
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;
/**
* Schéma Oracle : REFP.INSEE_COMMUNES
* Type : TABLE
* Description : Réplication miroir pour INSEE_COMMUNES
*/
final class InseeCommunesTable implements TableOrView
{
use IdentifiesTableOrView;
public static function schemaName(): string
{
return 'REFP';
}
public static function name(): string
{
return 'INSEE_COMMUNES';
}
public static function isView(): bool
{
return false;
}
public static function description(): string
{
return 'Objet miroir TABLE REFP.INSEE_COMMUNES du métamodèle Arcadia.';
}
public static function up(Builder $schema): void
{
if (app()->environment('local', 'testing')) {
$schema->dropIfExists(self::table($schema->getConnection()));
}
$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)');
$table->string('CODE_DEPARTEMENT', 16)->comment('Oracle: VARCHAR2(0, 0) [PK]');
$table->string('CODE_COMMUNE', 20)->comment('Oracle: VARCHAR2(0, 0) [PK]');
$table->smallInteger('AR')->nullable()->comment('Oracle: NUMBER(2, 0)');
$table->smallInteger('CT')->nullable()->comment('Oracle: NUMBER(3, 0)');
$table->smallInteger('TNCC')->nullable()->comment('Oracle: NUMBER(2, 0)');
$table->string('ARTMAJ', 40)->nullable()->comment('Oracle: VARCHAR2(0, 0)');
$table->text('NCC')->nullable()->comment('Oracle: VARCHAR2(0, 0)');
$table->string('ARTMIN', 40)->nullable()->comment('Oracle: VARCHAR2(0, 0)');
$table->text('NCCENR')->nullable()->comment('Oracle: VARCHAR2(0, 0)');
$table->string('NUM_COMMUNE', 20)->nullable()->comment('Oracle: VARCHAR2(0, 0)');
$table->unsignedBigInteger('UVERSION')->nullable()->comment('Oracle: NUMBER(10, 0)');
$table->string('CANTON_VILLE', 20)->nullable()->comment('Oracle: VARCHAR2(0, 0)');
$table->primary(['CODE_DEPARTEMENT', 'CODE_COMMUNE']);
});
}
public static function down(Builder $schema): void
{
$schema->dropIfExists(self::table($schema->getConnection()));
}
}