Skip to content

Commit

Permalink
ALTER_QUERY::FIXED:: Also rename __schema__ document for renamed coll…
Browse files Browse the repository at this point in the history
…ection
  • Loading branch information
frikilax committed May 15, 2024
1 parent 421cba3 commit 5507210
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions djongo/djongo/sql2mongo/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,16 @@ def _rename_column(self):

def _rename_collection(self):
self.db[self.left_table].rename(self._new_name)
self.db['__schema__'].update_one(
{
'name': self.left_table
},
{
'$set': {
'name': self._new_name
}
}
)

def _alter(self, statement: SQLStatement):
self.execute = lambda: None
Expand Down

0 comments on commit 5507210

Please sign in to comment.