code: def get_migrations_applied(engine, connection):
      
  
      try:
          # Get cursor based on engine
          if engine == 'postgresql':
              cursor = connection.cursor(
                  cursor_factory=psycopg2.extras.RealDictCursor)
          else:
              cursor = connection.cursor()
  
          sql = "SELECT id, name, date FROM migrations_applied"
          cursor.execute(sql)
          rows = cursor.fetchall()
          # print (rows);
          return rows
      except psycopg2.ProgrammingError:
          raise RuntimeError(
              'The table `migrations_applied` is missing. Please refer to the project documentation at https://github.com/gabfl/dbschema.')
      except pymysql.err.ProgrammingError:
          raise RuntimeError(
              'The table `migrations_applied` is missing. Please refer to the project documentation at https://github.com/gabfl/dbschema.')
docs: Get list of migrations already applied