plugins/codex/core/scripts/create.sh
Snider 466fe9f5a6 feat(codex): mirror claude plugins and ethics modal
Summary:\n- added Codex marketplace registry plus awareness/ethics/guardrails sub-plugins\n- mirrored Claude plugin commands/scripts/hooks into codex api/ci/code/collect/coolify/core/issue/perf/qa/review/verify\n- embedded Axioms of Life ethics modal, guardrails, and kernel files under codex/ethics\n- added Codex parity report, improvements list, and MCP integration plan\n- extended Gemini MCP tools and docs for Codex awareness
2026-02-05 20:13:01 +00:00

35 lines
1.1 KiB
Bash

#!/bin/bash
set -e
MIGRATION_NAME=""
MIGRATION_PATH="database/migrations"
# Parse command-line arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--path) MIGRATION_PATH="$2"; shift ;;
*) MIGRATION_NAME="$1" ;;
esac
shift
done
if [ -z "$MIGRATION_NAME" ]; then
echo "Usage: /core:migrate create <migration_name> [--path <path>]" >&2
exit 1
fi
# Let artisan create the file in the specified path
core php artisan make:migration "$MIGRATION_NAME" --path="$MIGRATION_PATH" > /dev/null
# Find the newest file in the target directory that matches the name.
FILE_PATH=$(find "$MIGRATION_PATH" -name "*_$MIGRATION_NAME.php" -print -quit)
if [ -f "$FILE_PATH" ]; then
# Add the workspace_id column and a placeholder for model generation
awk '1; /->id\(\);/ { print " \$table->foreignId(\"workspace_id\")->constrained();\n // --- AUTO-GENERATED COLUMNS GO HERE ---" }' "$FILE_PATH" > "$FILE_PATH.tmp" && mv "$FILE_PATH.tmp" "$FILE_PATH"
# Output just the path for other scripts
echo "$FILE_PATH"
else
echo "ERROR: Could not find created migration file for '$MIGRATION_NAME' in '$MIGRATION_PATH'." >&2
exit 1
fi