Added option to specify directories as a path for MySQL database schemas.

By using this approach we no longer have to specify schemas like this:

schema = "${myDatabaseSchemaDrvFun}/prefix/to/the/sqlfile.sql";

but like this:

schema = myDataBaseSchemaDrv;

which is in some cases more convenient.


svn path=/nixos/branches/upstart-0.6/; revision=18450
This commit is contained in:
Sander van der Burg 2009-11-18 21:56:47 +00:00
parent 27d0d2927e
commit e171b6d86e

View File

@ -124,7 +124,14 @@ in
echo "Creating initial database: ${database.name}"
( echo "create database ${database.name};"
echo "use ${database.name};"
cat ${database.schema} ) | ${mysql}/bin/mysql -u root -N
if [ -f "${database.schema}" ]
then
cat ${database.schema}
elif [ -d "${database.schema}" ]
then
cat ${database.schema}/mysql-databases/*.sql
fi
) | ${mysql}/bin/mysql -u root -N
fi
'') cfg.initialDatabases}
'';