Re: Why does sqlmigrate need a connection to an existing database?

2021-12-24 Thread Shmuel Treiger
To any future readers, the real answer is that connections are deeply baked into how Django migrations operate. Things as seemingly simple as `can_migrate_model` require a connection. The other problems pointed out by Jason are easily patched, but the schema_editor (and all of the migration ope

Re: Why does sqlmigrate need a connection to an existing database?

2021-12-10 Thread Shmuel Treiger
Build graph has a specific separate path for `if self.connection is None:`, so that shouldn't be an issue? As far as atomicity, what if, in a case where no connection is found, it could just prompt: "No database connection found. Do you want your migration to be atomic? (y/N)" On Thursday, 9 De

Why does sqlmigrate need a connection to an existing database?

2021-12-07 Thread Shmuel Treiger
Wondering why sqlmigrate needs a connection to an existing database. I understand that for certain commands, it needs the database to generate the migration. But for most (basic) commands, no connection is really needed. For example, I created a test project