Skip to content

Instantly share code, notes, and snippets.

@jameswnl
Created March 17, 2016 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jameswnl/705e3c6847adcf500aef to your computer and use it in GitHub Desktop.
Save jameswnl/705e3c6847adcf500aef to your computer and use it in GitHub Desktop.
DB migration plan for VMware Distributed vSwitch support:
PR1:
1. update table switches.uid_ems = switches.host_id + "|" + switches.uid_ems
2. add index to switches on field uid_ems :uniquness => true
(VDS already has its uid_ems natural unique, this migration is to enforce that for local vSwitches)
PR2:
1. create a join table between hosts and switches, host_switches
2. populate (host_switches.host_id, host_switches.uid_ems) = (switches.host_id, switches.uid_ems)
3. drop switches.host_id
(VDS and host is n:n relationshiop, so a join table is needed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment