Please run archives.sql before trying out the script as it will create the database. You can have a look at the schema also and check whether it is according to the way you desired.