Skip to content

Instantly share code, notes, and snippets.

@jbruni
Created September 11, 2013 16:10
Show Gist options
  • Save jbruni/6525859 to your computer and use it in GitHub Desktop.
Save jbruni/6525859 to your computer and use it in GitHub Desktop.
Querying information_schema at MySQL to get all DEFAULT values assigned at a given database schema. Right now I wanted this information to assign these values as default to the corresponding properties at my model classes...
SELECT * FROM `COLUMNS` WHERE (TABLE_SCHEMA = 'schema_name') AND (COLUMN_DEFAULT IS NOT NULL);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment