Sort by:
  • Database Migrations

    Paul Brown · 08/02/2024 · 1 min read

    When writiing database migrations (or reviewing them) look out for/add/avoid the following things:

    1. Unique constraints on one column or composite c...
  • Database Normalization

    Paul Brown · 07/02/2024 · 1 min read

    This post makes no effort to be the final word on normalization, nor does it aim to be exhaustive. It is, rather, a synthesis of existing resources wr...

  • SQL Magic

    Paul Brown · 31/01/2024 · 2 min read

    Get all column names of a database table

    SELECT COLUMN_NAME 
    	FROM INFORMATION_SCHEMA.COLUMNS 
    		WHERE 
        TABLE_SCHEMA = 'schema_name'
    		A...
    
  • Faux database constraint

    Paul Brown · 31/01/2024 · 1 min read

    DB::statement('ALTER TABLE provisions ADD CHECK (IF(is_default, (SELECT COUNT(*) FROM provisions WHERE is_default = true) = 1, 1))');
    ```...
    
  • Default schema approaches

    Paul Brown · 30/01/2024 · 1 min read

    • Schemata table has default column already

    • Ensure only ever one 'True' in the default column of the table

    • Every time a mode Schema model is...

  • Git Magic

    Paul Brown · 24/01/2024 · 2 min read

    To pull in changes from just one file on another branch:

    git checkout [branch_name] -- [file_path]
    

    The -- relates to the UNIX shell, no...

  • Reading List

    Paul Brown · 24/01/2024 · 1 min read

    1. LDAP servers
    2. Apache Tomcat
    3. POEDIT SOFTWARE https://poedit.net/
    4. PO Files [link here](https://www.gnu.org/software/gettext/manual/html_node/...