#NEWLINE# def ensure_schema( self ) : #NEWLINE# #INDENT# '\n        Ensures the table exists and has the correct schema.\n        ' #NEWLINE# if ( self . Migration . _meta . db_table in self . connection . introspection . table_names ( self . connection . cursor ( ) ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# with self . connection . schema_editor ( ) as editor : #NEWLINE# #INDENT# editor . create_model ( self . Migration ) #NEWLINE# #UNINDENT# #UNINDENT# except DatabaseError as exc : #NEWLINE# #INDENT# raise MigrationSchemaMissing ( ( 'Unable to create the django_migrations table (%s)' % exc ) )