{"id":831,"date":"2010-06-07T16:51:04","date_gmt":"2010-06-07T11:21:04","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=831"},"modified":"2016-12-19T15:05:48","modified_gmt":"2016-12-19T09:35:48","slug":"how-to-change-default-table-engine-in-grails","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/how-to-change-default-table-engine-in-grails\/","title":{"rendered":"Change default table engine in Grails 1.1"},"content":{"rendered":"<p>Recently in our project the client had the requirement that he want each table have &#8216;InnoDB&#8217; but Grails by default provided the MyIsam tables. We highly depends upon the create drop, update feature of grails and We dont want to change the table engine of every table manually.<br \/>\nSo after reading few docs of Grail we found the clean way of changing the default engine type of grails table<\/p>\n<p>We just need to do configure DataSource.groovy and add the dialect to it.<\/p>\n<pre>\r\ndataSource {\r\n    pooled = true\r\n    driverClassName = \"com.mysql.jdbc.Driver\"\r\n    username = \"username\"\r\n    password = \"password\"\r\n    dialect = 'org.hibernate.dialect.MySQL5InnoDBDialect'\r\n}\r\n<\/pre>\n<p>By adding a line we are done. This really depicts Grails is really highly configurable<\/p>\n<p><\/p>\n<p>Hope it helps<br \/>\n<a href=\"http:\/\/www.tothenew.com\/blog\/author\/uday\/\">Uday Pratap Singh<\/a><br \/>\n<a href=\"mailto:uday@intelligrape.com\">uday@intelligrape.com<\/a><br \/>\n<a href=\"https:\/\/twitter.com\/farjinaarad\">https:\/\/twitter.com\/meudaypratap<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently in our project the client had the requirement that he want each table have &#8216;InnoDB&#8217; but Grails by default provided the MyIsam tables. We highly depends upon the create drop, update feature of grails and We dont want to change the table engine of every table manually. So after reading few docs of Grail [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":0},"categories":[7],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/831"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=831"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/831\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}