You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

m181220_080234_translate_database.php 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <?php
  2. use yii\db\Migration;
  3. use yii\db\Schema;
  4. class m181220_080234_translate_database extends Migration
  5. {
  6. public function up()
  7. {
  8. $this->renameTable('commande', 'order') ;
  9. $this->renameColumn('order', 'id_point_vente', 'id_point_sale') ;
  10. $this->renameColumn('order', 'id_production', 'id_distribution') ;
  11. $this->renameColumn('order', 'commentaire', 'comment') ;
  12. $this->renameColumn('order', 'commentaire_point_vente', 'comment_point_sale') ;
  13. $this->renameColumn('order', 'paiement_automatique', 'auto_payment') ;
  14. $this->renameTable('commande_auto', 'subscription') ;
  15. $this->renameColumn('subscription', 'id_etablissement', 'id_producer') ;
  16. $this->renameColumn('subscription', 'date_debut', 'date_debin') ;
  17. $this->renameColumn('subscription', 'date_fin', 'date_end') ;
  18. $this->renameColumn('subscription', 'lundi', 'monday') ;
  19. $this->renameColumn('subscription', 'mardi', 'tuesday') ;
  20. $this->renameColumn('subscription', 'mercredi', 'wednesday') ;
  21. $this->renameColumn('subscription', 'jeudi', 'thursday') ;
  22. $this->renameColumn('subscription', 'vendredi', 'friday') ;
  23. $this->renameColumn('subscription', 'samedi', 'saterday') ;
  24. $this->renameColumn('subscription', 'dimanche', 'sunday') ;
  25. $this->renameColumn('subscription', 'periodicite_semaine', 'week_frequency') ;
  26. $this->renameColumn('subscription', 'id_point_vente', 'id_point_sale') ;
  27. $this->renameColumn('subscription', 'paiement_automatique', 'auto_payment') ;
  28. $this->renameTable('commande_auto_produit', 'product_subscription') ;
  29. $this->renameColumn('product_subscription', 'id_commande_auto', 'id_subscription') ;
  30. $this->renameColumn('product_subscription', 'id_produit', 'id_product') ;
  31. $this->renameColumn('product_subscription', 'quantite', 'quantity') ;
  32. $this->renameTable('commande_produit', 'product_order') ;
  33. $this->renameColumn('product_order', 'id_commande', 'id_order') ;
  34. $this->renameColumn('product_order', 'id_produit', 'id_product') ;
  35. $this->renameColumn('product_order', 'quantite', 'quantity') ;
  36. $this->renameColumn('product_order', 'prix', 'price') ;
  37. $this->renameColumn('product_order', 'mode_vente', 'sale_mode') ;
  38. $this->renameTable('credit_historique', 'credit_history') ;
  39. $this->renameColumn('credit_history', 'id_commande', 'id_order') ;
  40. $this->renameColumn('credit_history', 'montant', 'amount') ;
  41. $this->renameColumn('credit_history', 'id_etablissement', 'id_producer') ;
  42. $this->renameColumn('credit_history', 'moyen_paiement', 'mean_payment') ;
  43. $this->renameColumn('credit_history', 'commentaire', 'comment') ;
  44. $this->renameTable('developpement', 'development') ;
  45. $this->renameColumn('development', 'objet', 'subject') ;
  46. $this->renameColumn('development', 'avancement', 'progress') ;
  47. $this->renameColumn('development', 'statut', 'status') ;
  48. $this->renameColumn('development', 'estimation_temps', 'time_estimate') ;
  49. $this->renameColumn('development', 'date_livraison', 'date_delivery') ;
  50. $this->renameTable('developpement_priorite', 'development_priority') ;
  51. $this->renameColumn('development_priority', 'id_developpement', 'id_development') ;
  52. $this->renameColumn('development_priority', 'id_etablissement', 'id_producer') ;
  53. $this->renameColumn('development_priority', 'priorite', 'priority') ;
  54. $this->renameTable('etablissement', 'producer') ;
  55. $this->dropColumn('producer', 'gratuit') ;
  56. $this->renameColumn('producer', 'nom', 'name') ;
  57. $this->renameColumn('producer', 'code_postal', 'postcode') ;
  58. $this->renameColumn('producer', 'ville', 'city') ;
  59. $this->renameColumn('producer', 'date_paiement', 'date_payment') ;
  60. $this->renameColumn('producer', 'heure_limite_commande', 'order_deadline') ;
  61. $this->renameColumn('producer', 'delai_commande', 'order_delay') ;
  62. $this->renameColumn('producer', 'solde_negatif', 'negative_balance') ;
  63. $this->renameColumn('producer', 'credit_pain', 'credit') ;
  64. $this->renameColumn('producer', 'actif', 'active') ;
  65. $this->renameColumn('producer', 'prix_libre', 'free_price') ;
  66. $this->renameColumn('producer', 'infos_commande', 'order_infos') ;
  67. $this->renameTable('facture', 'invoice') ;
  68. $this->renameColumn('invoice', 'id_etablissement', 'id_producer') ;
  69. $this->renameColumn('invoice', 'libelle', 'wording') ;
  70. $this->renameColumn('invoice', 'texte', 'text') ;
  71. $this->renameColumn('invoice', 'montant_ht', 'amount_without_tax') ;
  72. $this->renameColumn('invoice', 'paye', 'paid') ;
  73. $this->renameColumn('invoice', 'date_paiement', 'date_payment') ;
  74. $this->renameColumn('invoice', 'methode_paiement', 'mean_payment') ;
  75. $this->renameColumn('invoice', 'periode', 'period') ;
  76. $this->renameColumn('invoice', 'ca', 'turnover') ;
  77. $this->renameTable('point_vente', 'point_sale') ;
  78. $this->dropColumn('point_sale', 'pain') ;
  79. $this->dropColumn('point_sale', 'vrac') ;
  80. $this->renameColumn('point_sale', 'nom', 'name') ;
  81. $this->renameColumn('point_sale', 'adresse', 'address') ;
  82. $this->renameColumn('point_sale', 'horaires_lundi', 'infos_monday') ;
  83. $this->renameColumn('point_sale', 'horaires_mardi', 'infos_tuesday') ;
  84. $this->renameColumn('point_sale', 'horaires_mercredi', 'infos_wednesday') ;
  85. $this->renameColumn('point_sale', 'horaires_jeudi', 'infos_thursday') ;
  86. $this->renameColumn('point_sale', 'horaires_vendredi', 'infos_friday') ;
  87. $this->renameColumn('point_sale', 'horaires_samedi', 'infos_saterday') ;
  88. $this->renameColumn('point_sale', 'horaires_dimanche', 'infos_sunday') ;
  89. $this->renameColumn('point_sale', 'localite', 'locality') ;
  90. $this->renameColumn('point_sale', 'point_fabrication', 'point_production') ;
  91. $this->renameColumn('point_sale', 'id_etablissement', 'id_producer') ;
  92. $this->renameColumn('point_sale', 'acces_restreint', 'restricted_access') ;
  93. $this->renameColumn('point_sale', 'credit_pain', 'credit') ;
  94. $this->renameColumn('point_sale', 'livraison_lundi', 'delivery_monday') ;
  95. $this->renameColumn('point_sale', 'livraison_mardi', 'delivery_tuesday') ;
  96. $this->renameColumn('point_sale', 'livraison_mercredi', 'delivery_wednesday') ;
  97. $this->renameColumn('point_sale', 'livraison_jeudi', 'delivery_thursday') ;
  98. $this->renameColumn('point_sale', 'livraison_vendredi', 'delivery_friday') ;
  99. $this->renameColumn('point_sale', 'livraison_samedi', 'delivery_saterday') ;
  100. $this->renameColumn('point_sale', 'livraison_dimanche', 'delivery_sunday') ;
  101. $this->renameTable('point_vente_user', 'user_point_sale') ;
  102. $this->renameColumn('user_point_sale', 'id_point_vente', 'id_point_sale') ;
  103. $this->renameColumn('user_point_sale', 'commentaire', 'comment') ;
  104. $this->renameTable('production', 'distribution') ;
  105. $this->renameColumn('distribution', 'actif', 'active') ;
  106. $this->renameColumn('distribution', 'livraison', 'delivery') ;
  107. $this->renameColumn('distribution', 'id_etablissement', 'id_producer') ;
  108. $this->renameTable('production_point_vente', 'point_sale_distribution') ;
  109. $this->renameColumn('point_sale_distribution', 'id_production', 'id_distribution') ;
  110. $this->renameColumn('point_sale_distribution', 'id_point_vente', 'id_point_sale') ;
  111. $this->renameColumn('point_sale_distribution', 'livraison', 'delivery') ;
  112. $this->renameTable('production_produit', 'product_distribution') ;
  113. $this->renameColumn('product_distribution', 'id_production', 'id_distribution') ;
  114. $this->renameColumn('product_distribution', 'id_produit', 'id_product') ;
  115. $this->renameColumn('product_distribution', 'actif', 'active') ;
  116. $this->renameColumn('product_distribution', 'quantite_max', 'quantity_max') ;
  117. $this->renameTable('produit', 'product') ;
  118. $this->dropColumn('product', 'illustration') ;
  119. $this->dropColumn('product', 'saison') ;
  120. $this->dropColumn('product', 'diminutif') ;
  121. $this->dropColumn('product', 'vrac') ;
  122. $this->renameColumn('product', 'nom', 'name') ;
  123. $this->renameColumn('product', 'actif', 'active') ;
  124. $this->renameColumn('product', 'prix', 'price') ;
  125. $this->renameColumn('product', 'poids', 'weight') ;
  126. $this->renameColumn('product', 'recette', 'recipe') ;
  127. $this->renameColumn('product', 'lundi', 'monday') ;
  128. $this->renameColumn('product', 'mardi', 'tuesday') ;
  129. $this->renameColumn('product', 'mercredi', 'wednesday') ;
  130. $this->renameColumn('product', 'jeudi', 'thursday') ;
  131. $this->renameColumn('product', 'vendredi', 'friday') ;
  132. $this->renameColumn('product', 'samedi', 'saterday') ;
  133. $this->renameColumn('product', 'dimanche', 'sunday') ;
  134. $this->renameColumn('product', 'quantite_max', 'quantity_max') ;
  135. $this->renameColumn('product', 'epuise', 'unavailable') ;
  136. $this->renameColumn('product', 'id_etablissement', 'id_producer') ;
  137. $this->renameColumn('product', 'mode_vente', 'sale_mode') ;
  138. $this->dropColumn('user', 'confiance') ;
  139. $this->renameColumn('user', 'nom', 'lastname') ;
  140. $this->renameColumn('user', 'prenom', 'name') ;
  141. $this->renameColumn('user', 'telephone', 'phone') ;
  142. $this->renameColumn('user', 'adresse', 'address') ;
  143. $this->renameColumn('user', 'mail_prod_lundi', 'mail_distribution_monday') ;
  144. $this->renameColumn('user', 'mail_prod_mardi', 'mail_distribution_tuesday') ;
  145. $this->renameColumn('user', 'mail_prod_mercredi', 'mail_distribution_wednesday') ;
  146. $this->renameColumn('user', 'mail_prod_jeudi', 'mail_distribution_thursday') ;
  147. $this->renameColumn('user', 'mail_prod_vendredi', 'mail_distribution_friday') ;
  148. $this->renameColumn('user', 'mail_prod_samedi', 'mail_distribution_saterday') ;
  149. $this->renameColumn('user', 'mail_prod_dimanche', 'mail_distribution_sunday') ;
  150. $this->renameColumn('user', 'id_etablissement', 'id_producer') ;
  151. $this->renameColumn('user', 'date_derniere_connexion', 'date_last_connection') ;
  152. $this->renameTable('user_etablissement', 'user_producer') ;
  153. $this->renameColumn('user_producer', 'id_etablissement', 'id_producer') ;
  154. $this->renameColumn('user_producer', 'actif', 'active') ;
  155. $this->renameColumn('user_producer', 'favoris', 'bookmark') ;
  156. }
  157. public function down()
  158. {
  159. $this->renameTable('order', 'commande') ;
  160. $this->renameColumn('commande', 'id_point_sale', 'id_point_vente') ;
  161. $this->renameColumn('commande', 'id_distribution', 'id_production') ;
  162. $this->renameColumn('commande', 'comment', 'commentaire') ;
  163. $this->renameColumn('commande', 'comment_point_sale', 'commentaire_point_vente') ;
  164. $this->renameColumn('commande', 'auto_payment', 'paiement_automatique') ;
  165. $this->renameTable('subscription', 'commande_auto') ;
  166. $this->renameColumn('commande_auto', 'id_producer', 'id_etablissement') ;
  167. $this->renameColumn('commande_auto', 'date_debin', 'date_debut') ;
  168. $this->renameColumn('commande_auto', 'date_end', 'date_fin') ;
  169. $this->renameColumn('commande_auto', 'monday', 'lundi') ;
  170. $this->renameColumn('commande_auto', 'tuesday', 'mardi') ;
  171. $this->renameColumn('commande_auto', 'wednesday', 'mercredi') ;
  172. $this->renameColumn('commande_auto', 'thursday', 'jeudi') ;
  173. $this->renameColumn('commande_auto', 'friday', 'vendredi') ;
  174. $this->renameColumn('commande_auto', 'saterday', 'samedi') ;
  175. $this->renameColumn('commande_auto', 'sunday', 'dimanche') ;
  176. $this->renameColumn('commande_auto', 'week_frequency', 'periodicite_semaine') ;
  177. $this->renameColumn('commande_auto', 'id_point_sale', 'id_point_vente') ;
  178. $this->renameColumn('commande_auto', 'auto_payment', 'paiement_automatique') ;
  179. $this->renameTable('product_subscription', 'commande_auto_produit') ;
  180. $this->renameColumn('commande_auto_produit', 'id_subscription', 'id_commande_auto') ;
  181. $this->renameColumn('commande_auto_produit', 'id_product', 'id_produit') ;
  182. $this->renameColumn('commande_auto_produit', 'quantity', 'quantite') ;
  183. $this->renameTable('product_order', 'commande_produit') ;
  184. $this->renameColumn('commande_produit', 'id_order', 'id_commande') ;
  185. $this->renameColumn('commande_produit', 'id_product', 'id_produit') ;
  186. $this->renameColumn('commande_produit', 'quantity', 'quantite') ;
  187. $this->renameColumn('commande_produit', 'price', 'prix') ;
  188. $this->renameColumn('commande_produit', 'sale_mode', 'mode_vente') ;
  189. $this->renameTable('credit_history', 'credit_historique') ;
  190. $this->renameColumn('credit_historique', 'id_order', 'id_commande') ;
  191. $this->renameColumn('credit_historique', 'amount', 'montant') ;
  192. $this->renameColumn('credit_historique', 'id_producer', 'id_etablissement') ;
  193. $this->renameColumn('credit_historique', 'mean_payment', 'moyen_paiement') ;
  194. $this->renameColumn('credit_historique', 'comment', 'commentaire') ;
  195. $this->renameTable('development', 'developpement') ;
  196. $this->renameColumn('developpement', 'subject', 'objet') ;
  197. $this->renameColumn('developpement', 'progress', 'avancement') ;
  198. $this->renameColumn('developpement', 'status', 'statut') ;
  199. $this->renameColumn('developpement', 'time_estimate', 'estimation_temps') ;
  200. $this->renameColumn('developpement', 'date_delivery', 'date_livraison') ;
  201. $this->renameTable('development_priority', 'developpement_priorite') ;
  202. $this->renameColumn('developpement_priorite', 'id_development', 'id_developpement') ;
  203. $this->renameColumn('developpement_priorite', 'id_producer', 'id_etablissement') ;
  204. $this->renameColumn('developpement_priorite', 'priority', 'priorite') ;
  205. $this->renameTable('producer', 'etablissement') ;
  206. $this->addColumn('etablissement', 'gratuit', 'boolean') ;
  207. $this->renameColumn('etablissement', 'name', 'nom') ;
  208. $this->renameColumn('etablissement', 'postcode', 'code_postal') ;
  209. $this->renameColumn('etablissement', 'city', 'ville') ;
  210. $this->renameColumn('etablissement', 'date_payment', 'date_paiement') ;
  211. $this->renameColumn('etablissement', 'order_deadline', 'heure_limite_commande') ;
  212. $this->renameColumn('etablissement', 'order_delay', 'delai_commande') ;
  213. $this->renameColumn('etablissement', 'negative_balance', 'solde_negatif') ;
  214. $this->renameColumn('etablissement', 'credit', 'credit_pain') ;
  215. $this->renameColumn('etablissement', 'active', 'actif') ;
  216. $this->renameColumn('etablissement', 'free_price', 'prix_libre') ;
  217. $this->renameColumn('etablissement', 'order_infos', 'infos_commande') ;
  218. $this->renameTable('invoice', 'facture') ;
  219. $this->renameColumn('facture', 'id_producer', 'id_etablissement') ;
  220. $this->renameColumn('facture', 'wording', 'libelle') ;
  221. $this->renameColumn('facture', 'text', 'texte') ;
  222. $this->renameColumn('facture', 'amount_without_tax', 'montant_ht') ;
  223. $this->renameColumn('facture', 'paid', 'paye') ;
  224. $this->renameColumn('facture', 'date_payment', 'date_paiement') ;
  225. $this->renameColumn('facture', 'mean_payment', 'methode_paiement') ;
  226. $this->renameColumn('facture', 'period', 'periode') ;
  227. $this->renameColumn('facture', 'turnover', 'ca') ;
  228. $this->renameTable('point_sale', 'point_vente') ;
  229. $this->addColumn('point_vente', 'pain', 'boolean') ;
  230. $this->addColumn('point_vente', 'vrac', 'boolean') ;
  231. $this->renameColumn('point_vente', 'name', 'nom') ;
  232. $this->renameColumn('point_vente', 'address', 'adresse') ;
  233. $this->renameColumn('point_vente', 'infos_monday', 'horaires_lundi') ;
  234. $this->renameColumn('point_vente', 'infos_tuesday', 'horaires_mardi') ;
  235. $this->renameColumn('point_vente', 'infos_wednesday', 'horaires_mercredi') ;
  236. $this->renameColumn('point_vente', 'infos_thursday', 'horaires_jeudi') ;
  237. $this->renameColumn('point_vente', 'infos_friday', 'horaires_vendredi') ;
  238. $this->renameColumn('point_vente', 'infos_saterday', 'horaires_samedi') ;
  239. $this->renameColumn('point_vente', 'infos_sunday', 'horaires_dimanche') ;
  240. $this->renameColumn('point_vente', 'locality', 'localite') ;
  241. $this->renameColumn('point_vente', 'point_production', 'point_fabrication') ;
  242. $this->renameColumn('point_vente', 'id_producer', 'id_etablissement') ;
  243. $this->renameColumn('point_vente', 'restricted_access', 'access_restreint') ;
  244. $this->renameColumn('point_vente', 'credit', 'credit_pain') ;
  245. $this->renameColumn('point_vente', 'delivery_monday', 'livraison_lundi') ;
  246. $this->renameColumn('point_vente', 'delivery_tuesday', 'livraison_mardi') ;
  247. $this->renameColumn('point_vente', 'delivery_wednesday', 'livraison_mercredi') ;
  248. $this->renameColumn('point_vente', 'delivery_thursday', 'livraison_jeudi') ;
  249. $this->renameColumn('point_vente', 'delivery_friday', 'livraison_vendredi') ;
  250. $this->renameColumn('point_vente', 'delivery_saterday', 'livraison_samedi') ;
  251. $this->renameColumn('point_vente', 'delivery_sunday', 'livraison_dimanche') ;
  252. $this->renameTable('user_point_sale', 'point_vente_user') ;
  253. $this->renameColumn('point_vente_user', 'id_point_sale', 'id_point_vente') ;
  254. $this->renameColumn('point_vente_user', 'comment', 'commentaire') ;
  255. $this->renameTable('distribution', 'production') ;
  256. $this->renameColumn('production', 'active', 'actif') ;
  257. $this->renameColumn('production', 'delivery', 'livraison') ;
  258. $this->renameColumn('production', 'id_producer', 'id_etablissement') ;
  259. $this->renameTable('point_sale_distribution', 'production_point_vente') ;
  260. $this->renameColumn('production_point_vente', 'id_distribution', 'id_production') ;
  261. $this->renameColumn('production_point_vente', 'id_point_sale', 'id_point_vente') ;
  262. $this->renameColumn('production_point_vente', 'delivery', 'livraison') ;
  263. $this->renameTable('product_distribution', 'production_produit') ;
  264. $this->renameColumn('production_produit', 'id_distribution', 'id_production') ;
  265. $this->renameColumn('production_produit', 'id_product', 'id_produit') ;
  266. $this->renameColumn('production_produit', 'active', 'actif') ;
  267. $this->renameColumn('production_produit', 'quantity_max', 'quantite_max') ;
  268. $this->renameTable('product', 'produit') ;
  269. $this->addColumn('produit', 'illustration', 'varchar(255)') ;
  270. $this->addColumn('produit', 'saison', 'varchar(255)') ;
  271. $this->addColumn('produit', 'diminutif', 'varchar(255)') ;
  272. $this->addColumn('produit', 'vrac', 'boolean') ;
  273. $this->renameColumn('produit', 'name', 'nom') ;
  274. $this->renameColumn('produit', 'active', 'actif') ;
  275. $this->renameColumn('produit', 'price', 'prix') ;
  276. $this->renameColumn('produit', 'weight', 'poids') ;
  277. $this->renameColumn('produit', 'recipe', 'recette') ;
  278. $this->renameColumn('produit', 'monday', 'lundi') ;
  279. $this->renameColumn('produit', 'tuesday', 'mardi') ;
  280. $this->renameColumn('produit', 'wednesday', 'mercredi') ;
  281. $this->renameColumn('produit', 'thursday', 'jeudi') ;
  282. $this->renameColumn('produit', 'friday', 'vendredi') ;
  283. $this->renameColumn('produit', 'saterday', 'samedi') ;
  284. $this->renameColumn('produit', 'sunday', 'dimanche') ;
  285. $this->renameColumn('produit', 'quantity_max', 'quantite_max') ;
  286. $this->renameColumn('produit', 'unavailable', 'epuise') ;
  287. $this->renameColumn('produit', 'id_producer', 'id_etablissement') ;
  288. $this->renameColumn('produit', 'sale_mode', 'mode_vente') ;
  289. $this->addColumn('user', 'confiance', 'boolean') ;
  290. $this->renameColumn('user', 'lastname', 'nom') ;
  291. $this->renameColumn('user', 'name', 'prenom') ;
  292. $this->renameColumn('user', 'phone', 'telephone') ;
  293. $this->renameColumn('user', 'address', 'adresse') ;
  294. $this->renameColumn('user', 'mail_distribution_monday', 'mail_prod_lundi') ;
  295. $this->renameColumn('user', 'mail_distribution_tuesday', 'mail_prod_mardi') ;
  296. $this->renameColumn('user', 'mail_distribution_wednesday', 'mail_prod_mercredi') ;
  297. $this->renameColumn('user', 'mail_distribution_thursday', 'mail_prod_jeudi') ;
  298. $this->renameColumn('user', 'mail_distribution_friday', 'mail_prod_vendredi') ;
  299. $this->renameColumn('user', 'mail_distribution_saterday', 'mail_prod_samedi') ;
  300. $this->renameColumn('user', 'mail_distribution_sunday', 'mail_prod_dimanche') ;
  301. $this->renameColumn('user', 'id_producer', 'id_etablissement') ;
  302. $this->renameColumn('user', 'date_last_connection', 'date_derniere_connexion') ;
  303. $this->renameTable('user_producer', 'user_etablissement') ;
  304. $this->renameColumn('user_etablissement', 'id_producer', 'id_etablissement') ;
  305. $this->renameColumn('user_etablissement', 'active', 'actif') ;
  306. $this->renameColumn('user_etablissement', 'bookmark', 'favoris') ;
  307. }
  308. }