@reachu/database 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (583) hide show
  1. package/.babelrc +28 -0
  2. package/.env.test +50 -0
  3. package/.eslintrc.json +23 -0
  4. package/.nvmrc +1 -0
  5. package/.prettierrc +6 -0
  6. package/.vscode/launch.json +13 -0
  7. package/.vscode/settings.json +3 -0
  8. package/README.md +17 -0
  9. package/dist/config/connect.d.ts +2 -0
  10. package/dist/config/connect.js +34 -0
  11. package/dist/config/connect.js.map +1 -0
  12. package/dist/entity/Address.d.ts +9 -0
  13. package/dist/entity/Address.js +44 -0
  14. package/dist/entity/Address.js.map +1 -0
  15. package/dist/entity/ApiCredential.d.ts +8 -0
  16. package/dist/entity/ApiCredential.js +41 -0
  17. package/dist/entity/ApiCredential.js.map +1 -0
  18. package/dist/entity/AuditedModel.d.ts +4 -0
  19. package/dist/entity/AuditedModel.js +24 -0
  20. package/dist/entity/AuditedModel.js.map +1 -0
  21. package/dist/entity/BankAccount.d.ts +11 -0
  22. package/dist/entity/BankAccount.js +55 -0
  23. package/dist/entity/BankAccount.js.map +1 -0
  24. package/dist/entity/Business.d.ts +21 -0
  25. package/dist/entity/Business.js +83 -0
  26. package/dist/entity/Business.js.map +1 -0
  27. package/dist/entity/BusinessProducts.d.ts +6 -0
  28. package/dist/entity/BusinessProducts.js +32 -0
  29. package/dist/entity/BusinessProducts.js.map +1 -0
  30. package/dist/entity/CardRegistration.d.ts +10 -0
  31. package/dist/entity/CardRegistration.js +51 -0
  32. package/dist/entity/CardRegistration.js.map +1 -0
  33. package/dist/entity/Category.d.ts +7 -0
  34. package/dist/entity/Category.js +36 -0
  35. package/dist/entity/Category.js.map +1 -0
  36. package/dist/entity/Channel.d.ts +12 -0
  37. package/dist/entity/Channel.js +56 -0
  38. package/dist/entity/Channel.js.map +1 -0
  39. package/dist/entity/ChannelGroup.d.ts +15 -0
  40. package/dist/entity/ChannelGroup.js +77 -0
  41. package/dist/entity/ChannelGroup.js.map +1 -0
  42. package/dist/entity/ChannelUser.d.ts +13 -0
  43. package/dist/entity/ChannelUser.js +59 -0
  44. package/dist/entity/ChannelUser.js.map +1 -0
  45. package/dist/entity/ChannelUserProductSync.d.ts +12 -0
  46. package/dist/entity/ChannelUserProductSync.js +63 -0
  47. package/dist/entity/ChannelUserProductSync.js.map +1 -0
  48. package/dist/entity/Check.d.ts +5 -0
  49. package/dist/entity/Check.js +28 -0
  50. package/dist/entity/Check.js.map +1 -0
  51. package/dist/entity/CheckoutMetadata.d.ts +6 -0
  52. package/dist/entity/CheckoutMetadata.js +35 -0
  53. package/dist/entity/CheckoutMetadata.js.map +1 -0
  54. package/dist/entity/Collection.d.ts +16 -0
  55. package/dist/entity/Collection.js +73 -0
  56. package/dist/entity/Collection.js.map +1 -0
  57. package/dist/entity/CollectionItem.d.ts +10 -0
  58. package/dist/entity/CollectionItem.js +47 -0
  59. package/dist/entity/CollectionItem.js.map +1 -0
  60. package/dist/entity/CollectionShared.d.ts +11 -0
  61. package/dist/entity/CollectionShared.js +51 -0
  62. package/dist/entity/CollectionShared.js.map +1 -0
  63. package/dist/entity/Contact.d.ts +9 -0
  64. package/dist/entity/Contact.js +44 -0
  65. package/dist/entity/Contact.js.map +1 -0
  66. package/dist/entity/Country.d.ts +7 -0
  67. package/dist/entity/Country.js +36 -0
  68. package/dist/entity/Country.js.map +1 -0
  69. package/dist/entity/Courier.d.ts +7 -0
  70. package/dist/entity/Courier.js +39 -0
  71. package/dist/entity/Courier.js.map +1 -0
  72. package/dist/entity/Currency.d.ts +7 -0
  73. package/dist/entity/Currency.js +39 -0
  74. package/dist/entity/Currency.js.map +1 -0
  75. package/dist/entity/CustomProduct.d.ts +22 -0
  76. package/dist/entity/CustomProduct.js +95 -0
  77. package/dist/entity/CustomProduct.js.map +1 -0
  78. package/dist/entity/CustomProductImage.d.ts +10 -0
  79. package/dist/entity/CustomProductImage.js +51 -0
  80. package/dist/entity/CustomProductImage.js.map +1 -0
  81. package/dist/entity/CustomVariant.d.ts +13 -0
  82. package/dist/entity/CustomVariant.js +59 -0
  83. package/dist/entity/CustomVariant.js.map +1 -0
  84. package/dist/entity/ExchangeRate.d.ts +8 -0
  85. package/dist/entity/ExchangeRate.js +43 -0
  86. package/dist/entity/ExchangeRate.js.map +1 -0
  87. package/dist/entity/FlatRate.d.ts +9 -0
  88. package/dist/entity/FlatRate.js +45 -0
  89. package/dist/entity/FlatRate.js.map +1 -0
  90. package/dist/entity/FlatRateCountry.d.ts +7 -0
  91. package/dist/entity/FlatRateCountry.js +39 -0
  92. package/dist/entity/FlatRateCountry.js.map +1 -0
  93. package/dist/entity/Fulfillment.d.ts +5 -0
  94. package/dist/entity/Fulfillment.js +28 -0
  95. package/dist/entity/Fulfillment.js.map +1 -0
  96. package/dist/entity/Image.d.ts +10 -0
  97. package/dist/entity/Image.js +49 -0
  98. package/dist/entity/Image.js.map +1 -0
  99. package/dist/entity/ImportedProduct.d.ts +14 -0
  100. package/dist/entity/ImportedProduct.js +66 -0
  101. package/dist/entity/ImportedProduct.js.map +1 -0
  102. package/dist/entity/MagentoConnection.entity.d.ts +13 -0
  103. package/dist/entity/MagentoConnection.entity.js +65 -0
  104. package/dist/entity/MagentoConnection.entity.js.map +1 -0
  105. package/dist/entity/MetricActiveUser.d.ts +8 -0
  106. package/dist/entity/MetricActiveUser.js +43 -0
  107. package/dist/entity/MetricActiveUser.js.map +1 -0
  108. package/dist/entity/Notification.d.ts +20 -0
  109. package/dist/entity/Notification.js +58 -0
  110. package/dist/entity/Notification.js.map +1 -0
  111. package/dist/entity/Option.d.ts +9 -0
  112. package/dist/entity/Option.js +45 -0
  113. package/dist/entity/Option.js.map +1 -0
  114. package/dist/entity/Order.d.ts +29 -0
  115. package/dist/entity/Order.js +106 -0
  116. package/dist/entity/Order.js.map +1 -0
  117. package/dist/entity/OrderCustomer.d.ts +17 -0
  118. package/dist/entity/OrderCustomer.js +76 -0
  119. package/dist/entity/OrderCustomer.js.map +1 -0
  120. package/dist/entity/OrderItem.d.ts +36 -0
  121. package/dist/entity/OrderItem.js +159 -0
  122. package/dist/entity/OrderItem.js.map +1 -0
  123. package/dist/entity/OrderShipping.d.ts +12 -0
  124. package/dist/entity/OrderShipping.js +69 -0
  125. package/dist/entity/OrderShipping.js.map +1 -0
  126. package/dist/entity/OrderTracking.d.ts +16 -0
  127. package/dist/entity/OrderTracking.js +73 -0
  128. package/dist/entity/OrderTracking.js.map +1 -0
  129. package/dist/entity/Payment.d.ts +19 -0
  130. package/dist/entity/Payment.js +85 -0
  131. package/dist/entity/Payment.js.map +1 -0
  132. package/dist/entity/PaymentMethod.d.ts +9 -0
  133. package/dist/entity/PaymentMethod.js +48 -0
  134. package/dist/entity/PaymentMethod.js.map +1 -0
  135. package/dist/entity/PaymentShopify.d.ts +7 -0
  136. package/dist/entity/PaymentShopify.js +39 -0
  137. package/dist/entity/PaymentShopify.js.map +1 -0
  138. package/dist/entity/Permission.d.ts +5 -0
  139. package/dist/entity/Permission.js +31 -0
  140. package/dist/entity/Permission.js.map +1 -0
  141. package/dist/entity/Price.entity.d.ts +5 -0
  142. package/dist/entity/Price.entity.js +29 -0
  143. package/dist/entity/Price.entity.js.map +1 -0
  144. package/dist/entity/Product.entity.d.ts +63 -0
  145. package/dist/entity/Product.entity.js +256 -0
  146. package/dist/entity/Product.entity.js.map +1 -0
  147. package/dist/entity/Request.d.ts +8 -0
  148. package/dist/entity/Request.js +42 -0
  149. package/dist/entity/Request.js.map +1 -0
  150. package/dist/entity/Return.d.ts +8 -0
  151. package/dist/entity/Return.js +40 -0
  152. package/dist/entity/Return.js.map +1 -0
  153. package/dist/entity/ReturnAddress.d.ts +10 -0
  154. package/dist/entity/ReturnAddress.js +48 -0
  155. package/dist/entity/ReturnAddress.js.map +1 -0
  156. package/dist/entity/Role.d.ts +7 -0
  157. package/dist/entity/Role.js +42 -0
  158. package/dist/entity/Role.js.map +1 -0
  159. package/dist/entity/RolePermission.d.ts +8 -0
  160. package/dist/entity/RolePermission.js +40 -0
  161. package/dist/entity/RolePermission.js.map +1 -0
  162. package/dist/entity/ShippingPackage.d.ts +7 -0
  163. package/dist/entity/ShippingPackage.js +39 -0
  164. package/dist/entity/ShippingPackage.js.map +1 -0
  165. package/dist/entity/ShopifyConnection.d.ts +13 -0
  166. package/dist/entity/ShopifyConnection.js +65 -0
  167. package/dist/entity/ShopifyConnection.js.map +1 -0
  168. package/dist/entity/Subcategory.d.ts +7 -0
  169. package/dist/entity/Subcategory.js +36 -0
  170. package/dist/entity/Subcategory.js.map +1 -0
  171. package/dist/entity/User.d.ts +87 -0
  172. package/dist/entity/User.js +321 -0
  173. package/dist/entity/User.js.map +1 -0
  174. package/dist/entity/UserChannelApiKey.d.ts +10 -0
  175. package/dist/entity/UserChannelApiKey.js +47 -0
  176. package/dist/entity/UserChannelApiKey.js.map +1 -0
  177. package/dist/entity/UserRole.d.ts +8 -0
  178. package/dist/entity/UserRole.js +40 -0
  179. package/dist/entity/UserRole.js.map +1 -0
  180. package/dist/entity/UserSettings.d.ts +12 -0
  181. package/dist/entity/UserSettings.js +54 -0
  182. package/dist/entity/UserSettings.js.map +1 -0
  183. package/dist/entity/UserTokenWolt.d.ts +8 -0
  184. package/dist/entity/UserTokenWolt.js +41 -0
  185. package/dist/entity/UserTokenWolt.js.map +1 -0
  186. package/dist/entity/Variant.d.ts +17 -0
  187. package/dist/entity/Variant.js +75 -0
  188. package/dist/entity/Variant.js.map +1 -0
  189. package/dist/entity/Wallet.d.ts +6 -0
  190. package/dist/entity/Wallet.js +35 -0
  191. package/dist/entity/Wallet.js.map +1 -0
  192. package/dist/entity/WooConnection.d.ts +9 -0
  193. package/dist/entity/WooConnection.js +48 -0
  194. package/dist/entity/WooConnection.js.map +1 -0
  195. package/dist/entity/index.d.ts +71 -0
  196. package/dist/entity/index.js +148 -0
  197. package/dist/entity/index.js.map +1 -0
  198. package/dist/entity/modules/shipping/ProductShipping.d.ts +10 -0
  199. package/dist/entity/modules/shipping/ProductShipping.js +53 -0
  200. package/dist/entity/modules/shipping/ProductShipping.js.map +1 -0
  201. package/dist/entity/modules/shipping/Shipping.d.ts +15 -0
  202. package/dist/entity/modules/shipping/Shipping.js +70 -0
  203. package/dist/entity/modules/shipping/Shipping.js.map +1 -0
  204. package/dist/entity/modules/shipping/ShippingCountry.d.ts +10 -0
  205. package/dist/entity/modules/shipping/ShippingCountry.js +52 -0
  206. package/dist/entity/modules/shipping/ShippingCountry.js.map +1 -0
  207. package/dist/entity/modules/shopcart/Cart.d.ts +14 -0
  208. package/dist/entity/modules/shopcart/Cart.js +60 -0
  209. package/dist/entity/modules/shopcart/Cart.js.map +1 -0
  210. package/dist/entity/modules/shopcart/CartItem.d.ts +13 -0
  211. package/dist/entity/modules/shopcart/CartItem.js +57 -0
  212. package/dist/entity/modules/shopcart/CartItem.js.map +1 -0
  213. package/dist/entity/modules/shopcart/Checkout.d.ts +23 -0
  214. package/dist/entity/modules/shopcart/Checkout.js +99 -0
  215. package/dist/entity/modules/shopcart/Checkout.js.map +1 -0
  216. package/dist/entity/modules/shopcart/CheckoutBillingAddress.d.ts +18 -0
  217. package/dist/entity/modules/shopcart/CheckoutBillingAddress.js +84 -0
  218. package/dist/entity/modules/shopcart/CheckoutBillingAddress.js.map +1 -0
  219. package/dist/entity/modules/shopcart/CheckoutShippingAddress.d.ts +18 -0
  220. package/dist/entity/modules/shopcart/CheckoutShippingAddress.js +84 -0
  221. package/dist/entity/modules/shopcart/CheckoutShippingAddress.js.map +1 -0
  222. package/dist/entity/modules/shopcart/PriceData.d.ts +8 -0
  223. package/dist/entity/modules/shopcart/PriceData.js +44 -0
  224. package/dist/entity/modules/shopcart/PriceData.js.map +1 -0
  225. package/dist/examples/app01.d.ts +1 -0
  226. package/dist/examples/app01.js +23 -0
  227. package/dist/examples/app01.js.map +1 -0
  228. package/dist/helpers/index.d.ts +5 -0
  229. package/dist/helpers/index.js +31 -0
  230. package/dist/helpers/index.js.map +1 -0
  231. package/dist/helpers/order/index.d.ts +28 -0
  232. package/dist/helpers/order/index.js +47 -0
  233. package/dist/helpers/order/index.js.map +1 -0
  234. package/dist/helpers/products/index.d.ts +2 -0
  235. package/dist/helpers/products/index.js +25 -0
  236. package/dist/helpers/products/index.js.map +1 -0
  237. package/dist/helpers/products/storage/index.d.ts +2 -0
  238. package/dist/helpers/products/storage/index.js +25 -0
  239. package/dist/helpers/products/storage/index.js.map +1 -0
  240. package/dist/helpers/products/storage/search.d.ts +52 -0
  241. package/dist/helpers/products/storage/search.js +181 -0
  242. package/dist/helpers/products/storage/search.js.map +1 -0
  243. package/dist/helpers/returns/index.d.ts +2 -0
  244. package/dist/helpers/returns/index.js +25 -0
  245. package/dist/helpers/returns/index.js.map +1 -0
  246. package/dist/helpers/returns/storage.d.ts +3 -0
  247. package/dist/helpers/returns/storage.js +23 -0
  248. package/dist/helpers/returns/storage.js.map +1 -0
  249. package/dist/helpers/statistics/connections.d.ts +6 -0
  250. package/dist/helpers/statistics/connections.js +78 -0
  251. package/dist/helpers/statistics/connections.js.map +1 -0
  252. package/dist/helpers/statistics/index.d.ts +2 -0
  253. package/dist/helpers/statistics/index.js +25 -0
  254. package/dist/helpers/statistics/index.js.map +1 -0
  255. package/dist/index.d.ts +7 -0
  256. package/dist/index.js +35 -0
  257. package/dist/index.js.map +1 -0
  258. package/dist/interface/connectionConfig.d.ts +16 -0
  259. package/dist/interface/connectionConfig.js +3 -0
  260. package/dist/interface/connectionConfig.js.map +1 -0
  261. package/dist/migrations/1628474597284-InitialSchema.d.ts +6 -0
  262. package/dist/migrations/1628474597284-InitialSchema.js +203 -0
  263. package/dist/migrations/1628474597284-InitialSchema.js.map +1 -0
  264. package/dist/migrations/1630077596132-RemoveMangopay.d.ts +6 -0
  265. package/dist/migrations/1630077596132-RemoveMangopay.js +53 -0
  266. package/dist/migrations/1630077596132-RemoveMangopay.js.map +1 -0
  267. package/dist/migrations/1633444449026-MagentoIntegration.d.ts +6 -0
  268. package/dist/migrations/1633444449026-MagentoIntegration.js +42 -0
  269. package/dist/migrations/1633444449026-MagentoIntegration.js.map +1 -0
  270. package/dist/migrations/1634070448072-MagentoIntegrationExternalChannelOrder.d.ts +6 -0
  271. package/dist/migrations/1634070448072-MagentoIntegrationExternalChannelOrder.js +31 -0
  272. package/dist/migrations/1634070448072-MagentoIntegrationExternalChannelOrder.js.map +1 -0
  273. package/dist/migrations/1635811861541-SSCCOrderGenerator.d.ts +6 -0
  274. package/dist/migrations/1635811861541-SSCCOrderGenerator.js +29 -0
  275. package/dist/migrations/1635811861541-SSCCOrderGenerator.js.map +1 -0
  276. package/dist/migrations/1638447028594-RolesFeature.d.ts +6 -0
  277. package/dist/migrations/1638447028594-RolesFeature.js +47 -0
  278. package/dist/migrations/1638447028594-RolesFeature.js.map +1 -0
  279. package/dist/migrations/1638493697631-ProductCurrencyPrice.d.ts +6 -0
  280. package/dist/migrations/1638493697631-ProductCurrencyPrice.js +35 -0
  281. package/dist/migrations/1638493697631-ProductCurrencyPrice.js.map +1 -0
  282. package/dist/migrations/1646797095632-UpdateWooTrackingNumber.d.ts +6 -0
  283. package/dist/migrations/1646797095632-UpdateWooTrackingNumber.js +33 -0
  284. package/dist/migrations/1646797095632-UpdateWooTrackingNumber.js.map +1 -0
  285. package/dist/migrations/1648526519546-AddedUserSettings.d.ts +6 -0
  286. package/dist/migrations/1648526519546-AddedUserSettings.js +37 -0
  287. package/dist/migrations/1648526519546-AddedUserSettings.js.map +1 -0
  288. package/dist/migrations/1651206194365-Wolt.d.ts +6 -0
  289. package/dist/migrations/1651206194365-Wolt.js +52 -0
  290. package/dist/migrations/1651206194365-Wolt.js.map +1 -0
  291. package/dist/migrations/1663227133335-shop-cart.d.ts +6 -0
  292. package/dist/migrations/1663227133335-shop-cart.js +62 -0
  293. package/dist/migrations/1663227133335-shop-cart.js.map +1 -0
  294. package/dist/migrations/1664160721396-collection.d.ts +6 -0
  295. package/dist/migrations/1664160721396-collection.js +43 -0
  296. package/dist/migrations/1664160721396-collection.js.map +1 -0
  297. package/dist/migrations/1664222251306-update-collection.d.ts +6 -0
  298. package/dist/migrations/1664222251306-update-collection.js +37 -0
  299. package/dist/migrations/1664222251306-update-collection.js.map +1 -0
  300. package/dist/migrations/1665757388450-channel.d.ts +6 -0
  301. package/dist/migrations/1665757388450-channel.js +59 -0
  302. package/dist/migrations/1665757388450-channel.js.map +1 -0
  303. package/dist/migrations/1666098098114-prod-22-10-18.d.ts +6 -0
  304. package/dist/migrations/1666098098114-prod-22-10-18.js +110 -0
  305. package/dist/migrations/1666098098114-prod-22-10-18.js.map +1 -0
  306. package/dist/migrations/1666631086586-user-channel-api-key-and-currency.d.ts +6 -0
  307. package/dist/migrations/1666631086586-user-channel-api-key-and-currency.js +39 -0
  308. package/dist/migrations/1666631086586-user-channel-api-key-and-currency.js.map +1 -0
  309. package/dist/migrations/1666632054252-user-channel-api-key-and-currency-update.d.ts +6 -0
  310. package/dist/migrations/1666632054252-user-channel-api-key-and-currency-update.js +35 -0
  311. package/dist/migrations/1666632054252-user-channel-api-key-and-currency-update.js.map +1 -0
  312. package/dist/migrations/1666752877685-checkout-and-usser-settings.d.ts +6 -0
  313. package/dist/migrations/1666752877685-checkout-and-usser-settings.js +39 -0
  314. package/dist/migrations/1666752877685-checkout-and-usser-settings.js.map +1 -0
  315. package/dist/migrations/1666846907205-update-user-settings.d.ts +6 -0
  316. package/dist/migrations/1666846907205-update-user-settings.js +31 -0
  317. package/dist/migrations/1666846907205-update-user-settings.js.map +1 -0
  318. package/dist/migrations/1667259333252-prod-22-10-31.d.ts +6 -0
  319. package/dist/migrations/1667259333252-prod-22-10-31.js +43 -0
  320. package/dist/migrations/1667259333252-prod-22-10-31.js.map +1 -0
  321. package/dist/migrations/1667518502388-product-update.d.ts +6 -0
  322. package/dist/migrations/1667518502388-product-update.js +31 -0
  323. package/dist/migrations/1667518502388-product-update.js.map +1 -0
  324. package/dist/migrations/1668571948507-ExchangeRate.d.ts +6 -0
  325. package/dist/migrations/1668571948507-ExchangeRate.js +29 -0
  326. package/dist/migrations/1668571948507-ExchangeRate.js.map +1 -0
  327. package/dist/migrations/1668580085818-update-ExchangeRate.d.ts +6 -0
  328. package/dist/migrations/1668580085818-update-ExchangeRate.js +31 -0
  329. package/dist/migrations/1668580085818-update-ExchangeRate.js.map +1 -0
  330. package/dist/migrations/1669318273596-update-oder-notification.d.ts +6 -0
  331. package/dist/migrations/1669318273596-update-oder-notification.js +33 -0
  332. package/dist/migrations/1669318273596-update-oder-notification.js.map +1 -0
  333. package/dist/migrations/1669737769669-option.d.ts +6 -0
  334. package/dist/migrations/1669737769669-option.js +29 -0
  335. package/dist/migrations/1669737769669-option.js.map +1 -0
  336. package/dist/migrations/1669912111945-shipping.d.ts +6 -0
  337. package/dist/migrations/1669912111945-shipping.js +39 -0
  338. package/dist/migrations/1669912111945-shipping.js.map +1 -0
  339. package/dist/migrations/1670258127812-price.d.ts +6 -0
  340. package/dist/migrations/1670258127812-price.js +31 -0
  341. package/dist/migrations/1670258127812-price.js.map +1 -0
  342. package/dist/migrations/1670952109146-variant.d.ts +6 -0
  343. package/dist/migrations/1670952109146-variant.js +29 -0
  344. package/dist/migrations/1670952109146-variant.js.map +1 -0
  345. package/dist/migrations/1671409580304-order.d.ts +6 -0
  346. package/dist/migrations/1671409580304-order.js +33 -0
  347. package/dist/migrations/1671409580304-order.js.map +1 -0
  348. package/dist/migrations/1672239194236-user-shipping.d.ts +6 -0
  349. package/dist/migrations/1672239194236-user-shipping.js +31 -0
  350. package/dist/migrations/1672239194236-user-shipping.js.map +1 -0
  351. package/dist/migrations/1673628218703-promote_to_production_2023_13_01.d.ts +6 -0
  352. package/dist/migrations/1673628218703-promote_to_production_2023_13_01.js +67 -0
  353. package/dist/migrations/1673628218703-promote_to_production_2023_13_01.js.map +1 -0
  354. package/dist/migrations/1674016904315-exchangeRate_2023_13_01.d.ts +6 -0
  355. package/dist/migrations/1674016904315-exchangeRate_2023_13_01.js +29 -0
  356. package/dist/migrations/1674016904315-exchangeRate_2023_13_01.js.map +1 -0
  357. package/dist/migrations/1674743576475-promote_to_production_2023_26_01.d.ts +6 -0
  358. package/dist/migrations/1674743576475-promote_to_production_2023_26_01.js +29 -0
  359. package/dist/migrations/1674743576475-promote_to_production_2023_26_01.js.map +1 -0
  360. package/dist/migrations/1675452256156-task-1062.d.ts +6 -0
  361. package/dist/migrations/1675452256156-task-1062.js +39 -0
  362. package/dist/migrations/1675452256156-task-1062.js.map +1 -0
  363. package/dist/migrations/1676057445311-task-1062V2.d.ts +6 -0
  364. package/dist/migrations/1676057445311-task-1062V2.js +29 -0
  365. package/dist/migrations/1676057445311-task-1062V2.js.map +1 -0
  366. package/dist/migrations/1676060390524-task-1062V3.d.ts +6 -0
  367. package/dist/migrations/1676060390524-task-1062V3.js +31 -0
  368. package/dist/migrations/1676060390524-task-1062V3.js.map +1 -0
  369. package/dist/migrations/1676389900564-task-1062V4.d.ts +6 -0
  370. package/dist/migrations/1676389900564-task-1062V4.js +29 -0
  371. package/dist/migrations/1676389900564-task-1062V4.js.map +1 -0
  372. package/dist/migrations/1676558804200-task-1074V1.d.ts +6 -0
  373. package/dist/migrations/1676558804200-task-1074V1.js +29 -0
  374. package/dist/migrations/1676558804200-task-1074V1.js.map +1 -0
  375. package/dist/migrations/1676656657956-task-1084V1.d.ts +6 -0
  376. package/dist/migrations/1676656657956-task-1084V1.js +29 -0
  377. package/dist/migrations/1676656657956-task-1084V1.js.map +1 -0
  378. package/dist/migrations/execute/index.d.ts +1 -0
  379. package/dist/migrations/execute/index.js +9 -0
  380. package/dist/migrations/execute/index.js.map +1 -0
  381. package/dist/migrations/index.d.ts +11 -0
  382. package/dist/migrations/index.js +24 -0
  383. package/dist/migrations/index.js.map +1 -0
  384. package/dist/repositories/index.d.ts +158 -0
  385. package/dist/repositories/index.js +383 -0
  386. package/dist/repositories/index.js.map +1 -0
  387. package/dist/repositories/shipping/index.d.ts +10 -0
  388. package/dist/repositories/shipping/index.js +35 -0
  389. package/dist/repositories/shipping/index.js.map +1 -0
  390. package/dist/repositories/shopcart/index.d.ts +19 -0
  391. package/dist/repositories/shopcart/index.js +56 -0
  392. package/dist/repositories/shopcart/index.js.map +1 -0
  393. package/dist/staticData/ChannelName.d.ts +9 -0
  394. package/dist/staticData/ChannelName.js +11 -0
  395. package/dist/staticData/ChannelName.js.map +1 -0
  396. package/dist/staticData/ConnectionType.d.ts +5 -0
  397. package/dist/staticData/ConnectionType.js +7 -0
  398. package/dist/staticData/ConnectionType.js.map +1 -0
  399. package/dist/staticData/Currency.d.ts +9 -0
  400. package/dist/staticData/Currency.js +14 -0
  401. package/dist/staticData/Currency.js.map +1 -0
  402. package/dist/staticData/OrderStatus.d.ts +18 -0
  403. package/dist/staticData/OrderStatus.js +44 -0
  404. package/dist/staticData/OrderStatus.js.map +1 -0
  405. package/dist/staticData/PaymentProcessor.d.ts +8 -0
  406. package/dist/staticData/PaymentProcessor.js +12 -0
  407. package/dist/staticData/PaymentProcessor.js.map +1 -0
  408. package/dist/staticData/ProductOrigin.d.ts +10 -0
  409. package/dist/staticData/ProductOrigin.js +18 -0
  410. package/dist/staticData/ProductOrigin.js.map +1 -0
  411. package/dist/staticData/TrackingProcessor.d.ts +7 -0
  412. package/dist/staticData/TrackingProcessor.js +11 -0
  413. package/dist/staticData/TrackingProcessor.js.map +1 -0
  414. package/dist/staticData/VippsPaymentStatus.d.ts +15 -0
  415. package/dist/staticData/VippsPaymentStatus.js +41 -0
  416. package/dist/staticData/VippsPaymentStatus.js.map +1 -0
  417. package/dist/staticData/index.d.ts +9 -0
  418. package/dist/staticData/index.js +23 -0
  419. package/dist/staticData/index.js.map +1 -0
  420. package/dist/subscribers/ProductSubscriber.d.ts +8 -0
  421. package/dist/subscribers/ProductSubscriber.js +46 -0
  422. package/dist/subscribers/ProductSubscriber.js.map +1 -0
  423. package/dist/subscribers/UserSubscriber.d.ts +8 -0
  424. package/dist/subscribers/UserSubscriber.js +46 -0
  425. package/dist/subscribers/UserSubscriber.js.map +1 -0
  426. package/dist/subscribers/index.d.ts +3 -0
  427. package/dist/subscribers/index.js +8 -0
  428. package/dist/subscribers/index.js.map +1 -0
  429. package/dist/tsconfig.tsbuildinfo +8681 -0
  430. package/dist/utils/index.d.ts +13 -0
  431. package/dist/utils/index.js +109 -0
  432. package/dist/utils/index.js.map +1 -0
  433. package/docs/notas.txt +1 -0
  434. package/jsconfig.json +5 -0
  435. package/nodemon.json +5 -0
  436. package/package.json +76 -0
  437. package/src/config/connect.ts +28 -0
  438. package/src/entity/Address.ts +24 -0
  439. package/src/entity/ApiCredential.ts +19 -0
  440. package/src/entity/AuditedModel.ts +9 -0
  441. package/src/entity/BankAccount.ts +29 -0
  442. package/src/entity/Business.ts +51 -0
  443. package/src/entity/BusinessProducts.ts +15 -0
  444. package/src/entity/CardRegistration.ts +26 -0
  445. package/src/entity/Category.ts +16 -0
  446. package/src/entity/Channel.ts +44 -0
  447. package/src/entity/ChannelGroup.ts +52 -0
  448. package/src/entity/ChannelUser.ts +46 -0
  449. package/src/entity/ChannelUserProductSync.ts +46 -0
  450. package/src/entity/Check.ts +12 -0
  451. package/src/entity/CheckoutMetadata.ts +16 -0
  452. package/src/entity/Collection.ts +55 -0
  453. package/src/entity/CollectionItem.ts +31 -0
  454. package/src/entity/CollectionShared.ts +35 -0
  455. package/src/entity/Contact.ts +24 -0
  456. package/src/entity/Country.ts +18 -0
  457. package/src/entity/Courier.ts +17 -0
  458. package/src/entity/Currency.ts +17 -0
  459. package/src/entity/CustomProduct.ts +85 -0
  460. package/src/entity/CustomProductImage.ts +36 -0
  461. package/src/entity/CustomVariant.ts +40 -0
  462. package/src/entity/ExchangeRate.ts +20 -0
  463. package/src/entity/FlatRate.ts +29 -0
  464. package/src/entity/FlatRateCountry.ts +17 -0
  465. package/src/entity/Fulfillment.ts +12 -0
  466. package/src/entity/Image.ts +34 -0
  467. package/src/entity/ImportedProduct.ts +45 -0
  468. package/src/entity/MagentoConnection.entity.ts +36 -0
  469. package/src/entity/MetricActiveUser.ts +25 -0
  470. package/src/entity/Notification.ts +46 -0
  471. package/src/entity/Option.ts +31 -0
  472. package/src/entity/Order.ts +80 -0
  473. package/src/entity/OrderCustomer.ts +48 -0
  474. package/src/entity/OrderItem.ts +118 -0
  475. package/src/entity/OrderShipping.ts +47 -0
  476. package/src/entity/OrderTracking.ts +50 -0
  477. package/src/entity/Payment.ts +52 -0
  478. package/src/entity/PaymentMethod.ts +32 -0
  479. package/src/entity/PaymentShopify.ts +17 -0
  480. package/src/entity/Permission.ts +13 -0
  481. package/src/entity/Price.entity.ts +12 -0
  482. package/src/entity/Product.entity.ts +200 -0
  483. package/src/entity/Request.ts +23 -0
  484. package/src/entity/Return.ts +19 -0
  485. package/src/entity/ReturnAddress.ts +27 -0
  486. package/src/entity/Role.ts +20 -0
  487. package/src/entity/RolePermission.ts +19 -0
  488. package/src/entity/ShippingPackage.ts +19 -0
  489. package/src/entity/ShopifyConnection.ts +37 -0
  490. package/src/entity/Subcategory.ts +16 -0
  491. package/src/entity/User.ts +261 -0
  492. package/src/entity/UserChannelApiKey.ts +32 -0
  493. package/src/entity/UserRole.ts +19 -0
  494. package/src/entity/UserSettings.ts +37 -0
  495. package/src/entity/UserTokenWolt.ts +19 -0
  496. package/src/entity/Variant.ts +53 -0
  497. package/src/entity/Wallet.ts +14 -0
  498. package/src/entity/WooConnection.ts +24 -0
  499. package/src/entity/index.ts +148 -0
  500. package/src/entity/modules/shipping/ProductShipping.ts +37 -0
  501. package/src/entity/modules/shipping/Shipping.ts +54 -0
  502. package/src/entity/modules/shipping/ShippingCountry.ts +35 -0
  503. package/src/entity/modules/shopcart/Cart.ts +43 -0
  504. package/src/entity/modules/shopcart/CartItem.ts +40 -0
  505. package/src/entity/modules/shopcart/Checkout.ts +74 -0
  506. package/src/entity/modules/shopcart/CheckoutBillingAddress.ts +50 -0
  507. package/src/entity/modules/shopcart/CheckoutShippingAddress.ts +50 -0
  508. package/src/entity/modules/shopcart/PriceData.ts +20 -0
  509. package/src/examples/app01.ts +9 -0
  510. package/src/helpers/index.ts +6 -0
  511. package/src/helpers/order/index.ts +47 -0
  512. package/src/helpers/products/index.ts +2 -0
  513. package/src/helpers/products/storage/index.ts +2 -0
  514. package/src/helpers/products/storage/search.ts +249 -0
  515. package/src/helpers/returns/index.ts +2 -0
  516. package/src/helpers/returns/storage.ts +9 -0
  517. package/src/helpers/statistics/connections.ts +70 -0
  518. package/src/helpers/statistics/index.ts +2 -0
  519. package/src/index.ts +8 -0
  520. package/src/interface/connectionConfig.ts +17 -0
  521. package/src/migrations/1628474597284-InitialSchema.ts +471 -0
  522. package/src/migrations/1630077596132-RemoveMangopay.ts +79 -0
  523. package/src/migrations/1633444449026-MagentoIntegration.ts +50 -0
  524. package/src/migrations/1634070448072-MagentoIntegrationExternalChannelOrder.ts +23 -0
  525. package/src/migrations/1635811861541-SSCCOrderGenerator.ts +13 -0
  526. package/src/migrations/1638447028594-RolesFeature.ts +59 -0
  527. package/src/migrations/1638493697631-ProductCurrencyPrice.ts +31 -0
  528. package/src/migrations/1646797095632-UpdateWooTrackingNumber.ts +27 -0
  529. package/src/migrations/1648526519546-AddedUserSettings.ts +35 -0
  530. package/src/migrations/1651206194365-Wolt.ts +37 -0
  531. package/src/migrations/1663227133335-shop-cart.ts +47 -0
  532. package/src/migrations/1664160721396-collection.ts +28 -0
  533. package/src/migrations/1664222251306-update-collection.ts +22 -0
  534. package/src/migrations/1665757388450-channel.ts +44 -0
  535. package/src/migrations/1666098098114-prod-22-10-18.ts +95 -0
  536. package/src/migrations/1666631086586-user-channel-api-key-and-currency.ts +24 -0
  537. package/src/migrations/1666632054252-user-channel-api-key-and-currency-update.ts +20 -0
  538. package/src/migrations/1666752877685-checkout-and-usser-settings.ts +24 -0
  539. package/src/migrations/1666846907205-update-user-settings.ts +16 -0
  540. package/src/migrations/1667259333252-prod-22-10-31.ts +28 -0
  541. package/src/migrations/1667518502388-product-update.ts +16 -0
  542. package/src/migrations/1668571948507-ExchangeRate.ts +14 -0
  543. package/src/migrations/1668580085818-update-ExchangeRate.ts +16 -0
  544. package/src/migrations/1669318273596-update-oder-notification.ts +18 -0
  545. package/src/migrations/1669737769669-option.ts +14 -0
  546. package/src/migrations/1669912111945-shipping.ts +24 -0
  547. package/src/migrations/1670258127812-price.ts +16 -0
  548. package/src/migrations/1670952109146-variant.ts +14 -0
  549. package/src/migrations/1671409580304-order.ts +18 -0
  550. package/src/migrations/1672239194236-user-shipping.ts +16 -0
  551. package/src/migrations/1673628218703-promote_to_production_2023_13_01.ts +52 -0
  552. package/src/migrations/1674016904315-exchangeRate_2023_13_01.ts +14 -0
  553. package/src/migrations/1674743576475-promote_to_production_2023_26_01.ts +14 -0
  554. package/src/migrations/1675452256156-task-1062.ts +24 -0
  555. package/src/migrations/1676057445311-task-1062V2.ts +14 -0
  556. package/src/migrations/1676060390524-task-1062V3.ts +16 -0
  557. package/src/migrations/1676389900564-task-1062V4.ts +14 -0
  558. package/src/migrations/1676558804200-task-1074V1.ts +14 -0
  559. package/src/migrations/1676656657956-task-1084V1.ts +14 -0
  560. package/src/migrations/execute/index.ts +3 -0
  561. package/src/migrations/index.ts +23 -0
  562. package/src/repositories/index.ts +233 -0
  563. package/src/repositories/shipping/index.ts +15 -0
  564. package/src/repositories/shopcart/index.ts +25 -0
  565. package/src/staticData/ChannelName.ts +8 -0
  566. package/src/staticData/ConnectionType.ts +4 -0
  567. package/src/staticData/Currency.ts +11 -0
  568. package/src/staticData/OrderStatus.ts +41 -0
  569. package/src/staticData/PaymentProcessor.ts +9 -0
  570. package/src/staticData/ProductOrigin.ts +19 -0
  571. package/src/staticData/TrackingProcessor.ts +8 -0
  572. package/src/staticData/VippsPaymentStatus.ts +41 -0
  573. package/src/staticData/index.ts +20 -0
  574. package/src/subscribers/ProductSubscriber.ts +25 -0
  575. package/src/subscribers/UserSubscriber.ts +23 -0
  576. package/src/subscribers/index.ts +4 -0
  577. package/src/utils/index.ts +88 -0
  578. package/test/setup.ts +4 -0
  579. package/test/staticData/OrderStatus.test.ts +0 -0
  580. package/test/staticData/VippsPaymentStatus.test.ts +0 -0
  581. package/test/utils.test.ts +22 -0
  582. package/tsconfig.build.json +9 -0
  583. package/tsconfig.json +18 -0
@@ -0,0 +1,471 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+
3
+ export class InitialSchema1628474597284 implements MigrationInterface {
4
+ name = 'InitialSchema1628474597284';
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `CREATE TABLE \`outshifter\`.\`subcategory\` (\`id\` int NOT NULL AUTO_INCREMENT, \`name\` varchar(255) NOT NULL, \`category_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
9
+ );
10
+ await queryRunner.query(
11
+ `CREATE TABLE \`outshifter\`.\`category\` (\`id\` int NOT NULL AUTO_INCREMENT, \`name\` varchar(255) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
12
+ );
13
+ await queryRunner.query(
14
+ `CREATE TABLE \`outshifter\`.\`card_registration\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`card_registration_id\` varchar(255) NOT NULL, \`card_id\` varchar(255) NOT NULL, \`alias\` varchar(255) NOT NULL, \`card_provider\` varchar(255) NOT NULL, \`validity\` varchar(255) NOT NULL, \`expiration_date\` varchar(255) NOT NULL, \`user_id\` int NULL, UNIQUE INDEX \`REL_fc69ffcad90889cf50bac7a1e4\` (\`user_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
15
+ );
16
+ await queryRunner.query(
17
+ `CREATE TABLE \`outshifter\`.\`bank_account\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`owner\` varchar(255) NULL, \`name\` varchar(255) NULL, \`bank_account_id\` varchar(255) NOT NULL, \`iban\` varchar(255) NOT NULL, \`active\` tinyint NOT NULL, \`bic\` varchar(255) NOT NULL, \`type\` varchar(255) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
18
+ );
19
+ await queryRunner.query(
20
+ `CREATE TABLE \`outshifter\`.\`wallet\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`wallet_id\` varchar(255) NOT NULL, \`currency\` varchar(255) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
21
+ );
22
+ await queryRunner.query(
23
+ `CREATE TABLE \`outshifter\`.\`courier\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`postmen_id\` varchar(255) NOT NULL, \`description\` varchar(255) NOT NULL, \`slug\` varchar(255) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
24
+ );
25
+ await queryRunner.query(
26
+ `CREATE TABLE \`outshifter\`.\`flat_rate_country\` (\`id\` int NOT NULL AUTO_INCREMENT, \`amount\` decimal(10,2) NULL, \`country\` varchar(255) NOT NULL, \`flat_rate_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
27
+ );
28
+ await queryRunner.query(
29
+ `CREATE TABLE \`outshifter\`.\`flat_rate\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`amount\` decimal(10,2) NULL, \`custom_prices_enabled\` tinyint NOT NULL DEFAULT 0, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
30
+ );
31
+ await queryRunner.query(
32
+ `CREATE TABLE \`outshifter\`.\`shipping_package\` (\`id\` int NOT NULL AUTO_INCREMENT, \`height\` decimal(10,2) NOT NULL, \`depth\` decimal(10,2) NOT NULL, \`weight\` decimal(10,2) NOT NULL, \`width\` decimal(10,2) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
33
+ );
34
+ await queryRunner.query(
35
+ `CREATE TABLE \`outshifter\`.\`woo_connection\` (\`id\` int NOT NULL AUTO_INCREMENT, \`shop\` varchar(255) NOT NULL, \`consumer_key\` varchar(255) NOT NULL, \`consumer_secret\` varchar(255) NOT NULL, \`currency\` varchar(255) NULL, \`user_id\` int NULL, UNIQUE INDEX \`REL_c61b68995acf5a1a32f2c60175\` (\`user_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
36
+ );
37
+ await queryRunner.query(
38
+ `CREATE TABLE \`outshifter\`.\`business\` (\`id\` int NOT NULL AUTO_INCREMENT, \`same_as_account\` tinyint NOT NULL DEFAULT 0, \`business_name\` varchar(255) NULL, \`country\` varchar(255) NULL, \`address\` varchar(255) NULL, \`address2\` varchar(255) NULL, \`post_code\` varchar(255) NULL, \`city\` varchar(255) NULL, \`ecommerce_system\` varchar(255) NULL, \`productscategory\` varchar(255) NULL, \`productssubcategory\` varchar(255) NULL, \`productscommission\` varchar(255) NULL, \`productschannels\` varchar(255) NULL, \`contact_title\` varchar(255) NULL, \`contact_name\` varchar(255) NULL, \`contact_surname\` varchar(255) NULL, \`contact_email\` varchar(255) NULL, \`contact_role\` varchar(255) NULL, \`contact_phone_code\` varchar(255) NULL, \`contact_phone\` varchar(255) NULL, \`return_right\` varchar(255) NULL, \`return_label\` varchar(255) NULL, \`return_cost\` varchar(255) NULL, \`return_policy\` text NULL, \`return__address_same_as_business\` tinyint NOT NULL DEFAULT 0, \`return__address_same_as_warehouse\` tinyint NOT NULL DEFAULT 0, \`return__address_country\` varchar(255) NULL, \`return__address_timezone\` varchar(255) NULL, \`return__address_address\` varchar(255) NULL, \`return__address_address2\` varchar(255) NULL, \`return__address_post_code\` varchar(255) NULL, \`return__address_return_city\` varchar(255) NULL, \`fulfillment_shipping_rates\` varchar(255) NULL, \`fulfillment_processing_time\` varchar(255) NULL, \`fulfillment_shipping_to\` varchar(255) NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
39
+ );
40
+ await queryRunner.query(
41
+ `CREATE TABLE \`outshifter\`.\`shopify_connection\` (\`id\` int NOT NULL AUTO_INCREMENT, \`imported_products\` tinyint NOT NULL DEFAULT 0, \`access_token\` varchar(255) NULL, \`url\` varchar(255) NULL, \`currency\` varchar(255) NULL, \`carrier_id\` varchar(255) NULL, \`fulfillment_id\` varchar(255) NULL, \`location_id\` varchar(255) NULL, \`reseller_id\` int NULL, \`supplier_id\` int NULL, UNIQUE INDEX \`REL_9499974cf522429803e172a627\` (\`reseller_id\`), UNIQUE INDEX \`REL_98158a497be5c13a12fad50554\` (\`supplier_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
42
+ );
43
+ await queryRunner.query(
44
+ `CREATE TABLE \`outshifter\`.\`country\` (\`id\` int NOT NULL AUTO_INCREMENT, \`name\` varchar(255) NOT NULL, \`code\` varchar(255) NOT NULL, \`postal_code\` varchar(255) NOT NULL, UNIQUE INDEX \`IDX_8ff4c23dc9a3f3856555bd8618\` (\`code\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
45
+ );
46
+ await queryRunner.query(
47
+ `CREATE TABLE \`outshifter\`.\`channel\` (\`id\` int NOT NULL AUTO_INCREMENT, \`name\` varchar(255) NOT NULL, \`enabled\` tinyint NOT NULL DEFAULT 0, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
48
+ );
49
+ await queryRunner.query(
50
+ `CREATE TABLE \`outshifter\`.\`option\` (\`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`name\` varchar(255) NOT NULL, \`order\` int NOT NULL, \`values\` varchar(255) NOT NULL, \`product_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
51
+ );
52
+ await queryRunner.query(
53
+ `CREATE TABLE \`outshifter\`.\`image\` (\`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`url\` varchar(255) NOT NULL, \`width\` int NULL, \`height\` int NULL, \`order\` int NOT NULL, \`product_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
54
+ );
55
+ await queryRunner.query(
56
+ `CREATE TABLE \`outshifter\`.\`variant\` (\`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`title\` varchar(255) NOT NULL, \`sku\` varchar(255) NOT NULL, \`barcode\` varchar(255) NULL, \`quantity\` int NOT NULL, \`price\` decimal(10,2) NOT NULL, \`origin_id\` varchar(255) NULL, \`product_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
57
+ );
58
+ await queryRunner.query(
59
+ `CREATE TABLE \`outshifter\`.\`request\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`state\` int NULL DEFAULT '0', \`sender_id\` int NULL, \`receiver_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
60
+ );
61
+ await queryRunner.query(
62
+ `CREATE TABLE \`outshifter\`.\`imported_product\` (\`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`shopify_id\` bigint NULL, \`woo_id\` bigint NULL, \`squarespace_id\` varchar(255) NULL, \`profile_id\` varchar(255) NULL, \`profile_woo_id\` varchar(255) NULL, \`user_id\` int NULL, \`product_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
63
+ );
64
+ await queryRunner.query(
65
+ `CREATE TABLE \`outshifter\`.\`payment_shopify\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`shopify_id\` varchar(255) NOT NULL, \`confirmation_url\` varchar(255) NOT NULL, \`status\` varchar(255) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
66
+ );
67
+ await queryRunner.query(
68
+ `CREATE TABLE \`outshifter\`.\`order_item\` (\`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`quantity\` int NOT NULL, \`sku\` varchar(255) NULL, \`variant_title\` varchar(255) NOT NULL, \`price\` decimal(10,2) NOT NULL, \`price_channel\` decimal(10,2) NOT NULL, \`currency_channel\` varchar(255) NOT NULL, \`tax\` decimal(10,2) NULL, \`tax_rate\` decimal(10,2) NULL, \`tax_title\` varchar(255) NULL, \`profit\` decimal(10,2) NOT NULL, \`revenue\` decimal(10,2) NOT NULL, \`fee\` decimal(10,2) NOT NULL, \`status\` varchar(255) NOT NULL, \`status_detail\` varchar(255) NULL, \`status_reason\` varchar(255) NULL, \`is_sales_channel\` tinyint NOT NULL DEFAULT 0, \`supplier_woo_order_id\` varchar(255) NULL, \`supplier_shopify_order_id\` varchar(255) NULL, \`channel_id\` varchar(255) NULL, \`product_id\` int NULL, \`order_tracking_id\` int NULL, \`supplier_id\` int NULL, \`order_id\` int NULL, \`payment_shopify_id\` int NULL, UNIQUE INDEX \`REL_1e106723258bd677ee40719d81\` (\`payment_shopify_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
69
+ );
70
+ await queryRunner.query(
71
+ `CREATE TABLE \`outshifter\`.\`order_shipping\` (\`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`code\` varchar(255) NOT NULL, \`title\` varchar(255) NOT NULL, \`price\` decimal(10,2) NOT NULL, \`price_channel\` decimal(10,2) NOT NULL, \`captured\` tinyint NOT NULL DEFAULT 0, \`order_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
72
+ );
73
+ await queryRunner.query(
74
+ `CREATE TABLE \`outshifter\`.\`order\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`channel\` varchar(255) NOT NULL, \`channel_id\` varchar(255) NOT NULL, \`channel_order_name\` varchar(255) NOT NULL, \`channel_created_date\` datetime NOT NULL, \`currency\` varchar(255) NOT NULL, \`payment_processor\` varchar(255) NULL, \`shipping_price\` decimal(10,2) NULL, \`shipping_title\` varchar(255) NULL, \`shipping_code\` varchar(255) NULL, \`reseller_id\` int NULL, \`customer_full_name\` varchar(255) NOT NULL, \`customer_email\` varchar(255) NULL, \`customer_phone\` varchar(255) NULL, \`customer_shipping_zip\` varchar(255) NOT NULL, \`customer_shipping_address\` varchar(255) NOT NULL, \`customer_shipping_city\` varchar(255) NOT NULL, \`customer_shipping_state\` varchar(255) NULL, \`customer_shipping_country\` varchar(255) NOT NULL, \`customer_shipping_contact_name\` varchar(255) NOT NULL, \`customer_billing_name\` varchar(255) NOT NULL, \`customer_billing_zip\` varchar(255) NOT NULL, \`customer_billing_city\` varchar(255) NOT NULL, \`customer_billing_state\` varchar(255) NULL, \`customer_billing_address\` varchar(255) NOT NULL, \`customer_billing_country\` varchar(255) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
75
+ );
76
+ await queryRunner.query(
77
+ `CREATE TABLE \`outshifter\`.\`order_tracking\` (\`id\` int NOT NULL AUTO_INCREMENT, \`tracking_number\` varchar(255) NULL, \`url\` varchar(255) NULL, \`processor\` varchar(255) NULL, \`processor_id\` varchar(255) NULL, \`status\` varchar(255) NULL, \`status_date\` datetime NULL, \`reseller_fulfillment_id\` varchar(255) NULL, \`supplier_fulfillment_ids\` varchar(255) NULL, \`order_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
78
+ );
79
+ await queryRunner.query(
80
+ `CREATE TABLE \`outshifter\`.\`checkout_metadata\` (\`uuid\` varchar(255) NOT NULL, \`deleted_at\` datetime(6) NULL, \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`data\` text NOT NULL, PRIMARY KEY (\`uuid\`)) ENGINE=InnoDB`,
81
+ );
82
+ await queryRunner.query(
83
+ `CREATE TABLE \`outshifter\`.\`metric_active_user\` (\`id\` int NOT NULL AUTO_INCREMENT, \`seller\` bigint NOT NULL, \`supplier\` bigint NOT NULL, \`seller_today\` bigint NOT NULL, \`supplier_today\` bigint NOT NULL, \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
84
+ );
85
+ await queryRunner.query(
86
+ `CREATE TABLE \`outshifter\`.\`product\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`title\` varchar(255) NULL, \`status\` int NOT NULL DEFAULT '0', \`description\` text NULL, \`public_price\` decimal(10,2) NULL, \`referral_fee\` int NOT NULL DEFAULT '0', \`tags\` varchar(255) NULL DEFAULT '', \`sku\` varchar(255) NULL, \`barcode\` varchar(255) NULL, \`quantity\` int NULL, \`allow_purchase_out_of_stock\` tinyint NOT NULL DEFAULT 0, \`weight\` decimal(10,2) NULL, \`ship_to\` text NULL, \`width\` decimal(10,2) NULL, \`height\` decimal(10,2) NULL, \`depth\` decimal(10,2) NULL, \`options_enabled\` tinyint NOT NULL DEFAULT 0, \`origin\` varchar(255) NULL, \`origin_id\` varchar(255) NULL, \`origin_variant_id\` varchar(255) NULL, \`total_orders\` varchar(255) NULL, \`total_imports\` varchar(255) NULL, \`imported\` int NULL, \`shopify_id\` varchar(255) NULL, \`woo_id\` varchar(255) NULL, \`user_is_sender\` varchar(255) NULL, \`user_is_receiver\` varchar(255) NULL, \`rate\` int NOT NULL DEFAULT '0', \`migrated\` tinyint NOT NULL DEFAULT 0, \`user_id\` int NULL, \`flat_rate_id\` int NULL, UNIQUE INDEX \`REL_be9d7736b967abed111e114f05\` (\`flat_rate_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
87
+ );
88
+ await queryRunner.query(
89
+ `CREATE TABLE \`outshifter\`.\`notification\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`entity_type\` varchar(255) NOT NULL, \`entity_id\` bigint NOT NULL, \`type\` varchar(255) NULL, \`viewed\` tinyint NOT NULL DEFAULT 0, \`user_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
90
+ );
91
+ await queryRunner.query(
92
+ `CREATE TABLE \`outshifter\`.\`payment\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`mangopay_id\` varchar(255) NOT NULL, \`card_id\` varchar(255) NOT NULL, \`related_entity_id\` bigint NOT NULL, \`related_entity_type\` varchar(255) NOT NULL, \`refund_id\` varchar(255) NULL, \`status\` varchar(255) NOT NULL, \`wallet_id\` varchar(255) NOT NULL, \`amount\` int NOT NULL, \`currency\` varchar(255) NULL, \`fee\` int NOT NULL, \`secure_mode\` tinyint NOT NULL, \`secure_redirect_url\` varchar(255) NULL, \`secure_return_url\` varchar(255) NULL, \`author_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
93
+ );
94
+ await queryRunner.query(
95
+ `CREATE TABLE \`outshifter\`.\`user\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`is_business\` tinyint NOT NULL DEFAULT 0, \`uid\` varchar(255) NULL, \`code\` varchar(255) NULL, \`active\` tinyint NOT NULL DEFAULT 1, \`is_admin\` tinyint NOT NULL DEFAULT 0, \`is_supplier\` tinyint NOT NULL DEFAULT 0, \`username\` varchar(255) NOT NULL DEFAULT '', \`name\` varchar(255) NOT NULL, \`surname\` varchar(255) NOT NULL, \`date_birth\` date NOT NULL DEFAULT '1990-01-01', \`phone\` varchar(255) NOT NULL DEFAULT '', \`phone_code\` varchar(255) NOT NULL DEFAULT '', \`address\` varchar(255) NULL, \`address2\` varchar(255) NULL, \`post_code\` varchar(255) NULL, \`state\` varchar(255) NOT NULL DEFAULT '', \`country\` varchar(255) NOT NULL DEFAULT '', \`city\` varchar(255) NOT NULL DEFAULT '', \`avatar\` varchar(255) NOT NULL DEFAULT '', \`website\` varchar(255) NOT NULL DEFAULT '', \`description\` text NOT NULL, \`facebook_access_token\` varchar(255) NULL, \`facebook_page_id\` varchar(255) NULL, \`instagram_account_id\` varchar(255) NULL, \`mangopay_id\` varchar(255) NULL, \`squarespace_api_token\` text NULL, \`first_squarespace_import\` tinyint NOT NULL DEFAULT 0, \`interests\` varchar(255) NOT NULL DEFAULT '', \`gender\` varchar(255) NULL, \`contact_name\` varchar(255) NULL, \`brand_name\` varchar(255) NULL, \`organization_number\` varchar(255) NULL, \`vat_number\` varchar(255) NULL, \`warehouse_same_address\` tinyint NOT NULL DEFAULT 0, \`oda_id\` varchar(255) NULL, \`terms_and_conditions\` tinyint NOT NULL DEFAULT 0, \`privacy_policy\` tinyint NOT NULL DEFAULT 0, \`cover_image\` varchar(255) NULL, \`listings_quantity\` varchar(255) NULL, \`imported_quantity\` varchar(255) NULL, \`orders_quantity\` varchar(255) NULL, \`connections_quantity\` varchar(255) NULL, \`is_sender\` varchar(255) NULL, \`is_receiver\` varchar(255) NULL, \`request_id\` varchar(255) NULL, \`request_state\` varchar(255) NULL, \`listings_draft\` varchar(255) NULL, \`listings_published\` varchar(255) NULL, \`saved_products\` varchar(255) NULL, \`exported_products\` varchar(255) NULL, \`rate\` int NOT NULL DEFAULT '0', \`business_id\` int NULL, \`card_registration_id\` int NULL, \`bank_account_id\` int NULL, \`wallet_id\` int NULL, \`courier_id\` int NULL, \`flat_rate_id\` int NULL, \`woo_id\` int NULL, \`shopify_reseller_id\` int NULL, \`shopify_supplier_id\` int NULL, \`shipping_package_id\` int NULL, \`warehouse_address\` varchar(255) NULL, \`warehouse_address2\` varchar(255) NULL, \`warehouse_post_code\` varchar(255) NULL, \`warehouse_state\` varchar(255) NULL, \`warehouse_country\` varchar(255) NULL, \`warehouse_timezone\` varchar(255) NULL, \`warehouse_city\` varchar(255) NULL, \`check_first_sync_shopify\` tinyint NOT NULL DEFAULT 0, \`check_first_sync_woo\` tinyint NOT NULL DEFAULT 0, \`check_activate_guide\` tinyint NOT NULL DEFAULT 0, UNIQUE INDEX \`IDX_df955cae05f17b2bcf5045cc02\` (\`uid\`), UNIQUE INDEX \`REL_5a4bd96d9a519d4d20a21231b9\` (\`business_id\`), UNIQUE INDEX \`REL_371bf8739470035e4b540b798a\` (\`card_registration_id\`), UNIQUE INDEX \`REL_080d426b06188408bc1cc508c8\` (\`bank_account_id\`), UNIQUE INDEX \`REL_b453ec3d9d579f6b9699be98be\` (\`wallet_id\`), UNIQUE INDEX \`REL_306ce5e598064be83a4f9711ac\` (\`courier_id\`), UNIQUE INDEX \`REL_a222a4249313cf0c934a55e038\` (\`flat_rate_id\`), UNIQUE INDEX \`REL_c9bd34a984ea3ad2570defd876\` (\`woo_id\`), UNIQUE INDEX \`REL_30e7578021099b78aa332a49ce\` (\`shopify_reseller_id\`), UNIQUE INDEX \`REL_bb09b5baeed0eff98b89cb1ff5\` (\`shopify_supplier_id\`), UNIQUE INDEX \`REL_286146c9e2b7b7e053305bebb3\` (\`shipping_package_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
96
+ );
97
+ await queryRunner.query(
98
+ `CREATE TABLE \`outshifter\`.\`api_credential\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`api_key\` varchar(255) NOT NULL, \`api_token\` varchar(255) NOT NULL, \`user_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
99
+ );
100
+ await queryRunner.query(
101
+ `CREATE TABLE \`outshifter\`.\`product_subcategories_subcategory\` (\`product_id\` int NOT NULL, \`subcategory_id\` int NOT NULL, INDEX \`IDX_b45925f896a21830a6a186aff2\` (\`product_id\`), INDEX \`IDX_040b74263cc7e908b421a5205b\` (\`subcategory_id\`), PRIMARY KEY (\`product_id\`, \`subcategory_id\`)) ENGINE=InnoDB`,
102
+ );
103
+ await queryRunner.query(
104
+ `CREATE TABLE \`outshifter\`.\`product_channels_channel\` (\`product_id\` int NOT NULL, \`channel_id\` int NOT NULL, INDEX \`IDX_07e15b0eb640ff6072219afa73\` (\`product_id\`), INDEX \`IDX_396113fa3b66d9aa5abbaa402d\` (\`channel_id\`), PRIMARY KEY (\`product_id\`, \`channel_id\`)) ENGINE=InnoDB`,
105
+ );
106
+ await queryRunner.query(
107
+ `CREATE TABLE \`outshifter\`.\`user_categories_category\` (\`user_id\` int NOT NULL, \`category_id\` int NOT NULL, INDEX \`IDX_4e845aafeb0bda6eb2016d17cf\` (\`user_id\`), INDEX \`IDX_93e4b82612dd44e4288ff0b662\` (\`category_id\`), PRIMARY KEY (\`user_id\`, \`category_id\`)) ENGINE=InnoDB`,
108
+ );
109
+ await queryRunner.query(
110
+ `ALTER TABLE \`outshifter\`.\`subcategory\` ADD CONSTRAINT \`FK_23584d8b8d26287e4fca0e1aaab\` FOREIGN KEY (\`category_id\`) REFERENCES \`outshifter\`.\`category\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
111
+ );
112
+ await queryRunner.query(
113
+ `ALTER TABLE \`outshifter\`.\`card_registration\` ADD CONSTRAINT \`FK_fc69ffcad90889cf50bac7a1e4f\` FOREIGN KEY (\`user_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
114
+ );
115
+ await queryRunner.query(
116
+ `ALTER TABLE \`outshifter\`.\`flat_rate_country\` ADD CONSTRAINT \`FK_2d5acae96bbd94943242b0ade78\` FOREIGN KEY (\`flat_rate_id\`) REFERENCES \`outshifter\`.\`flat_rate\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
117
+ );
118
+ await queryRunner.query(
119
+ `ALTER TABLE \`outshifter\`.\`woo_connection\` ADD CONSTRAINT \`FK_c61b68995acf5a1a32f2c601759\` FOREIGN KEY (\`user_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
120
+ );
121
+ await queryRunner.query(
122
+ `ALTER TABLE \`outshifter\`.\`shopify_connection\` ADD CONSTRAINT \`FK_9499974cf522429803e172a6276\` FOREIGN KEY (\`reseller_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
123
+ );
124
+ await queryRunner.query(
125
+ `ALTER TABLE \`outshifter\`.\`shopify_connection\` ADD CONSTRAINT \`FK_98158a497be5c13a12fad50554a\` FOREIGN KEY (\`supplier_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
126
+ );
127
+ await queryRunner.query(
128
+ `ALTER TABLE \`outshifter\`.\`option\` ADD CONSTRAINT \`FK_590a423d166a34b781205bb0a0d\` FOREIGN KEY (\`product_id\`) REFERENCES \`outshifter\`.\`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
129
+ );
130
+ await queryRunner.query(
131
+ `ALTER TABLE \`outshifter\`.\`image\` ADD CONSTRAINT \`FK_e6a9e829e17fc47fc17d695af8e\` FOREIGN KEY (\`product_id\`) REFERENCES \`outshifter\`.\`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
132
+ );
133
+ await queryRunner.query(
134
+ `ALTER TABLE \`outshifter\`.\`variant\` ADD CONSTRAINT \`FK_738bfa62f918ad1436cb5c8ee5b\` FOREIGN KEY (\`product_id\`) REFERENCES \`outshifter\`.\`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
135
+ );
136
+ await queryRunner.query(
137
+ `ALTER TABLE \`outshifter\`.\`request\` ADD CONSTRAINT \`FK_5ae23b096b55625fdc81d591950\` FOREIGN KEY (\`sender_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
138
+ );
139
+ await queryRunner.query(
140
+ `ALTER TABLE \`outshifter\`.\`request\` ADD CONSTRAINT \`FK_eaf97ef4b8eac5e7caf9194446e\` FOREIGN KEY (\`receiver_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
141
+ );
142
+ await queryRunner.query(
143
+ `ALTER TABLE \`outshifter\`.\`imported_product\` ADD CONSTRAINT \`FK_eee5363eb038cf4269ac62d200c\` FOREIGN KEY (\`user_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
144
+ );
145
+ await queryRunner.query(
146
+ `ALTER TABLE \`outshifter\`.\`imported_product\` ADD CONSTRAINT \`FK_c5357bb33e051013aa1365f7220\` FOREIGN KEY (\`product_id\`) REFERENCES \`outshifter\`.\`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
147
+ );
148
+ await queryRunner.query(
149
+ `ALTER TABLE \`outshifter\`.\`order_item\` ADD CONSTRAINT \`FK_5e17c017aa3f5164cb2da5b1c6b\` FOREIGN KEY (\`product_id\`) REFERENCES \`outshifter\`.\`product\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
150
+ );
151
+ await queryRunner.query(
152
+ `ALTER TABLE \`outshifter\`.\`order_item\` ADD CONSTRAINT \`FK_0b750a32c016e66eea041057138\` FOREIGN KEY (\`order_tracking_id\`) REFERENCES \`outshifter\`.\`order_tracking\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
153
+ );
154
+ await queryRunner.query(
155
+ `ALTER TABLE \`outshifter\`.\`order_item\` ADD CONSTRAINT \`FK_7342435b0fa4957e39f809a2cb6\` FOREIGN KEY (\`supplier_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
156
+ );
157
+ await queryRunner.query(
158
+ `ALTER TABLE \`outshifter\`.\`order_item\` ADD CONSTRAINT \`FK_e9674a6053adbaa1057848cddfa\` FOREIGN KEY (\`order_id\`) REFERENCES \`outshifter\`.\`order\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
159
+ );
160
+ await queryRunner.query(
161
+ `ALTER TABLE \`outshifter\`.\`order_item\` ADD CONSTRAINT \`FK_1e106723258bd677ee40719d812\` FOREIGN KEY (\`payment_shopify_id\`) REFERENCES \`outshifter\`.\`payment_shopify\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
162
+ );
163
+ await queryRunner.query(
164
+ `ALTER TABLE \`outshifter\`.\`order_shipping\` ADD CONSTRAINT \`FK_b4a21d5bd902c38f79c019fbe99\` FOREIGN KEY (\`order_id\`) REFERENCES \`outshifter\`.\`order\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
165
+ );
166
+ await queryRunner.query(
167
+ `ALTER TABLE \`outshifter\`.\`order\` ADD CONSTRAINT \`FK_8a8045e1e17ebc98c4c7918bf99\` FOREIGN KEY (\`reseller_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
168
+ );
169
+ await queryRunner.query(
170
+ `ALTER TABLE \`outshifter\`.\`order_tracking\` ADD CONSTRAINT \`FK_c1e2051fba9bdbb70641cd90ea4\` FOREIGN KEY (\`order_id\`) REFERENCES \`outshifter\`.\`order\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
171
+ );
172
+ await queryRunner.query(
173
+ `ALTER TABLE \`outshifter\`.\`product\` ADD CONSTRAINT \`FK_3e59a34134d840e83c2010fac9a\` FOREIGN KEY (\`user_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
174
+ );
175
+ await queryRunner.query(
176
+ `ALTER TABLE \`outshifter\`.\`product\` ADD CONSTRAINT \`FK_be9d7736b967abed111e114f058\` FOREIGN KEY (\`flat_rate_id\`) REFERENCES \`outshifter\`.\`flat_rate\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
177
+ );
178
+ await queryRunner.query(
179
+ `ALTER TABLE \`outshifter\`.\`notification\` ADD CONSTRAINT \`FK_928b7aa1754e08e1ed7052cb9d8\` FOREIGN KEY (\`user_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
180
+ );
181
+ await queryRunner.query(
182
+ `ALTER TABLE \`outshifter\`.\`payment\` ADD CONSTRAINT \`FK_3949a14868d836aa1776f5cadcf\` FOREIGN KEY (\`author_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
183
+ );
184
+ await queryRunner.query(
185
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_5a4bd96d9a519d4d20a21231b9f\` FOREIGN KEY (\`business_id\`) REFERENCES \`outshifter\`.\`business\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
186
+ );
187
+ await queryRunner.query(
188
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_371bf8739470035e4b540b798a4\` FOREIGN KEY (\`card_registration_id\`) REFERENCES \`outshifter\`.\`card_registration\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
189
+ );
190
+ await queryRunner.query(
191
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_080d426b06188408bc1cc508c84\` FOREIGN KEY (\`bank_account_id\`) REFERENCES \`outshifter\`.\`bank_account\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
192
+ );
193
+ await queryRunner.query(
194
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_b453ec3d9d579f6b9699be98beb\` FOREIGN KEY (\`wallet_id\`) REFERENCES \`outshifter\`.\`wallet\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
195
+ );
196
+ await queryRunner.query(
197
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_306ce5e598064be83a4f9711acf\` FOREIGN KEY (\`courier_id\`) REFERENCES \`outshifter\`.\`courier\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
198
+ );
199
+ await queryRunner.query(
200
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_a222a4249313cf0c934a55e038f\` FOREIGN KEY (\`flat_rate_id\`) REFERENCES \`outshifter\`.\`flat_rate\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
201
+ );
202
+ await queryRunner.query(
203
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_c9bd34a984ea3ad2570defd876a\` FOREIGN KEY (\`woo_id\`) REFERENCES \`outshifter\`.\`woo_connection\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
204
+ );
205
+ await queryRunner.query(
206
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_30e7578021099b78aa332a49ceb\` FOREIGN KEY (\`shopify_reseller_id\`) REFERENCES \`outshifter\`.\`shopify_connection\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
207
+ );
208
+ await queryRunner.query(
209
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_bb09b5baeed0eff98b89cb1ff57\` FOREIGN KEY (\`shopify_supplier_id\`) REFERENCES \`outshifter\`.\`shopify_connection\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
210
+ );
211
+ await queryRunner.query(
212
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_286146c9e2b7b7e053305bebb33\` FOREIGN KEY (\`shipping_package_id\`) REFERENCES \`outshifter\`.\`shipping_package\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
213
+ );
214
+ await queryRunner.query(
215
+ `ALTER TABLE \`outshifter\`.\`api_credential\` ADD CONSTRAINT \`FK_5b1bb2beee236dffec39bfd0aab\` FOREIGN KEY (\`user_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
216
+ );
217
+ await queryRunner.query(
218
+ `ALTER TABLE \`outshifter\`.\`product_subcategories_subcategory\` ADD CONSTRAINT \`FK_b45925f896a21830a6a186aff27\` FOREIGN KEY (\`product_id\`) REFERENCES \`outshifter\`.\`product\`(\`id\`) ON DELETE CASCADE ON UPDATE CASCADE`,
219
+ );
220
+ await queryRunner.query(
221
+ `ALTER TABLE \`outshifter\`.\`product_subcategories_subcategory\` ADD CONSTRAINT \`FK_040b74263cc7e908b421a5205bb\` FOREIGN KEY (\`subcategory_id\`) REFERENCES \`outshifter\`.\`subcategory\`(\`id\`) ON DELETE CASCADE ON UPDATE CASCADE`,
222
+ );
223
+ await queryRunner.query(
224
+ `ALTER TABLE \`outshifter\`.\`product_channels_channel\` ADD CONSTRAINT \`FK_07e15b0eb640ff6072219afa73c\` FOREIGN KEY (\`product_id\`) REFERENCES \`outshifter\`.\`product\`(\`id\`) ON DELETE CASCADE ON UPDATE CASCADE`,
225
+ );
226
+ await queryRunner.query(
227
+ `ALTER TABLE \`outshifter\`.\`product_channels_channel\` ADD CONSTRAINT \`FK_396113fa3b66d9aa5abbaa402d6\` FOREIGN KEY (\`channel_id\`) REFERENCES \`outshifter\`.\`channel\`(\`id\`) ON DELETE CASCADE ON UPDATE CASCADE`,
228
+ );
229
+ await queryRunner.query(
230
+ `ALTER TABLE \`outshifter\`.\`user_categories_category\` ADD CONSTRAINT \`FK_4e845aafeb0bda6eb2016d17cfd\` FOREIGN KEY (\`user_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE CASCADE ON UPDATE CASCADE`,
231
+ );
232
+ await queryRunner.query(
233
+ `ALTER TABLE \`outshifter\`.\`user_categories_category\` ADD CONSTRAINT \`FK_93e4b82612dd44e4288ff0b662c\` FOREIGN KEY (\`category_id\`) REFERENCES \`outshifter\`.\`category\`(\`id\`) ON DELETE CASCADE ON UPDATE CASCADE`,
234
+ );
235
+ }
236
+
237
+ public async down(queryRunner: QueryRunner): Promise<void> {
238
+ await queryRunner.query(
239
+ `ALTER TABLE \`outshifter\`.\`user_categories_category\` DROP FOREIGN KEY \`FK_93e4b82612dd44e4288ff0b662c\``,
240
+ );
241
+ await queryRunner.query(
242
+ `ALTER TABLE \`outshifter\`.\`user_categories_category\` DROP FOREIGN KEY \`FK_4e845aafeb0bda6eb2016d17cfd\``,
243
+ );
244
+ await queryRunner.query(
245
+ `ALTER TABLE \`outshifter\`.\`product_channels_channel\` DROP FOREIGN KEY \`FK_396113fa3b66d9aa5abbaa402d6\``,
246
+ );
247
+ await queryRunner.query(
248
+ `ALTER TABLE \`outshifter\`.\`product_channels_channel\` DROP FOREIGN KEY \`FK_07e15b0eb640ff6072219afa73c\``,
249
+ );
250
+ await queryRunner.query(
251
+ `ALTER TABLE \`outshifter\`.\`product_subcategories_subcategory\` DROP FOREIGN KEY \`FK_040b74263cc7e908b421a5205bb\``,
252
+ );
253
+ await queryRunner.query(
254
+ `ALTER TABLE \`outshifter\`.\`product_subcategories_subcategory\` DROP FOREIGN KEY \`FK_b45925f896a21830a6a186aff27\``,
255
+ );
256
+ await queryRunner.query(
257
+ `ALTER TABLE \`outshifter\`.\`api_credential\` DROP FOREIGN KEY \`FK_5b1bb2beee236dffec39bfd0aab\``,
258
+ );
259
+ await queryRunner.query(
260
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_286146c9e2b7b7e053305bebb33\``,
261
+ );
262
+ await queryRunner.query(
263
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_bb09b5baeed0eff98b89cb1ff57\``,
264
+ );
265
+ await queryRunner.query(
266
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_30e7578021099b78aa332a49ceb\``,
267
+ );
268
+ await queryRunner.query(
269
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_c9bd34a984ea3ad2570defd876a\``,
270
+ );
271
+ await queryRunner.query(
272
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_a222a4249313cf0c934a55e038f\``,
273
+ );
274
+ await queryRunner.query(
275
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_306ce5e598064be83a4f9711acf\``,
276
+ );
277
+ await queryRunner.query(
278
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_b453ec3d9d579f6b9699be98beb\``,
279
+ );
280
+ await queryRunner.query(
281
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_080d426b06188408bc1cc508c84\``,
282
+ );
283
+ await queryRunner.query(
284
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_371bf8739470035e4b540b798a4\``,
285
+ );
286
+ await queryRunner.query(
287
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_5a4bd96d9a519d4d20a21231b9f\``,
288
+ );
289
+ await queryRunner.query(
290
+ `ALTER TABLE \`outshifter\`.\`payment\` DROP FOREIGN KEY \`FK_3949a14868d836aa1776f5cadcf\``,
291
+ );
292
+ await queryRunner.query(
293
+ `ALTER TABLE \`outshifter\`.\`notification\` DROP FOREIGN KEY \`FK_928b7aa1754e08e1ed7052cb9d8\``,
294
+ );
295
+ await queryRunner.query(
296
+ `ALTER TABLE \`outshifter\`.\`product\` DROP FOREIGN KEY \`FK_be9d7736b967abed111e114f058\``,
297
+ );
298
+ await queryRunner.query(
299
+ `ALTER TABLE \`outshifter\`.\`product\` DROP FOREIGN KEY \`FK_3e59a34134d840e83c2010fac9a\``,
300
+ );
301
+ await queryRunner.query(
302
+ `ALTER TABLE \`outshifter\`.\`order_tracking\` DROP FOREIGN KEY \`FK_c1e2051fba9bdbb70641cd90ea4\``,
303
+ );
304
+ await queryRunner.query(
305
+ `ALTER TABLE \`outshifter\`.\`order\` DROP FOREIGN KEY \`FK_8a8045e1e17ebc98c4c7918bf99\``,
306
+ );
307
+ await queryRunner.query(
308
+ `ALTER TABLE \`outshifter\`.\`order_shipping\` DROP FOREIGN KEY \`FK_b4a21d5bd902c38f79c019fbe99\``,
309
+ );
310
+ await queryRunner.query(
311
+ `ALTER TABLE \`outshifter\`.\`order_item\` DROP FOREIGN KEY \`FK_1e106723258bd677ee40719d812\``,
312
+ );
313
+ await queryRunner.query(
314
+ `ALTER TABLE \`outshifter\`.\`order_item\` DROP FOREIGN KEY \`FK_e9674a6053adbaa1057848cddfa\``,
315
+ );
316
+ await queryRunner.query(
317
+ `ALTER TABLE \`outshifter\`.\`order_item\` DROP FOREIGN KEY \`FK_7342435b0fa4957e39f809a2cb6\``,
318
+ );
319
+ await queryRunner.query(
320
+ `ALTER TABLE \`outshifter\`.\`order_item\` DROP FOREIGN KEY \`FK_0b750a32c016e66eea041057138\``,
321
+ );
322
+ await queryRunner.query(
323
+ `ALTER TABLE \`outshifter\`.\`order_item\` DROP FOREIGN KEY \`FK_5e17c017aa3f5164cb2da5b1c6b\``,
324
+ );
325
+ await queryRunner.query(
326
+ `ALTER TABLE \`outshifter\`.\`imported_product\` DROP FOREIGN KEY \`FK_c5357bb33e051013aa1365f7220\``,
327
+ );
328
+ await queryRunner.query(
329
+ `ALTER TABLE \`outshifter\`.\`imported_product\` DROP FOREIGN KEY \`FK_eee5363eb038cf4269ac62d200c\``,
330
+ );
331
+ await queryRunner.query(
332
+ `ALTER TABLE \`outshifter\`.\`request\` DROP FOREIGN KEY \`FK_eaf97ef4b8eac5e7caf9194446e\``,
333
+ );
334
+ await queryRunner.query(
335
+ `ALTER TABLE \`outshifter\`.\`request\` DROP FOREIGN KEY \`FK_5ae23b096b55625fdc81d591950\``,
336
+ );
337
+ await queryRunner.query(
338
+ `ALTER TABLE \`outshifter\`.\`variant\` DROP FOREIGN KEY \`FK_738bfa62f918ad1436cb5c8ee5b\``,
339
+ );
340
+ await queryRunner.query(
341
+ `ALTER TABLE \`outshifter\`.\`image\` DROP FOREIGN KEY \`FK_e6a9e829e17fc47fc17d695af8e\``,
342
+ );
343
+ await queryRunner.query(
344
+ `ALTER TABLE \`outshifter\`.\`option\` DROP FOREIGN KEY \`FK_590a423d166a34b781205bb0a0d\``,
345
+ );
346
+ await queryRunner.query(
347
+ `ALTER TABLE \`outshifter\`.\`shopify_connection\` DROP FOREIGN KEY \`FK_98158a497be5c13a12fad50554a\``,
348
+ );
349
+ await queryRunner.query(
350
+ `ALTER TABLE \`outshifter\`.\`shopify_connection\` DROP FOREIGN KEY \`FK_9499974cf522429803e172a6276\``,
351
+ );
352
+ await queryRunner.query(
353
+ `ALTER TABLE \`outshifter\`.\`woo_connection\` DROP FOREIGN KEY \`FK_c61b68995acf5a1a32f2c601759\``,
354
+ );
355
+ await queryRunner.query(
356
+ `ALTER TABLE \`outshifter\`.\`flat_rate_country\` DROP FOREIGN KEY \`FK_2d5acae96bbd94943242b0ade78\``,
357
+ );
358
+ await queryRunner.query(
359
+ `ALTER TABLE \`outshifter\`.\`card_registration\` DROP FOREIGN KEY \`FK_fc69ffcad90889cf50bac7a1e4f\``,
360
+ );
361
+ await queryRunner.query(
362
+ `ALTER TABLE \`outshifter\`.\`subcategory\` DROP FOREIGN KEY \`FK_23584d8b8d26287e4fca0e1aaab\``,
363
+ );
364
+ await queryRunner.query(
365
+ `DROP INDEX \`IDX_93e4b82612dd44e4288ff0b662\` ON \`outshifter\`.\`user_categories_category\``,
366
+ );
367
+ await queryRunner.query(
368
+ `DROP INDEX \`IDX_4e845aafeb0bda6eb2016d17cf\` ON \`outshifter\`.\`user_categories_category\``,
369
+ );
370
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`user_categories_category\``);
371
+ await queryRunner.query(
372
+ `DROP INDEX \`IDX_396113fa3b66d9aa5abbaa402d\` ON \`outshifter\`.\`product_channels_channel\``,
373
+ );
374
+ await queryRunner.query(
375
+ `DROP INDEX \`IDX_07e15b0eb640ff6072219afa73\` ON \`outshifter\`.\`product_channels_channel\``,
376
+ );
377
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`product_channels_channel\``);
378
+ await queryRunner.query(
379
+ `DROP INDEX \`IDX_040b74263cc7e908b421a5205b\` ON \`outshifter\`.\`product_subcategories_subcategory\``,
380
+ );
381
+ await queryRunner.query(
382
+ `DROP INDEX \`IDX_b45925f896a21830a6a186aff2\` ON \`outshifter\`.\`product_subcategories_subcategory\``,
383
+ );
384
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`product_subcategories_subcategory\``);
385
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`api_credential\``);
386
+ await queryRunner.query(
387
+ `DROP INDEX \`REL_286146c9e2b7b7e053305bebb3\` ON \`outshifter\`.\`user\``,
388
+ );
389
+ await queryRunner.query(
390
+ `DROP INDEX \`REL_bb09b5baeed0eff98b89cb1ff5\` ON \`outshifter\`.\`user\``,
391
+ );
392
+ await queryRunner.query(
393
+ `DROP INDEX \`REL_30e7578021099b78aa332a49ce\` ON \`outshifter\`.\`user\``,
394
+ );
395
+ await queryRunner.query(
396
+ `DROP INDEX \`REL_c9bd34a984ea3ad2570defd876\` ON \`outshifter\`.\`user\``,
397
+ );
398
+ await queryRunner.query(
399
+ `DROP INDEX \`REL_a222a4249313cf0c934a55e038\` ON \`outshifter\`.\`user\``,
400
+ );
401
+ await queryRunner.query(
402
+ `DROP INDEX \`REL_306ce5e598064be83a4f9711ac\` ON \`outshifter\`.\`user\``,
403
+ );
404
+ await queryRunner.query(
405
+ `DROP INDEX \`REL_b453ec3d9d579f6b9699be98be\` ON \`outshifter\`.\`user\``,
406
+ );
407
+ await queryRunner.query(
408
+ `DROP INDEX \`REL_080d426b06188408bc1cc508c8\` ON \`outshifter\`.\`user\``,
409
+ );
410
+ await queryRunner.query(
411
+ `DROP INDEX \`REL_371bf8739470035e4b540b798a\` ON \`outshifter\`.\`user\``,
412
+ );
413
+ await queryRunner.query(
414
+ `DROP INDEX \`REL_5a4bd96d9a519d4d20a21231b9\` ON \`outshifter\`.\`user\``,
415
+ );
416
+ await queryRunner.query(
417
+ `DROP INDEX \`IDX_df955cae05f17b2bcf5045cc02\` ON \`outshifter\`.\`user\``,
418
+ );
419
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`user\``);
420
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`payment\``);
421
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`notification\``);
422
+ await queryRunner.query(
423
+ `DROP INDEX \`REL_be9d7736b967abed111e114f05\` ON \`outshifter\`.\`product\``,
424
+ );
425
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`product\``);
426
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`metric_active_user\``);
427
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`checkout_metadata\``);
428
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`order_tracking\``);
429
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`order\``);
430
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`order_shipping\``);
431
+ await queryRunner.query(
432
+ `DROP INDEX \`REL_1e106723258bd677ee40719d81\` ON \`outshifter\`.\`order_item\``,
433
+ );
434
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`order_item\``);
435
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`payment_shopify\``);
436
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`imported_product\``);
437
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`request\``);
438
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`variant\``);
439
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`image\``);
440
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`option\``);
441
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`channel\``);
442
+ await queryRunner.query(
443
+ `DROP INDEX \`IDX_8ff4c23dc9a3f3856555bd8618\` ON \`outshifter\`.\`country\``,
444
+ );
445
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`country\``);
446
+ await queryRunner.query(
447
+ `DROP INDEX \`REL_98158a497be5c13a12fad50554\` ON \`outshifter\`.\`shopify_connection\``,
448
+ );
449
+ await queryRunner.query(
450
+ `DROP INDEX \`REL_9499974cf522429803e172a627\` ON \`outshifter\`.\`shopify_connection\``,
451
+ );
452
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`shopify_connection\``);
453
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`business\``);
454
+ await queryRunner.query(
455
+ `DROP INDEX \`REL_c61b68995acf5a1a32f2c60175\` ON \`outshifter\`.\`woo_connection\``,
456
+ );
457
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`woo_connection\``);
458
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`shipping_package\``);
459
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`flat_rate\``);
460
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`flat_rate_country\``);
461
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`courier\``);
462
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`wallet\``);
463
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`bank_account\``);
464
+ await queryRunner.query(
465
+ `DROP INDEX \`REL_fc69ffcad90889cf50bac7a1e4\` ON \`outshifter\`.\`card_registration\``,
466
+ );
467
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`card_registration\``);
468
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`category\``);
469
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`subcategory\``);
470
+ }
471
+ }
@@ -0,0 +1,79 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+
3
+ export class RemoveMangopay1630077596132 implements MigrationInterface {
4
+ name = 'RemoveMangopay1630077596132';
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_080d426b06188408bc1cc508c84\``,
9
+ );
10
+ await queryRunner.query(
11
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_371bf8739470035e4b540b798a4\``,
12
+ );
13
+ await queryRunner.query(
14
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_b453ec3d9d579f6b9699be98beb\``,
15
+ );
16
+ await queryRunner.query(
17
+ `ALTER TABLE \`outshifter\`.\`card_registration\` DROP FOREIGN KEY \`FK_fc69ffcad90889cf50bac7a1e4f\``,
18
+ );
19
+ await queryRunner.query(
20
+ `DROP INDEX \`REL_371bf8739470035e4b540b798a\` ON \`outshifter\`.\`user\``,
21
+ );
22
+ await queryRunner.query(
23
+ `DROP INDEX \`REL_080d426b06188408bc1cc508c8\` ON \`outshifter\`.\`user\``,
24
+ );
25
+ await queryRunner.query(
26
+ `DROP INDEX \`REL_b453ec3d9d579f6b9699be98be\` ON \`outshifter\`.\`user\``,
27
+ );
28
+ await queryRunner.query(
29
+ `DROP INDEX \`REL_fc69ffcad90889cf50bac7a1e4\` ON \`outshifter\`.\`card_registration\``,
30
+ );
31
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`user\` DROP COLUMN \`mangopay_id\``);
32
+ await queryRunner.query(
33
+ `ALTER TABLE \`outshifter\`.\`user\` DROP COLUMN \`card_registration_id\``,
34
+ );
35
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`user\` DROP COLUMN \`bank_account_id\``);
36
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`user\` DROP COLUMN \`wallet_id\``);
37
+ await queryRunner.query(
38
+ `ALTER TABLE \`outshifter\`.\`card_registration\` DROP COLUMN \`user_id\``,
39
+ );
40
+ }
41
+
42
+ public async down(queryRunner: QueryRunner): Promise<void> {
43
+ await queryRunner.query(
44
+ `ALTER TABLE \`outshifter\`.\`card_registration\` ADD \`user_id\` int NULL`,
45
+ );
46
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`user\` ADD \`wallet_id\` int NULL`);
47
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`user\` ADD \`bank_account_id\` int NULL`);
48
+ await queryRunner.query(
49
+ `ALTER TABLE \`outshifter\`.\`user\` ADD \`card_registration_id\` int NULL`,
50
+ );
51
+ await queryRunner.query(
52
+ `ALTER TABLE \`outshifter\`.\`user\` ADD \`mangopay_id\` varchar(255) NULL`,
53
+ );
54
+ await queryRunner.query(
55
+ `CREATE UNIQUE INDEX \`REL_fc69ffcad90889cf50bac7a1e4\` ON \`outshifter\`.\`card_registration\` (\`user_id\`)`,
56
+ );
57
+ await queryRunner.query(
58
+ `CREATE UNIQUE INDEX \`REL_b453ec3d9d579f6b9699be98be\` ON \`outshifter\`.\`user\` (\`wallet_id\`)`,
59
+ );
60
+ await queryRunner.query(
61
+ `CREATE UNIQUE INDEX \`REL_080d426b06188408bc1cc508c8\` ON \`outshifter\`.\`user\` (\`bank_account_id\`)`,
62
+ );
63
+ await queryRunner.query(
64
+ `CREATE UNIQUE INDEX \`REL_371bf8739470035e4b540b798a\` ON \`outshifter\`.\`user\` (\`card_registration_id\`)`,
65
+ );
66
+ await queryRunner.query(
67
+ `ALTER TABLE \`outshifter\`.\`card_registration\` ADD CONSTRAINT \`FK_fc69ffcad90889cf50bac7a1e4f\` FOREIGN KEY (\`user_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
68
+ );
69
+ await queryRunner.query(
70
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_b453ec3d9d579f6b9699be98beb\` FOREIGN KEY (\`wallet_id\`) REFERENCES \`outshifter\`.\`wallet\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
71
+ );
72
+ await queryRunner.query(
73
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_371bf8739470035e4b540b798a4\` FOREIGN KEY (\`card_registration_id\`) REFERENCES \`outshifter\`.\`card_registration\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
74
+ );
75
+ await queryRunner.query(
76
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_080d426b06188408bc1cc508c84\` FOREIGN KEY (\`bank_account_id\`) REFERENCES \`outshifter\`.\`bank_account\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
77
+ );
78
+ }
79
+ }
@@ -0,0 +1,50 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+
3
+ export class MagentoIntegration1633444449026 implements MigrationInterface {
4
+ name = 'MagentoIntegration1633444449026';
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `CREATE TABLE \`outshifter\`.\`magento_connection\` (\`id\` int NOT NULL AUTO_INCREMENT, \`imported_products\` tinyint NOT NULL DEFAULT 0, \`active\` tinyint NOT NULL DEFAULT 0, \`consumer_key\` varchar(255) NOT NULL, \`consumer_secret\` varchar(255) NOT NULL, \`url\` varchar(255) NOT NULL, \`access_token\` varchar(255) NULL, \`token_secret\` varchar(255) NULL, \`currency\` varchar(255) NULL, \`user_id\` int NULL, UNIQUE INDEX \`REL_28d5bb57bf4cfd4c6b07f1cb2a\` (\`user_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
9
+ );
10
+ await queryRunner.query(
11
+ `ALTER TABLE \`outshifter\`.\`order_item\` ADD \`supplier_external_order_id\` varchar(255) NULL`,
12
+ );
13
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`user\` ADD \`magento_id\` int NULL`);
14
+ await queryRunner.query(
15
+ `ALTER TABLE \`outshifter\`.\`user\` ADD UNIQUE INDEX \`IDX_6ffc42dde34a3e7f420ad2a3bd\` (\`magento_id\`)`,
16
+ );
17
+ await queryRunner.query(
18
+ `CREATE UNIQUE INDEX \`REL_6ffc42dde34a3e7f420ad2a3bd\` ON \`outshifter\`.\`user\` (\`magento_id\`)`,
19
+ );
20
+ await queryRunner.query(
21
+ `ALTER TABLE \`outshifter\`.\`magento_connection\` ADD CONSTRAINT \`FK_28d5bb57bf4cfd4c6b07f1cb2a0\` FOREIGN KEY (\`user_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
22
+ );
23
+ await queryRunner.query(
24
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_6ffc42dde34a3e7f420ad2a3bdf\` FOREIGN KEY (\`magento_id\`) REFERENCES \`outshifter\`.\`magento_connection\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
25
+ );
26
+ }
27
+
28
+ public async down(queryRunner: QueryRunner): Promise<void> {
29
+ await queryRunner.query(
30
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_6ffc42dde34a3e7f420ad2a3bdf\``,
31
+ );
32
+ await queryRunner.query(
33
+ `ALTER TABLE \`outshifter\`.\`magento_connection\` DROP FOREIGN KEY \`FK_28d5bb57bf4cfd4c6b07f1cb2a0\``,
34
+ );
35
+ await queryRunner.query(
36
+ `DROP INDEX \`REL_6ffc42dde34a3e7f420ad2a3bd\` ON \`outshifter\`.\`user\``,
37
+ );
38
+ await queryRunner.query(
39
+ `ALTER TABLE \`outshifter\`.\`user\` DROP INDEX \`IDX_6ffc42dde34a3e7f420ad2a3bd\``,
40
+ );
41
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`user\` DROP COLUMN \`magento_id\``);
42
+ await queryRunner.query(
43
+ `ALTER TABLE \`outshifter\`.\`order_item\` DROP COLUMN \`supplier_external_order_id\``,
44
+ );
45
+ await queryRunner.query(
46
+ `DROP INDEX \`REL_28d5bb57bf4cfd4c6b07f1cb2a\` ON \`outshifter\`.\`magento_connection\``,
47
+ );
48
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`magento_connection\``);
49
+ }
50
+ }
@@ -0,0 +1,23 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+
3
+ export class MagentoIntegrationExternalChannelOrder1634070448072 implements MigrationInterface {
4
+ name = 'MagentoIntegrationExternalChannelOrder1634070448072';
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `DROP INDEX \`IDX_6ffc42dde34a3e7f420ad2a3bd\` ON \`outshifter\`.\`user\``,
9
+ );
10
+ await queryRunner.query(
11
+ `ALTER TABLE \`outshifter\`.\`order_item\` ADD \`supplier_external_order_channel\` varchar(255) NULL`,
12
+ );
13
+ }
14
+
15
+ public async down(queryRunner: QueryRunner): Promise<void> {
16
+ await queryRunner.query(
17
+ `ALTER TABLE \`outshifter\`.\`order_item\` DROP COLUMN \`supplier_external_order_channel\``,
18
+ );
19
+ await queryRunner.query(
20
+ `CREATE UNIQUE INDEX \`IDX_6ffc42dde34a3e7f420ad2a3bd\` ON \`outshifter\`.\`user\` (\`magento_id\`)`,
21
+ );
22
+ }
23
+ }