Al-Hijr - 15:4

وَمَا أَهْلَكْنَا مِن قَرْيَةٍ إِلاَّ وَلَهَا كِتَابٌ مَّعْلُومٌ
[15:4]
And never did We destroy a town but it had a term made known.
Never did We destroy a population that had not a term decreed and assigned beforehand.
And We destroyed no township but there was a known decree for it.