-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
WIP: Improve postgresql support #14794
base: develop
Are you sure you want to change the base?
Conversation
💖 Thanks for this pull request! 💖 We use semantic commit messages to streamline the release process and easily generate changelogs between versions. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix if it doesn't have one already. Examples of commit messages with semantic prefixes:
Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
PR Summary
|
saving settings on security page fails:
tried the same trick in
|
Thanks for looking into this - can you please make these changes against the |
(Unfortunately, you probably won't be able to retarget cleanly) |
ah sorry, didn't realize |
suggested in snipe#7600 (comment) improves interoperability with postgresql where the database fields are of type boolean see snipe#7600 & snipe#13615
…skin from POST the value matches the default set in the database migration creating the field avoids error 500 when saving branding or general settings on postgresql, because those fields end up with a 'not null' constraint in the schema.
5ec9564
to
40a621c
Compare
i've checked and i can successfully save settings on:
saving settings on label page fails:
i've tried the following but it's not enough, i still get the null violation on
|
Weird that that's not working there... that would be the Laravel way to set a default for those values. 🤔 |
another thing that i noted, since i've the
as if https://github.com/snipe/snipe-it/blob/develop/resources/views/layouts/default.blade.php#L39 didn't contain if i look at the generated HTML there's plenty of spaces between
the
|
that restores a working skin but feels... meh? |
Another buglet passing by.. sometimes visiting the asset list for a given order (eg
and the list of assets shown is empty |
I'm not sure that's related though. If you run the following query, do you get any results?
|
(It might be related - I'm not sure.) |
hm sorry, you're right that's unrelated, reloading the hardware by order id page doesn't trigger the traceback i saw in the log (which is probably coming from visiting another page). It's just weird that the list is empty, given i get there by clicking on the order id associated to an asset. I was pretty sure that feature worked/works... i've seen it working at some point, at least. I'll dig further, and also try to figure out what page triggered the sql exception i saw |
When we see that, it's usually because some data got into the database that's a little off. The query I gave you above should find any assets that are checked out to a user ( |
i have nothing returned by this request, eg all assigned assets are either assigned properly to a location or a user what i found strange in the sql exception was the |
We're also seeing internally if there isn't an easy way to set up an automated pgSQL test for GH actions. I expect some tests would fail normally anyway (we have to skip some tests in sqlite, for example because the test framework doesn't handle it exactly right) but we could probably try to add something for pgSQL as well, at least to give us a heads up, once we get this to a more-working position. |
(Stupidly, speaking of GH actions, Codacy for some reason is saying this PR created 2 new issues, but when I go to the dashboard on Codacy, it can't seem to find any new issues from the PR. Sigh. Technology, man.) |
That's not even a pgSQL issue though, that's Laravel mix. Shot in the dark, but if you try
using the null coalescence operator instead, does that work any better? (We're going to be moving a lot of stuff over to that anyway in v7.)
It does feel meh, but I suppose it won't hurt anything to keep it. Just not sure why we'd need it - there isn't any space padding in the DB for those... |
nah, with that sadly the skin is still broken (eg edit: it works if i use
i can also work around this issue by nulling the |
Description
WIP to Fixes #13615 & #7600
the rationale is to:
with those two commits i can save settings on general & branding pages, will check for others....
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Tested on postgresql only, needs testing on mysql. php 8.1, using 6.4.2, on OpenBSD w/ nginx.
Checklist: