Commit 86b9a18d authored by Fabien Potencier's avatar Fabien Potencier

merged branch KodoArkivo/patch-2 (PR #596)

This PR was merged into the master branch.

Commits
-------

d740c4e2 Sample user insert snippet.

Discussion
----------

Sample user insert snippet.

The execute_query command to insert users into a sample database doesn't work with postgres due to the use of database specific string escape quotes. Changed to use the doctrine insert command which is less DB specific and better illustrates the use of DBAL.

---------------------------------------------------------------------------

by stof at 2013-01-19T11:57:24Z

👍
parents e82a9a3b d740c4e2
...@@ -497,8 +497,17 @@ sample users:: ...@@ -497,8 +497,17 @@ sample users::
$schema->createTable($users); $schema->createTable($users);
$app['db']->executeQuery('INSERT INTO users (username, password, roles) VALUES ("fabien", "5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg==", "ROLE_USER")'); $app['db']->insert('users', array(
$app['db']->executeQuery('INSERT INTO users (username, password, roles) VALUES ("admin", "5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg==", "ROLE_ADMIN")'); 'username' => 'fabien',
'password' => '5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg==',
'roles' => 'ROLE_USER'
));
$app['db']->insert('users', array(
'username' => 'admin',
'password' => '5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg==',
'roles' => 'ROLE_ADMIN'
));
} }
.. tip:: .. tip::
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment