@@ -880,7 +880,13 @@ Preparing the Database to Store Sessions
880880........................................
881881
882882Before storing sessions in the database, you must create the table that stores
883- the information. The session handler provides a method called
883+ the information.
884+
885+ With Doctrine installed, the session table will be automatically generated when
886+ you run the make:migration command if the database targeted by doctrine is identical to
887+ the one used by this component.
888+
889+ Or if you prefer to create the table yourself and the table has not already been created, the session handler provides a method called
884890:method: `Symfony\\ Component\\ HttpFoundation\\ Session\\ Storage\\ Handler\\ PdoSessionHandler::createTable `
885891to set up this table for you according to the database engine used::
886892
@@ -890,7 +896,9 @@ to set up this table for you according to the database engine used::
890896 // the table could not be created for some reason
891897 }
892898
893- If you prefer to set up the table yourself, it's recommended to generate an
899+ If the table already exists an exception will be thrown.
900+
901+ If you would rather set up the table yourself, it's recommended to generate an
894902empty database migration with the following command:
895903
896904.. code-block :: terminal
@@ -904,6 +912,10 @@ file and run the migration with the following command:
904912
905913 $ php bin/console doctrine:migrations:migrate
906914
915+ If needed, you can also add this table to your schema by calling
916+ :method: `Symfony\\ Component\\ HttpFoundation\\ Session\\ Storage\\ Handler\\ PdoSessionHandler::configureSchema ` method
917+ in your code.
918+
907919.. _mysql :
908920
909921MariaDB/MySQL
0 commit comments