Skip to content

Instantly share code, notes, and snippets.

@Stelian
Created February 15, 2017 19:34
Show Gist options
  • Save Stelian/69d4ee6fb02122ae41dd3d3a32cf3fe2 to your computer and use it in GitHub Desktop.
Save Stelian/69d4ee6fb02122ae41dd3d3a32cf3fe2 to your computer and use it in GitHub Desktop.
ALTER TABLE objects ADD COLUMN namespace VARCHAR(255) GENERATED ALWAYS AS (SUBSTRING_INDEX(key, '.', 1)) STORED;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment