Commit Graph

184 Commits

Author SHA1 Message Date
Jacob Walls 80d38de52b Fixed #34051 -- Made makemigrations --check exit before making migrations. 2022-09-28 09:48:07 +02:00
JunKi Yoon 1a7b6909ac Fixed #34052 -- Made migrate --check don't emit signals and output when up to date. 2022-09-27 21:10:30 +02:00
Alberto Planas 4e13b40a76
Fixed #33887 -- Fixed test_fails_squash_migration_manual_porting() on final tags.
Regression in 7c318a8bdd.
2022-08-03 16:36:04 +02:00
David Wobrock e286ce17ff Fixed #24870 -- Added --update option to makemigrations command. 2022-06-17 07:50:39 +02:00
Adam Johnson 6f453cd298 Fixed #33509 -- Added "(no-op)" to sqlmigrate output for operations without SQL statement. 2022-04-21 12:25:16 +02:00
Adam Johnson f15f7d395c Refs #33509 -- Made sqlmigrate tests stricter and improved isolation. 2022-04-21 12:21:46 +02:00
Mariusz Felisiak d11944be34
Refs #33476 -- Added warning to optimizemigration/squashmigrations commands when black cannot be applied. 2022-02-23 07:29:15 +01:00
David Wobrock 7c318a8bdd Fixed #27844 -- Added optimizemigration management command. 2022-02-22 10:30:40 +01:00
Carlton Gibson d113b5a837 Refs #33476 -- Made management commands use black.
Run black on generated files, if it is available on PATH.
2022-02-11 12:23:26 +01:00
Mariusz Felisiak 7119f40c98 Refs #33476 -- Refactored code to strictly match 88 characters line length. 2022-02-07 20:37:05 +01:00
django-bot 9c19aff7c7 Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
Mariusz Felisiak c5cd878382
Refs #33476 -- Refactored problematic code before reformatting by Black.
In these cases Black produces unexpected results, e.g.

def make_random_password(
    self,
    length=10,
    allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789',
):

or

cursor.execute("""
SELECT ...
""",
    [table name],
)
2022-02-03 11:20:46 +01:00
Jacob Walls 2d8232fa71 Fixed #26760 -- Added --prune option to migrate command. 2022-01-21 17:10:31 +01:00
Jacob Walls 6f78cb6b13 Fixed #29026 -- Added --scriptable option to makemigrations. 2022-01-10 18:49:57 +01:00
Jacob Walls 0ab58c1209 Refs #29026 -- Allowed customizing InteractiveMigrationQuestioner's prompt destination.
Previously, the questioner did not obey the value of stdout provided
to the command.
2022-01-03 12:30:51 +01:00
Mariusz Felisiak 2d07e1aaeb
Refs #22983 -- Added tests for squashing migrations with functions from migration files.
Follow up to ebb13bbd88.
2021-12-27 18:49:19 +01:00
Jacob Walls 1833a9eee9 Increased test coverage of django.db.migrations.questioner. 2021-12-20 11:11:39 +01:00
andrewdotn 9e6d631697
Fixed #33246 -- Made squashmigrations raise CommandError when squashed_name already exists. 2021-11-02 07:13:42 +01:00
Jacob Walls 15683cdb95 Fixed #23953 -- Made makemigrations continue number sequence for squashed migrations. 2021-10-15 06:59:31 +02:00
Jacob Walls 32f1fe5f89 Fixed #29470 -- Logged makemigrations automatic decisions in non-interactive mode. 2021-10-12 15:19:39 +02:00
Jacob Walls 241ba23870 Refs #29470 -- Added makemigrations test for adding fields with no default and auto_now_add=True in non-interactive mode. 2021-10-12 15:19:39 +02:00
Jacob Walls 47f791f132 Fixed #23408 -- Added migrations questioner prompt for adding unique fields with a callable default. 2021-10-06 08:05:33 +02:00
Jacob Walls 3219dd3388 Fixed #24900 -- Allowed migrating backward to squashed migrations. 2021-08-30 12:08:04 +02:00
Mateo Radman 02bc7161ec Fixed #32900 -- Improved migrations questioner prompts. 2021-08-27 13:27:41 +02:00
Mateo Radman 61c5eae516 Refs #32900 -- Added makemigrations tests for messages in interactive mode. 2021-08-27 13:27:41 +02:00
Jacob Walls 910ecd1b8d Fixed #29063 -- Fixed migrate crash when specifying a name of partially applied squashed migrations. 2021-08-04 09:57:32 +02:00
Jacob Walls 2dfc1066a0 Fixed #25250 -- Clarified partially recorded state of squashed migrations in showmigrations --list. 2021-06-11 09:35:42 +02:00
Mariusz Felisiak 2f435e75ab
Fixed isolation of test_showmigrations_unmigrated_app().
Follow up to 90916f050c.
2021-04-23 10:06:08 +02:00
Mariusz Felisiak 90916f050c
Fixed isolation of test_showmigrations_unmigrated_app(). 2021-04-22 17:43:58 +02:00
Daniel Ebrahimian 3f8979e37b Fixed #32350 -- Fixed showmigrations crash for applied squashed migrations.
Thanks Simon Charette for reviews.
2021-02-04 21:17:26 +01:00
Simon Charette f23b05696e Fixed #32395 -- Allowed capturing stdout of migration signals. 2021-02-04 11:19:49 +01:00
Mariusz Felisiak ada83fd8b8
Fixed isolation of test_migrate_fake_split_initial. 2020-12-23 07:48:45 +01:00
Jon Dufresne 796be5901a Fixed #31769 -- Improved default naming of merged migrations.
47 gives 60 in total (47 + 5 + 5 + 3).
2020-07-20 15:04:22 +02:00
François Freitag 04e4f80c1f Sorted conflicting migrations by names. 2020-07-10 12:18:42 +02:00
Chinmoy Chakraborty 2928019e0c Fixed #31645 -- Enhanced the migration warning for migrate commmand.
Added the list of apps with changes not reflected in migrations.
2020-06-12 10:26:06 +02:00
davidchorpash 07506a6114 Fixed #31661 -- Removed period in makemigrations history check warning. 2020-06-08 06:46:23 +02:00
Mariusz Felisiak 42de52affe
Fixed isolation of test_migrate_fake_initial. 2020-05-28 09:32:43 +02:00
wtkm11 9756c33429 Fixed #31504 -- Allowed calling makemigrations without an active database connection. 2020-05-19 10:24:23 +02:00
François Freitag f19bb54fb1 Added test for squashmigrations' output. 2020-04-28 06:32:43 +02:00
François Freitag 687cb38a05 Removed unnecessary capturing/hiding of stdout/stderr in various tests. 2020-04-27 08:06:12 +02:00
François Freitag a8d175c297 Disabled management commands output with verbosity 0 in test_regression_22823_unmigrated_fk_to_migrated_model. 2020-04-27 07:43:09 +02:00
François Freitag da606513db
Removed unnecessary capturing of stdout in test_makemigrations_non_interactive_not_null_addition. 2020-04-25 20:53:53 +02:00
Gordon Pendleton d0da2820ca Fixed #31402 -- Added migrate --check option.
Command exits with non-zero status if unapplied migrations exist.
2020-03-26 20:12:39 +01:00
David Wobrock d88365708c Fixed #31318 -- Allowed sqlmigrate to inspect squashed migrations. 2020-03-09 08:42:30 +01:00
David Wobrock b88ad1d356 Refs #31318 -- Added tests for inspecting squashed migrations and ambiguous names in sqlmigrate. 2020-03-09 08:21:34 +01:00
Matthijs Kooijman 2a2ea4ee18 Refs #31117 -- Made various tests properly handle unexpected databases aliases.
- Used selected "databases" instead of django.db.connections.
- Made routers in tests.migrations skip migrations on unexpected
  databases.
- Added DiscoverRunnerGetDatabasesTests.assertSkippedDatabases() hook
  which properly asserts messages about skipped databases.
2020-01-20 14:39:02 +01:00
Hasan Ramezani 530dd193f2 Fixed #29808 -- Fixed initial migration detection when identifiers are case-insensitive.
Thanks Simon Charette for the review.
2019-11-15 09:01:30 +01:00
Mariusz Felisiak 06d34aab7c Fixed #30870 -- Fixed showing that RunPython operations are irreversible by migrate --plan.
Thanks Hasan Ramezani for the initial patch and Kyle Dickerson for the
report.
2019-10-14 11:13:27 +02:00
Mariusz Felisiak 05186c03a3 Isolated migrations.test_commands.MigrateTests.test_migrate_plan. 2019-10-14 08:42:38 +02:00
Min ho Kim 65e86948b8 Corrected several typos in string literals and test names. 2019-08-07 11:23:14 +02:00