do not use foreign data as your unique id in your database. id should be it's own thing, usually start at 1 increment by 1, and a different column should store your tunnel id. This way you can set the tunnel id as the lowest available number and recycle ids. also, this is good db design so do it anyway.We have a database we keep all of our units in, we use an arbitrary (read sequential) numbering system. We use these arbitrary numbers as reference numbers and as the tunnel ID in reference to the unit. We are nearing the point where any new units won't be able to use existing scripts and EOIP tunnels due to this.