Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Lock] create migration for lock table when DoctrineDbalStore is used #48999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

alli83
Copy link
Contributor

@alli83 alli83 commented Jan 16, 2023

Q A
Branch? 6.3
Bug fix? no
New feature? yes
Deprecations? no
Tickets
License MIT
Doc PR to do

The purpose of this PR is to automatically generate the lock table with the make migration command when DoctrineDbalStore is used.

DoctrineBundle PR => doctrine/DoctrineBundle#1618

@alli83 alli83 requested a review from jderusse as a code owner January 16, 2023 18:54
@carsonbot carsonbot added this to the 6.3 milestone Jan 16, 2023
@alli83 alli83 force-pushed the lock-create-automatically-lock-table branch from 4e2f094 to e41cc54 Compare January 16, 2023 18:55
@alli83 alli83 changed the title [Lock] create migration for lock table when PdoLockStore or DoctrineDbalStore is used [Lock] create migration for lock table when PdoStore or DoctrineDbalStore is used Jan 16, 2023
@alli83 alli83 force-pushed the lock-create-automatically-lock-table branch from e41cc54 to f6780d5 Compare January 16, 2023 19:00
@alli83 alli83 marked this pull request as draft January 16, 2023 19:26
@alli83 alli83 force-pushed the lock-create-automatically-lock-table branch 2 times, most recently from edf99a4 to a3df56e Compare January 16, 2023 19:42
@alli83
Copy link
Contributor Author

alli83 commented Jan 16, 2023

I'm going to add a tag on the store definitions in order to inject them in the lockStoreSchemasubscriber

@alli83 alli83 marked this pull request as ready for review January 17, 2023 14:21
@alli83 alli83 force-pushed the lock-create-automatically-lock-table branch 3 times, most recently from 133d715 to 6fe3d20 Compare January 17, 2023 19:39
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a doubt about the interest of this on PdoStore. To use the schema, they will have to install doctrine/dbal and instantiate a DBAL connection or use a DSN different from what is expected by PDO. What would be the point of not using DoctrineDBALStore?

@alli83
Copy link
Contributor Author

alli83 commented Jan 18, 2023

I have a doubt about the interest of this on PdoStore. To use the schema, they will have to install doctrine/dbal and instantiate a DBAL connection or use a DSN different from what is expected by PDO. What would be the point of not using DoctrineDBALStore?

Please correct me if I'm wrong, If I understand you correctly, it's that by logic if one installed doctrine/dbal, he would have chosen DoctrineDbalStore ?

I'm wondering if there is a possibility to get to that case, shouldn't we cover this case ? I mean if one doesn't want to install doctrine bundle then it will be ignored.

Thanks you for your feedback !

@GromNaN
Copy link
Member

GromNaN commented Jan 18, 2023

That's it. Basically if the project uses DoctrineBundle they will mostly use the DoctrineDbalStore to reuse the same configuration DSN and additional features. On the other hand, the project would use PdoStore when they don't include the Doctrine dependencies.

The Cache PdoAdapter has createTable but no configureSchema which is in DoctrineDbalAdapter.

For Sessions, there is a single PdoSessionHandler that accepts both DBAL and PDO DSN, that's why it has both createTable and configureSchema.

I may be wrong, but I don't find the PdoStore::configureSchema useful.

@alli83
Copy link
Contributor Author

alli83 commented Jan 19, 2023

I may be wrong, but I don't find the PdoStore::configureSchema useful.

I get your point. Not useful in the sense of not logical to get to that case. So I will update my PR.

@alli83 alli83 force-pushed the lock-create-automatically-lock-table branch from 6fe3d20 to 048f922 Compare January 19, 2023 17:34
@alli83 alli83 changed the title [Lock] create migration for lock table when PdoStore or DoctrineDbalStore is used [Lock] create migration for lock table when DoctrineDbalStore is used Jan 19, 2023
@alli83 alli83 force-pushed the lock-create-automatically-lock-table branch 2 times, most recently from 078ff4d to f64e7d9 Compare January 19, 2023 17:44
@alli83 alli83 force-pushed the lock-create-automatically-lock-table branch from f64e7d9 to 5e69f59 Compare January 19, 2023 18:22
@fabpot
Copy link
Member

fabpot commented Jan 19, 2023

Thank you @alli83.

@GromNaN
Copy link
Member

GromNaN commented Jan 20, 2023

Thank you @alli83

javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Mar 23, 2023
This PR was merged into the 6.3 branch.

Discussion
----------

[Lock] update doc creation lock table

linked to issue #17778 and PR symfony/symfony#48999

Update the methods to create the lock table.

Commits
-------

20f38c1 [Lock] update doc creation lock table
@fabpot fabpot mentioned this pull request May 1, 2023
nicolas-grekas added a commit that referenced this pull request Jun 28, 2023
…0689 (alli83)

This PR was merged into the 6.3 branch.

Discussion
----------

[Lock] add missing UPGRADE and CHANGELOG Lock mention #50689

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

$isSameDatabase parameter for DoctrineDbalStore was added in #48999.

Also related to #50689

Commits
-------

147067d [Lock] add missing UPGRADE and CHANGELOG Lock mention #50689
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants