MCPcopy
hub / github.com/django/django / database_backwards

Method database_backwards

django/contrib/postgres/operations.py:45–56  ·  view source on GitHub ↗
(self, app_label, schema_editor, from_state, to_state)

Source from the content-addressed store, hash-verified

43 )
44
45 def database_backwards(self, app_label, schema_editor, from_state, to_state):
46 if schema_editor.connection.vendor != "postgresql" or not router.allow_migrate(
47 schema_editor.connection.alias, app_label, **self.hints
48 ):
49 return
50 if self.extension_exists(schema_editor, self.name):
51 schema_editor.execute(
52 "DROP EXTENSION IF EXISTS %s" % schema_editor.quote_name(self.name)
53 )
54 # Clear cached, stale oids.
55 get_hstore_oids.cache_clear()
56 get_citext_oids.cache_clear()
57
58 def extension_exists(self, schema_editor, extension):
59 with schema_editor.connection.cursor() as cursor:

Calls 4

extension_existsMethod · 0.95
allow_migrateMethod · 0.45
executeMethod · 0.45
quote_nameMethod · 0.45