Fix SQL error on installation due to wrong table creation order