For the next 200 years, Krakow underwent a programme of total reconstruction, with the addition of an outer wall to protect the city from further invasions. Once the city’s glory was restored, it also began to prosper as a major trade centre, maintaining this position for a few hundred years, and also continuing as the capital of Poland until 1791.
Constitutional reforms enacted at that time resulted in the capital being moved to Warsaw; and also resulted in destabilising Krakow and it being invaded and ruled by a number of countries in the following centuries. This actually continued through WWI, at which time Poland re-emerged as a sovereign nation after almost 150 years of foreign occupation and rule.