862 lines
29 KiB
PHP
862 lines
29 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\Gestion\Migration;
|
|
|
|
use Closure;
|
|
use OCP\IDBConnection;
|
|
use OCP\DB\ISchemaWrapper;
|
|
use OCP\Migration\IOutput;
|
|
use OCP\Migration\SimpleMigrationStep;
|
|
|
|
/**
|
|
* Auto-generated migration step: Please modify to your needs!
|
|
*/
|
|
class Version7Date20220125174818 extends SimpleMigrationStep {
|
|
|
|
private IDbConnection $db;
|
|
public function __construct(IDbConnection $db){
|
|
$this->db = $db;
|
|
}
|
|
|
|
/**
|
|
* @param IOutput $output
|
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
|
* @param array $options
|
|
*/
|
|
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
|
|
}
|
|
|
|
/**
|
|
* @param IOutput $output
|
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
|
* @param array $options
|
|
* @return null|ISchemaWrapper
|
|
*/
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
|
|
/** @var ISchemaWrapper $schema */
|
|
$schema = $schemaClosure();
|
|
$tableprefix = "gestion_";
|
|
|
|
/**Client**/
|
|
if (!$schema->hasTable($tableprefix.'client')) {
|
|
$table = $schema->createTable($tableprefix.'client');
|
|
}
|
|
$table = $schema->getTable($tableprefix.'client');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true,'notnull' => true,]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
if (!$table->hasColumn('nom')) {
|
|
$table->addColumn('nom', 'text', []);
|
|
}
|
|
if (!$table->hasColumn('prenom')) {
|
|
$table->addColumn('prenom', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('legal_one')) {
|
|
$table->addColumn('legal_one', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('entreprise')) {
|
|
$table->addColumn('entreprise', 'text', []);
|
|
}
|
|
if (!$table->hasColumn('telephone')) {
|
|
$table->addColumn('telephone', 'text', []);
|
|
}
|
|
if (!$table->hasColumn('mail')) {
|
|
$table->addColumn('mail', 'text', []);
|
|
}
|
|
if (!$table->hasColumn('adresse')) {
|
|
$table->addColumn('adresse', 'text', []);
|
|
}
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
/** Thanatopracteurs **/
|
|
if (!$schema->hasTable($tableprefix.'thanato')) {
|
|
$table = $schema->createTable($tableprefix.'thanato');
|
|
}
|
|
$table = $schema->getTable($tableprefix.'thanato');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true,'notnull' => true,]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
if (!$table->hasColumn('nom')) {
|
|
$table->addColumn('nom', 'text', []);
|
|
}
|
|
if (!$table->hasColumn('prenom')) {
|
|
$table->addColumn('prenom', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('reference')) {
|
|
$table->addColumn('reference', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('date_habilitation')) {
|
|
$table->addColumn('date_habilitation', 'date', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
/**Configuration**/
|
|
if (!$schema->hasTable($tableprefix.'configuration')) {
|
|
$table = $schema->createTable($tableprefix.'configuration');
|
|
}
|
|
$table = $schema->getTable($tableprefix.'configuration');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true,'notnull' => true,]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('entreprise')) {
|
|
$table->addColumn('entreprise', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('nom')) {
|
|
$table->addColumn('nom', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('prenom')) {
|
|
$table->addColumn('prenom', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('legal_one')) {
|
|
$table->addColumn('legal_one', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('legal_two')) {
|
|
$table->addColumn('legal_two', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('mail')) {
|
|
$table->addColumn('mail', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('telephone')) {
|
|
$table->addColumn('telephone', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('adresse')) {
|
|
$table->addColumn('adresse', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('path')) {
|
|
$table->addColumn('path', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('mentions_default')) {
|
|
$table->addColumn('mentions_default', 'string', ['default'=>'Legales mentions']);
|
|
}else{
|
|
$column = $table->getColumn('mentions_default');
|
|
$column->setOptions(['default'=>'Legales mentions']);
|
|
}
|
|
|
|
if (!$table->hasColumn('tva_default')) {
|
|
$table->addColumn('tva_default', 'float', ['default' => 0]);
|
|
}else{
|
|
$column = $table->getColumn('tva_default');
|
|
$column->setOptions(['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('coefficient_ik')) {
|
|
$table->addColumn('coefficient_ik', 'float', ['default' => 1]);
|
|
}else{
|
|
$column = $table->getColumn('coefficient_ik');
|
|
$column->setOptions(['default' => 1]);
|
|
}
|
|
|
|
if (!$table->hasColumn('changelog')) {
|
|
$table->addColumn('changelog', 'string', ['default' => '0']);
|
|
}else{
|
|
$column = $table->getColumn('changelog');
|
|
$column->setOptions(['default' => '0']);
|
|
}
|
|
|
|
if (!$table->hasColumn('devise')) {
|
|
$table->addColumn('devise', 'string', ['default' => 'EUR']);
|
|
}else{
|
|
$column = $table->getColumn('devise');
|
|
$column->setOptions(['default' => 'EUR']);
|
|
|
|
}
|
|
|
|
if (!$table->hasColumn('auto_invoice_number')) {
|
|
$table->addColumn('auto_invoice_number', 'integer', ['default' => 1 ]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
/**DEVIS**/
|
|
if (!$schema->hasTable($tableprefix.'devis')) {
|
|
$table = $schema->createTable($tableprefix.'devis');
|
|
}
|
|
|
|
$table = $schema->getTable($tableprefix.'devis');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true,'notnull' => true]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('date')) {
|
|
$table->addColumn('date', 'date', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('num')) {
|
|
$table->addColumn('num', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('comment')) {
|
|
$table->addColumn('comment', 'string', ['default' => "comment"]);
|
|
}else{
|
|
$column = $table->getColumn('comment');
|
|
$column->setOptions(['default' => 'comment']);
|
|
}
|
|
|
|
if (!$table->hasColumn('version')) {
|
|
$table->addColumn('version', 'string', ['length' => 64, 'default' => "1.0"]);
|
|
}else{
|
|
$column = $table->getColumn('version');
|
|
$column->setOptions(['default' => '1.0']);
|
|
}
|
|
|
|
if (!$table->hasColumn('mentions')) {
|
|
$table->addColumn('mentions', 'string', ['default' => "New"]);
|
|
}else{
|
|
$column = $table->getColumn('mentions');
|
|
$column->setOptions(['default' => 'New']);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_defunt')) {
|
|
$table->addColumn('id_defunt', 'integer', ['length' => 11, 'default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_lieu')) {
|
|
$table->addColumn('id_lieu', 'integer', ['length' => 11, 'default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_client')) {
|
|
$table->addColumn('id_client', 'integer', ['length' => 11]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_thanato')) {
|
|
$table->addColumn('id_thanato', 'integer', ['length' => 11]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
/**TRAJET**/
|
|
if (!$schema->hasTable($tableprefix.'trajet')) {
|
|
$table = $schema->createTable($tableprefix.'trajet');
|
|
}
|
|
|
|
$table = $schema->getTable($tableprefix.'trajet');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true,'notnull' => true]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('date')) {
|
|
$table->addColumn('date', 'date', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('distance')) {
|
|
$table->addColumn('distance', 'float', ['default' => 0]);
|
|
}else{
|
|
$column = $table->getColumn('distance');
|
|
$column->setOptions(['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_thanato')) {
|
|
$table->addColumn('id_thanato', 'integer', ['length' => 11]);
|
|
}
|
|
|
|
if (!$table->hasColumn('mois')) {
|
|
$table->addColumn('mois', 'integer', ['default' => 0]);
|
|
}else{
|
|
$column = $table->getColumn('mois');
|
|
$column->setOptions(['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('annee')) {
|
|
$table->addColumn('annee', 'integer', ['default' => 0]);
|
|
}else{
|
|
$column = $table->getColumn('annee');
|
|
$column->setOptions(['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
/**LIGNE TRAJET**/
|
|
if (!$schema->hasTable($tableprefix.'ligne_trajet')) {
|
|
$table = $schema->createTable($tableprefix.'ligne_trajet');
|
|
}
|
|
|
|
$table = $schema->getTable($tableprefix.'ligne_trajet');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true,'notnull' => true]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('date')) {
|
|
$table->addColumn('date', 'date', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_trajet')) {
|
|
$table->addColumn('id_trajet', 'integer', ['length' => 11, 'default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_client')) {
|
|
$table->addColumn('id_client', 'integer', ['length' => 11, 'default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_devis')) {
|
|
$table->addColumn('id_devis', 'integer', ['length' => 11]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_lieu')) {
|
|
$table->addColumn('id_lieu', 'integer', ['length' => 11]);
|
|
}
|
|
|
|
if (!$table->hasColumn('rang')) {
|
|
$table->addColumn('rang', 'integer', ['length' => 11]);
|
|
}
|
|
|
|
if (!$table->hasColumn('commentaire')) {
|
|
$table->addColumn('commentaire', 'string', ['length' => 55]);
|
|
}
|
|
|
|
if (!$table->hasColumn('source')) {
|
|
$table->addColumn('source', 'string', ['length' => 55]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
|
|
/** LIEU **/
|
|
if (!$schema->hasTable($tableprefix.'lieu')) {
|
|
$table = $schema->createTable($tableprefix.'lieu');
|
|
}
|
|
|
|
$table = $schema->getTable($tableprefix.'lieu');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true,'notnull' => true]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('adresse')) {
|
|
$table->addColumn('adresse', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('nom')) {
|
|
$table->addColumn('nom', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('latitude')) {
|
|
$table->addColumn('latitude', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('longitude')) {
|
|
$table->addColumn('longitude', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
/**FACTURE**/
|
|
if (!$schema->hasTable($tableprefix.'facture')) {
|
|
$table = $schema->createTable($tableprefix.'facture');
|
|
}
|
|
|
|
$table = $schema->getTable($tableprefix.'facture');
|
|
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true,'notnull' => true,]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('num')) {
|
|
$table->addColumn('num', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('date')) {
|
|
$table->addColumn('date', 'string', ['length' => 64,]);
|
|
}
|
|
|
|
if (!$table->hasColumn('date_paiement')) {
|
|
$table->addColumn('date_paiement', 'date', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('type_paiement')) {
|
|
$table->addColumn('type_paiement', 'string', ['length' => 64]);
|
|
}
|
|
|
|
if (!$table->hasColumn('status_paiement')) {
|
|
$table->addColumn('status_paiement', 'string', ['length' => 64, 'default' => 'NC']);
|
|
}else{
|
|
$column = $table->getColumn('status_paiement');
|
|
$column->setOptions(['default' => 'NC']);
|
|
}
|
|
|
|
if (!$table->hasColumn('version')) {
|
|
$table->addColumn('version', 'string', ['length' => 64, 'default' => '1.0']);
|
|
}else{
|
|
$column = $table->getColumn('version');
|
|
$column->setOptions(['default' => '1.0']);
|
|
}
|
|
if (!$table->hasColumn('id_devis')) {
|
|
$table->addColumn('id_devis', 'integer', ['length' => 11]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
/** PRODUIT **/
|
|
if (!$schema->hasTable($tableprefix.'produit')) {
|
|
$table = $schema->createTable($tableprefix.'produit');
|
|
}
|
|
|
|
$table = $schema->getTable($tableprefix.'produit');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true,'notnull' => true,]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('reference')) {
|
|
$table->addColumn('reference', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('description')) {
|
|
$table->addColumn('description', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('prix_unitaire')) {
|
|
$table->addColumn('prix_unitaire', 'float', ['default' => 0]);
|
|
}else{
|
|
$column = $table->getColumn('prix_unitaire');
|
|
$column->setOptions(['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('vat')) {
|
|
$table->addColumn('vat', 'float', ['default' => 0]);
|
|
}else{
|
|
$column = $table->getColumn('vat');
|
|
$column->setOptions(['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
|
|
/** PRODUIT_DEVIS **/
|
|
if (!$schema->hasTable($tableprefix.'produit_devis')) {
|
|
$table = $schema->createTable($tableprefix.'produit_devis');
|
|
}
|
|
|
|
$table = $schema->getTable($tableprefix.'produit_devis');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true,'notnull' => true,]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('devis_id')) {
|
|
$table->addColumn('devis_id', 'integer', ['length' => 11,]);
|
|
}
|
|
|
|
if (!$table->hasColumn('produit_id')) {
|
|
$table->addColumn('produit_id', 'integer', ['length' => 11,]);
|
|
}
|
|
|
|
if (!$table->hasColumn('quantite')) {
|
|
$table->addColumn('quantite', 'integer', ['length' => 11,]);
|
|
}
|
|
|
|
if (!$table->hasColumn('discount')) {
|
|
$table->addColumn('discount', 'integer', ['length' => 11, 'default' => 0]);
|
|
}else{
|
|
$column = $table->getColumn('discount');
|
|
$column->setOptions(['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
/** ARTICLE */
|
|
if(!$schema->hasTable($tableprefix.'article')) {
|
|
$table = $schema->createTable($tableprefix.'article');
|
|
}
|
|
|
|
$table = $schema->getTable($tableprefix.'article');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true,'notnull' => true,]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('reference')) {
|
|
$table->addColumn('reference', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('description')) {
|
|
$table->addColumn('description', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('prix_unitaire')) {
|
|
$table->addColumn('prix_unitaire', 'float', ['default' => 0]);
|
|
}else{
|
|
$column = $table->getColumn('prix_unitaire');
|
|
$column->setOptions(['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
/** ARTICLE_DEVIS **/
|
|
if (!$schema->hasTable($tableprefix.'article_devis')) {
|
|
$table = $schema->createTable($tableprefix.'article_devis');
|
|
}
|
|
|
|
$table = $schema->getTable($tableprefix.'article_devis');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true, 'notnull' => true,]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('devis_id')) {
|
|
$table->addColumn('devis_id', 'integer', ['length' => 11, 'notnull' => true]);
|
|
}
|
|
|
|
if (!$table->hasColumn('article_id')) {
|
|
$table->addColumn('article_id', 'integer', ['length' => 11, 'notnull' => true]);
|
|
}
|
|
|
|
if (!$table->hasColumn('quantite')) {
|
|
$table->addColumn('quantite', 'integer', ['length' => 11]);
|
|
}
|
|
|
|
if (!$table->hasColumn('discount')) {
|
|
$table->addColumn('discount', 'integer', ['length' => 11, 'default' => 0]);
|
|
}else{
|
|
$column = $table->getColumn('discount');
|
|
$column->setOptions(['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('comment')) {
|
|
$table->addColumn('comment', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
/** DEFUNT */
|
|
if(!$schema->hasTable($tableprefix.'defunt')) {
|
|
$table = $schema->createTable($tableprefix.'defunt');
|
|
}
|
|
|
|
$table = $schema->getTable($tableprefix.'defunt');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true,'notnull' => true]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('nom')) {
|
|
$table->addColumn('nom', 'string', ['length' => 150, 'notnull' => true]);
|
|
}
|
|
|
|
if (!$table->hasColumn('sexe')) {
|
|
$table->addColumn('sexe', 'string', ['length' => 11,'notnull' => true]);
|
|
}
|
|
|
|
if (!$table->hasColumn('date_naissance')) {
|
|
$table->addColumn('date_naissance', 'date', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('ref_pacemaker')) {
|
|
$table->addColumn('ref_pacemaker', 'string', ['length' => 64]);
|
|
}
|
|
|
|
if (!$table->hasColumn('date')) {
|
|
$table->addColumn('date', 'date', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('heure_debut')) {
|
|
$table->addColumn('heure_debut', 'string', ['length' => 10, 'default' => '08:00']);
|
|
}
|
|
|
|
if (!$table->hasColumn('heure_fin')) {
|
|
$table->addColumn('heure_fin', 'string', ['length' => 10, 'default' => '10:00']);
|
|
}
|
|
|
|
if (!$table->hasColumn('corpulence')) {
|
|
$table->addColumn('corpulence', 'string', ['length' => 64]);
|
|
}
|
|
|
|
if (!$table->hasColumn('rigidite')) {
|
|
$table->addColumn('rigidite', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('lividite')) {
|
|
$table->addColumn('lividite', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('observations_corps')) {
|
|
$table->addColumn('observations_corps', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('acces')) {
|
|
$table->addColumn('acces', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('acces_recherche')) {
|
|
$table->addColumn('acces_recherche', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('acces_etat')) {
|
|
$table->addColumn('acces_etat', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('injection')) {
|
|
$table->addColumn('injection', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('injection_diffusion')) {
|
|
$table->addColumn('injection_diffusion', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('injection_qte')) {
|
|
$table->addColumn('injection_qte', 'float', ['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('preinjection')) {
|
|
$table->addColumn('preinjection', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('preinjection_qte')) {
|
|
$table->addColumn('preinjection_qte', 'float', ['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('coinjection')) {
|
|
$table->addColumn('coinjection', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('coinjection_qte')) {
|
|
$table->addColumn('coinjection_qte', 'float', ['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('drainage')) {
|
|
$table->addColumn('drainage', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('drainage_qte')) {
|
|
$table->addColumn('drainage_qte', 'float', ['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('drainage_etat')) {
|
|
$table->addColumn('drainage_etat', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('ponction')) {
|
|
$table->addColumn('ponction', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('ponction_qte')) {
|
|
$table->addColumn('ponction_qte', 'float', ['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('cavite')) {
|
|
$table->addColumn('cavite', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('cavite_qte')) {
|
|
$table->addColumn('cavite_qte', 'float', ['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('hypodermiques')) {
|
|
$table->addColumn('hypodermiques', 'float', ['default' => 0]);
|
|
}
|
|
|
|
if ($table->hasColumn('hypodermiques_sur')) {
|
|
$table->dropColumn('hypodermiques_sur');
|
|
}
|
|
|
|
if ($table->hasColumn('hypodermiques_text1')) {
|
|
$table->dropColumn('hypodermiques_text1');
|
|
}
|
|
|
|
if ($table->hasColumn('hypodermiques_text2')) {
|
|
$table->dropColumn('hypodermiques_text2');
|
|
}
|
|
|
|
if ($table->hasColumn('local')) {
|
|
$table->dropColumn('local');
|
|
}
|
|
|
|
if ($table->hasColumn('local_sur')) {
|
|
$table->dropColumn('local_sur');
|
|
}
|
|
|
|
if (!$table->hasColumn('desinfection')) {
|
|
$table->addColumn('desinfection', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('lavage')) {
|
|
$table->addColumn('lavage', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('rasage')) {
|
|
$table->addColumn('rasage', 'boolean', ['default' => false, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('presentation_cosmetique')) {
|
|
$table->addColumn('presentation_cosmetique', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('presentation_sur')) {
|
|
$table->addColumn('presentation_sur', 'string', ['length' => 64, 'notnull' => false]);
|
|
}
|
|
|
|
if (!$table->hasColumn('observations_generales')) {
|
|
$table->addColumn('observations_generales', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
$table->dropColumn('age');
|
|
$table->dropColumn('corpulance');
|
|
$table->dropColumn('presentation_cosemetique');
|
|
|
|
/** BIBLIOTHEQUE **/
|
|
if (!$schema->hasTable($tableprefix.'bibliotheque')) {
|
|
$table = $schema->createTable($tableprefix.'bibliotheque');
|
|
}
|
|
|
|
$table = $schema->getTable($tableprefix.'bibliotheque');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true,'notnull' => true,]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('contenu')) {
|
|
$table->addColumn('contenu', 'string', ['length' => 64]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
/** OBSERVATION_DEFUNT **/
|
|
if (!$schema->hasTable($tableprefix.'obs_defunt')) {
|
|
$table = $schema->createTable($tableprefix.'obs_defunt');
|
|
}
|
|
|
|
$table = $schema->getTable($tableprefix.'obs_defunt');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true, 'notnull' => true,]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('defunt_id')) {
|
|
$table->addColumn('defunt_id', 'integer', ['length' => 11, 'notnull' => true]);
|
|
}
|
|
|
|
if (!$table->hasColumn('designation')) {
|
|
$table->addColumn('designation', 'string', ['length' => 155]);
|
|
}
|
|
|
|
if (!$table->hasColumn('commentaire')) {
|
|
$table->addColumn('commentaire', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
/** HYPODERMIQUE_DEFUNT **/
|
|
if (!$schema->hasTable($tableprefix.'hypo_defunt')) {
|
|
$table = $schema->createTable($tableprefix.'hypo_defunt');
|
|
}
|
|
|
|
$table = $schema->getTable($tableprefix.'hypo_defunt');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true, 'notnull' => true,]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('defunt_id')) {
|
|
$table->addColumn('defunt_id', 'integer', ['length' => 11, 'notnull' => true]);
|
|
}
|
|
|
|
if (!$table->hasColumn('designation')) {
|
|
$table->addColumn('designation', 'string', ['length' => 155]);
|
|
}
|
|
|
|
if (!$table->hasColumn('qte')) {
|
|
$table->addColumn('qte', 'float', ['default' => 0]);
|
|
}
|
|
|
|
if (!$table->hasColumn('endroit')) {
|
|
$table->addColumn('endroit', 'string', ['length' => 155]);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
/** BIJOU_DEFUNT **/
|
|
if (!$schema->hasTable($tableprefix.'bijou_defunt')) {
|
|
$table = $schema->createTable($tableprefix.'bijou_defunt');
|
|
}
|
|
|
|
$table = $schema->getTable($tableprefix.'bijou_defunt');
|
|
if (!$table->hasColumn('id')) {
|
|
$table->addColumn('id', 'integer', ['autoincrement' => true, 'notnull' => true,]);
|
|
$table->setPrimaryKey(['id']);
|
|
}
|
|
|
|
if (!$table->hasColumn('defunt_id')) {
|
|
$table->addColumn('defunt_id', 'integer', ['length' => 11, 'notnull' => true]);
|
|
}
|
|
|
|
if (!$table->hasColumn('designation')) {
|
|
$table->addColumn('designation', 'string', ['length' => 155]);
|
|
}
|
|
|
|
if (!$table->hasColumn('commentaire')) {
|
|
$table->addColumn('commentaire', 'text', []);
|
|
}
|
|
|
|
if (!$table->hasColumn('id_nextcloud')) {
|
|
$table->addColumn('id_nextcloud', 'string', ['length' => 64]);
|
|
}
|
|
|
|
return $schema;
|
|
}
|
|
|
|
/**
|
|
* @param IOutput $output
|
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
|
* @param array $options
|
|
*/
|
|
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
|
|
}
|
|
}
|