Jump to content
  • Status: Not a bug

The queries.json file for the 5.0.5 Beta 1 upgrade step contains 3 queries for the same column (1 add + 2 change):

    "1": {
        "method": "addColumn",
        "params": [
            "core_custom_badges",
            {
                "name": "icon_size",
                "type": "TINYINT",
                "length": null,
                "decimals": null,
                "values": null,
                "allow_null": false,
                "default": "1",
                "comment": "relative size of the icon",
                "unsigned": true,
                "auto_increment": false
            }
        ]
    },
    "2": {
        "method": "changeColumn",
        "params": [
            "core_custom_badges",
            "icon_size",
            {
                "name": "icon_size",
                "type": "TINYINT",
                "length": null,
                "decimals": null,
                "values": null,
                "allow_null": false,
                "default": "3",
                "comment": "relative size of the icon",
                "unsigned": true,
                "auto_increment": false
            }
        ]
    },
    "3": {
        "method": "changeColumn",
        "params": [
            "core_custom_badges",
            "icon_size",
            {
                "name": "icon_size",
                "type": "TINYINT",
                "length": null,
                "decimals": null,
                "values": null,
                "allow_null": false,
                "default": "3",
                "comment": "relative size of the icon",
                "unsigned": true,
                "auto_increment": false
            }
        ]
    },

You can remove queries #2 and #3 (which are the same, btw) and change the first one to have a default 3 value instead of 1:

    "1": {
        "method": "addColumn",
        "params": [
            "core_custom_badges",
            {
                "name": "icon_size",
                "type": "TINYINT",
                "length": null,
                "decimals": null,
                "values": null,
                "allow_null": false,
                "default": "3",
                "comment": "relative size of the icon",
                "unsigned": true,
                "auto_increment": false
            }
        ]
    },

User Feedback

Recommended Comments

Matt Finger

Invision Community Team

Well 2 and 3 can be merged, but the separate steps are intentional. The existing badges from before 5.0.5 are the same as badges created with the size of 1, so when adding the column that is the default used. For 5.0.5 and up, the default size throughout the backend code and UI is 3 because it's a more universal size, however it can overflow in some shapes.

So we change the default after adding the column so that database records for existing badges match the badge's SVG file and the badge content isn't altered.