daily pastebin goal
30%
SHARE
TWEET

kobsu

a guest Feb 16th, 2010 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- phing build file to create database -->
  3. <project name="myproject" default="build">
  4.         <property name="db.host" value="localhost" />
  5.         <property name="db.name" value="myproject_test" />
  6.         <property name="db.user" value="development" />
  7.         <property name="db.pass" value="passwd" />
  8.         <property name="db.dir.create" value="./schema/create" />
  9.         <property name="db.dir.insert" value="./schema/insert" />
  10.  
  11.         <!-- nothing here yet -->
  12.         <target name="prepare"></target>
  13.         <target name="build" depends="prepare"></target>
  14.  
  15.         <target name="createdb">
  16.                 <exec command="mysql -u${db.user} -p${db.pass} -h ${db.host} -e 'CREATE DATABASE IF NOT EXISTS `${db.name}` CHARSET=utf8 COLLATE=utf8_swedish_ci;'" />
  17.                 <!-- there is an error in phing docs... this is pdo, not pdosqlexec as mentioned in docs -->
  18.                 <pdo url="mysql:host=${db.host};dbname=${db.name}" userid="${db.user}" password="${db.pass}" encoding="utf8">
  19.                         <transaction src="${db.dir.create}/create_table1.sql" />
  20.                         <transaction src="${db.dir.create}/create_table2.sql" />
  21.                         <transaction src="${db.dir.create}/create_table3.sql" />
  22.  
  23.                         <transaction src="${db.dir.insert}/insert_table1.sql" />
  24.                 </pdo>
  25.         </target>
  26.  
  27.         <target name="testdata" depends="createdb">
  28.                 <pdo url="mysql:host=${db.host};dbname=${db.name}" userid="${db.user}" password="${db.pass}" encoding="utf8">
  29.                         <transaction src="${db.dir.insert}/set_encoding.sql" /> <!-- set encoding here, because attribute above didn't work -->
  30.                         <transaction src="${db.dir.insert}/test/insert_test_table1.sql" />
  31.                         <transaction src="${db.dir.insert}/test/insert_test_table2.sql" />
  32.                         <transaction src="${db.dir.insert}/test/insert_test_table3.sql" />
  33.                 </pdo>
  34.         </target>
  35. </project>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top