Skip to content

Add default table names #44

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 8 commits into from
Sep 15, 2023
Merged

Add default table names #44

merged 8 commits into from
Sep 15, 2023

Conversation

arogachev
Copy link
Contributor

Q A
Is bugfix?
New feature?
Breaks BC?

@arogachev arogachev requested a review from a team September 13, 2023 07:28
@arogachev arogachev self-assigned this Sep 13, 2023
@arogachev arogachev added type:enhancement Enhancement status:code review The pull request needs review. labels Sep 13, 2023
@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.39% ⚠️

Comparison is base (1a805a7) 99.42% compared to head (eccfd9b) 99.04%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #44      +/-   ##
============================================
- Coverage     99.42%   99.04%   -0.39%     
- Complexity      123      126       +3     
============================================
  Files             9        9              
  Lines           518      521       +3     
============================================
+ Hits            515      516       +1     
- Misses            3        5       +2     
Files Changed Coverage Δ
src/AssignmentsStorage.php 100.00% <ø> (ø)
src/ItemsStorage.php 100.00% <ø> (ø)
src/DbSchemaManager.php 100.00% <100.00%> (ø)
src/ItemTreeTraversal/MysqlItemTreeTraversal.php 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@what-the-diff
Copy link

what-the-diff bot commented Sep 13, 2023

PR Summary

  • Included Default Table Names in 'CHANGELOG.md'

    • The changes reflect an enhancement in the use of default table names within the "CHANGELOG.md" file. Some hardcoded aspects in the queries have been fixed, and default table names now use specific prefixes.
  • Updated Default Table Names in 'README.md' and SQL Migration Files

    • This update changes previously used 'auth_' prefixes for table names to a 'yii_rbac_' prefix. This change reflects in plain SQL sample code in "README.md" and is consistent across multiple database systems SQL migration files.
  • Changes in Source Code Files

    • The Use of table names in the src/AssignmentsStorage.php and src/ItemsStorage.php files will now utilise the 'DbSchemaManager' constants 'ASSIGNMENTS_TABLE' and 'ITEMS_TABLE'. This change has also been applied to the 'DbSchemaManager.php', and 'MysqlItemTreeTraversal.php' files. This enhances the code's adaptability and easy referencing of the table names.
  • Updated Table Names in Tests

    • The table names referenced in the tests have been updated. The hardcoded table names have been replaced with references from the 'DbSchemaManager' for consistency and simplicity.
  • Security Test Changes

    • Various tests, with a focus on transaction errors and success scenarios, have been streamlined. The '$itemsChildrenTable' parameter from the 'ItemsStorage' constructor was removed in the process, aiding in code simplicity.
  • Modifications in 'SchemaTrait.php', 'TestCase.php', and 'SchemaTrait.php' (inside the 'Sqlite' Folder)

    • Some constants such as 'ITEMS_TABLE', 'ASSIGNMENTS_TABLE', and 'ITEMS_CHILDREN_TABLE' were removed and replaced with references to constants from 'DbSchemaManager'. This makes the system more coherent and avoid repeated hardcoding of these constants. The constants in 'SchemaTrait.php' specifically within the 'Sqlite' folder, have been updated with new table names.

These changes overall enhance the code's readability, maintainability, and consistency across various components of the system and between different types of databases. It will be easier to track and modify table names as they are now centrally referenced in the 'DbSchemaManager'.

@arogachev arogachev merged commit faf5795 into master Sep 15, 2023
@arogachev arogachev deleted the default-table-names branch September 15, 2023 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review. type:enhancement Enhancement
Projects
None yet
2 participants