Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #18468 testcase to cover SQL Comment
- Loading branch information
1 parent
8192ba0
commit 1a1e4d5
Showing
5 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
tests/migrations/test_migrations_db_comment/0001_initial.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
initial = True | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
"Author", | ||
[ | ||
("id", models.AutoField(primary_key=True)), | ||
("name", models.CharField(max_length=255, db_comment='db comment to name Field')), | ||
("slug", models.SlugField(null=True)), | ||
("age", models.IntegerField(default=0, db_comment='db comment to age Field')), | ||
("silly_field", models.BooleanField(default=False, db_comment='db comment to bool Field')), | ||
], | ||
options={ | ||
"db_table_comment": "I am table Comment", | ||
} | ||
), | ||
migrations.CreateModel( | ||
"Tribble", | ||
[ | ||
("id", models.AutoField(primary_key=True)), | ||
("fluffy", models.BooleanField(default=True)), | ||
], | ||
options={ | ||
"db_table_comment": "I am tribble table Comment", | ||
} | ||
), | ||
migrations.AddField( | ||
model_name='tribble', | ||
name='bool_field', | ||
field=models.BooleanField(default=False, db_comment='new db comment'), | ||
), | ||
migrations.AlterField( | ||
model_name='author', | ||
name='silly_field', | ||
field=models.BooleanField(default=True, db_comment='changed db comment') | ||
), | ||
] |
29 changes: 29 additions & 0 deletions
29
tests/migrations/test_migrations_db_comment/0002_second.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("migrations", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
|
||
migrations.DeleteModel("Tribble"), | ||
|
||
migrations.RemoveField("Author", "silly_field"), | ||
|
||
migrations.AddField("Author", "rating", | ||
models.IntegerField(default=0, db_comment='new comment for rating Column')), | ||
|
||
migrations.CreateModel( | ||
"Book", | ||
[ | ||
("id", models.AutoField(primary_key=True)), | ||
( | ||
"author", | ||
models.ForeignKey("migrations.Author", models.SET_NULL, db_comment='this is FK', null=True) | ||
), | ||
], | ||
) | ||
|
||
] |
Empty file.