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:
parent
27d0d2927e
commit
e171b6d86e
@ -124,7 +124,14 @@ in
|
|||||||
echo "Creating initial database: ${database.name}"
|
echo "Creating initial database: ${database.name}"
|
||||||
( echo "create database ${database.name};"
|
( echo "create database ${database.name};"
|
||||||
echo "use ${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
|
fi
|
||||||
'') cfg.initialDatabases}
|
'') cfg.initialDatabases}
|
||||||
'';
|
'';
|
||||||
|
Loading…
Reference in New Issue
Block a user