Osm Admin: ALTER TABLE. Non-NULL Data Conversion. Query Test Suite
2 years ago ∙ 5 minutes read
Implemented in Osm Admin:
- new ALTER TABLE algorithm
- NULL to non-NULL data conversion
- new query test suite
2 years ago ∙ 5 minutes read
Implemented in Osm Admin:
2 years ago ∙ 4 minutes read
This time, I tackled adding an explicit property to an existing table, and then making it non-nullable.
It raised the need for data conversions - additional handling of the existing data - or otherwise, the database engine fails, or the data becomes invalid.
And it made me split migrations in two parts - the one that runs before the data conversion, and the other one that runs afterwards.
2 years ago ∙ 3 minutes read
While working on diff algorithm I noticed a certain pattern that I use over an over again.
Using this pattern, I implemented notification table diff.
Finally, I rearranged diff/migration code for better code readability.
2 years ago ∙ 3 minutes read
Yesterday, I moved the table creation code into new schema diff migration engine.
Now, working on notification table migrations.
2 years ago ∙ 2 minutes read
This time:
2 years ago ∙ 1 minute read
Before digging into property diff algorithm, let's dig into how exactly it's used, and what other property-related logic is there.
2 years ago ∙ 2 minutes read
Yesterday, I continued working on schema migrations:
2 years ago ∙ 2 minutes read
After a system update, I've got some problem with my laptop, and one thing to check was system log files.
This got me thinking: what makes a good log for my own application? And I think that application logs are as useful as they are able to answer potential questions I may have when an application is in production.
Let's think what kind of questions I might have, and what information might be useful to answer them.
2 years ago ∙ 4 minutes read
Recently, I fixed numerous issues to make the first migration tests work.
Then, I started implementing the schema diff algorithm - the basis for schema migrations.
2 years ago ∙ 1 minute read
More dots got connected in the schema migration design, see this post for details.
Then, I tried to return to TDDing it, but strange errors met me there, so I left them to be resolved in the next piece.
2 years ago ∙ 2 minutes read
Schema migrations are going to be generated and executed automatically under gulp watch
. It will result in lots of tiny migrations: add a column, change its type, make it not nullable, and so on.
It's convenient during development, but it might be not optimal to reapply in production. Indeed, it's better to convert a large table to new structure all at once rather than running a conversion for each of the tiny migration.
This observation contradicts the previously stated migration workflow, so let's update it.
2 years ago ∙ 4 minutes read
In spirit of TDD, I started with a meaningful, but failing test that is reasonably fast. Then, I worked to make it green:
2 years ago ∙ 1 minute read
After drafting some ideas of how the schema migrations should actually work, let's start implementing it in TDD way.
2 years ago ∙ 3 minutes read
The goal of the current iteration is to adjust the database schema and preserve/convert existing data according to any changes in schema classes, grids, forms or indexers.
This post presents some thoughts how it might work with class definitions.
2 years ago ∙ 2 minutes read
After finishing the iteration "#17 Minimum UI", I revisited the goals and the scope of the minimum viable product, and picked the most pressing task for the next iteration - "#18 Database Schema Changes".
2 years ago ∙ 1 minute read
I implemented the last user action that is typical to a CRUD application - object deletion.
2 years ago ∙ 3 minutes read
Done:
INSERT INTO ... SELECT ...
statements2 years ago ∙ 2 minutes read
Last two weeks were about implementing initial version of an Osm Admin grid, integrating it seamlessly with the editing form, and enabling mass-editing of multiple objects.
After finishing it, I realized that Osm Admin had become bigger than Osm Framework! To keep up, I started writing docs for it.
And now, you have a step-by-step guide for creating a project, adding Osm Admin to it and a practical example of an admin area that you can copy to your project and try it out locally.
2 years ago ∙ 2 minutes read
Recently, I implemented mass-editing in Osm Admin. It allows you to view and edit multiple objects in a single operation.
This article describes mass-editing of products in a typical e-commerce application.
2 years ago ∙ 3 minutes read
The last 4 weeks were mostly a vacation. It's been a time for reflection, but still, I delivered some new features.
In Osm Admin, forms already allow creating new objects and saving them to the database, and editing one or several existing objects.
I've also implemented URL query filters that are applied to the underlying database query and that can be displayed in the user interface.
From now on, Osm Framework and all projects built with it - can be installed and developed under Apache and on Windows.
2 years ago ∙ 3 minutes read
In the user interface, you can narrow displayed data using grid column filters, or filters displayed in the sidebar. To enable that, apply #[Filter\*]
attributes to class properties.
Applied filters appear in the URL query parameters, for example, .../edit?id=5+16+19
, and on the page.
You can apply filters not only to a grid page, but also to a form page - to mass edit all matching objects, or to an action URL (edit, delete, or custom) - to perform the action on all matching objects.
In the same way, you can apply filters to the API URLs in order to retrieve or modify matching objects in a script.
2021 ∙ May ∙ Osm Framework
3 years ago ∙ 4 minutes read
Full-text search and layered navigation is a common feature for e-commerce applications. It's also used in this blog. Actually, it makes browsing any non-trivial data better. Under the hood, search and layered navigation interact with ElasticSearch, or other search engine, and this article describes how.
Note. This post is moved to Osm Framework documentation.
2021 ∙ May ∙ Osm Framework
3 years ago ∙ 3 minutes read
Osm Framework is an open-source, insanely fast, unprecedentedly extensible, and fun to work with PHP 8 framework for creating modern Web applications. It's built on top of tried and tested Symfony and Laravel components.
Note. This post is moved to Osm Framework documentation.