Skip to content
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

chore: tests: use schema builder for columns setup #20

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

MohannadNaj
Copy link
Contributor

This PR will change the columns setup in tests to use the schema builder instead of the raw db-agnostic SQL.

The need for this change came from an attempt to add a "datetime" column, where PostgreSQL will throw an error type "datetime" does not exist. Action run example: https://github.com/mohannadnaj-forks/laravel-query-expressions/actions/runs/6211881746/job/16861481277#step:8:274

Pros of this change: Expressive and a guaranteed db-agnostic setup. Cons of this change: More boilerplate for tests.

Edit: The special snowflake SQLite again doesn't have this type. Maybe I should add the testing then to use the blueprint for all tests. I'll have to think about it.
#18 (comment)

Looks like it's PostgreSQL not SQLite?

This change is not really necessary since we can just use an additional parameter for unsupported types, like what's currently applied in the pending date format PR #18

P.S: I wasn't familiar with the expression "special snowflake", and I laughed a lot when I read "The conviction that one (or often, one's child) is, in some way, special and should therefore be treated differently than others" lol 😹

@tpetry
Copy link
Owner

tpetry commented Oct 30, 2023

I like that change. More boilerplate for the trst helper but the tests feel more laravel-like.

I may make some personal style changes the next days and then merge it

@tpetry
Copy link
Owner

tpetry commented Nov 1, 2023

Can you grant me the right to push changes to your branch?

@tpetry tpetry merged commit ab94832 into tpetry:main Nov 1, 2023
81 of 82 checks passed
@MohannadNaj MohannadNaj deleted the chore/tests-schema-builder branch December 25, 2023 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants