Latest Updates

Documenting code, one commit at a time.

PHP CSS 10 posts
×

Making Database Migrations Idempotent: Preventing Duplicate Table Errors

This post discusses how to create idempotent database migrations, specifically focusing on preventing duplicate table errors within the Reimpact/platform project.

The Problem

During development and deployment, database migrations are essential for evolving the application's schema. However, if migrations are not carefully designed, they can lead to issues, particularly when the same

Read more

Improving Migration Handling in the Reimpact Platform

Introduction

In the Reimpact platform, we recently addressed an issue related to how database table names were being handled during migration seeding. Specifically, the system wasn't accurately extracting table names from migration files, leading to discrepancies and potential errors.

The Problem

Previously, the migrationTableAlreadyCreated method relied on parsing table names directly

Read more

Simplifying Tenant Management in Reimpact Platform

The Challenge

In multi-tenant applications, managing data isolation is crucial. The Reimpact platform, designed for managing various industrial processes, initially relied on company_id filtering within each database table to achieve this isolation. This approach, while functional, introduced redundancy and complexity across our Eloquent models.

The Solution: PostgreSQL Schema Isolation

Read more
PHP Laravel

Tenant Migrations and the Perils of Implicit State

The Reimpact/platform project involves managing multi-tenant applications. One subtle issue arose related to running migrations within these tenants. The original approach, while seemingly straightforward, introduced an unexpected dependency on implicit state, leading to incorrect migration behavior.

The Problem

Initially, tenant migrations were executed using Laravel's

Read more

Tenant Migrations: Ensuring Data Consistency in Multi-Tenant Applications

When building multi-tenant applications with Laravel, ensuring each tenant's database schema is correctly migrated can be a challenge. In the Reimpact platform, we encountered issues with tenant schemas either re-running all migrations on each deploy or skipping them entirely. This led to potential data inconsistencies and application instability.

The Problem

Without a dedicated migration

Read more
PHP Platform

Improving Report Filtering in Reimpact Platform

Introduction

Have you ever encountered a situation where a dropdown list displays irrelevant data, hindering user experience and efficiency? This post delves into a scenario within the Reimpact platform where a seemingly minor oversight in filtering generated reports led to precisely that issue, and how it was resolved.

The Problem: Unfiltered Reports

In the Reimpact platform, users rely

Read more
PHP Laravel

Tenant Schema Migrations in Laravel: Automating Database Management

This post discusses automating tenant database migrations within a Laravel application, focusing on maintaining separate database schemas for each tenant.

The Challenge

In multi-tenant applications, managing database migrations across numerous tenants can be a complex and time-consuming task. Manually executing migrations for each tenant is prone to errors and inefficiencies.

Read more

Enhancing Real-Time Updates in Reimpact Platform: Implementing Polling for Packaging Uploads

Introduction

In the Reimpact platform, keeping users informed about the status of long-running packaging uploads is crucial. To improve the user experience, we've introduced a polling mechanism to the massive uploads table. This enhancement ensures that users receive near-real-time updates without needing to manually refresh the page.

The Problem

Previously, users had to rely on manual

Read more
PHP Serde

Improving Job Reliability in Reimpact/platform with Property Serialization

Introduction

This post discusses a recent enhancement to the Reimpact/platform project focused on improving the reliability of background jobs. Specifically, it addresses issues encountered during the serialization and deserialization of model properties, and error handling during Excel data processing.

The Problem: Private Properties and Silent Errors

When working with background jobs

Read more