If you ever run into:
(1005, 'Can't create table `database_name`.`table_name` (errno: 150 "Foreign key constraint is incorrectly formed")
Run:
mariadb -e "SHOW ENGINE INNODB STATUS"
| # /// script | |
| # requires-python = ">=3.13" | |
| # dependencies = [ | |
| # "sentence-transformers", | |
| # "sqlite-vec", | |
| # "numpy", | |
| # ] | |
| # /// | |
| #!/usr/bin/env python | |
| # BEGIN: history_meta.py | |
| # https://docs.sqlalchemy.org/en/14/_modules/examples/versioned_history/history_meta.html | |
| """Versioned mixin class and other utilities.""" | |
| from __future__ import annotations | |
| import datetime | |
| from collections.abc import Callable, Generator | |
| from typing import TypeAlias, Any |
| from os import PathLike | |
| from functools import reduce | |
| from operator import getitem | |
| try: | |
| # Python 3.11+ | |
| from tomllib import load, loads | |
| except ImportError: | |
| from tomli import load, loads | |
| from typing import Any, BinaryIO, Iterable, Mapping, TypeAlias, TypeGuard, Union |
| package main | |
| import ( | |
| "bytes" | |
| "compress/zlib" | |
| "crypto/sha1" | |
| "encoding/hex" | |
| "fmt" | |
| "io" | |
| "os" |
| #!/usr/bin/env python | |
| # based on | |
| # https://tylercipriani.com/blog/2017/07/09/the-rsync-algorithm-in-python/ | |
| from collections.abc import Generator | |
| from hashlib import md5 | |
| from io import BufferedReader, TextIOWrapper | |
| from logging import DEBUG, INFO, basicConfig, getLogger | |
| from os import PathLike |
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } | |
| if ! command -v jq &> /dev/null | |
| then | |
| echo "jq could not be found" |
If you ever run into:
(1005, 'Can't create table `database_name`.`table_name` (errno: 150 "Foreign key constraint is incorrectly formed")
Run:
mariadb -e "SHOW ENGINE INNODB STATUS"
| #!/usr/bin/env bash | |
| set -eu -o pipefail; | |
| function check { | |
| PLUGINS=$(asdf plugin list) | |
| echo "Plugin Current Latest" | |
| for plugin in ${PLUGINS}; do | |
| LATEST_VERSION=$(asdf latest ${plugin}) | |
| CURRENT_VERSION=$(asdf current ${plugin}| perl -lne 'print $& if /((\d+\.){2}\d+(-otp-\d+)?)/') |
| # Load via: | |
| # if [ -f "${HOME}/.functions.sh" ]; then . "${HOME}/.functions.sh"; fi | |
| # MIT License | |
| if [ "${PLATFORM}" = "Linux" ]; then | |
| alias pbcopy='xclip -selection clipboard' | |
| alias pbpaste='xclip -selection clipboard -o' | |
| fi | |
| function extract() { |
| #!/usr/bin/env python | |
| """Usage Example: | |
| $ python reserved_words_retriever.py --help | |
| usage: reserved_words_retriever.py [-h] [-y] [-a] [-w] [-d] | |
| Retrieve the reserved keywords for MySQL and/or MariaDB | |
| options: | |
| -h, --help show this help message and exit |