Browse Source

Correctif migrations

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
8181256b48
33 changed files with 24 additions and 188 deletions
  1. +1
    -1
      common/components/TillerClient.php
  2. +1
    -1
      common/logic/Order/Order/Service/TillerManager.php
  3. +2
    -2
      console/migrations/m161012_074719_infos_boulanger.php
  4. +1
    -1
      console/migrations/m171227_090138_champs_priorite_developpement.php
  5. +1
    -0
      console/migrations/m181107_104051_add_champs_commande_deleted.php
  6. +1
    -0
      console/migrations/m181220_080234_translate_database.php
  7. +1
    -0
      console/migrations/m190109_080828_add_field_subscription_order.php
  8. +0
    -3
      console/migrations/m190205_164612_ajout_produit_don_aux_distributions_existantes.php
  9. +1
    -35
      console/migrations/m190226_084104_lien_utilisateur_point_de_vente.php
  10. +0
    -14
      console/migrations/m190515_122438_ajout_champs_price_product_subscription.php
  11. +1
    -1
      console/migrations/m190522_091006_option_comportement_annulation_commande.php
  12. +0
    -15
      console/migrations/m200108_145508_module_bl_devis_factures_suppression_price_unit_step_product_subscription.php
  13. +0
    -15
      console/migrations/m200108_195657_module_bl_devis_factures_order_status_history.php
  14. +1
    -1
      console/migrations/m200109_092028_module_bl_devis_factures_champs_status_document.php
  15. +0
    -1
      console/migrations/m200109_152833_module_bl_devis_factures_order_status_history_add_origin.php
  16. +2
    -1
      console/migrations/m200117_144356_user_ajout_champs_type.php
  17. +1
    -3
      console/migrations/m200117_161844_order_existantes_set_status.php
  18. +1
    -1
      console/migrations/m200601_073309_add_producer_options.php
  19. +0
    -15
      console/migrations/m200624_083903_product_distribution_change_column_quantity_max.php
  20. +1
    -0
      console/migrations/m201026_074711_option_email_confirm_producer.php
  21. +1
    -0
      console/migrations/m201218_071628_add_option_export_csv.php
  22. +1
    -0
      console/migrations/m201230_102708_add_option_export_csv.php
  23. +1
    -0
      console/migrations/m210303_090805_add_group_user_specific_prices.php
  24. +1
    -0
      console/migrations/m210317_122616_option_order_reference_type.php
  25. +1
    -0
      console/migrations/m210318_102840_add_option_allow_order_guest.php
  26. +0
    -15
      console/migrations/m210914_132350_add_options_online_payment.php
  27. +0
    -15
      console/migrations/m210915_064446_add_option_stripe_endpoint.php
  28. +0
    -15
      console/migrations/m210915_083421_add_option_stripe_mode_test.php
  29. +0
    -15
      console/migrations/m220823_084928_add_option_notify_producer_order_summary.php
  30. +1
    -1
      console/migrations/m220915_072309_producer_add_option_billing_frequency.php
  31. +1
    -1
      console/migrations/m220915_083713_producer_add_options_billing.php
  32. +1
    -1
      console/migrations/m220916_062206_add_column_document_tax_calculation_method.php
  33. +0
    -15
      console/migrations/m221109_100033_producer_add_option_display_message_new_opendistrib_version.php

+ 1
- 1
common/components/TillerClient.php View File

var $restaurantToken; var $restaurantToken;
var $urlApi = 'https://app.tillersystems.com/api/'; var $urlApi = 'https://app.tillersystems.com/api/';


public function __construct(string $providerToken, string $restaurantToken)
public function __construct(string $providerToken = null, string $restaurantToken = null)
{ {
$this->curl = new curl\Curl(); $this->curl = new curl\Curl();
$this->providerToken = $providerToken; $this->providerToken = $providerToken;

+ 1
- 1
common/logic/Order/Order/Service/TillerManager.php View File



class TillerManager extends AbstractManager class TillerManager extends AbstractManager
{ {
protected bool $tillerActivated;
protected ?bool $tillerActivated;
protected ProducerSolver $producerSolver; protected ProducerSolver $producerSolver;
protected TillerClient $tillerClient; protected TillerClient $tillerClient;
protected OrderSolver $orderSolver; protected OrderSolver $orderSolver;

+ 2
- 2
console/migrations/m161012_074719_infos_boulanger.php View File

{ {
public function up() public function up()
{ {
$this->addColumn('user', 'id_etablissement', Schema::TYPE_INTEGER) ;
//$this->addColumn('user', 'id_etablissement', Schema::TYPE_INTEGER) ;
//$this->addColumn('user', 'nom_magasin', Schema::TYPE_STRING) ; //$this->addColumn('user', 'nom_magasin', Schema::TYPE_STRING) ;
//$this->addColumn('user', 'siret', Schema::TYPE_STRING) ; //$this->addColumn('user', 'siret', Schema::TYPE_STRING) ;
} }


public function down() public function down()
{ {
$this->dropColumn('user', 'id_etablissement') ;
//$this->dropColumn('user', 'id_etablissement') ;
//$this->dropColumn('user', 'nom_magasin') ; //$this->dropColumn('user', 'nom_magasin') ;
//$this->dropColumn('user', 'siret') ; //$this->dropColumn('user', 'siret') ;
} }

+ 1
- 1
console/migrations/m171227_090138_champs_priorite_developpement.php View File

class m171227_090138_champs_priorite_developpement extends Migration { class m171227_090138_champs_priorite_developpement extends Migration {


public function up() { public function up() {
$this->addColumn('developpement_priorite','priorite',Schema::TYPE_STRING.' DEFAULT \''.DeveloppementPriorite::PRIORITE_NORMALE.'\'');
$this->addColumn('developpement_priorite','priorite',Schema::TYPE_STRING);
} }


public function down() { public function down() {

+ 1
- 0
console/migrations/m181107_104051_add_champs_commande_deleted.php View File

*/ */


use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema;


class m181107_104051_add_champs_commande_deleted extends Migration class m181107_104051_add_champs_commande_deleted extends Migration
{ {

+ 1
- 0
console/migrations/m181220_080234_translate_database.php View File

<?php <?php


use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema;


class m181220_080234_translate_database extends Migration class m181220_080234_translate_database extends Migration
{ {

+ 1
- 0
console/migrations/m190109_080828_add_field_subscription_order.php View File

<?php <?php


use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema;


class m190109_080828_add_field_subscription_order extends Migration { class m190109_080828_add_field_subscription_order extends Migration {



+ 0
- 3
console/migrations/m190205_164612_ajout_produit_don_aux_distributions_existantes.php View File

class m190205_164612_ajout_produit_don_aux_distributions_existantes extends Migration { class m190205_164612_ajout_produit_don_aux_distributions_existantes extends Migration {


public function up() { public function up() {
$distributionsArray = common\logic\Distribution\Distribution\Distribution::find()->all() ;
foreach($distributionsArray as $distribution) {


}
} }


public function down() { public function down() {

+ 1
- 35
console/migrations/m190226_084104_lien_utilisateur_point_de_vente.php View File

{ {
public function up() public function up()
{ {
$producersArray = Producer::find()->all() ;
foreach($producersArray as $producer) {
$pointsSaleArray = PointSale::find()
->where([
'id_producer' => $producer->id
])
->all();
foreach($pointsSaleArray as $pointSale) {
$usersArray = UserModel::find()->innerJoin(
'order',
'user.id = order.id_user AND order.id_point_sale = :id_point_sale',
[':id_point_sale' => $pointSale->id]
)
->groupBy('user.id')
->all();
foreach($usersArray as $user) {
$userPointSale = UserPointSale::find()
->where([
'id_user' => $user->id,
'id_point_sale' => $pointSale->id
])->one() ;
if(!$userPointSale) {
$userPointSale = new UserPointSale() ;
$userPointSale->id_user = $user->id ;
$userPointSale->id_point_sale = $pointSale->id ;
$userPointSale->save() ;
}
}
}
}

} }


public function down() public function down()

+ 0
- 14
console/migrations/m190515_122438_ajout_champs_price_product_subscription.php View File



use yii\db\Migration; use yii\db\Migration;
use yii\db\mysql\Schema; use yii\db\mysql\Schema;
use common\logic\Subscription\ProductSubscription\ProductSubscription;
use common\logic\Product\Product\Product;


class m190515_122438_ajout_champs_price_product_subscription extends Migration { class m190515_122438_ajout_champs_price_product_subscription extends Migration {


public function up() { public function up() {
$this->addColumn('product_subscription', 'price', Schema::TYPE_FLOAT. ' DEFAULT 0') ; $this->addColumn('product_subscription', 'price', Schema::TYPE_FLOAT. ' DEFAULT 0') ;
$productsSubscriptionsArray = ProductSubscription::find()->all() ;
$productsArray = Product::find()->all() ;
foreach($productsSubscriptionsArray as $productSubscription) {
foreach($productsArray as $product) {
if($productSubscription->id_product == $product->id) {
$productSubscription->price = $product->price ;
$productSubscription->save() ;
}
}
}
} }


public function down() { public function down() {

+ 1
- 1
console/migrations/m190522_091006_option_comportement_annulation_commande.php View File



use yii\db\Migration; use yii\db\Migration;
use yii\db\mysql\Schema; use yii\db\mysql\Schema;
use common\logic\Producer\Producer\Producer;
use common\logic\Producer\Producer\Model\Producer;


class m190522_091006_option_comportement_annulation_commande extends Migration { class m190522_091006_option_comportement_annulation_commande extends Migration {



+ 0
- 15
console/migrations/m200108_145508_module_bl_devis_factures_suppression_price_unit_step_product_subscription.php View File



return false; return false;
} }

/*
// Use up()/down() to run migration code without a transaction.
public function up()
{

}

public function down()
{
echo "m200108_145508_module_bl_devis_factures_suppression_price_unit_step_product_subscription cannot be reverted.\n";

return false;
}
*/
} }

+ 0
- 15
console/migrations/m200108_195657_module_bl_devis_factures_order_status_history.php View File



return 'false'; return 'false';
} }

/*
// Use up()/down() to run migration code without a transaction.
public function up()
{

}

public function down()
{
echo "m200108_195657_module_bl_devis_factures_order_status_history cannot be reverted.\n";

return false;
}
*/
} }

+ 1
- 1
console/migrations/m200109_092028_module_bl_devis_factures_champs_status_document.php View File



use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema; use yii\db\Schema;
use common\logic\Document\Document\Document
use common\logic\Document\Document\Model\Document;


class m200109_092028_module_bl_devis_factures_champs_status_document extends Migration class m200109_092028_module_bl_devis_factures_champs_status_document extends Migration
{ {

+ 0
- 1
console/migrations/m200109_152833_module_bl_devis_factures_order_status_history_add_origin.php View File

public function safeUp() public function safeUp()
{ {
$this->addColumn('order_status_history', 'origin', Schema::TYPE_STRING); $this->addColumn('order_status_history', 'origin', Schema::TYPE_STRING);

} }


public function safeDown() public function safeDown()

+ 2
- 1
console/migrations/m200117_144356_user_ajout_champs_type.php View File

<?php <?php


use common\logic\User\User\Model\User;
use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema; use yii\db\Schema;


{ {
public function safeUp() public function safeUp()
{ {
$this->addColumn('user', 'type', Schema::TYPE_STRING.' DEFAULT \''.UserModel::TYPE_INDIVIDUAL.'\'');
$this->addColumn('user', 'type', Schema::TYPE_STRING.' DEFAULT \''.User::TYPE_INDIVIDUAL.'\'');
$this->addColumn('user', 'name_legal_person', Schema::TYPE_STRING) ; $this->addColumn('user', 'name_legal_person', Schema::TYPE_STRING) ;
} }



+ 1
- 3
console/migrations/m200117_161844_order_existantes_set_status.php View File

{ {
public function safeUp() public function safeUp()
{ {
Order::updateAll([
'status' => 'tmp-order'
]) ;

} }


public function safeDown() public function safeDown()

+ 1
- 1
console/migrations/m200601_073309_add_producer_options.php View File



use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema; use yii\db\Schema;
use common\logic\Producer\Producer\Producer;
use common\logic\Producer\Producer\Model\Producer;


class m200601_073309_add_producer_options extends Migration class m200601_073309_add_producer_options extends Migration
{ {

+ 0
- 15
console/migrations/m200624_083903_product_distribution_change_column_quantity_max.php View File



return false; return false;
} }

/*
// Use up()/down() to run migration code without a transaction.
public function up()
{

}

public function down()
{
echo "m200624_083903_product_distribution_change_column_quantity_max cannot be reverted.\n";

return false;
}
*/
} }

+ 1
- 0
console/migrations/m201026_074711_option_email_confirm_producer.php View File

<?php <?php


use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema;


class m201026_074711_option_email_confirm_producer extends Migration class m201026_074711_option_email_confirm_producer extends Migration
{ {

+ 1
- 0
console/migrations/m201218_071628_add_option_export_csv.php View File

<?php <?php


use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema;


class m201218_071628_add_option_export_csv extends Migration class m201218_071628_add_option_export_csv extends Migration
{ {

+ 1
- 0
console/migrations/m201230_102708_add_option_export_csv.php View File

<?php <?php


use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema;


class m201230_102708_add_option_export_csv extends Migration class m201230_102708_add_option_export_csv extends Migration
{ {

+ 1
- 0
console/migrations/m210303_090805_add_group_user_specific_prices.php View File

<?php <?php


use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema;


class m210303_090805_add_group_user_specific_prices extends Migration class m210303_090805_add_group_user_specific_prices extends Migration
{ {

+ 1
- 0
console/migrations/m210317_122616_option_order_reference_type.php View File

<?php <?php


use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema;


class m210317_122616_option_order_reference_type extends Migration class m210317_122616_option_order_reference_type extends Migration
{ {

+ 1
- 0
console/migrations/m210318_102840_add_option_allow_order_guest.php View File

<?php <?php


use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema;


class m210318_102840_add_option_allow_order_guest extends Migration class m210318_102840_add_option_allow_order_guest extends Migration
{ {

+ 0
- 15
console/migrations/m210914_132350_add_options_online_payment.php View File

$this->dropColumn('producer', 'option_stripe_public_key'); $this->dropColumn('producer', 'option_stripe_public_key');
$this->dropColumn('producer', 'option_stripe_private_key'); $this->dropColumn('producer', 'option_stripe_private_key');
} }

/*
// Use up()/down() to run migration code without a transaction.
public function up()
{

}

public function down()
{
echo "m210914_132350_add_options_online_payment cannot be reverted.\n";

return false;
}
*/
} }

+ 0
- 15
console/migrations/m210915_064446_add_option_stripe_endpoint.php View File

{ {
$this->dropColumn('producer', 'option_stripe_endpoint_secret'); $this->dropColumn('producer', 'option_stripe_endpoint_secret');
} }

/*
// Use up()/down() to run migration code without a transaction.
public function up()
{

}

public function down()
{
echo "m210915_064446_add_option_stripe_endpoint cannot be reverted.\n";

return false;
}
*/
} }

+ 0
- 15
console/migrations/m210915_083421_add_option_stripe_mode_test.php View File

{ {
$this->dropColumn('producer', 'option_stripe_mode_test'); $this->dropColumn('producer', 'option_stripe_mode_test');
} }

/*
// Use up()/down() to run migration code without a transaction.
public function up()
{

}

public function down()
{
echo "m210915_083421_add_option_stripe_mode_test cannot be reverted.\n";

return false;
}
*/
} }

+ 0
- 15
console/migrations/m220823_084928_add_option_notify_producer_order_summary.php View File



return false; return false;
} }

/*
// Use up()/down() to run migration code without a transaction.
public function up()
{

}

public function down()
{
echo "m220823_084928_add_option_notify_producer_order_summary cannot be reverted.\n";

return false;
}
*/
} }

+ 1
- 1
console/migrations/m220915_072309_producer_add_option_billing_frequency.php View File



use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema; use yii\db\Schema;
use common\logic\Producer\Producer\Producer;
use common\logic\Producer\Producer\Model\Producer;


/** /**
* Class m220915_072309_producer_add_option_billing_frequency * Class m220915_072309_producer_add_option_billing_frequency

+ 1
- 1
console/migrations/m220915_083713_producer_add_options_billing.php View File



use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema; use yii\db\Schema;
use common\logic\Producer\Producer\Producer;
use common\logic\Producer\Producer\Model\Producer;


/** /**
* Class m220915_083713_producer_add_options_billing * Class m220915_083713_producer_add_options_billing

+ 1
- 1
console/migrations/m220916_062206_add_column_document_tax_calculation_method.php View File



use yii\db\Migration; use yii\db\Migration;
use yii\db\Schema; use yii\db\Schema;
use common\logic\Document\Document\Document;
use common\logic\Document\Document\Model\Document;


/** /**
* Class m220916_062206_add_column_document_tax_calculation_method * Class m220916_062206_add_column_document_tax_calculation_method

+ 0
- 15
console/migrations/m221109_100033_producer_add_option_display_message_new_opendistrib_version.php View File

{ {
$this->dropColumn('producer', 'option_display_message_new_opendistrib_version'); $this->dropColumn('producer', 'option_display_message_new_opendistrib_version');
} }

/*
// Use up()/down() to run migration code without a transaction.
public function up()
{

}

public function down()
{
echo "m221109_100033_producer_add_option_display_message_new_opendistrib_version cannot be reverted.\n";

return false;
}
*/
} }

Loading…
Cancel
Save