subsquid / squid-sdk

The main repo of the squid SDK
Apache License 2.0
1.23k stars 151 forks source link

Add synchronize option for typeorm #222

Open smaknsk opened 10 months ago

smaknsk commented 10 months ago

Hello! I would like to use the synchronize option for development. Also I have a case where I would like to use these options in my small project without creating and applying a migration. And of course this is not recommended for production https://typeorm.io/faq#how-do-i-update-a-database-schema.

eldargab commented 10 months ago

We had such request before, but I'm not in favour of it.

Will leave it open for other team members to decide. @dzhelezov , @mo4islona

eldargab commented 10 months ago

Here is one example showing that it is not as benign as it looks.

Consider the case when both TypeORM based graphql server extensions and the processor is used. User can easily start both simultaneously leading to a race between migration procedures. At the same time we know, that TypeORM doesn't handle migration races properly.

smaknsk commented 10 months ago

The default value is false. If someone sets this to true, they probably know what they're doing. Squid-sdk is a framework and I think being able to control typeORM settings is a good thing :)

llllvvuu commented 7 months ago

Generally people don't set this in prod. It is useful for dev, where too lazy to run migrations. I would be a user.