def _add_foreign_keys(self, blueprint):
        sql = ''

        foreigns = self._get_commands_by_name(blueprint, 'foreign')

        for foreign in foreigns:
            sql += self._get_foreign_key(foreign)

            if foreign.get('on_delete'):
                sql += ' ON DELETE %s' % foreign.on_delete

            if foreign.get('on_update'):
                sql += ' ON UPDATE %s' % foreign.on_delete

        return sql
dataset/ETHPy150Open sdispater/orator/orator/schema/grammars/sqlite_grammar.py/SQLiteSchemaGrammar._add_foreign_keys/original