write-upgrade-sql-script
Skill by PrestaShop
Writes an idempotent SQL upgrade script for shops upgrading to a target PrestaShop version. Covers schema changes, default configuration rows and feature-flag transitions.
Install write-upgrade-sql-script
Built from the published package, never by AI.
git clone --depth 1 https://github.com/PrestaShop/PrestaShop /tmp/PrestaShop && mkdir -p ~/.claude/skills && cp -r /tmp/PrestaShop/.ai/Component/Migration/skills/write-upgrade-sql-script ~/.claude/skills/write-upgrade-sql-scriptRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install write-upgrade-sql-script in Claude Code
git clone --depth 1 https://github.com/PrestaShop/PrestaShop /tmp/PrestaShop && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/PrestaShop/.ai/Component/Migration/skills/write-upgrade-sql-script ~/.gemini/antigravity-cli/skills/write-upgrade-sql-scriptAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install write-upgrade-sql-script in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill guides an AI assistant in writing a SQL upgrade script for shops upgrading to a target PrestaShop version. It covers three cases: schema changes, default configuration or fixture rows, and feature-flag state transitions. Since PrestaShop 9.x, these scripts live in the autoupgrade module at upgrade/sql/{version}.sql, not in the core repository.
Every statement must be idempotent, so re-running the script does not error or corrupt data. The skill asks for PREFIX_ and ENGINE_TYPE placeholders, forbids destructive statements at upgrade time, and requires matching rows in the install fixtures. It is aimed at developers who merged a core change that needs a database modification on existing shops.
Written from the project's SKILL.md and checked against it.
What it can do
- Schema changesAdds tables, columns or indexes with IF NOT EXISTS guards so they can run again safely.
- Configuration row updatesInserts a ps_configuration row only when it is not already present, keeping merchant overrides.
- Feature-flag transitionsPromotes a feature flag to stable and enables it for existing installs.
- Idempotency rulesExplains how to keep upgrade statements safe to re-run without errors or data loss.
What you need
- MySQL 8.0 or later, for ADD COLUMN IF NOT EXISTS
- Access to the PrestaShop autoupgrade module repository
Try asking
- Write an idempotent SQL upgrade script for PrestaShop 9.1.0 adding a new column
- Create an upgrade SQL script that inserts a configuration row if it is missing
- Write an upgrade script that promotes a feature flag to stable for existing shops
Good to know
- Upgrade scripts belong in the autoupgrade module, not the core repository.
- Only upgrading shops need the script. New installs read the install fixtures.
- Destructive statements such as DROP are not allowed at upgrade time.
- Renaming a column takes multiple scripts across releases.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .ai/Component/Migration/skills/write-upgrade-sql-script/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md4 KB
Alternatives to write-upgrade-sql-script
All alternatives →Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.
Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.
Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.
Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.
Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.
Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.
Compare with hugging-face-datasets, db-repair or alloydb-basics
write-upgrade-sql-script: common questions
Where do PrestaShop 9 upgrade SQL scripts live?
They live in the autoupgrade module at upgrade/sql/{version}.sql, not in the core repository. The source says agents working in core should hand the change off or open a PR against autoupgrade.
Do new installs need this upgrade script?
No. New installs read the install fixtures directly, so only upgrading shops need the script.
Why must the upgrade SQL be idempotent?
The script may be run more than once and must not error or corrupt data on re-run. Re-running it should be a no-op.
How do I install write-upgrade-sql-script?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is write-upgrade-sql-script free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is write-upgrade-sql-script safe to use?
It scores 80 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to write-upgrade-sql-script?
Similar skills: hugging-face-datasets, db-repair, alloydb-basics, clickhouse-logs-queries.
