Commit 256a0466 authored by Dries's avatar Dries

- Patch #13334 by Axel: added a simple script to prefix a database scheme.
parent b442fad0
#!/bin/sh
if [ $# != 2 ]; then
cat >&2 << EOH
This is Drupal database prefixer.
Usage:
$0 prefix original_db.sql >prefixed_db.sql
- all tables will prefixed with 'prefix'
EOH
exit 1;
fi
PRFX=$1;
sed "s/^CREATE TABLE /CREATE TABLE $PRFX/;
s/^INSERT INTO /INSERT INTO $PRFX/;
s/^REPLACE /REPLACE $PRFX/;
s/^ALTER TABLE /ALTER TABLE $PRFX/" $2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment