remove old files
This commit is contained in:
@@ -1,132 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
|
||||||
|
|
||||||
use Illuminate\Console\Command;
|
|
||||||
use App\Models\Botanic\Family;
|
|
||||||
use App\Models\Botanic\Genre;
|
|
||||||
use App\Models\Botanic\Specie;
|
|
||||||
use App\Models\Botanic\Variety;
|
|
||||||
|
|
||||||
class checkdb extends Command
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'checkdb';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Consistency from old version';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new command instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
parent::__construct();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute the console command.
|
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function handle()
|
|
||||||
{
|
|
||||||
|
|
||||||
$varieties = Variety::whereNull('specie_id')->get();
|
|
||||||
foreach ($varieties as $variety) {
|
|
||||||
$specie_name = trim($variety->specie_name);
|
|
||||||
/*
|
|
||||||
$specie = Specie::firstOrCreate(['name' => $specie_name]);
|
|
||||||
if ($specie) {
|
|
||||||
$variety->specie_id = $specie->id;
|
|
||||||
$variety->save();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
dump($specie_name);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
|
|
||||||
$species = Specie::all();
|
|
||||||
foreach ($species as $specie) {
|
|
||||||
$specie->name = trim($specie->name);
|
|
||||||
$specie->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
$varieties = Variety::all();
|
|
||||||
foreach ($varieties as $variety) {
|
|
||||||
$variety->name = trim($variety->name);
|
|
||||||
$variety->save();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
$varieties = Variety::all();
|
|
||||||
foreach ($varieties as $variety) {
|
|
||||||
$specie_name = $variety->specie;
|
|
||||||
dump($specie_name);
|
|
||||||
if (!empty($specie_name)) {
|
|
||||||
$specie = Specie::byName($specie_name)->first();
|
|
||||||
if (isset($specie->name))
|
|
||||||
{
|
|
||||||
dump($specie->name);
|
|
||||||
$variety->specie_id = $specie->id;
|
|
||||||
$variety->save();
|
|
||||||
} else {
|
|
||||||
dump("non trouvé");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
dump("Aucune espèce");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
$species = Specie::all();
|
|
||||||
foreach ($species as $specie) {
|
|
||||||
$genre_name = $specie->genre;
|
|
||||||
dump($genre_name);
|
|
||||||
if (!empty($genre_name)) {
|
|
||||||
$genre = Genre::byName($genre_name)->first();
|
|
||||||
if (isset($genre->name))
|
|
||||||
{
|
|
||||||
dump($genre->name);
|
|
||||||
$specie->genre_id = $genre->id;
|
|
||||||
$specie->save();
|
|
||||||
} else {
|
|
||||||
dump("non trouvé");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
dump("Aucun genre");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
$genres = Genre::all();
|
|
||||||
foreach ($genres as $genre) {
|
|
||||||
$family_name = $genre->family;
|
|
||||||
dump($family_name);
|
|
||||||
if (!empty($family_name)) {
|
|
||||||
$family = Family::byName($family_name)->first();
|
|
||||||
if (isset($family->name))
|
|
||||||
{
|
|
||||||
dump($family->name);
|
|
||||||
$genre->family_id = $family->id;
|
|
||||||
$genre->save();
|
|
||||||
} else {
|
|
||||||
dump("non trouvé");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
dump("Aucune famille");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
|
||||||
|
|
||||||
use Illuminate\Console\Command;
|
|
||||||
use App\Models\Botanic\Family;
|
|
||||||
use App\Models\Botanic\Genre;
|
|
||||||
use App\Models\Botanic\Specie;
|
|
||||||
use App\Models\Botanic\Variety;
|
|
||||||
|
|
||||||
class migrate extends Command
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'create_relation';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Migration from old version';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new command instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
parent::__construct();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute the console command.
|
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function handle()
|
|
||||||
{
|
|
||||||
$species = Specie::all();
|
|
||||||
foreach ($species as $specie) {
|
|
||||||
$specie->name = trim($specie->name);
|
|
||||||
$specie->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
$varieties = Variety::all();
|
|
||||||
foreach ($varieties as $variety) {
|
|
||||||
$variety->name = trim($variety->name);
|
|
||||||
$variety->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
$varieties = Variety::all();
|
|
||||||
foreach ($varieties as $variety) {
|
|
||||||
$specie_name = $variety->specie;
|
|
||||||
dump($specie_name);
|
|
||||||
if (!empty($specie_name)) {
|
|
||||||
$specie = Specie::byName($specie_name)->first();
|
|
||||||
if (isset($specie->name))
|
|
||||||
{
|
|
||||||
dump($specie->name);
|
|
||||||
$variety->specie_id = $specie->id;
|
|
||||||
$variety->save();
|
|
||||||
} else {
|
|
||||||
dump("non trouvé");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
dump("Aucune espèce");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
$species = Specie::all();
|
|
||||||
foreach ($species as $specie) {
|
|
||||||
$genre_name = $specie->genre;
|
|
||||||
dump($genre_name);
|
|
||||||
if (!empty($genre_name)) {
|
|
||||||
$genre = Genre::byName($genre_name)->first();
|
|
||||||
if (isset($genre->name))
|
|
||||||
{
|
|
||||||
dump($genre->name);
|
|
||||||
$specie->genre_id = $genre->id;
|
|
||||||
$specie->save();
|
|
||||||
} else {
|
|
||||||
dump("non trouvé");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
dump("Aucun genre");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
$genres = Genre::all();
|
|
||||||
foreach ($genres as $genre) {
|
|
||||||
$family_name = $genre->family;
|
|
||||||
dump($family_name);
|
|
||||||
if (!empty($family_name)) {
|
|
||||||
$family = Family::byName($family_name)->first();
|
|
||||||
if (isset($family->name))
|
|
||||||
{
|
|
||||||
dump($family->name);
|
|
||||||
$genre->family_id = $family->id;
|
|
||||||
$genre->save();
|
|
||||||
} else {
|
|
||||||
dump("non trouvé");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
dump("Aucune famille");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
ancien modèle ludo
|
|
||||||
|
|
||||||
digraph G {
|
|
||||||
inventories -> articles
|
|
||||||
article_prices -> article_families
|
|
||||||
|
|
||||||
customer_adresses -> customers
|
|
||||||
payments -> orders
|
|
||||||
packages -> articles_families
|
|
||||||
unities -> packages
|
|
||||||
prices -> articles
|
|
||||||
prices -> articles_families
|
|
||||||
prices -> price_generics
|
|
||||||
prices -> packages
|
|
||||||
prices -> unities
|
|
||||||
prices -> taxes
|
|
||||||
price_generics -> price_generic_categories
|
|
||||||
price_generic_categories -> articles_families
|
|
||||||
price_generic_values -> price_generics
|
|
||||||
price_generic_values -> packages
|
|
||||||
price_generic_values -> unities
|
|
||||||
price_generic_values -> taxes
|
|
||||||
unities -> packages
|
|
||||||
|
|
||||||
invoices -> customers
|
|
||||||
invoice_items -> invoices
|
|
||||||
invoice_items -> articles
|
|
||||||
invoice_items -> taxes
|
|
||||||
orders -> customers
|
|
||||||
|
|
||||||
articles -> botanic_variétés
|
|
||||||
articles -> botanic_especes
|
|
||||||
articles -> articles_families
|
|
||||||
produits -> botanic_variétés
|
|
||||||
produits -> botanic_especes
|
|
||||||
botanic_variétés -> botanic_especes
|
|
||||||
botanic_especes -> botanic_genres
|
|
||||||
botanic_genres -> botanic_familles
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
nouveau modèle ludo
|
|
||||||
|
|
||||||
# Place the cursor inside "graph" to get some refactoring options
|
|
||||||
|
|
||||||
digraph G {
|
|
||||||
articles -> article_natures
|
|
||||||
articles -> boutique_rayons
|
|
||||||
articles -> marchandises
|
|
||||||
articles -> produits_déclinaisons
|
|
||||||
offres -> stock
|
|
||||||
offres -> produits_déclinaisons
|
|
||||||
offres -> tarifs
|
|
||||||
offres -> tarifs_génériques
|
|
||||||
produits_déclinaisons -> packages
|
|
||||||
produits_déclinaisons -> unités
|
|
||||||
clients -> canaux_distribution
|
|
||||||
clients_adresses -> clients
|
|
||||||
tarifs -> canaux_distribution
|
|
||||||
tarifs_génériques -> canaux_distribution
|
|
||||||
tarifs_génériques -> produits_déclinaisons
|
|
||||||
paniers -> clients
|
|
||||||
paniers -> canaux_distribution
|
|
||||||
panier_lignes -> paniers
|
|
||||||
panier_lignes -> offres
|
|
||||||
factures -> clients
|
|
||||||
factures_lignes -> factures
|
|
||||||
factures_lignes -> offres
|
|
||||||
articles -> botanic_variétés
|
|
||||||
articles -> botanic_especes
|
|
||||||
stock -> articles
|
|
||||||
stock -> produits_déclinaisons
|
|
||||||
botanic_variétés -> botanic_especes
|
|
||||||
botanic_especes -> botanic_genres
|
|
||||||
botanic_genres -> botanic_familles
|
|
||||||
taggables -> articles
|
|
||||||
taggables -> tags
|
|
||||||
tags -> tag_groups
|
|
||||||
boutique_rayons_filterables -> boutique_rayons
|
|
||||||
boutique_rayons_filterables -> articles
|
|
||||||
boutique_rayons_filterables -> tags
|
|
||||||
boutique_rayons_filterables -> botanic_especes
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
------------------------
|
|
||||||
|
|
||||||
modèle Patrice
|
|
||||||
|
|
||||||
|
|
||||||
digraph G {
|
|
||||||
shop_offers -> articles
|
|
||||||
shop_offers -> prod_declinations
|
|
||||||
offers_tariffs -> shop_offers
|
|
||||||
offers_tariffs -> mkt_tariffs
|
|
||||||
mkt_tariffs -> sales_channels
|
|
||||||
mkt_tariffs -> mkt_tariff_blocks
|
|
||||||
mkt_tariffs -> shop_offers
|
|
||||||
mkt_tariffs_values -> mkt_tariffs
|
|
||||||
mkt_tariffs_values -> sales_channels
|
|
||||||
mkt_tariffs_values -> mkt_price_unities
|
|
||||||
mkt_tariffs_values -> taxes
|
|
||||||
shop_session_baskets -> sales_channels
|
|
||||||
shop_session_baskets -> customers
|
|
||||||
customer_sales_channels -> sales_channels
|
|
||||||
customer_sales_channels -> customers
|
|
||||||
customer_adresses -> customers
|
|
||||||
sales_channels -> sales_business_partners
|
|
||||||
shop_basket_items -> shop_session_baskets
|
|
||||||
shop_basket_items -> shop_offers
|
|
||||||
prod_declinations -> shop_offers
|
|
||||||
prod_declinations -> prod_packages
|
|
||||||
prod_declinations -> prod_unities
|
|
||||||
|
|
||||||
articles -> produits
|
|
||||||
shop_invoice_items -> shop_invoices
|
|
||||||
shop_invoice_items -> taxes
|
|
||||||
shop_invoices -> customers
|
|
||||||
shop_orders -> customers
|
|
||||||
shop_orders -> sales_channels
|
|
||||||
shop_order_items -> shop_offers
|
|
||||||
shop_order_items -> shop_orders
|
|
||||||
shop_order_payments -> shop_orders
|
|
||||||
produits -> botanic_variétés
|
|
||||||
produits -> botanic_especes
|
|
||||||
botanic_variétés -> botanic_especes
|
|
||||||
botanic_especes -> botanic_genres
|
|
||||||
botanic_genres -> botanic_familles
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user