Skip to content

Commit fee22ab

Browse files
committed
minor #17844 [HttpFoundation] update doc creation session table (alli83)
This PR was merged into the 6.3 branch. Discussion ---------- [HttpFoundation] update doc creation session table linked to issue #17569 and PR https://github.com/symfony/symfony/pull/49097/files Update the methods to create the session table. Commits ------- ace8e03 [HttpFoundation] update doc creation session table
2 parents d1f2c14 + ace8e03 commit fee22ab

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

session.rst

+14-2
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,13 @@ Preparing the Database to Store Sessions
880880
........................................
881881

882882
Before 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`
885891
to 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
894902
empty 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

909921
MariaDB/MySQL

0 commit comments

Comments
 (0)