Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ignoreafter andfirst attributes with default values#64

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
roxblnfk merged 3 commits into4.xfromignore-after-size-attributes
Jul 13, 2025

Conversation

@puzzledpolymath
Copy link
Contributor

@puzzledpolymathpuzzledpolymath commentedJul 12, 2025
edited
Loading

Since the pull requestcycle/database#226 has been merged, it might be a good idea to ignore thefirst andafter attributes when equaling the default values? So migrations are not declaring them for every column when not needed.

🔍 What was changed

  • Added logic to ignore thefirst andafter attributes when equaling the default values.
  • Added some test cases (using Reflection) for theRenderer::columnOptions method.

🤔 Why?

When thinking about how column positioning would be used in migrations, I'm of the opinion they would be defined manually. As in I can't imagine defining this for an entity, instead I'd likely generate a migration, say containing an added column and then modify the options to position the new column after and existing column, to suit an order I prefer.

publicfunctionup():void    {$this->table('api_key')->addColumn('expires_at','datetime', ['nullable' =>true,'defaultValue' =>null,'comment' =>'Date and time API key will expire','after' =>'updated_at',        ]);    }

📝 Checklist

  • How was this tested:
    • Unit tests added

@cyclecycle deleted a comment fromcodecovbotJul 12, 2025
@codecov
Copy link

codecovbot commentedJul 12, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.29%. Comparing base(7d977c2) to head(f67926b).
Report is 4 commits behind head on 4.x.

Additional details and impacted files
@@             Coverage Diff              @@##                4.x      #64      +/-   ##============================================+ Coverage     95.26%   95.29%   +0.02%- Complexity      244      248       +4============================================  Files            30       30                Lines           782      786       +4     ============================================+ Hits            745      749       +4  Misses           37       37

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

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@roxblnfkroxblnfk merged commitc1712b6 into4.xJul 13, 2025
19 checks passed
@roxblnfkroxblnfk deleted the ignore-after-size-attributes branchJuly 13, 2025 07:22
@roxblnfkroxblnfk changed the titleIgnore after size attributesIgnoreafter andfirst attributes with default valuesJul 13, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@roxblnfkroxblnfkroxblnfk approved these changes

@msmakouzmsmakouzAwaiting requested review from msmakouz

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@puzzledpolymath@roxblnfk

[8]ページ先頭

©2009-2025 Movatter.jp