@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,13 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+
3
+ export class SSCCOrderGenerator1635811861541 implements MigrationInterface {
4
+ name = 'SSCCOrderGenerator1635811861541';
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`order\` ADD \`sscc\` varchar(255) NULL`);
8
+ }
9
+
10
+ public async down(queryRunner: QueryRunner): Promise<void> {
11
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`order\` DROP COLUMN \`sscc\``);
12
+ }
13
+ }
@@ -0,0 +1,59 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+
3
+ export class RolesFeature1638447028594 implements MigrationInterface {
4
+ name = 'RolesFeature1638447028594';
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `CREATE TABLE \`outshifter\`.\`permission\` (\`id_permission\` int NOT NULL AUTO_INCREMENT, \`permission\` varchar(255) NOT NULL, \`active_permission\` tinyint NOT NULL DEFAULT 1, PRIMARY KEY (\`id_permission\`)) ENGINE=InnoDB`,
9
+ );
10
+ await queryRunner.query(
11
+ `CREATE TABLE \`outshifter\`.\`role_permission\` (\`id_role_permission\` int NOT NULL AUTO_INCREMENT, \`active_role_permission\` tinyint NOT NULL DEFAULT 1, \`permission_id_permission\` int NOT NULL, \`role_id_role\` int NOT NULL, PRIMARY KEY (\`id_role_permission\`)) ENGINE=InnoDB`,
12
+ );
13
+ await queryRunner.query(
14
+ `CREATE TABLE \`outshifter\`.\`role\` (\`id_role\` int NOT NULL AUTO_INCREMENT, \`role\` varchar(255) NOT NULL, \`active_role\` tinyint NOT NULL DEFAULT 1, PRIMARY KEY (\`id_role\`)) ENGINE=InnoDB`,
15
+ );
16
+ await queryRunner.query(
17
+ `CREATE TABLE \`outshifter\`.\`user_role\` (\`id_user_role\` int NOT NULL AUTO_INCREMENT, \`active_user_role\` tinyint NOT NULL DEFAULT 1, \`user_id\` int NOT NULL, \`role_id_role\` int NOT NULL, PRIMARY KEY (\`id_user_role\`)) ENGINE=InnoDB`,
18
+ );
19
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`user\` DROP COLUMN \`is_admin\``);
20
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`user\` DROP COLUMN \`is_supplier\``);
21
+ await queryRunner.query(
22
+ `ALTER TABLE \`outshifter\`.\`role_permission\` ADD CONSTRAINT \`FK_ad50ca0ec7622997cd8c823d586\` FOREIGN KEY (\`permission_id_permission\`) REFERENCES \`outshifter\`.\`permission\`(\`id_permission\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
23
+ );
24
+ await queryRunner.query(
25
+ `ALTER TABLE \`outshifter\`.\`role_permission\` ADD CONSTRAINT \`FK_965aa5d8d65340250e91bc8b543\` FOREIGN KEY (\`role_id_role\`) REFERENCES \`outshifter\`.\`role\`(\`id_role\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
26
+ );
27
+ await queryRunner.query(
28
+ `ALTER TABLE \`outshifter\`.\`user_role\` ADD CONSTRAINT \`FK_d0e5815877f7395a198a4cb0a46\` FOREIGN KEY (\`user_id\`) REFERENCES \`outshifter\`.\`user\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
29
+ );
30
+ await queryRunner.query(
31
+ `ALTER TABLE \`outshifter\`.\`user_role\` ADD CONSTRAINT \`FK_d1f7b185f34e551e5cc8db81fc3\` FOREIGN KEY (\`role_id_role\`) REFERENCES \`outshifter\`.\`role\`(\`id_role\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
32
+ );
33
+ }
34
+
35
+ public async down(queryRunner: QueryRunner): Promise<void> {
36
+ await queryRunner.query(
37
+ `ALTER TABLE \`outshifter\`.\`user_role\` DROP FOREIGN KEY \`FK_d1f7b185f34e551e5cc8db81fc3\``,
38
+ );
39
+ await queryRunner.query(
40
+ `ALTER TABLE \`outshifter\`.\`user_role\` DROP FOREIGN KEY \`FK_d0e5815877f7395a198a4cb0a46\``,
41
+ );
42
+ await queryRunner.query(
43
+ `ALTER TABLE \`outshifter\`.\`role_permission\` DROP FOREIGN KEY \`FK_965aa5d8d65340250e91bc8b543\``,
44
+ );
45
+ await queryRunner.query(
46
+ `ALTER TABLE \`outshifter\`.\`role_permission\` DROP FOREIGN KEY \`FK_ad50ca0ec7622997cd8c823d586\``,
47
+ );
48
+ await queryRunner.query(
49
+ `ALTER TABLE \`outshifter\`.\`user\` ADD \`is_supplier\` tinyint NOT NULL DEFAULT '0'`,
50
+ );
51
+ await queryRunner.query(
52
+ `ALTER TABLE \`outshifter\`.\`user\` ADD \`is_admin\` tinyint NOT NULL DEFAULT '0'`,
53
+ );
54
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`user_role\``);
55
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`role\``);
56
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`role_permission\``);
57
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`permission\``);
58
+ }
59
+ }
@@ -0,0 +1,31 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+
3
+ export class ProductCurrencyPrice1638493697631 implements MigrationInterface {
4
+ name = 'ProductCurrencyPrice1638493697631';
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `ALTER TABLE \`outshifter\`.\`variant\` ADD \`price_amount\` decimal(10,2) NULL`,
9
+ );
10
+ await queryRunner.query(
11
+ `ALTER TABLE \`outshifter\`.\`variant\` ADD \`price_currency_code\` varchar(255) NULL`,
12
+ );
13
+ await queryRunner.query(
14
+ `ALTER TABLE \`outshifter\`.\`product\` ADD \`price_amount\` decimal(10,2) NULL`,
15
+ );
16
+ await queryRunner.query(
17
+ `ALTER TABLE \`outshifter\`.\`product\` ADD \`price_currency_code\` varchar(255) NULL`,
18
+ );
19
+ }
20
+
21
+ public async down(queryRunner: QueryRunner): Promise<void> {
22
+ await queryRunner.query(
23
+ `ALTER TABLE \`outshifter\`.\`product\` DROP COLUMN \`price_currency_code\``,
24
+ );
25
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`product\` DROP COLUMN \`price_amount\``);
26
+ await queryRunner.query(
27
+ `ALTER TABLE \`outshifter\`.\`variant\` DROP COLUMN \`price_currency_code\``,
28
+ );
29
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`variant\` DROP COLUMN \`price_amount\``);
30
+ }
31
+ }
@@ -0,0 +1,27 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+
3
+ export class UpdateWooTrackingNumber1646797095632 implements MigrationInterface {
4
+ name = 'UpdateWooTrackingNumber1646797095632';
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `ALTER TABLE \`outshifter\`.\`order_tracking\` ADD \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)`,
9
+ );
10
+ await queryRunner.query(
11
+ `ALTER TABLE \`outshifter\`.\`order_tracking\` ADD \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)`,
12
+ );
13
+ await queryRunner.query(
14
+ `ALTER TABLE \`outshifter\`.\`order_tracking\` ADD \`slug\` varchar(255) NULL`,
15
+ );
16
+ }
17
+
18
+ public async down(queryRunner: QueryRunner): Promise<void> {
19
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`order_tracking\` DROP COLUMN \`slug\``);
20
+ await queryRunner.query(
21
+ `ALTER TABLE \`outshifter\`.\`order_tracking\` DROP COLUMN \`updated_at\``,
22
+ );
23
+ await queryRunner.query(
24
+ `ALTER TABLE \`outshifter\`.\`order_tracking\` DROP COLUMN \`created_at\``,
25
+ );
26
+ }
27
+ }
@@ -0,0 +1,35 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+
3
+ export class AddedUserSettings1648526519546 implements MigrationInterface {
4
+ name = 'AddedUserSettings1648526519546';
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `CREATE TABLE \`outshifter\`.\`user_settings\` (\`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, \`customer_notifications\` tinyint NOT NULL DEFAULT 1, \`outshifter_notifications\` tinyint NOT NULL DEFAULT 1, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
9
+ );
10
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`user\` ADD \`settings_id\` int NULL`);
11
+ await queryRunner.query(
12
+ `ALTER TABLE \`outshifter\`.\`user\` ADD UNIQUE INDEX \`IDX_00f004f5922a0744d174530d63\` (\`settings_id\`)`,
13
+ );
14
+ await queryRunner.query(
15
+ `CREATE UNIQUE INDEX \`REL_00f004f5922a0744d174530d63\` ON \`outshifter\`.\`user\` (\`settings_id\`)`,
16
+ );
17
+ await queryRunner.query(
18
+ `ALTER TABLE \`outshifter\`.\`user\` ADD CONSTRAINT \`FK_00f004f5922a0744d174530d639\` FOREIGN KEY (\`settings_id\`) REFERENCES \`outshifter\`.\`user_settings\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`,
19
+ );
20
+ }
21
+
22
+ public async down(queryRunner: QueryRunner): Promise<void> {
23
+ await queryRunner.query(
24
+ `ALTER TABLE \`outshifter\`.\`user\` DROP FOREIGN KEY \`FK_00f004f5922a0744d174530d639\``,
25
+ );
26
+ await queryRunner.query(
27
+ `DROP INDEX \`REL_00f004f5922a0744d174530d63\` ON \`outshifter\`.\`user\``,
28
+ );
29
+ await queryRunner.query(
30
+ `ALTER TABLE \`outshifter\`.\`user\` DROP INDEX \`IDX_00f004f5922a0744d174530d63\``,
31
+ );
32
+ await queryRunner.query(`ALTER TABLE \`outshifter\`.\`user\` DROP COLUMN \`settings_id\``);
33
+ await queryRunner.query(`DROP TABLE \`outshifter\`.\`user_settings\``);
34
+ }
35
+ }
@@ -0,0 +1,37 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class Wolt1651206194365 implements MigrationInterface {
4
+ name = 'Wolt1651206194365'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE \`subcategory\` DROP FOREIGN KEY \`FK_3fc84b9483bdd736f728dbf95b2\``);
8
+ await queryRunner.query(`ALTER TABLE \`user\` DROP FOREIGN KEY \`FK_00f004f5922a0744d174530d639\``);
9
+ await queryRunner.query(`DROP INDEX \`FK_3fc84b9483bdd736f728dbf95b2_idx\` ON \`subcategory\``);
10
+ await queryRunner.query(`DROP INDEX \`IDX_00f004f5922a0744d174530d63\` ON \`user\``);
11
+ await queryRunner.query(`DROP INDEX \`REL_00f004f5922a0744d174530d63\` ON \`user\``);
12
+ await queryRunner.query(`CREATE TABLE \`user_token_wolt\` (\`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, \`token\` varchar(255) NOT NULL, \`refresh_token\` varchar(255) NULL, \`user_id\` int NULL, UNIQUE INDEX \`REL_5c90af171a334aa59e5b20a55c\` (\`user_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
13
+ await queryRunner.query(`ALTER TABLE \`user\` DROP COLUMN \`settings_id\``);
14
+ await queryRunner.query(`ALTER TABLE \`order_tracking\` DROP COLUMN \`created_at\``);
15
+ await queryRunner.query(`ALTER TABLE \`order_tracking\` DROP COLUMN \`updated_at\``);
16
+ await queryRunner.query(`ALTER TABLE \`order_tracking\` DROP COLUMN \`slug\``);
17
+ await queryRunner.query(`ALTER TABLE \`subcategory\` ADD CONSTRAINT \`FK_23584d8b8d26287e4fca0e1aaab\` FOREIGN KEY (\`category_id\`) REFERENCES \`category\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
18
+ await queryRunner.query(`ALTER TABLE \`user_token_wolt\` ADD CONSTRAINT \`FK_5c90af171a334aa59e5b20a55c6\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
19
+ }
20
+
21
+ public async down(queryRunner: QueryRunner): Promise<void> {
22
+ await queryRunner.query(`ALTER TABLE \`user_token_wolt\` DROP FOREIGN KEY \`FK_5c90af171a334aa59e5b20a55c6\``);
23
+ await queryRunner.query(`ALTER TABLE \`subcategory\` DROP FOREIGN KEY \`FK_23584d8b8d26287e4fca0e1aaab\``);
24
+ await queryRunner.query(`ALTER TABLE \`order_tracking\` ADD \`slug\` varchar(255) CHARACTER SET "latin1" COLLATE "latin1_swedish_ci" NULL`);
25
+ await queryRunner.query(`ALTER TABLE \`order_tracking\` ADD \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)`);
26
+ await queryRunner.query(`ALTER TABLE \`order_tracking\` ADD \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)`);
27
+ await queryRunner.query(`ALTER TABLE \`user\` ADD \`settings_id\` int NULL`);
28
+ await queryRunner.query(`DROP INDEX \`REL_5c90af171a334aa59e5b20a55c\` ON \`user_token_wolt\``);
29
+ await queryRunner.query(`DROP TABLE \`user_token_wolt\``);
30
+ await queryRunner.query(`CREATE UNIQUE INDEX \`REL_00f004f5922a0744d174530d63\` ON \`user\` (\`settings_id\`)`);
31
+ await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_00f004f5922a0744d174530d63\` ON \`user\` (\`settings_id\`)`);
32
+ await queryRunner.query(`CREATE INDEX \`FK_3fc84b9483bdd736f728dbf95b2_idx\` ON \`subcategory\` (\`category_id\`)`);
33
+ await queryRunner.query(`ALTER TABLE \`user\` ADD CONSTRAINT \`FK_00f004f5922a0744d174530d639\` FOREIGN KEY (\`settings_id\`) REFERENCES \`user_settings\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
34
+ await queryRunner.query(`ALTER TABLE \`subcategory\` ADD CONSTRAINT \`FK_3fc84b9483bdd736f728dbf95b2\` FOREIGN KEY (\`category_id\`) REFERENCES \`category\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
35
+ }
36
+
37
+ }
@@ -0,0 +1,47 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class shopCart1663227133335 implements MigrationInterface {
4
+ name = 'shopCart1663227133335'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`CREATE TABLE \`payment_method\` (\`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), \`deleted_at\` datetime(6) NULL, \`id\` varchar(36) NOT NULL, \`active\` tinyint NOT NULL DEFAULT 0, \`options\` varchar(21844) NULL, \`user_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
8
+ await queryRunner.query(`CREATE TABLE \`price_data\` (\`id\` varchar(36) NOT NULL, \`unit_price\` decimal(10,2) NOT NULL DEFAULT '0.00', \`tax\` decimal(10,2) NOT NULL DEFAULT '0.00', \`currency\` varchar(255) NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
9
+ await queryRunner.query(`CREATE TABLE \`cart_item\` (\`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\` varchar(36) NOT NULL, \`deleted_at\` datetime(6) NULL, \`variant_id\` int NULL, \`quantity\` int NOT NULL DEFAULT '0', \`product_id\` int NULL, \`price_data_id\` varchar(36) NULL, \`cart_id\` varchar(36) NULL, UNIQUE INDEX \`REL_f6e81acd6dc6b3a224e9a9e656\` (\`price_data_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
10
+ await queryRunner.query(`CREATE TABLE \`checkout_billing_address\` (\`id\` varchar(36) NOT NULL, \`first_name\` varchar(255) NULL, \`last_name\` varchar(255) NULL, \`phone_code\` varchar(255) NULL, \`phone\` int NULL, \`company\` varchar(255) NULL, \`address1\` varchar(255) NULL, \`address2\` varchar(255) NULL, \`city\` varchar(255) NULL, \`province\` varchar(255) NULL, \`province_code\` varchar(255) NULL, \`country\` varchar(255) NULL, \`country_code\` varchar(255) NULL, \`zip\` varchar(255) NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
11
+ await queryRunner.query(`CREATE TABLE \`checkout_shipping_address\` (\`id\` varchar(36) NOT NULL, \`first_name\` varchar(255) NULL, \`last_name\` varchar(255) NULL, \`phone_code\` varchar(255) NULL, \`phone\` int NULL, \`company\` varchar(255) NULL, \`address1\` varchar(255) NULL, \`address2\` varchar(255) NULL, \`city\` varchar(255) NULL, \`province\` varchar(255) NULL, \`province_code\` varchar(255) NULL, \`country\` varchar(255) NULL, \`country_code\` varchar(255) NULL, \`zip\` varchar(255) NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
12
+ await queryRunner.query(`CREATE TABLE \`checkout\` (\`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\` varchar(36) NOT NULL, \`deleted_at\` datetime(6) NULL, \`success_url\` varchar(255) NULL, \`cancel_url\` varchar(255) NULL, \`payment_method\` varchar(255) NULL, \`email\` varchar(255) NULL, \`status\` varchar(255) NULL, \`checkout_url\` varchar(255) NULL, \`total_price\` decimal(10,2) NOT NULL DEFAULT '0.00', \`total_tax\` decimal(10,2) NOT NULL DEFAULT '0.00', \`total_line_items_price\` int NOT NULL DEFAULT '0', \`billing_address_id\` varchar(36) NULL, \`shipping_address_id\` varchar(36) NULL, \`order_id\` int NULL, \`cart_id\` varchar(36) NULL, UNIQUE INDEX \`REL_a9b3310bf20693e64099c79328\` (\`billing_address_id\`), UNIQUE INDEX \`REL_0e0fbcd226624af4980bf8a0e9\` (\`shipping_address_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
13
+ await queryRunner.query(`CREATE TABLE \`cart\` (\`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\` varchar(36) NOT NULL, \`customer_session_id\` varchar(255) NULL, \`currency\` varchar(255) NULL, \`total_amount\` decimal(10,2) NOT NULL DEFAULT '0.00', \`deleted_at\` datetime(6) NULL, \`user_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
14
+ await queryRunner.query(`ALTER TABLE \`payment_method\` ADD CONSTRAINT \`FK_b9f0b59dc5fd5150f2df494a480\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
15
+ await queryRunner.query(`ALTER TABLE \`cart_item\` ADD CONSTRAINT \`FK_67a2e8406e01ffa24ff9026944e\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
16
+ await queryRunner.query(`ALTER TABLE \`cart_item\` ADD CONSTRAINT \`FK_f6e81acd6dc6b3a224e9a9e6567\` FOREIGN KEY (\`price_data_id\`) REFERENCES \`price_data\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
17
+ await queryRunner.query(`ALTER TABLE \`cart_item\` ADD CONSTRAINT \`FK_b6b2a4f1f533d89d218e70db941\` FOREIGN KEY (\`cart_id\`) REFERENCES \`cart\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
18
+ await queryRunner.query(`ALTER TABLE \`checkout\` ADD CONSTRAINT \`FK_a9b3310bf20693e64099c793282\` FOREIGN KEY (\`billing_address_id\`) REFERENCES \`checkout_billing_address\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
19
+ await queryRunner.query(`ALTER TABLE \`checkout\` ADD CONSTRAINT \`FK_0e0fbcd226624af4980bf8a0e93\` FOREIGN KEY (\`shipping_address_id\`) REFERENCES \`checkout_shipping_address\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
20
+ await queryRunner.query(`ALTER TABLE \`checkout\` ADD CONSTRAINT \`FK_44691a014ff769f4059b3a4aa6d\` FOREIGN KEY (\`order_id\`) REFERENCES \`order\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
21
+ await queryRunner.query(`ALTER TABLE \`checkout\` ADD CONSTRAINT \`FK_89e251c687f45918ee829c4570f\` FOREIGN KEY (\`cart_id\`) REFERENCES \`cart\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
22
+ await queryRunner.query(`ALTER TABLE \`cart\` ADD CONSTRAINT \`FK_f091e86a234693a49084b4c2c86\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
23
+ }
24
+
25
+ public async down(queryRunner: QueryRunner): Promise<void> {
26
+ await queryRunner.query(`ALTER TABLE \`cart\` DROP FOREIGN KEY \`FK_f091e86a234693a49084b4c2c86\``);
27
+ await queryRunner.query(`ALTER TABLE \`checkout\` DROP FOREIGN KEY \`FK_89e251c687f45918ee829c4570f\``);
28
+ await queryRunner.query(`ALTER TABLE \`checkout\` DROP FOREIGN KEY \`FK_44691a014ff769f4059b3a4aa6d\``);
29
+ await queryRunner.query(`ALTER TABLE \`checkout\` DROP FOREIGN KEY \`FK_0e0fbcd226624af4980bf8a0e93\``);
30
+ await queryRunner.query(`ALTER TABLE \`checkout\` DROP FOREIGN KEY \`FK_a9b3310bf20693e64099c793282\``);
31
+ await queryRunner.query(`ALTER TABLE \`cart_item\` DROP FOREIGN KEY \`FK_b6b2a4f1f533d89d218e70db941\``);
32
+ await queryRunner.query(`ALTER TABLE \`cart_item\` DROP FOREIGN KEY \`FK_f6e81acd6dc6b3a224e9a9e6567\``);
33
+ await queryRunner.query(`ALTER TABLE \`cart_item\` DROP FOREIGN KEY \`FK_67a2e8406e01ffa24ff9026944e\``);
34
+ await queryRunner.query(`ALTER TABLE \`payment_method\` DROP FOREIGN KEY \`FK_b9f0b59dc5fd5150f2df494a480\``);
35
+ await queryRunner.query(`DROP TABLE \`cart\``);
36
+ await queryRunner.query(`DROP INDEX \`REL_0e0fbcd226624af4980bf8a0e9\` ON \`checkout\``);
37
+ await queryRunner.query(`DROP INDEX \`REL_a9b3310bf20693e64099c79328\` ON \`checkout\``);
38
+ await queryRunner.query(`DROP TABLE \`checkout\``);
39
+ await queryRunner.query(`DROP TABLE \`checkout_shipping_address\``);
40
+ await queryRunner.query(`DROP TABLE \`checkout_billing_address\``);
41
+ await queryRunner.query(`DROP INDEX \`REL_f6e81acd6dc6b3a224e9a9e656\` ON \`cart_item\``);
42
+ await queryRunner.query(`DROP TABLE \`cart_item\``);
43
+ await queryRunner.query(`DROP TABLE \`price_data\``);
44
+ await queryRunner.query(`DROP TABLE \`payment_method\``);
45
+ }
46
+
47
+ }
@@ -0,0 +1,28 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class collection1664160721396 implements MigrationInterface {
4
+ name = 'collection1664160721396'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`CREATE TABLE \`collection_item\` (\`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, \`variant_id\` int NULL, \`collection_id\` varchar(10) NULL, \`product_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
8
+ await queryRunner.query(`CREATE TABLE \`collection\` (\`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\` varchar(10) NOT NULL DEFAULT 'j1mxP0ZAy', \`deleted_at\` datetime(6) NULL, \`title\` varchar(255) NOT NULL, \`description\` varchar(255) NULL, \`slug\` varchar(255) NULL, \`image\` varchar(255) NULL, \`user_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
9
+ await queryRunner.query(`ALTER TABLE \`collection\` CHANGE \`id\` \`id\` varchar(10) NOT NULL DEFAULT 'QwKk81z2ad'`);
10
+ await queryRunner.query(`ALTER TABLE \`collection_item\` ADD CONSTRAINT \`FK_18d78d0cec94e632cd5f758157c\` FOREIGN KEY (\`collection_id\`) REFERENCES \`collection\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
11
+ await queryRunner.query(`ALTER TABLE \`collection_item\` ADD CONSTRAINT \`FK_fb39f029ec236466246a3e247ec\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
12
+ await queryRunner.query(`ALTER TABLE \`collection\` ADD CONSTRAINT \`FK_4f925485b013b52e32f43d430f6\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
13
+ await queryRunner.query(`ALTER TABLE \`collection_shared\` ADD CONSTRAINT \`FK_209bf9ce0377cffc01d3638186d\` FOREIGN KEY (\`collection_id\`) REFERENCES \`collection\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
14
+ await queryRunner.query(`ALTER TABLE \`collection_shared\` ADD CONSTRAINT \`FK_1e881009b91e3344cb4956d512c\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
15
+ }
16
+
17
+ public async down(queryRunner: QueryRunner): Promise<void> {
18
+ await queryRunner.query(`ALTER TABLE \`collection_shared\` DROP FOREIGN KEY \`FK_1e881009b91e3344cb4956d512c\``);
19
+ await queryRunner.query(`ALTER TABLE \`collection_shared\` DROP FOREIGN KEY \`FK_209bf9ce0377cffc01d3638186d\``);
20
+ await queryRunner.query(`ALTER TABLE \`collection\` DROP FOREIGN KEY \`FK_4f925485b013b52e32f43d430f6\``);
21
+ await queryRunner.query(`ALTER TABLE \`collection_item\` DROP FOREIGN KEY \`FK_fb39f029ec236466246a3e247ec\``);
22
+ await queryRunner.query(`ALTER TABLE \`collection_item\` DROP FOREIGN KEY \`FK_18d78d0cec94e632cd5f758157c\``);
23
+ await queryRunner.query(`ALTER TABLE \`collection\` CHANGE \`id\` \`id\` varchar(10) NOT NULL DEFAULT 'j1mxP0ZAy'`);
24
+ await queryRunner.query(`DROP TABLE \`collection\``);
25
+ await queryRunner.query(`DROP TABLE \`collection_item\``);
26
+ }
27
+
28
+ }
@@ -0,0 +1,22 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class updateCollection1664222251306 implements MigrationInterface {
4
+ name = 'updateCollection1664222251306'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE \`collection_item\` DROP FOREIGN KEY \`FK_18d78d0cec94e632cd5f758157c\``);
8
+ await queryRunner.query(`ALTER TABLE \`collection_shared\` DROP FOREIGN KEY \`FK_209bf9ce0377cffc01d3638186d\``);
9
+ await queryRunner.query(`ALTER TABLE \`collection\` CHANGE \`id\` \`id\` varchar(10) NOT NULL`);
10
+ await queryRunner.query(`ALTER TABLE \`collection_item\` ADD CONSTRAINT \`FK_18d78d0cec94e632cd5f758157c\` FOREIGN KEY (\`collection_id\`) REFERENCES \`collection\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
11
+ await queryRunner.query(`ALTER TABLE \`collection_shared\` ADD CONSTRAINT \`FK_209bf9ce0377cffc01d3638186d\` FOREIGN KEY (\`collection_id\`) REFERENCES \`collection\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
12
+ }
13
+
14
+ public async down(queryRunner: QueryRunner): Promise<void> {
15
+ await queryRunner.query(`ALTER TABLE \`collection_shared\` DROP FOREIGN KEY \`FK_209bf9ce0377cffc01d3638186d\``);
16
+ await queryRunner.query(`ALTER TABLE \`collection_item\` DROP FOREIGN KEY \`FK_18d78d0cec94e632cd5f758157c\``);
17
+ await queryRunner.query(`ALTER TABLE \`collection\` CHANGE \`id\` \`id\` varchar(10) NOT NULL DEFAULT 'QwKk81z2ad'`);
18
+ await queryRunner.query(`ALTER TABLE \`collection_shared\` ADD CONSTRAINT \`FK_209bf9ce0377cffc01d3638186d\` FOREIGN KEY (\`collection_id\`) REFERENCES \`collection\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
19
+ await queryRunner.query(`ALTER TABLE \`collection_item\` ADD CONSTRAINT \`FK_18d78d0cec94e632cd5f758157c\` FOREIGN KEY (\`collection_id\`) REFERENCES \`collection\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
20
+ }
21
+
22
+ }
@@ -0,0 +1,44 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class channel1665757388450 implements MigrationInterface {
4
+ name = 'channel1665757388450'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`CREATE TABLE \`channel_group\` (\`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), \`deleted_at\` datetime(6) NULL, \`id\` int NOT NULL AUTO_INCREMENT, \`channel_user_id\` int NULL, \`product_id\` int NULL, \`variant_id\` int NULL, \`collection_id\` varchar(10) NULL, \`collection_shared_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
8
+ await queryRunner.query(`CREATE TABLE \`channel_user_product_sync\` (\`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), \`deleted_at\` datetime(6) NULL, \`id\` int NOT NULL AUTO_INCREMENT, \`sync\` tinyint NOT NULL DEFAULT 0, \`channel_user_id\` int NULL, \`product_id\` int NULL, \`variant_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
9
+ await queryRunner.query(`CREATE TABLE \`channel_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), \`deleted_at\` datetime(6) NULL, \`id\` int NOT NULL AUTO_INCREMENT, \`user_id\` int NULL, \`channel_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
10
+ await queryRunner.query(`ALTER TABLE \`channel\` ADD \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)`);
11
+ await queryRunner.query(`ALTER TABLE \`channel\` ADD \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)`);
12
+ await queryRunner.query(`ALTER TABLE \`channel\` ADD \`deleted_at\` datetime(6) NULL`);
13
+ await queryRunner.query(`ALTER TABLE \`channel_group\` ADD CONSTRAINT \`FK_cdf9edf073c9e94025289a1d19b\` FOREIGN KEY (\`channel_user_id\`) REFERENCES \`channel_user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
14
+ await queryRunner.query(`ALTER TABLE \`channel_group\` ADD CONSTRAINT \`FK_45950478a423fdc46b17aca77c1\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
15
+ await queryRunner.query(`ALTER TABLE \`channel_group\` ADD CONSTRAINT \`FK_7ad32bbee5d7964429d47cacd0a\` FOREIGN KEY (\`variant_id\`) REFERENCES \`variant\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
16
+ await queryRunner.query(`ALTER TABLE \`channel_group\` ADD CONSTRAINT \`FK_8fcd2dd06554030ebeaedb6336b\` FOREIGN KEY (\`collection_id\`) REFERENCES \`collection\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
17
+ await queryRunner.query(`ALTER TABLE \`channel_group\` ADD CONSTRAINT \`FK_5551f4b45bb31950e8410204a57\` FOREIGN KEY (\`collection_shared_id\`) REFERENCES \`collection_shared\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
18
+ await queryRunner.query(`ALTER TABLE \`channel_user_product_sync\` ADD CONSTRAINT \`FK_80ebba2c4ef931eede30083489b\` FOREIGN KEY (\`channel_user_id\`) REFERENCES \`channel_user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
19
+ await queryRunner.query(`ALTER TABLE \`channel_user_product_sync\` ADD CONSTRAINT \`FK_db9ba7a4c6973493e6b7d382de0\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
20
+ await queryRunner.query(`ALTER TABLE \`channel_user_product_sync\` ADD CONSTRAINT \`FK_55d5a56c3d67bf8cf82df556ee8\` FOREIGN KEY (\`variant_id\`) REFERENCES \`variant\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
21
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_a846c7202b4f59da68ad20af060\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
22
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_d31b165b69b0b23135ce413ce09\` FOREIGN KEY (\`channel_id\`) REFERENCES \`channel\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
23
+ }
24
+
25
+ public async down(queryRunner: QueryRunner): Promise<void> {
26
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_d31b165b69b0b23135ce413ce09\``);
27
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_a846c7202b4f59da68ad20af060\``);
28
+ await queryRunner.query(`ALTER TABLE \`channel_user_product_sync\` DROP FOREIGN KEY \`FK_55d5a56c3d67bf8cf82df556ee8\``);
29
+ await queryRunner.query(`ALTER TABLE \`channel_user_product_sync\` DROP FOREIGN KEY \`FK_db9ba7a4c6973493e6b7d382de0\``);
30
+ await queryRunner.query(`ALTER TABLE \`channel_user_product_sync\` DROP FOREIGN KEY \`FK_80ebba2c4ef931eede30083489b\``);
31
+ await queryRunner.query(`ALTER TABLE \`channel_group\` DROP FOREIGN KEY \`FK_5551f4b45bb31950e8410204a57\``);
32
+ await queryRunner.query(`ALTER TABLE \`channel_group\` DROP FOREIGN KEY \`FK_8fcd2dd06554030ebeaedb6336b\``);
33
+ await queryRunner.query(`ALTER TABLE \`channel_group\` DROP FOREIGN KEY \`FK_7ad32bbee5d7964429d47cacd0a\``);
34
+ await queryRunner.query(`ALTER TABLE \`channel_group\` DROP FOREIGN KEY \`FK_45950478a423fdc46b17aca77c1\``);
35
+ await queryRunner.query(`ALTER TABLE \`channel_group\` DROP FOREIGN KEY \`FK_cdf9edf073c9e94025289a1d19b\``);
36
+ await queryRunner.query(`ALTER TABLE \`channel\` DROP COLUMN \`deleted_at\``);
37
+ await queryRunner.query(`ALTER TABLE \`channel\` DROP COLUMN \`updated_at\``);
38
+ await queryRunner.query(`ALTER TABLE \`channel\` DROP COLUMN \`created_at\``);
39
+ await queryRunner.query(`DROP TABLE \`channel_user\``);
40
+ await queryRunner.query(`DROP TABLE \`channel_user_product_sync\``);
41
+ await queryRunner.query(`DROP TABLE \`channel_group\``);
42
+ }
43
+
44
+ }
@@ -0,0 +1,95 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class prod2210181666098098114 implements MigrationInterface {
4
+ name = 'prod2210181666098098114'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`CREATE TABLE \`collection_item\` (\`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, \`variant_id\` int NULL, \`collection_id\` varchar(10) NULL, \`product_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
8
+ await queryRunner.query(`CREATE TABLE \`collection\` (\`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\` varchar(10) NOT NULL, \`deleted_at\` datetime(6) NULL, \`title\` varchar(255) NOT NULL, \`description\` varchar(255) NULL, \`slug\` varchar(255) NULL, \`image\` varchar(255) NULL, \`user_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
9
+ await queryRunner.query(`CREATE TABLE \`collection_shared\` (\`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, \`collection_id\` varchar(10) NULL, \`user_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
10
+ await queryRunner.query(`CREATE TABLE \`channel_group\` (\`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), \`deleted_at\` datetime(6) NULL, \`id\` int NOT NULL AUTO_INCREMENT, \`channel_user_id\` int NULL, \`product_id\` int NULL, \`variant_id\` int NULL, \`collection_id\` varchar(10) NULL, \`collection_shared_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
11
+ await queryRunner.query(`CREATE TABLE \`channel_user_product_sync\` (\`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), \`deleted_at\` datetime(6) NULL, \`id\` int NOT NULL AUTO_INCREMENT, \`sync\` tinyint NOT NULL DEFAULT 0, \`channel_user_id\` int NULL, \`product_id\` int NULL, \`variant_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
12
+ await queryRunner.query(`CREATE TABLE \`channel_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), \`deleted_at\` datetime(6) NULL, \`id\` int NOT NULL AUTO_INCREMENT, \`user_id\` int NULL, \`channel_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
13
+ await queryRunner.query(`CREATE TABLE \`payment_method\` (\`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), \`deleted_at\` datetime(6) NULL, \`id\` varchar(36) NOT NULL, \`active\` tinyint NOT NULL DEFAULT 0, \`options\` varchar(21844) NULL, \`user_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
14
+ await queryRunner.query(`CREATE TABLE \`price_data\` (\`id\` varchar(36) NOT NULL, \`unit_price\` decimal(10,2) NOT NULL DEFAULT '0.00', \`tax\` decimal(10,2) NOT NULL DEFAULT '0.00', \`currency\` varchar(255) NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
15
+ await queryRunner.query(`CREATE TABLE \`cart_item\` (\`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\` varchar(36) NOT NULL, \`deleted_at\` datetime(6) NULL, \`variant_id\` int NULL, \`quantity\` int NOT NULL DEFAULT '0', \`product_id\` int NULL, \`price_data_id\` varchar(36) NULL, \`cart_id\` varchar(36) NULL, UNIQUE INDEX \`REL_f6e81acd6dc6b3a224e9a9e656\` (\`price_data_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
16
+ await queryRunner.query(`CREATE TABLE \`checkout_billing_address\` (\`id\` varchar(36) NOT NULL, \`first_name\` varchar(255) NULL, \`last_name\` varchar(255) NULL, \`phone_code\` varchar(255) NULL, \`phone\` int NULL, \`company\` varchar(255) NULL, \`address1\` varchar(255) NULL, \`address2\` varchar(255) NULL, \`city\` varchar(255) NULL, \`province\` varchar(255) NULL, \`province_code\` varchar(255) NULL, \`country\` varchar(255) NULL, \`country_code\` varchar(255) NULL, \`zip\` varchar(255) NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
17
+ await queryRunner.query(`CREATE TABLE \`checkout_shipping_address\` (\`id\` varchar(36) NOT NULL, \`first_name\` varchar(255) NULL, \`last_name\` varchar(255) NULL, \`phone_code\` varchar(255) NULL, \`phone\` int NULL, \`company\` varchar(255) NULL, \`address1\` varchar(255) NULL, \`address2\` varchar(255) NULL, \`city\` varchar(255) NULL, \`province\` varchar(255) NULL, \`province_code\` varchar(255) NULL, \`country\` varchar(255) NULL, \`country_code\` varchar(255) NULL, \`zip\` varchar(255) NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
18
+ await queryRunner.query(`CREATE TABLE \`checkout\` (\`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\` varchar(36) NOT NULL, \`deleted_at\` datetime(6) NULL, \`success_url\` varchar(255) NULL, \`cancel_url\` varchar(255) NULL, \`payment_method\` varchar(255) NULL, \`email\` varchar(255) NULL, \`status\` varchar(255) NULL, \`checkout_url\` varchar(255) NULL, \`total_price\` decimal(10,2) NOT NULL DEFAULT '0.00', \`total_tax\` decimal(10,2) NOT NULL DEFAULT '0.00', \`total_line_items_price\` int NOT NULL DEFAULT '0', \`billing_address_id\` varchar(36) NULL, \`shipping_address_id\` varchar(36) NULL, \`order_id\` int NULL, \`cart_id\` varchar(36) NULL, UNIQUE INDEX \`REL_a9b3310bf20693e64099c79328\` (\`billing_address_id\`), UNIQUE INDEX \`REL_0e0fbcd226624af4980bf8a0e9\` (\`shipping_address_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
19
+ await queryRunner.query(`CREATE TABLE \`cart\` (\`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\` varchar(36) NOT NULL, \`customer_session_id\` varchar(255) NULL, \`currency\` varchar(255) NULL, \`total_amount\` decimal(10,2) NOT NULL DEFAULT '0.00', \`deleted_at\` datetime(6) NULL, \`user_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
20
+ await queryRunner.query(`ALTER TABLE \`channel\` ADD \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)`);
21
+ await queryRunner.query(`ALTER TABLE \`channel\` ADD \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)`);
22
+ await queryRunner.query(`ALTER TABLE \`channel\` ADD \`deleted_at\` datetime(6) NULL`);
23
+ await queryRunner.query(`ALTER TABLE \`collection_item\` ADD CONSTRAINT \`FK_18d78d0cec94e632cd5f758157c\` FOREIGN KEY (\`collection_id\`) REFERENCES \`collection\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
24
+ await queryRunner.query(`ALTER TABLE \`collection_item\` ADD CONSTRAINT \`FK_fb39f029ec236466246a3e247ec\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
25
+ await queryRunner.query(`ALTER TABLE \`collection\` ADD CONSTRAINT \`FK_4f925485b013b52e32f43d430f6\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
26
+ await queryRunner.query(`ALTER TABLE \`collection_shared\` ADD CONSTRAINT \`FK_209bf9ce0377cffc01d3638186d\` FOREIGN KEY (\`collection_id\`) REFERENCES \`collection\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
27
+ await queryRunner.query(`ALTER TABLE \`collection_shared\` ADD CONSTRAINT \`FK_1e881009b91e3344cb4956d512c\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
28
+ await queryRunner.query(`ALTER TABLE \`channel_group\` ADD CONSTRAINT \`FK_cdf9edf073c9e94025289a1d19b\` FOREIGN KEY (\`channel_user_id\`) REFERENCES \`channel_user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
29
+ await queryRunner.query(`ALTER TABLE \`channel_group\` ADD CONSTRAINT \`FK_45950478a423fdc46b17aca77c1\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
30
+ await queryRunner.query(`ALTER TABLE \`channel_group\` ADD CONSTRAINT \`FK_7ad32bbee5d7964429d47cacd0a\` FOREIGN KEY (\`variant_id\`) REFERENCES \`variant\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
31
+ await queryRunner.query(`ALTER TABLE \`channel_group\` ADD CONSTRAINT \`FK_8fcd2dd06554030ebeaedb6336b\` FOREIGN KEY (\`collection_id\`) REFERENCES \`collection\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
32
+ await queryRunner.query(`ALTER TABLE \`channel_group\` ADD CONSTRAINT \`FK_5551f4b45bb31950e8410204a57\` FOREIGN KEY (\`collection_shared_id\`) REFERENCES \`collection_shared\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
33
+ await queryRunner.query(`ALTER TABLE \`channel_user_product_sync\` ADD CONSTRAINT \`FK_80ebba2c4ef931eede30083489b\` FOREIGN KEY (\`channel_user_id\`) REFERENCES \`channel_user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
34
+ await queryRunner.query(`ALTER TABLE \`channel_user_product_sync\` ADD CONSTRAINT \`FK_db9ba7a4c6973493e6b7d382de0\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
35
+ await queryRunner.query(`ALTER TABLE \`channel_user_product_sync\` ADD CONSTRAINT \`FK_55d5a56c3d67bf8cf82df556ee8\` FOREIGN KEY (\`variant_id\`) REFERENCES \`variant\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
36
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_a846c7202b4f59da68ad20af060\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
37
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_d31b165b69b0b23135ce413ce09\` FOREIGN KEY (\`channel_id\`) REFERENCES \`channel\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
38
+ await queryRunner.query(`ALTER TABLE \`payment_method\` ADD CONSTRAINT \`FK_b9f0b59dc5fd5150f2df494a480\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
39
+ await queryRunner.query(`ALTER TABLE \`cart_item\` ADD CONSTRAINT \`FK_67a2e8406e01ffa24ff9026944e\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
40
+ await queryRunner.query(`ALTER TABLE \`cart_item\` ADD CONSTRAINT \`FK_f6e81acd6dc6b3a224e9a9e6567\` FOREIGN KEY (\`price_data_id\`) REFERENCES \`price_data\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
41
+ await queryRunner.query(`ALTER TABLE \`cart_item\` ADD CONSTRAINT \`FK_b6b2a4f1f533d89d218e70db941\` FOREIGN KEY (\`cart_id\`) REFERENCES \`cart\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
42
+ await queryRunner.query(`ALTER TABLE \`checkout\` ADD CONSTRAINT \`FK_a9b3310bf20693e64099c793282\` FOREIGN KEY (\`billing_address_id\`) REFERENCES \`checkout_billing_address\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
43
+ await queryRunner.query(`ALTER TABLE \`checkout\` ADD CONSTRAINT \`FK_0e0fbcd226624af4980bf8a0e93\` FOREIGN KEY (\`shipping_address_id\`) REFERENCES \`checkout_shipping_address\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
44
+ await queryRunner.query(`ALTER TABLE \`checkout\` ADD CONSTRAINT \`FK_44691a014ff769f4059b3a4aa6d\` FOREIGN KEY (\`order_id\`) REFERENCES \`order\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
45
+ await queryRunner.query(`ALTER TABLE \`checkout\` ADD CONSTRAINT \`FK_89e251c687f45918ee829c4570f\` FOREIGN KEY (\`cart_id\`) REFERENCES \`cart\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
46
+ await queryRunner.query(`ALTER TABLE \`cart\` ADD CONSTRAINT \`FK_f091e86a234693a49084b4c2c86\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
47
+ }
48
+
49
+ public async down(queryRunner: QueryRunner): Promise<void> {
50
+ await queryRunner.query(`ALTER TABLE \`cart\` DROP FOREIGN KEY \`FK_f091e86a234693a49084b4c2c86\``);
51
+ await queryRunner.query(`ALTER TABLE \`checkout\` DROP FOREIGN KEY \`FK_89e251c687f45918ee829c4570f\``);
52
+ await queryRunner.query(`ALTER TABLE \`checkout\` DROP FOREIGN KEY \`FK_44691a014ff769f4059b3a4aa6d\``);
53
+ await queryRunner.query(`ALTER TABLE \`checkout\` DROP FOREIGN KEY \`FK_0e0fbcd226624af4980bf8a0e93\``);
54
+ await queryRunner.query(`ALTER TABLE \`checkout\` DROP FOREIGN KEY \`FK_a9b3310bf20693e64099c793282\``);
55
+ await queryRunner.query(`ALTER TABLE \`cart_item\` DROP FOREIGN KEY \`FK_b6b2a4f1f533d89d218e70db941\``);
56
+ await queryRunner.query(`ALTER TABLE \`cart_item\` DROP FOREIGN KEY \`FK_f6e81acd6dc6b3a224e9a9e6567\``);
57
+ await queryRunner.query(`ALTER TABLE \`cart_item\` DROP FOREIGN KEY \`FK_67a2e8406e01ffa24ff9026944e\``);
58
+ await queryRunner.query(`ALTER TABLE \`payment_method\` DROP FOREIGN KEY \`FK_b9f0b59dc5fd5150f2df494a480\``);
59
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_d31b165b69b0b23135ce413ce09\``);
60
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_a846c7202b4f59da68ad20af060\``);
61
+ await queryRunner.query(`ALTER TABLE \`channel_user_product_sync\` DROP FOREIGN KEY \`FK_55d5a56c3d67bf8cf82df556ee8\``);
62
+ await queryRunner.query(`ALTER TABLE \`channel_user_product_sync\` DROP FOREIGN KEY \`FK_db9ba7a4c6973493e6b7d382de0\``);
63
+ await queryRunner.query(`ALTER TABLE \`channel_user_product_sync\` DROP FOREIGN KEY \`FK_80ebba2c4ef931eede30083489b\``);
64
+ await queryRunner.query(`ALTER TABLE \`channel_group\` DROP FOREIGN KEY \`FK_5551f4b45bb31950e8410204a57\``);
65
+ await queryRunner.query(`ALTER TABLE \`channel_group\` DROP FOREIGN KEY \`FK_8fcd2dd06554030ebeaedb6336b\``);
66
+ await queryRunner.query(`ALTER TABLE \`channel_group\` DROP FOREIGN KEY \`FK_7ad32bbee5d7964429d47cacd0a\``);
67
+ await queryRunner.query(`ALTER TABLE \`channel_group\` DROP FOREIGN KEY \`FK_45950478a423fdc46b17aca77c1\``);
68
+ await queryRunner.query(`ALTER TABLE \`channel_group\` DROP FOREIGN KEY \`FK_cdf9edf073c9e94025289a1d19b\``);
69
+ await queryRunner.query(`ALTER TABLE \`collection_shared\` DROP FOREIGN KEY \`FK_1e881009b91e3344cb4956d512c\``);
70
+ await queryRunner.query(`ALTER TABLE \`collection_shared\` DROP FOREIGN KEY \`FK_209bf9ce0377cffc01d3638186d\``);
71
+ await queryRunner.query(`ALTER TABLE \`collection\` DROP FOREIGN KEY \`FK_4f925485b013b52e32f43d430f6\``);
72
+ await queryRunner.query(`ALTER TABLE \`collection_item\` DROP FOREIGN KEY \`FK_fb39f029ec236466246a3e247ec\``);
73
+ await queryRunner.query(`ALTER TABLE \`collection_item\` DROP FOREIGN KEY \`FK_18d78d0cec94e632cd5f758157c\``);
74
+ await queryRunner.query(`ALTER TABLE \`channel\` DROP COLUMN \`deleted_at\``);
75
+ await queryRunner.query(`ALTER TABLE \`channel\` DROP COLUMN \`updated_at\``);
76
+ await queryRunner.query(`ALTER TABLE \`channel\` DROP COLUMN \`created_at\``);
77
+ await queryRunner.query(`DROP TABLE \`cart\``);
78
+ await queryRunner.query(`DROP INDEX \`REL_0e0fbcd226624af4980bf8a0e9\` ON \`checkout\``);
79
+ await queryRunner.query(`DROP INDEX \`REL_a9b3310bf20693e64099c79328\` ON \`checkout\``);
80
+ await queryRunner.query(`DROP TABLE \`checkout\``);
81
+ await queryRunner.query(`DROP TABLE \`checkout_shipping_address\``);
82
+ await queryRunner.query(`DROP TABLE \`checkout_billing_address\``);
83
+ await queryRunner.query(`DROP INDEX \`REL_f6e81acd6dc6b3a224e9a9e656\` ON \`cart_item\``);
84
+ await queryRunner.query(`DROP TABLE \`cart_item\``);
85
+ await queryRunner.query(`DROP TABLE \`price_data\``);
86
+ await queryRunner.query(`DROP TABLE \`payment_method\``);
87
+ await queryRunner.query(`DROP TABLE \`channel_user\``);
88
+ await queryRunner.query(`DROP TABLE \`channel_user_product_sync\``);
89
+ await queryRunner.query(`DROP TABLE \`channel_group\``);
90
+ await queryRunner.query(`DROP TABLE \`collection_shared\``);
91
+ await queryRunner.query(`DROP TABLE \`collection\``);
92
+ await queryRunner.query(`DROP TABLE \`collection_item\``);
93
+ }
94
+
95
+ }
@@ -0,0 +1,24 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class userChannelApiKeyAndCurrency1666631086586 implements MigrationInterface {
4
+ name = 'userChannelApiKeyAndCurrency1666631086586'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`CREATE TABLE \`currency\` (\`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), \`deleted_at\` datetime(6) NULL, \`id\` int NOT NULL AUTO_INCREMENT, \`code\` varchar(255) NOT NULL, \`enabled\` tinyint NOT NULL DEFAULT 0, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
8
+ await queryRunner.query(`CREATE TABLE \`user_channel_api_key\` (\`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, \`api_key\` varchar(255) NOT NULL, \`user_id\` int NULL, \`channel_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
9
+ await queryRunner.query(`ALTER TABLE \`user\` ADD \`currency_id\` int NULL`);
10
+ await queryRunner.query(`ALTER TABLE \`user\` ADD CONSTRAINT \`FK_46950bb3bc8e5d3c7ecc7dae605\` FOREIGN KEY (\`currency_id\`) REFERENCES \`currency\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
11
+ await queryRunner.query(`ALTER TABLE \`user_channel_api_key\` ADD CONSTRAINT \`FK_c662a300a92421d2ab39de4f05b\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
12
+ await queryRunner.query(`ALTER TABLE \`user_channel_api_key\` ADD CONSTRAINT \`FK_3f899dcba8f7da83c1923c0c642\` FOREIGN KEY (\`channel_id\`) REFERENCES \`channel\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
13
+ }
14
+
15
+ public async down(queryRunner: QueryRunner): Promise<void> {
16
+ await queryRunner.query(`ALTER TABLE \`user_channel_api_key\` DROP FOREIGN KEY \`FK_3f899dcba8f7da83c1923c0c642\``);
17
+ await queryRunner.query(`ALTER TABLE \`user_channel_api_key\` DROP FOREIGN KEY \`FK_c662a300a92421d2ab39de4f05b\``);
18
+ await queryRunner.query(`ALTER TABLE \`user\` DROP FOREIGN KEY \`FK_46950bb3bc8e5d3c7ecc7dae605\``);
19
+ await queryRunner.query(`ALTER TABLE \`user\` DROP COLUMN \`currency_id\``);
20
+ await queryRunner.query(`DROP TABLE \`user_channel_api_key\``);
21
+ await queryRunner.query(`DROP TABLE \`currency\``);
22
+ }
23
+
24
+ }
@@ -0,0 +1,20 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class userChannelApiKeyAndCurrencyUpdate1666632054252 implements MigrationInterface {
4
+ name = 'userChannelApiKeyAndCurrencyUpdate1666632054252'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE \`user\` DROP FOREIGN KEY \`FK_46950bb3bc8e5d3c7ecc7dae605\``);
8
+ await queryRunner.query(`ALTER TABLE \`user\` DROP COLUMN \`currency_id\``);
9
+ await queryRunner.query(`ALTER TABLE \`user_settings\` ADD \`currency_id\` int NULL`);
10
+ await queryRunner.query(`ALTER TABLE \`user_settings\` ADD CONSTRAINT \`FK_3e2b295923ea4011ccb75693afb\` FOREIGN KEY (\`currency_id\`) REFERENCES \`currency\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
11
+ }
12
+
13
+ public async down(queryRunner: QueryRunner): Promise<void> {
14
+ await queryRunner.query(`ALTER TABLE \`user_settings\` DROP FOREIGN KEY \`FK_3e2b295923ea4011ccb75693afb\``);
15
+ await queryRunner.query(`ALTER TABLE \`user_settings\` DROP COLUMN \`currency_id\``);
16
+ await queryRunner.query(`ALTER TABLE \`user\` ADD \`currency_id\` int NULL`);
17
+ await queryRunner.query(`ALTER TABLE \`user\` ADD CONSTRAINT \`FK_46950bb3bc8e5d3c7ecc7dae605\` FOREIGN KEY (\`currency_id\`) REFERENCES \`currency\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
18
+ }
19
+
20
+ }
@@ -0,0 +1,24 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class checkoutAndUsserSettings1666752877685 implements MigrationInterface {
4
+ name = 'checkoutAndUsserSettings1666752877685'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE \`user_settings\` ADD \`deleted_at\` datetime(6) NULL`);
8
+ await queryRunner.query(`ALTER TABLE \`checkout\` ADD \`origin_payment_id\` varchar(255) NULL`);
9
+ await queryRunner.query(`ALTER TABLE \`user_settings\` DROP FOREIGN KEY \`FK_3e2b295923ea4011ccb75693afb\``);
10
+ await queryRunner.query(`ALTER TABLE \`user_settings\` ADD UNIQUE INDEX \`IDX_3e2b295923ea4011ccb75693af\` (\`currency_id\`)`);
11
+ await queryRunner.query(`CREATE UNIQUE INDEX \`REL_3e2b295923ea4011ccb75693af\` ON \`user_settings\` (\`currency_id\`)`);
12
+ await queryRunner.query(`ALTER TABLE \`user_settings\` ADD CONSTRAINT \`FK_3e2b295923ea4011ccb75693afb\` FOREIGN KEY (\`currency_id\`) REFERENCES \`currency\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
13
+ }
14
+
15
+ public async down(queryRunner: QueryRunner): Promise<void> {
16
+ await queryRunner.query(`ALTER TABLE \`user_settings\` DROP FOREIGN KEY \`FK_3e2b295923ea4011ccb75693afb\``);
17
+ await queryRunner.query(`DROP INDEX \`REL_3e2b295923ea4011ccb75693af\` ON \`user_settings\``);
18
+ await queryRunner.query(`ALTER TABLE \`user_settings\` DROP INDEX \`IDX_3e2b295923ea4011ccb75693af\``);
19
+ await queryRunner.query(`ALTER TABLE \`user_settings\` ADD CONSTRAINT \`FK_3e2b295923ea4011ccb75693afb\` FOREIGN KEY (\`currency_id\`) REFERENCES \`currency\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
20
+ await queryRunner.query(`ALTER TABLE \`checkout\` DROP COLUMN \`origin_payment_id\``);
21
+ await queryRunner.query(`ALTER TABLE \`user_settings\` DROP COLUMN \`deleted_at\``);
22
+ }
23
+
24
+ }
@@ -0,0 +1,16 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class updateUserSettings1666846907205 implements MigrationInterface {
4
+ name = 'updateUserSettings1666846907205'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE \`user_settings\` ADD \`currency_id\` int NULL`);
8
+ await queryRunner.query(`ALTER TABLE \`user_settings\` ADD CONSTRAINT \`FK_3e2b295923ea4011ccb75693afb\` FOREIGN KEY (\`currency_id\`) REFERENCES \`currency\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
9
+ }
10
+
11
+ public async down(queryRunner: QueryRunner): Promise<void> {
12
+ await queryRunner.query(`ALTER TABLE \`user_settings\` DROP FOREIGN KEY \`FK_3e2b295923ea4011ccb75693afb\``);
13
+ await queryRunner.query(`ALTER TABLE \`user_settings\` DROP COLUMN \`currency_id\``);
14
+ }
15
+
16
+ }
@@ -0,0 +1,28 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class prod2210311667259333252 implements MigrationInterface {
4
+ name = 'prod2210311667259333252'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`CREATE TABLE \`currency\` (\`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), \`deleted_at\` datetime(6) NULL, \`id\` int NOT NULL AUTO_INCREMENT, \`code\` varchar(255) NOT NULL, \`enabled\` tinyint NOT NULL DEFAULT 0, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
8
+ await queryRunner.query(`CREATE TABLE \`user_channel_api_key\` (\`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, \`api_key\` varchar(255) NOT NULL, \`user_id\` int NULL, \`channel_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
9
+ await queryRunner.query(`ALTER TABLE \`user_settings\` ADD \`deleted_at\` datetime(6) NULL`);
10
+ await queryRunner.query(`ALTER TABLE \`user_settings\` ADD \`currency_id\` int NULL`);
11
+ await queryRunner.query(`ALTER TABLE \`checkout\` ADD \`origin_payment_id\` varchar(255) NULL`);
12
+ await queryRunner.query(`ALTER TABLE \`user_settings\` ADD CONSTRAINT \`FK_3e2b295923ea4011ccb75693afb\` FOREIGN KEY (\`currency_id\`) REFERENCES \`currency\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
13
+ await queryRunner.query(`ALTER TABLE \`user_channel_api_key\` ADD CONSTRAINT \`FK_c662a300a92421d2ab39de4f05b\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
14
+ await queryRunner.query(`ALTER TABLE \`user_channel_api_key\` ADD CONSTRAINT \`FK_3f899dcba8f7da83c1923c0c642\` FOREIGN KEY (\`channel_id\`) REFERENCES \`channel\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
15
+ }
16
+
17
+ public async down(queryRunner: QueryRunner): Promise<void> {
18
+ await queryRunner.query(`ALTER TABLE \`user_channel_api_key\` DROP FOREIGN KEY \`FK_3f899dcba8f7da83c1923c0c642\``);
19
+ await queryRunner.query(`ALTER TABLE \`user_channel_api_key\` DROP FOREIGN KEY \`FK_c662a300a92421d2ab39de4f05b\``);
20
+ await queryRunner.query(`ALTER TABLE \`user_settings\` DROP FOREIGN KEY \`FK_3e2b295923ea4011ccb75693afb\``);
21
+ await queryRunner.query(`ALTER TABLE \`checkout\` DROP COLUMN \`origin_payment_id\``);
22
+ await queryRunner.query(`ALTER TABLE \`user_settings\` DROP COLUMN \`currency_id\``);
23
+ await queryRunner.query(`ALTER TABLE \`user_settings\` DROP COLUMN \`deleted_at\``);
24
+ await queryRunner.query(`DROP TABLE \`user_channel_api_key\``);
25
+ await queryRunner.query(`DROP TABLE \`currency\``);
26
+ }
27
+
28
+ }