-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #817 from rybaktomasz/ticket_5568
Fixes #5568 -- DROP INDEX subcommand
- Loading branch information
Showing
7 changed files
with
121 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from __future__ import unicode_literals | ||
|
||
from optparse import make_option | ||
|
||
from django.core.management.base import AppCommand | ||
from django.core.management.sql import sql_destroy_indexes | ||
from django.db import connections, DEFAULT_DB_ALIAS | ||
|
||
class Command(AppCommand): | ||
help = "Prints the DROP INDEX SQL statements for the given model module name(s)." | ||
|
||
option_list = AppCommand.option_list + ( | ||
make_option('--database', action='store', dest='database', | ||
default=DEFAULT_DB_ALIAS, help='Nominates a database to print the ' | ||
'SQL for. Defaults to the "default" database.'), | ||
|
||
) | ||
|
||
output_transaction = True | ||
|
||
def handle_app(self, app, **options): | ||
return '\n'.join(sql_destroy_indexes(app, self.style, connections[options.get('database')])) | ||
|
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
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
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