title: Maven SQL plugin execution order
body: <p>I am facing some problem in ordering the sql execution.</p>
  
  <p>We have one sql script file for each table under one directory. Ex: There is user.sql and role.sql in the directory c:\SqlScripts. We are using the sql maven plugin to execute these sql files. </p>
  
  <p>The role table has a Foriegn key to the user table and the execution is failing because the plugin is trying to execute the role.sql before user.sql. I cannot use the  orderfile attribute as we specify the  as c:\SqlScripts*.sql. </p>
  
  <p>How do I overcome this problem?</p>
  
  <p>I see 2 solutions:</p>
  
  <ol>
  <li><p>Merge all scripts into one file in the creation order, the script to create role comes after the script to create user.</p></li>
  <li><p>Remove the * wildcard and specify each file in the  attribute in the order of execution.</p></li>
  <li><p>Number the name of the files according to the execution order ex: 1_user.sql, 2_role.sql and use the 'ascending' orderfile attribute(not sure if this would work though, as the ordering may not be applied)</p></li>
  </ol>
  
  <p>Any more elegant solutions?</p>