Statement create_table
also creates sequence for id (named :tablename_id_seq
).
So we have to create "non id_seq" sequences before tables, so they can be used in creating tables.
And, just for safety, try to create sequences "id_seq" after tables (silently skipping no-creation-for-duplicate-sequence)