MySQL and MariaDB have an SQL mode setting which changes how MySQL behaves. The SQL mode value is comprised of...

On your local system that only hosts non-critical development data and only you have access to, you can store...

stackoverflow.com

Your default postgres user is named like your linux user. That default user has limited access privileges, which can cause...

Bundler::GemRequireError: There was an error while trying to load the gem 'mysql2'. Gem Load Error is: Incorrect MySQL client...

stackoverflow.com

mysql> SELECT @@global.version; +------------------+ | @@global.version | +------------------+ | 5.6.30 | +------------------+ 1 row in set (0,00 sec) MySQL 5.6 Reference Manual says "BLOB and TEXT...

Understanding your type of cronjob Some cronjobs must only run on a single server. E.g. when you run nightly batch...

makandra Operations

If one etcd node is no longer a member of the remaining etcd cluster or fails to connect you need...

This is an extension to PostgreSQL vs MySQL: How to UPDATE using a JOIN. UPDATE employees SET department_name = departments.name...

TL;DR Use user.update!(remove_avatar: true) to delete attachments outside of forms. This will have the same behavior as...

This is a small example on how you can check if your Postgres index can be used by a specific...

This is painful. Consider using Microsoft Office or switching careers. If you need to write < 20 letters consider doing it...

blog.bigbinary.com

This error is raised because your old database does not have a configured environment yet, which Rails 5 enforces.

You should avoid using application models in your migrations. But how else could you create records in a migration?

github.com

When writing XLSX files, there are gems like rubyXL or axlsx. While they do offer features like formatting or graphs...

postgresql.org

PostgreSQL's Common Table Expressions (CTEs) can be used to extract sub-queries from bulky SQL statements into a temporary...

PostgreSQL supports the SQL OVERLAPS operator. You can use it to test if two date ranges overlap: => SELECT ('2001-02...

makandra dev

Git has two kind of tags: annotated lightweight Annotated tags are stored as full objects in the Git database. They...

We're usually running Ubuntu LTS versions. Sometimes newer hardware requires packages from more recent Ubuntu releases that only come...

makandra dev

An end-to-end test (E2E test) is a script that remote-controls a web browser with tools like Selenium...

Slides for Henning's talk on Sep 21st 2017. Understanding sync vs. async control flow Talking to synchronous (or "blocking...

When you want to group rails models of a logical context, namespaces are your friend. However, if you have a...

After loading a staging dump into development, you might get an ActiveRecord::EnvironmentMismatchError when trying to replace the database (like...

If another session is accessing your database you are trying to reset or drop you might have seen the following...

I frequently find myself needing a combination of group_by, count and sort for quick statistics. Here's a method...