Open haf opened 2 weeks ago
Hi @haf , i'm having this issue as well while running the integration tests.
Did you solve it?
Yes, I solved my problem by guessing the cause correctly. Thankfully I hadn’t changed much
@haf Thank you for the quick answer! Can you show me what kind of issue that was?
Sure, I followed the multi-tenant guide and added store;
+import {
+ // alias the core entity to not cause a naming conflict
+ Product as MedusaProduct,
+ Store,
+} from "@medusajs/medusa"
+import { Entity, JoinColumn, ManyToOne } from "typeorm"
+
+@Entity()
+export class Product extends MedusaProduct {
+ @ManyToOne(() => Store)
+ @JoinColumn({ name: "store_id" })
+ store: Store
+}
then
+import {
+ Store as MedusaStore,
+} from "@medusajs/medusa"
+import { Entity, JoinColumn, ManyToOne } from "typeorm"
+import { Tenant } from "./tenant"
+
+@Entity()
+export class Store extends MedusaStore {
+ @ManyToOne(() => Tenant)
+ @JoinColumn({ name: "tenant_id" })
+ tenant: Tenant
+}
without creating the tenant table. So when Medusa started, it crashed.
Bug report
When adding new models (in a bad manner by not making migrations for them; just declaring them) Medusa doesn't start, because for the get currency query, a previously executed query failed (and was rolled back)
Describe the bug
A clear and concise description of what the bug is.
System information
Medusa version (including plugins): Node.js version: Database: Operating system: Browser (if relevant):
Steps to reproduce the behavior
Expected behavior
Log error messages